From owner-svn-src-head@freebsd.org Sun Oct 1 00:40:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68F13E32DBB; Sun, 1 Oct 2017 00:40:28 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC5F81283; Sun, 1 Oct 2017 00:40:27 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v910eRSK036202; Sun, 1 Oct 2017 00:40:27 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v910eOWQ036170; Sun, 1 Oct 2017 00:40:24 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201710010040.v910eOWQ036170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sun, 1 Oct 2017 00:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324148 - in head: contrib/libarchive/cat/test contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/t... X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in head: contrib/libarchive/cat/test contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/tar... X-SVN-Commit-Revision: 324148 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 00:40:28 -0000 Author: mm Date: Sun Oct 1 00:40:23 2017 New Revision: 324148 URL: https://svnweb.freebsd.org/changeset/base/324148 Log: MFV r324145,324147: Sync libarchive with vendor. Relevant vendor changes: PR #905: Support for Zstandard read and write filters PR #922: Avoid overflow when reading corrupt cpio archive Issue #935: heap-based buffer overflow in xml_data (CVE-2017-14166) OSS-Fuzz 2936: Place a limit on the mtree line length OSS-Fuzz 2394: Ensure that the ZIP AES extension header is large enough OSS-Fuzz 573: Read off-by-one error in RAR archives (CVE-2017-14502) MFC after: 1 week Security: CVE-2017-14166, CVE-2017-14502 Added: head/contrib/libarchive/cat/test/test_empty.zst.uu - copied unchanged from r324145, vendor/libarchive/dist/cat/test/test_empty.zst.uu head/contrib/libarchive/cat/test/test_empty_zstd.c - copied unchanged from r324145, vendor/libarchive/dist/cat/test/test_empty_zstd.c head/contrib/libarchive/cat/test/test_expand.zst.uu - copied unchanged from r324145, vendor/libarchive/dist/cat/test/test_expand.zst.uu head/contrib/libarchive/cat/test/test_expand_zstd.c - copied unchanged from r324145, vendor/libarchive/dist/cat/test/test_expand_zstd.c head/contrib/libarchive/cpio/test/test_extract.cpio.zst.uu - copied unchanged from r324145, vendor/libarchive/dist/cpio/test/test_extract.cpio.zst.uu head/contrib/libarchive/cpio/test/test_extract_cpio_zstd.c - copied unchanged from r324145, vendor/libarchive/dist/cpio/test/test_extract_cpio_zstd.c head/contrib/libarchive/cpio/test/test_option_zstd.c - copied unchanged from r324145, vendor/libarchive/dist/cpio/test/test_option_zstd.c head/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c - copied unchanged from r324145, vendor/libarchive/dist/libarchive/archive_read_support_filter_zstd.c head/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c - copied unchanged from r324145, vendor/libarchive/dist/libarchive/archive_write_add_filter_zstd.c head/contrib/libarchive/libarchive/test/test_compat_zstd.c - copied unchanged from r324145, vendor/libarchive/dist/libarchive/test/test_compat_zstd.c head/contrib/libarchive/libarchive/test/test_compat_zstd_1.tar.zst.uu - copied unchanged from r324145, vendor/libarchive/dist/libarchive/test/test_compat_zstd_1.tar.zst.uu head/contrib/libarchive/libarchive/test/test_write_filter_zstd.c - copied unchanged from r324145, vendor/libarchive/dist/libarchive/test/test_write_filter_zstd.c head/contrib/libarchive/tar/test/test_extract.tar.zst.uu - copied unchanged from r324145, vendor/libarchive/dist/tar/test/test_extract.tar.zst.uu head/contrib/libarchive/tar/test/test_extract_tar_zstd.c - copied unchanged from r324145, vendor/libarchive/dist/tar/test/test_extract_tar_zstd.c head/contrib/libarchive/tar/test/test_option_zstd.c - copied unchanged from r324145, vendor/libarchive/dist/tar/test/test_option_zstd.c Modified: head/contrib/libarchive/cpio/bsdcpio.1 head/contrib/libarchive/cpio/cmdline.c head/contrib/libarchive/cpio/cpio.c head/contrib/libarchive/cpio/cpio.h head/contrib/libarchive/libarchive/archive.h head/contrib/libarchive/libarchive/archive_cmdline.c head/contrib/libarchive/libarchive/archive_platform.h head/contrib/libarchive/libarchive/archive_read_append_filter.c head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c head/contrib/libarchive/libarchive/archive_read_filter.3 head/contrib/libarchive/libarchive/archive_read_support_filter_all.c head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c head/contrib/libarchive/libarchive/archive_read_support_format_rar.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/libarchive/archive_read_support_format_xar.c head/contrib/libarchive/libarchive/archive_read_support_format_zip.c head/contrib/libarchive/libarchive/archive_string.c head/contrib/libarchive/libarchive/archive_version_details.c head/contrib/libarchive/libarchive/archive_write.3 head/contrib/libarchive/libarchive/archive_write_add_filter.c head/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c head/contrib/libarchive/libarchive/archive_write_filter.3 head/contrib/libarchive/libarchive/archive_write_set_format_pax.c head/contrib/libarchive/libarchive/test/test_archive_write_add_filter_by_name.c head/contrib/libarchive/libarchive/test/test_fuzz.c head/contrib/libarchive/tar/bsdtar.1 head/contrib/libarchive/tar/bsdtar.c head/contrib/libarchive/tar/bsdtar.h head/contrib/libarchive/tar/cmdline.c head/contrib/libarchive/tar/creation_set.c head/contrib/libarchive/tar/test/test_option_acls.c head/contrib/libarchive/test_utils/test_common.h head/contrib/libarchive/test_utils/test_main.c head/lib/libarchive/Makefile head/lib/libarchive/tests/Makefile head/usr.bin/bsdcat/tests/Makefile head/usr.bin/cpio/tests/Makefile head/usr.bin/tar/tests/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Copied: head/contrib/libarchive/cat/test/test_empty.zst.uu (from r324145, vendor/libarchive/dist/cat/test/test_empty.zst.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/cat/test/test_empty.zst.uu Sun Oct 1 00:40:23 2017 (r324148, copy of r324145, vendor/libarchive/dist/cat/test/test_empty.zst.uu) @@ -0,0 +1,4 @@ +begin 644 test_empty.zst +-*+4O_010`0``F>G840`` +` +end Copied: head/contrib/libarchive/cat/test/test_empty_zstd.c (from r324145, vendor/libarchive/dist/cat/test/test_empty_zstd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/cat/test/test_empty_zstd.c Sun Oct 1 00:40:23 2017 (r324148, copy of r324145, vendor/libarchive/dist/cat/test/test_empty_zstd.c) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2017 Sean Purcell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" + +DEFINE_TEST(test_empty_zstd) +{ + const char *reffile = "test_empty.zst"; + int f; + + extract_reference_file(reffile); + f = systemf("%s %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canZstd()) { + assertEqualInt(0, f); + assertEmptyFile("test.out"); + assertEmptyFile("test.err"); + } else { + skipping("It seems zstd is not supported on this platform"); + } +} Copied: head/contrib/libarchive/cat/test/test_expand.zst.uu (from r324145, vendor/libarchive/dist/cat/test/test_expand.zst.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/cat/test/test_expand.zst.uu Sun Oct 1 00:40:23 2017 (r324148, copy of r324145, vendor/libarchive/dist/cat/test/test_expand.zst.uu) @@ -0,0 +1,4 @@ +begin 644 test_expand.zst +J*+4O_010Z0``8V]N=&5N=',@;V8@=&5S=%]E>'!A;F0N>G-T+@J;23#F +` +end Copied: head/contrib/libarchive/cat/test/test_expand_zstd.c (from r324145, vendor/libarchive/dist/cat/test/test_expand_zstd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/cat/test/test_expand_zstd.c Sun Oct 1 00:40:23 2017 (r324148, copy of r324145, vendor/libarchive/dist/cat/test/test_expand_zstd.c) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2017 Sean Purcell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" + +DEFINE_TEST(test_expand_zstd) +{ + const char *reffile = "test_expand.zst"; + int f; + + extract_reference_file(reffile); + f = systemf("%s %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canZstd()) { + assertEqualInt(0, f); + assertTextFileContents("contents of test_expand.zst.\n", "test.out"); + assertEmptyFile("test.err"); + } else { + skipping("It seems zstd is not supported on this platform"); + } +} Modified: head/contrib/libarchive/cpio/bsdcpio.1 ============================================================================== --- head/contrib/libarchive/cpio/bsdcpio.1 Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/cpio/bsdcpio.1 Sun Oct 1 00:40:23 2017 (r324148) @@ -187,6 +187,11 @@ In input mode, this option is ignored. Compress the archive with lz4-compatible compression before writing it. In input mode, this option is ignored; lz4 compression is recognized automatically on input. +.It Fl Fl zstd +(o mode only) +Compress the archive with zstd-compatible compression before writing it. +In input mode, this option is ignored; zstd compression is recognized +automatically on input. .It Fl Fl lzma (o mode only) Compress the file with lzma-compatible compression before writing it. Modified: head/contrib/libarchive/cpio/cmdline.c ============================================================================== --- head/contrib/libarchive/cpio/cmdline.c Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/cpio/cmdline.c Sun Oct 1 00:40:23 2017 (r324148) @@ -92,6 +92,7 @@ static const struct option { { "verbose", 0, 'v' }, { "version", 0, OPTION_VERSION }, { "xz", 0, 'J' }, + { "zstd", 0, OPTION_ZSTD }, { NULL, 0, 0 } }; Modified: head/contrib/libarchive/cpio/cpio.c ============================================================================== --- head/contrib/libarchive/cpio/cpio.c Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/cpio/cpio.c Sun Oct 1 00:40:23 2017 (r324148) @@ -269,6 +269,7 @@ main(int argc, char *argv[]) case OPTION_LZ4: case OPTION_LZMA: /* GNU tar, others */ case OPTION_LZOP: /* GNU tar, others */ + case OPTION_ZSTD: cpio->compress = opt; break; case 'm': /* POSIX 1997 */ @@ -545,6 +546,9 @@ mode_out(struct cpio *cpio) break; case OPTION_LZOP: r = archive_write_add_filter_lzop(cpio->archive); + break; + case OPTION_ZSTD: + r = archive_write_add_filter_zstd(cpio->archive); break; case 'j': case 'y': r = archive_write_add_filter_bzip2(cpio->archive); Modified: head/contrib/libarchive/cpio/cpio.h ============================================================================== --- head/contrib/libarchive/cpio/cpio.h Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/cpio/cpio.h Sun Oct 1 00:40:23 2017 (r324148) @@ -111,7 +111,8 @@ enum { OPTION_PRESERVE_OWNER, OPTION_QUIET, OPTION_UUENCODE, - OPTION_VERSION + OPTION_VERSION, + OPTION_ZSTD, }; int cpio_getopt(struct cpio *cpio); Copied: head/contrib/libarchive/cpio/test/test_extract.cpio.zst.uu (from r324145, vendor/libarchive/dist/cpio/test/test_extract.cpio.zst.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/cpio/test/test_extract.cpio.zst.uu Sun Oct 1 00:40:23 2017 (r324148, copy of r324145, vendor/libarchive/dist/cpio/test/test_extract.cpio.zst.uu) @@ -0,0 +1,6 @@ +begin 644 test_extract.cpio.zst +M*+4O_01090,`,@41%X")&@#'G6T\K16_MR)#=DK)5:.1,2J0HY2"!(1!`!7R +M$(UB`2"*D41;J2UF&)<0!Y7X'TU<%W.\W^R]GO-WW^OO^QX0`%P<]30-!#U` +?!KD!`#XP,_`U4`HT3+RF:#!7Y\V@R)5"7P"^;WEUK@`` +` +end Copied: head/contrib/libarchive/cpio/test/test_extract_cpio_zstd.c (from r324145, vendor/libarchive/dist/cpio/test/test_extract_cpio_zstd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/cpio/test/test_extract_cpio_zstd.c Sun Oct 1 00:40:23 2017 (r324148, copy of r324145, vendor/libarchive/dist/cpio/test/test_extract_cpio_zstd.c) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2017 Sean Purcell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_cpio_zstd) +{ + const char *reffile = "test_extract.cpio.zst"; + int f; + + extract_reference_file(reffile); + f = systemf("%s -it < %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canZstd()) { + assertEqualInt(0, systemf("%s -i < %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertTextFileContents("1 block\n", "test.err"); + } else { + skipping("It seems zstd is not supported on this platform"); + } +} Copied: head/contrib/libarchive/cpio/test/test_option_zstd.c (from r324145, vendor/libarchive/dist/cpio/test/test_option_zstd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/cpio/test/test_option_zstd.c Sun Oct 1 00:40:23 2017 (r324148, copy of r324145, vendor/libarchive/dist/cpio/test/test_option_zstd.c) @@ -0,0 +1,85 @@ +/*- + * Copyright (c) 2017 Sean Purcell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_zstd) +{ + char *p; + int r; + size_t s; + + /* Create a file. */ + assertMakeFile("f", 0644, "a"); + + /* Archive it with zstd compression. */ + r = systemf("echo f | %s -o --zstd >archive.out 2>archive.err", + testprog); + p = slurpfile(&s, "archive.err"); + p[s] = '\0'; + if (r != 0) { + if (strstr(p, "Unsupported compression") != NULL) { + skipping("This version of bsdcpio was compiled " + "without zstd support"); + goto done; + } + /* POSIX permits different handling of the spawnp + * system call used to launch the subsidiary + * program: */ + /* Some systems fail immediately to spawn the new process. */ + if (strstr(p, "Can't launch") != NULL && !canZstd()) { + skipping("This version of bsdcpio uses an external zstd program " + "but no such program is available on this system."); + goto done; + } + /* Some systems successfully spawn the new process, + * but fail to exec a program within that process. + * This results in failure at the first attempt to + * write. */ + if (strstr(p, "Can't write") != NULL && !canZstd()) { + skipping("This version of bsdcpio uses an external zstd program " + "but no such program is available on this system."); + goto done; + } + /* On some systems the error won't be detected until closing + time, by a 127 exit error returned by waitpid. */ + if (strstr(p, "Error closing") != NULL && !canZstd()) { + skipping("This version of bsdcpio uses an external zstd program " + "but no such program is available on this system."); + return; + } + failure("--zstd option is broken: %s", p); + assertEqualInt(r, 0); + goto done; + } + free(p); + /* Check that the archive file has an zstd signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "\x28\xb5\x2f\xfd", 4); + +done: + free(p); +} Modified: head/contrib/libarchive/libarchive/archive.h ============================================================================== --- head/contrib/libarchive/libarchive/archive.h Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/libarchive/archive.h Sun Oct 1 00:40:23 2017 (r324148) @@ -177,6 +177,7 @@ __LA_DECL const char * archive_zlib_version(void); __LA_DECL const char * archive_liblzma_version(void); __LA_DECL const char * archive_bzlib_version(void); __LA_DECL const char * archive_liblz4_version(void); +__LA_DECL const char * archive_libzstd_version(void); /* Declare our basic types. */ struct archive; @@ -276,6 +277,7 @@ typedef const char *archive_passphrase_callback(struct #define ARCHIVE_FILTER_LZOP 11 #define ARCHIVE_FILTER_GRZIP 12 #define ARCHIVE_FILTER_LZ4 13 +#define ARCHIVE_FILTER_ZSTD 14 #if ARCHIVE_VERSION_NUMBER < 4000000 #define ARCHIVE_COMPRESSION_NONE ARCHIVE_FILTER_NONE @@ -433,6 +435,7 @@ __LA_DECL int archive_read_support_filter_program_sign __LA_DECL int archive_read_support_filter_rpm(struct archive *); __LA_DECL int archive_read_support_filter_uu(struct archive *); __LA_DECL int archive_read_support_filter_xz(struct archive *); +__LA_DECL int archive_read_support_filter_zstd(struct archive *); __LA_DECL int archive_read_support_format_7zip(struct archive *); __LA_DECL int archive_read_support_format_all(struct archive *); @@ -778,6 +781,7 @@ __LA_DECL int archive_write_add_filter_program(struct const char *cmd); __LA_DECL int archive_write_add_filter_uuencode(struct archive *); __LA_DECL int archive_write_add_filter_xz(struct archive *); +__LA_DECL int archive_write_add_filter_zstd(struct archive *); /* A convenience function to set the format based on the code or name. */ Modified: head/contrib/libarchive/libarchive/archive_cmdline.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_cmdline.c Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/libarchive/archive_cmdline.c Sun Oct 1 00:40:23 2017 (r324148) @@ -100,10 +100,10 @@ get_argument(struct archive_string *as, const char *p) /* * Set up command line arguments. - * Returns ARChIVE_OK if everything okey. - * Returns ARChIVE_FAILED if there is a lack of the `"' terminator or an + * Returns ARCHIVE_OK if everything okey. + * Returns ARCHIVE_FAILED if there is a lack of the `"' terminator or an * empty command line. - * Returns ARChIVE_FATAL if no memory. + * Returns ARCHIVE_FATAL if no memory. */ int __archive_cmdline_parse(struct archive_cmdline *data, const char *cmd) Modified: head/contrib/libarchive/libarchive/archive_platform.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_platform.h Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/libarchive/archive_platform.h Sun Oct 1 00:40:23 2017 (r324148) @@ -52,6 +52,17 @@ #error Oops: No config.h and no pre-built configuration in archive_platform.h. #endif +/* On macOS check for some symbols based on the deployment target version. */ +#if defined(__APPLE__) +# undef HAVE_FUTIMENS +# undef HAVE_UTIMENSAT +# include +# if MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 +# define HAVE_FUTIMENS 1 +# define HAVE_UTIMENSAT 1 +# endif +#endif + /* It should be possible to get rid of this by extending the feature-test * macros to cover Windows API functions, probably along with non-trivial * refactoring of code to find structures that sit more cleanly on top of Modified: head/contrib/libarchive/libarchive/archive_read_append_filter.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_append_filter.c Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/libarchive/archive_read_append_filter.c Sun Oct 1 00:40:23 2017 (r324148) @@ -89,6 +89,10 @@ archive_read_append_filter(struct archive *_a, int cod strcpy(str, "lz4"); r1 = archive_read_support_filter_lz4(_a); break; + case ARCHIVE_FILTER_ZSTD: + strcpy(str, "zstd"); + r1 = archive_read_support_filter_zstd(_a); + break; case ARCHIVE_FILTER_LZIP: strcpy(str, "lzip"); r1 = archive_read_support_filter_lzip(_a); Modified: head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Sun Oct 1 00:40:23 2017 (r324148) @@ -127,7 +127,7 @@ archive_read_disk_entry_setup_acls(struct archive_read /* * Enter working directory and return working pathname of archive_entry. * If a pointer to an integer is provided and its value is below zero - * open a file descriptor on this pahtname. + * open a file descriptor on this pathname. */ const char * archive_read_disk_entry_setup_path(struct archive_read_disk *a, Modified: head/contrib/libarchive/libarchive/archive_read_filter.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_filter.3 Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/libarchive/archive_read_filter.3 Sun Oct 1 00:40:23 2017 (r324148) @@ -38,6 +38,7 @@ .Nm archive_read_support_filter_rpm , .Nm archive_read_support_filter_uu , .Nm archive_read_support_filter_xz , +.Nm archive_read_support_filter_zstd , .Nm archive_read_support_filter_program , .Nm archive_read_support_filter_program_signature .Nd functions for reading streaming archives @@ -73,6 +74,8 @@ Streaming Archive Library (libarchive, -larchive) .Ft int .Fn archive_read_support_filter_xz "struct archive *" .Ft int +.Fn archive_read_support_filter_zstd "struct archive *" +.Ft int .Fo archive_read_support_filter_program .Fa "struct archive *" .Fa "const char *cmd" @@ -99,7 +102,8 @@ Streaming Archive Library (libarchive, -larchive) .Fn archive_read_support_filter_none , .Fn archive_read_support_filter_rpm , .Fn archive_read_support_filter_uu , -.Fn archive_read_support_filter_xz +.Fn archive_read_support_filter_xz , +.Fn archive_read_support_filter_zstd , .Xc Enables auto-detection code and decompression support for the specified compression. Modified: head/contrib/libarchive/libarchive/archive_read_support_filter_all.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_filter_all.c Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/libarchive/archive_read_support_filter_all.c Sun Oct 1 00:40:23 2017 (r324148) @@ -71,6 +71,8 @@ archive_read_support_filter_all(struct archive *a) archive_read_support_filter_grzip(a); /* Lz4 falls back to "lz4 -d" command-line program. */ archive_read_support_filter_lz4(a); + /* Zstd falls back to "zstd -d" command-line program. */ + archive_read_support_filter_zstd(a); /* Note: We always return ARCHIVE_OK here, even if some of the * above return ARCHIVE_WARN. The intent here is to enable Copied: head/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c (from r324145, vendor/libarchive/dist/libarchive/archive_read_support_filter_zstd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c Sun Oct 1 00:40:23 2017 (r324148, copy of r324145, vendor/libarchive/dist/libarchive/archive_read_support_filter_zstd.c) @@ -0,0 +1,292 @@ +/*- + * Copyright (c) 2009-2011 Sean Purcell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "archive_platform.h" + +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_ERRNO_H +#include +#endif + +#ifdef HAVE_ERRNO_H +#include +#endif +#include +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#if HAVE_ZSTD_H +#include +#endif + +#include "archive.h" +#include "archive_endian.h" +#include "archive_private.h" +#include "archive_read_private.h" + +#if HAVE_ZSTD_H && HAVE_LIBZSTD + +struct private_data { + ZSTD_DStream *dstream; + unsigned char *out_block; + size_t out_block_size; + int64_t total_out; + char in_frame; /* True = in the middle of a zstd frame. */ + char eof; /* True = found end of compressed data. */ +}; + +/* Zstd Filter. */ +static ssize_t zstd_filter_read(struct archive_read_filter *, const void**); +static int zstd_filter_close(struct archive_read_filter *); +#endif + +/* + * Note that we can detect zstd compressed files even if we can't decompress + * them. (In fact, we like detecting them because we can give better error + * messages.) So the bid framework here gets compiled even if no zstd library + * is available. + */ +static int zstd_bidder_bid(struct archive_read_filter_bidder *, + struct archive_read_filter *); +static int zstd_bidder_init(struct archive_read_filter *); + +int +archive_read_support_filter_zstd(struct archive *_a) +{ + struct archive_read *a = (struct archive_read *)_a; + struct archive_read_filter_bidder *bidder; + + archive_check_magic(_a, ARCHIVE_READ_MAGIC, + ARCHIVE_STATE_NEW, "archive_read_support_filter_zstd"); + + if (__archive_read_get_bidder(a, &bidder) != ARCHIVE_OK) + return (ARCHIVE_FATAL); + + bidder->data = NULL; + bidder->name = "zstd"; + bidder->bid = zstd_bidder_bid; + bidder->init = zstd_bidder_init; + bidder->options = NULL; + bidder->free = NULL; +#if HAVE_ZSTD_H && HAVE_LIBZSTD + return (ARCHIVE_OK); +#else + archive_set_error(_a, ARCHIVE_ERRNO_MISC, + "Using external zstd program for zstd decompression"); + return (ARCHIVE_WARN); +#endif +} + +/* + * Test whether we can handle this data. + */ +static int +zstd_bidder_bid(struct archive_read_filter_bidder *self, + struct archive_read_filter *filter) +{ + const unsigned char *buffer; + ssize_t avail; + unsigned prefix; + + /* Zstd frame magic values */ + const unsigned zstd_magic = 0xFD2FB528U; + + (void) self; /* UNUSED */ + + buffer = __archive_read_filter_ahead(filter, 4, &avail); + if (buffer == NULL) + return (0); + + prefix = archive_le32dec(buffer); + if (prefix == zstd_magic) + return (32); + + return (0); +} + +#if !(HAVE_ZSTD_H && HAVE_LIBZSTD) + +/* + * If we don't have the library on this system, we can't do the + * decompression directly. We can, however, try to run "zstd -d" + * in case that's available. + */ +static int +zstd_bidder_init(struct archive_read_filter *self) +{ + int r; + + r = __archive_read_program(self, "zstd -d -qq"); + /* Note: We set the format here even if __archive_read_program() + * above fails. We do, after all, know what the format is + * even if we weren't able to read it. */ + self->code = ARCHIVE_FILTER_ZSTD; + self->name = "zstd"; + return (r); +} + +#else + +/* + * Initialize the filter object + */ +static int +zstd_bidder_init(struct archive_read_filter *self) +{ + struct private_data *state; + const size_t out_block_size = ZSTD_DStreamOutSize(); + void *out_block; + ZSTD_DStream *dstream; + + self->code = ARCHIVE_FILTER_ZSTD; + self->name = "zstd"; + + state = (struct private_data *)calloc(sizeof(*state), 1); + out_block = (unsigned char *)malloc(out_block_size); + dstream = ZSTD_createDStream(); + + if (state == NULL || out_block == NULL || dstream == NULL) { + free(out_block); + free(state); + ZSTD_freeDStream(dstream); /* supports free on NULL */ + archive_set_error(&self->archive->archive, ENOMEM, + "Can't allocate data for zstd decompression"); + return (ARCHIVE_FATAL); + } + + self->data = state; + + state->out_block_size = out_block_size; + state->out_block = out_block; + state->dstream = dstream; + self->read = zstd_filter_read; + self->skip = NULL; /* not supported */ + self->close = zstd_filter_close; + + state->eof = 0; + state->in_frame = 0; + + return (ARCHIVE_OK); +} + +static ssize_t +zstd_filter_read(struct archive_read_filter *self, const void **p) +{ + struct private_data *state; + size_t decompressed; + ssize_t avail_in; + ZSTD_outBuffer out; + ZSTD_inBuffer in; + + state = (struct private_data *)self->data; + + out = (ZSTD_outBuffer) { state->out_block, state->out_block_size, 0 }; + + /* Try to fill the output buffer. */ + while (out.pos < out.size && !state->eof) { + if (!state->in_frame) { + const size_t ret = ZSTD_initDStream(state->dstream); + if (ZSTD_isError(ret)) { + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, + "Error initializing zstd decompressor: %s", + ZSTD_getErrorName(ret)); + return (ARCHIVE_FATAL); + } + } + in.src = __archive_read_filter_ahead(self->upstream, 1, + &avail_in); + if (avail_in < 0) { + return avail_in; + } + if (in.src == NULL && avail_in == 0) { + if (!state->in_frame) { + /* end of stream */ + state->eof = 1; + break; + } else { + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, + "Truncated zstd input"); + return (ARCHIVE_FATAL); + } + } + in.size = avail_in; + in.pos = 0; + + { + const size_t ret = + ZSTD_decompressStream(state->dstream, &out, &in); + + if (ZSTD_isError(ret)) { + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, + "Zstd decompression failed: %s", + ZSTD_getErrorName(ret)); + return (ARCHIVE_FATAL); + } + + /* Decompressor made some progress */ + __archive_read_filter_consume(self->upstream, in.pos); + + /* ret guaranteed to be > 0 if frame isn't done yet */ + state->in_frame = (ret != 0); + } + } + + decompressed = out.pos; + state->total_out += decompressed; + if (decompressed == 0) + *p = NULL; + else + *p = state->out_block; + return (decompressed); +} + +/* + * Clean up the decompressor. + */ +static int +zstd_filter_close(struct archive_read_filter *self) +{ + struct private_data *state; + + state = (struct private_data *)self->data; + + ZSTD_freeDStream(state->dstream); + free(state->out_block); + free(state); + + return (ARCHIVE_OK); +} + +#endif /* HAVE_ZLIB_H && HAVE_LIBZSTD */ Modified: head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c Sun Oct 1 00:40:23 2017 (r324148) @@ -633,6 +633,13 @@ header_newc(struct archive_read *a, struct cpio *cpio, /* Pad name to 2 more than a multiple of 4. */ *name_pad = (2 - *namelength) & 3; + /* Make sure that the padded name length fits into size_t. */ + if (*name_pad > SIZE_MAX - *namelength) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "cpio archive has invalid namelength"); + return (ARCHIVE_FATAL); + } + /* * Note: entry_bytes_remaining is at least 64 bits and * therefore guaranteed to be big enough for a 33-bit file Modified: head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Sun Oct 1 00:40:23 2017 (r324148) @@ -77,6 +77,8 @@ __FBSDID("$FreeBSD$"); #define MTREE_HASHTABLE_SIZE 1024 +#define MAX_LINE_LEN (1024 * 1024) + struct mtree_option { struct mtree_option *next; char *value; @@ -333,6 +335,14 @@ next_line(struct archive_read *a, ssize_t diff = *ravail - *avail; size_t nbytes_req = (*ravail+1023) & ~1023U; ssize_t tested; + + /* + * Place an arbitrary limit on the line length. + * mtree is almost free-form input and without line length limits, + * it can consume a lot of memory. + */ + if (len >= MAX_LINE_LEN) + return (-1); /* Increase reading bytes if it is not enough to at least * new two lines. */ Modified: head/contrib/libarchive/libarchive/archive_read_support_format_rar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_rar.c Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/libarchive/archive_read_support_format_rar.c Sun Oct 1 00:40:23 2017 (r324148) @@ -1496,7 +1496,11 @@ read_header(struct archive_read *a, struct archive_ent return (ARCHIVE_FATAL); } filename[filename_size++] = '\0'; - filename[filename_size++] = '\0'; + /* + * Do not increment filename_size here as the computations below + * add the space for the terminating NUL explicitly. + */ + filename[filename_size] = '\0'; /* Decoded unicode form is UTF-16BE, so we have to update a string * conversion object for it. */ Modified: head/contrib/libarchive/libarchive/archive_read_support_format_tar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Sun Oct 1 00:40:23 2017 (r324148) @@ -2243,7 +2243,7 @@ gnu_add_sparse_entry(struct archive_read *a, struct ta else tar->sparse_list = p; tar->sparse_last = p; - if (remaining < 0 || offset < 0) { + if (remaining < 0 || offset < 0 || offset > INT64_MAX - remaining) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Malformed sparse map data"); return (ARCHIVE_FATAL); } Modified: head/contrib/libarchive/libarchive/archive_read_support_format_xar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_xar.c Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/libarchive/archive_read_support_format_xar.c Sun Oct 1 00:40:23 2017 (r324148) @@ -1040,6 +1040,9 @@ atol10(const char *p, size_t char_cnt) uint64_t l; int digit; + if (char_cnt == 0) + return (0); + l = 0; digit = *p - '0'; while (digit >= 0 && digit < 10 && char_cnt-- > 0) { @@ -1054,7 +1057,10 @@ atol8(const char *p, size_t char_cnt) { int64_t l; int digit; - + + if (char_cnt == 0) + return (0); + l = 0; while (char_cnt-- > 0) { if (*p >= '0' && *p <= '7') @@ -2623,6 +2629,14 @@ strappend_base64(struct xar *xar, archive_strncat(as, (const char *)buff, len); } +static int +is_string(const char *known, const char *data, size_t len) +{ + if (strlen(known) != len) + return -1; + return memcmp(data, known, len); +} + static void xml_data(void *userData, const char *s, int len) { @@ -2674,26 +2688,26 @@ xml_data(void *userData, const char *s, int len) archive_strncpy(&(xar->file->symlink), s, len); break; case FILE_TYPE: - if (strncmp("file", s, len) == 0 || - strncmp("hardlink", s, len) == 0) + if (is_string("file", s, len) == 0 || + is_string("hardlink", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFREG; - if (strncmp("directory", s, len) == 0) + if (is_string("directory", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFDIR; - if (strncmp("symlink", s, len) == 0) + if (is_string("symlink", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFLNK; - if (strncmp("character special", s, len) == 0) + if (is_string("character special", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFCHR; - if (strncmp("block special", s, len) == 0) + if (is_string("block special", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFBLK; - if (strncmp("socket", s, len) == 0) + if (is_string("socket", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFSOCK; - if (strncmp("fifo", s, len) == 0) + if (is_string("fifo", s, len) == 0) xar->file->mode = (xar->file->mode & ~AE_IFMT) | AE_IFIFO; xar->file->has |= HAS_TYPE; Modified: head/contrib/libarchive/libarchive/archive_read_support_format_zip.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_zip.c Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/libarchive/archive_read_support_format_zip.c Sun Oct 1 00:40:23 2017 (r324148) @@ -723,6 +723,11 @@ process_extra(struct archive_read *a, const char *p, s } case 0x9901: /* WinZip AES extra data field. */ + if (datasize < 6) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Incomplete AES field"); + return ARCHIVE_FAILED; + } if (p[offset + 2] == 'A' && p[offset + 3] == 'E') { /* Vendor version. */ zip_entry->aes_extra.vendor = Modified: head/contrib/libarchive/libarchive/archive_string.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_string.c Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/libarchive/archive_string.c Sun Oct 1 00:40:23 2017 (r324148) @@ -214,7 +214,8 @@ archive_wstring_append(struct archive_wstring *as, con { if (archive_wstring_ensure(as, as->length + s + 1) == NULL) return (NULL); - wmemmove(as->s + as->length, p, s); + if (s) + wmemmove(as->s + as->length, p, s); as->length += s; as->s[as->length] = 0; return (as); Modified: head/contrib/libarchive/libarchive/archive_version_details.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_version_details.c Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/libarchive/archive_version_details.c Sun Oct 1 00:40:23 2017 (r324148) @@ -45,6 +45,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_LZ4_H #include #endif +#ifdef HAVE_ZSTD_H +#include +#endif #include "archive.h" #include "archive_private.h" @@ -59,6 +62,7 @@ archive_version_details(void) const char *liblzma = archive_liblzma_version(); const char *bzlib = archive_bzlib_version(); const char *liblz4 = archive_liblz4_version(); + const char *libzstd = archive_libzstd_version(); if (!init) { archive_string_init(&str); @@ -84,6 +88,10 @@ archive_version_details(void) archive_strcat(&str, " liblz4/"); archive_strcat(&str, liblz4); } + if (libzstd) { + archive_strcat(&str, " libzstd/"); + archive_strcat(&str, libzstd); + } } return str.s; } @@ -127,6 +135,16 @@ archive_liblz4_version(void) return NUMBER(LZ4_VERSION_MAJOR) "." NUMBER(LZ4_VERSION_MINOR) "." NUMBER(LZ4_VERSION_RELEASE); #undef NUMBER #undef str +#else + return NULL; +#endif +} + +const char * +archive_libzstd_version(void) +{ +#if HAVE_ZSTD_H && HAVE_LIBZSTD + return ZSTD_VERSION_STRING; #else return NULL; #endif Modified: head/contrib/libarchive/libarchive/archive_write.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_write.3 Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/libarchive/archive_write.3 Sun Oct 1 00:40:23 2017 (r324148) @@ -71,7 +71,7 @@ support. .\" .Ss Set options See -.Xr archive_read_set_options 3 . +.Xr archive_write_set_options 3 . .\" .Ss Open archive See Modified: head/contrib/libarchive/libarchive/archive_write_add_filter.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_add_filter.c Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/libarchive/archive_write_add_filter.c Sun Oct 1 00:40:23 2017 (r324148) @@ -53,6 +53,7 @@ struct { int code; int (*setter)(struct archive *); } { ARCHIVE_FILTER_LZOP, archive_write_add_filter_lzip }, { ARCHIVE_FILTER_UU, archive_write_add_filter_uuencode }, { ARCHIVE_FILTER_XZ, archive_write_add_filter_xz }, + { ARCHIVE_FILTER_ZSTD, archive_write_add_filter_zstd }, { -1, NULL } }; Modified: head/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c Sun Oct 1 00:26:06 2017 (r324147) +++ head/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c Sun Oct 1 00:40:23 2017 (r324148) @@ -57,6 +57,7 @@ struct { const char *name; int (*setter)(struct archiv { "lzop", archive_write_add_filter_lzop }, { "uuencode", archive_write_add_filter_uuencode }, { "xz", archive_write_add_filter_xz }, + { "zstd", archive_write_add_filter_zstd }, { NULL, NULL } }; Copied: head/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c (from r324145, vendor/libarchive/dist/libarchive/archive_write_add_filter_zstd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c Sun Oct 1 00:40:23 2017 (r324148, copy of r324145, vendor/libarchive/dist/libarchive/archive_write_add_filter_zstd.c) @@ -0,0 +1,335 @@ +/*- + * Copyright (c) 2017 Sean Purcell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Oct 1 09:48:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49A6FE3E8E7; Sun, 1 Oct 2017 09:48:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 224C17F94A; Sun, 1 Oct 2017 09:48:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v919mVdL063683; Sun, 1 Oct 2017 09:48:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v919mVOo063682; Sun, 1 Oct 2017 09:48:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201710010948.v919mVOo063682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 1 Oct 2017 09:48:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324155 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/ntb/ntb_hw X-SVN-Commit-Revision: 324155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 09:48:32 -0000 Author: mav Date: Sun Oct 1 09:48:31 2017 New Revision: 324155 URL: https://svnweb.freebsd.org/changeset/base/324155 Log: Add initial support for Address Lookup Table (A-LUT). When enabled by EEPROM, use it to relax translation address/size alignment requirements for BAR2 window by 128 or 256 times. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Sun Oct 1 05:26:52 2017 (r324154) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Sun Oct 1 09:48:31 2017 (r324155) @@ -80,6 +80,7 @@ struct ntb_plx_softc { u_int ntx; /* NTx number within chip. */ u_int link; /* Link v/s Virtual side. */ u_int port; /* Port number within chip. */ + u_int alut; /* A-LUT is enabled for NTx */ int int_rid; struct resource *int_res; @@ -197,6 +198,10 @@ ntb_plx_init(device_t dev) } } + /* Make sure Virtual to Link A-LUT is disabled. */ + if (sc->alut) + PNTX_WRITE(sc, 0xc94, 0); + /* Enable Link Interface LUT entries 0/1 for peer 0/1. */ PNTX_WRITE(sc, 0xdb4, 0x00090001); } @@ -329,6 +334,12 @@ ntb_plx_attach(device_t dev) val = bus_read_4(sc->conf_res, 0x360); sc->port = (val >> ((sc->ntx == 0) ? 8 : 16)) & 0x1f; + /* Detect A-LUT enable and size. */ + val >>= 30; + sc->alut = (val == 0x3) ? 1 : ((val & (1 << sc->ntx)) ? 2 : 0); + if (sc->alut) + device_printf(dev, "%u A-LUT entries\n", 128 * sc->alut); + /* Find configured memory windows at BAR2-5. */ sc->mw_count = 0; for (i = 2; i <= 5; i++) { @@ -561,22 +572,31 @@ ntb_plx_mw_get_range(device_t dev, unsigned mw_idx, vm /* * Remote to local memory window translation address alignment. - * XXX: In B2B mode we can change window size (and so alignmet) - * live, but there is no way to report it, so report safe value. + * Translation address has to be aligned to the BAR size, but A-LUT + * entries re-map addresses can be aligned to 1/128 or 1/256 of it. + * XXX: In B2B mode we can change BAR size (and so alignmet) live, + * but there is no way to report it here, so report safe value. */ - if (align != NULL) - *align = mw->mw_size - off; + if (align != NULL) { + if (sc->alut && mw->mw_bar == 2) + *align = (mw->mw_size - off) / 128 / sc->alut; + else + *align = mw->mw_size - off; + } /* * Remote to local memory window size alignment. - * XXX: The chip has no limit registers. In B2B case size must be - * power of 2 (since we can reprogram BAR size), but there is no way - * to report it, so report 1MB -- minimal BAR size. In non-B2B case - * there is no control at all, so report the precofigured BAR size. + * The chip has no limit registers, but A-LUT, when available, allows + * access control with granularity of 1/128 or 1/256 of the BAR size. + * XXX: In B2B case we can change BAR size live, but there is no way + * to report it, so report half of the BAR size, that should be safe. + * In non-B2B case there is no control at all, so report the BAR size. */ if (align_size != NULL) { - if (sc->b2b_mw >= 0) - *align_size = 1024 * 1024; + if (sc->alut && mw->mw_bar == 2) + *align_size = (mw->mw_size - off) / 128 / sc->alut; + else if (sc->b2b_mw >= 0) + *align_size = (mw->mw_size - off) / 2; else *align_size = mw->mw_size - off; } @@ -593,8 +613,9 @@ ntb_plx_mw_set_trans_internal(device_t dev, unsigned m { struct ntb_plx_softc *sc = device_get_softc(dev); struct ntb_plx_mw_info *mw; - uint64_t addr, off, size, val64; + uint64_t addr, eaddr, off, size, bsize, esize, val64; uint32_t val; + int i; mw = &sc->mw_info[mw_idx]; addr = mw->mw_xlat_addr; @@ -615,22 +636,29 @@ ntb_plx_mw_set_trans_internal(device_t dev, unsigned m if (size > 0) { /* Round BAR size to next power of 2 or at least 1MB. */ - if (!powerof2(size)) - size = 1LL << flsll(size); - if (size < 1024 * 1024) - size = 1024 * 1024; + bsize = size; + if (!powerof2(bsize)) + bsize = 1LL << flsll(bsize); + if (bsize < 1024 * 1024) + bsize = 1024 * 1024; - /* Hardware requires addr aligned to BAR size. */ - if ((addr & (size - 1)) != 0) + /* A-LUT has 128 or 256 times better granularity. */ + esize = bsize; + if (sc->alut && mw->mw_bar == 2) + esize /= 128 * sc->alut; + + /* addr should be aligned to BAR or A-LUT element size. */ + if ((addr & (esize - 1)) != 0) return (EINVAL); - } + } else + esize = bsize = 0; if (mw->mw_64bit) { if (sc->b2b_mw >= 0) { /* Set Link Interface BAR size and enable/disable it. */ val64 = 0; - if (size > 0) - val64 = (~(size - 1) & ~0xfffff); + if (bsize > 0) + val64 = (~(bsize - 1) & ~0xfffff); val64 |= 0xc; PNTX_WRITE(sc, 0xe8 + (mw->mw_bar - 2) * 4, val64); PNTX_WRITE(sc, 0xe8 + (mw->mw_bar - 2) * 4 + 4, val64 >> 32); @@ -648,14 +676,14 @@ ntb_plx_mw_set_trans_internal(device_t dev, unsigned m /* Make sure we fit into 32-bit address space. */ if ((addr & UINT32_MAX) != addr) return (ERANGE); - if (((addr + size) & UINT32_MAX) != (addr + size)) + if (((addr + bsize) & UINT32_MAX) != (addr + bsize)) return (ERANGE); if (sc->b2b_mw >= 0) { /* Set Link Interface BAR size and enable/disable it. */ val = 0; - if (size > 0) - val = (~(size - 1) & ~0xfffff); + if (bsize > 0) + val = (~(bsize - 1) & ~0xfffff); PNTX_WRITE(sc, 0xe8 + (mw->mw_bar - 2) * 4, val); /* Set Link Interface BAR address. */ @@ -666,6 +694,27 @@ ntb_plx_mw_set_trans_internal(device_t dev, unsigned m /* Set Virtual Interface BARs address translation */ PNTX_WRITE(sc, 0xc3c + (mw->mw_bar - 2) * 4, addr); } + + /* Configure and enable Link to Virtual A-LUT if we need it. */ + if (sc->alut && mw->mw_bar == 2 && + ((addr & (bsize - 1)) != 0 || size != bsize)) { + eaddr = addr; + for (i = 0; i < 128 * sc->alut; i++) { + val = sc->link ? 0 : 1; + if (sc->alut == 1) + val += 2 * sc->ntx; + val *= 0x1000 * sc->alut; + val += 0x38000 + i * 4 + (i >= 128 ? 0x0e00 : 0); + bus_write_4(sc->conf_res, val, eaddr); + bus_write_4(sc->conf_res, val + 0x400, eaddr >> 32); + bus_write_4(sc->conf_res, val + 0x800, + (eaddr < addr + size) ? 0x3 : 0); + eaddr += esize; + } + NTX_WRITE(sc, 0xc94, 0x10000000); + } else if (sc->alut && mw->mw_bar == 2) + NTX_WRITE(sc, 0xc94, 0); + return (0); } From owner-svn-src-head@freebsd.org Sun Oct 1 11:17:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6D68E1464F; Sun, 1 Oct 2017 11:17:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B011A82346; Sun, 1 Oct 2017 11:17:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v91BHU7R000764; Sun, 1 Oct 2017 11:17:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v91BHUkB000763; Sun, 1 Oct 2017 11:17:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710011117.v91BHUkB000763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 1 Oct 2017 11:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324156 - head/sys/dev/smbus X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/smbus X-SVN-Commit-Revision: 324156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 11:17:32 -0000 Author: kib Date: Sun Oct 1 11:17:30 2017 New Revision: 324156 URL: https://svnweb.freebsd.org/changeset/base/324156 Log: Improve smb(4) devfs interactions. Use make_dev_s(9) to create device, since the device ioctl interface needs to access si_drv1 to get softc pointer. Remove the common but not functional attempt to prevent parallel accesses by file descriptors by blocking more than one open. Either threads in one process, or forked siblings, or file descriptors passed over unix domain sockets all allow to execute parallel requests once one fd is opened. Since ioctl handler uses smbus_request_bus() to take the bus ownership, the correct mechanism establishes exclusive access already. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/dev/smbus/smb.c Modified: head/sys/dev/smbus/smb.c ============================================================================== --- head/sys/dev/smbus/smb.c Sun Oct 1 09:48:31 2017 (r324155) +++ head/sys/dev/smbus/smb.c Sun Oct 1 11:17:30 2017 (r324156) @@ -47,9 +47,7 @@ struct smb_softc { device_t sc_dev; - int sc_count; /* >0 if device opened */ struct cdev *sc_devnode; - struct mtx sc_lock; }; static void smb_identify(driver_t *driver, device_t parent); @@ -78,15 +76,11 @@ static driver_t smb_driver = { sizeof(struct smb_softc), }; -static d_open_t smbopen; -static d_close_t smbclose; static d_ioctl_t smbioctl; static struct cdevsw smb_cdevsw = { .d_version = D_VERSION, .d_flags = D_TRACKCLOSE, - .d_open = smbopen, - .d_close = smbclose, .d_ioctl = smbioctl, .d_name = "smb", }; @@ -112,59 +106,31 @@ smb_probe(device_t dev) static int smb_attach(device_t dev) { - struct smb_softc *sc = device_get_softc(dev); - int unit; - - unit = device_get_unit(dev); + struct smb_softc *sc; + struct make_dev_args mda; + int error; + + sc = device_get_softc(dev); sc->sc_dev = dev; - sc->sc_devnode = make_dev(&smb_cdevsw, unit, UID_ROOT, GID_WHEEL, - 0600, "smb%d", unit); - sc->sc_devnode->si_drv1 = sc; - mtx_init(&sc->sc_lock, device_get_nameunit(dev), NULL, MTX_DEF); - - return (0); + make_dev_args_init(&mda); + mda.mda_devsw = &smb_cdevsw; + mda.mda_unit = device_get_unit(dev); + mda.mda_uid = UID_ROOT; + mda.mda_gid = GID_WHEEL; + mda.mda_mode = 0600; + mda.mda_si_drv1 = sc; + error = make_dev_s(&mda, &sc->sc_devnode, "smb%d", mda.mda_unit); + return (error); } static int smb_detach(device_t dev) { - struct smb_softc *sc = (struct smb_softc *)device_get_softc(dev); + struct smb_softc *sc; - if (sc->sc_devnode) - destroy_dev(sc->sc_devnode); - mtx_destroy(&sc->sc_lock); - - return (0); -} - -static int -smbopen(struct cdev *dev, int flags, int fmt, struct thread *td) -{ - struct smb_softc *sc = dev->si_drv1; - - mtx_lock(&sc->sc_lock); - if (sc->sc_count != 0) { - mtx_unlock(&sc->sc_lock); - return (EBUSY); - } - - sc->sc_count++; - mtx_unlock(&sc->sc_lock); - - return (0); -} - -static int -smbclose(struct cdev *dev, int flags, int fmt, struct thread *td) -{ - struct smb_softc *sc = dev->si_drv1; - - mtx_lock(&sc->sc_lock); - KASSERT(sc->sc_count == 1, ("device not busy")); - sc->sc_count--; - mtx_unlock(&sc->sc_lock); - + sc = device_get_softc(dev); + destroy_dev(sc->sc_devnode); return (0); } From owner-svn-src-head@freebsd.org Sun Oct 1 12:54:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E487E241C1; Sun, 1 Oct 2017 12:54:41 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D5F284C06; Sun, 1 Oct 2017 12:54:41 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v91CseXB041821; Sun, 1 Oct 2017 12:54:40 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v91Csex4041820; Sun, 1 Oct 2017 12:54:40 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201710011254.v91Csex4041820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 1 Oct 2017 12:54:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324157 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 324157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 12:54:41 -0000 Author: avos Date: Sun Oct 1 12:54:40 2017 New Revision: 324157 URL: https://svnweb.freebsd.org/changeset/base/324157 Log: Mark libifconfig as private library in src.libnames.mk (completes r305700) Modified: head/share/mk/src.libnames.mk Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Sun Oct 1 11:17:30 2017 (r324156) +++ head/share/mk/src.libnames.mk Sun Oct 1 12:54:40 2017 (r324157) @@ -20,6 +20,7 @@ _PRIVATELIBS= \ event \ heimipcc \ heimipcs \ + ifconfig \ ldns \ sqlite3 \ ssh \ @@ -108,7 +109,6 @@ _LIBRARIES= \ heimntlm \ heimsqlite \ hx509 \ - ifconfig \ ipsec \ jail \ kadm5clnt \ From owner-svn-src-head@freebsd.org Sun Oct 1 15:35:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94314E2798F; Sun, 1 Oct 2017 15:35:22 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E8EA64098; Sun, 1 Oct 2017 15:35:22 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v91FZLSa008007; Sun, 1 Oct 2017 15:35:21 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v91FZL54008003; Sun, 1 Oct 2017 15:35:21 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201710011535.v91FZL54008003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Sun, 1 Oct 2017 15:35:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324162 - in head: share/man/man4 sys/dev/mpr sys/dev/mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/mpr sys/dev/mps X-SVN-Commit-Revision: 324162 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 15:35:22 -0000 Author: scottl Date: Sun Oct 1 15:35:21 2017 New Revision: 324162 URL: https://svnweb.freebsd.org/changeset/base/324162 Log: Improve the debug parsing to allow flags to be added and subtracted from the existing set. Submitted by: rea@freebsd.org Modified: head/share/man/man4/mpr.4 head/share/man/man4/mps.4 head/sys/dev/mpr/mpr.c head/sys/dev/mps/mps.c Modified: head/share/man/man4/mpr.4 ============================================================================== --- head/share/man/man4/mpr.4 Sun Oct 1 15:03:44 2017 (r324161) +++ head/share/man/man4/mpr.4 Sun Oct 1 15:35:21 2017 (r324162) @@ -354,6 +354,11 @@ All variables can be named by either an integer value or a text string. Multiple values can be specified together by either ORing the integer values or by providing a comma-separated list of names. +A text string prefixed by +.Qq + +adds the specified debug levels to the existing set, while the prefix +.Qq - +removes them from the existing set. The current .Va debug_level status is reported in both formats for convenience. Modified: head/share/man/man4/mps.4 ============================================================================== --- head/share/man/man4/mps.4 Sun Oct 1 15:03:44 2017 (r324161) +++ head/share/man/man4/mps.4 Sun Oct 1 15:35:21 2017 (r324162) @@ -330,6 +330,11 @@ All variables can be named by either an integer value or a text string. Multiple values can be specified together by either ORing the integer values or by providing a comma-separated list of names. +A text string prefixed by +.Qq + +adds the specified debug levels to the existing set, while the prefix +.Qq - +removes them from the existing set. The current .Va debug_level status is reported in both formats for convenience. Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Sun Oct 1 15:03:44 2017 (r324161) +++ head/sys/dev/mpr/mpr.c Sun Oct 1 15:35:21 2017 (r324162) @@ -1834,6 +1834,12 @@ static struct mpr_debug_string { {"trace", MPR_TRACE} }; +enum mpr_debug_level_combiner { + COMB_NONE, + COMB_ADD, + COMB_SUB +}; + static int mpr_debug_sysctl(SYSCTL_HANDLER_ARGS) { @@ -1885,6 +1891,7 @@ static void mpr_parse_debug(struct mpr_softc *sc, char *list) { struct mpr_debug_string *string; + enum mpr_debug_level_combiner op; char *token, *endtoken; size_t sz; int flags, i; @@ -1892,6 +1899,17 @@ mpr_parse_debug(struct mpr_softc *sc, char *list) if (list == NULL || *list == '\0') return; + if (*list == '+') { + op = COMB_ADD; + list++; + } else if (*list == '-') { + op = COMB_SUB; + list++; + } else + op = COMB_NONE; + if (*list == '\0') + return; + flags = 0; sz = sizeof(mpr_debug_strings) / sizeof(mpr_debug_strings[0]); while ((token = strsep(&list, ":,")) != NULL) { @@ -1911,7 +1929,17 @@ mpr_parse_debug(struct mpr_softc *sc, char *list) } } - sc->mpr_debug = flags; + switch (op) { + case COMB_NONE: + sc->mpr_debug = flags; + break; + case COMB_ADD: + sc->mpr_debug |= flags; + break; + case COMB_SUB: + sc->mpr_debug &= (~flags); + break; + } return; } Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Sun Oct 1 15:03:44 2017 (r324161) +++ head/sys/dev/mps/mps.c Sun Oct 1 15:35:21 2017 (r324162) @@ -1696,6 +1696,12 @@ static struct mps_debug_string { {"trace", MPS_TRACE} }; +enum mps_debug_level_combiner { + COMB_NONE, + COMB_ADD, + COMB_SUB +}; + static int mps_debug_sysctl(SYSCTL_HANDLER_ARGS) { @@ -1747,6 +1753,7 @@ static void mps_parse_debug(struct mps_softc *sc, char *list) { struct mps_debug_string *string; + enum mps_debug_level_combiner op; char *token, *endtoken; size_t sz; int flags, i; @@ -1754,6 +1761,17 @@ mps_parse_debug(struct mps_softc *sc, char *list) if (list == NULL || *list == '\0') return; + if (*list == '+') { + op = COMB_ADD; + list++; + } else if (*list == '-') { + op = COMB_SUB; + list++; + } else + op = COMB_NONE; + if (*list == '\0') + return; + flags = 0; sz = sizeof(mps_debug_strings) / sizeof(mps_debug_strings[0]); while ((token = strsep(&list, ":,")) != NULL) { @@ -1773,7 +1791,18 @@ mps_parse_debug(struct mps_softc *sc, char *list) } } - sc->mps_debug = flags; + switch (op) { + case COMB_NONE: + sc->mps_debug = flags; + break; + case COMB_ADD: + sc->mps_debug |= flags; + break; + case COMB_SUB: + sc->mps_debug &= (~flags); + break; + } + return; } From owner-svn-src-head@freebsd.org Sun Oct 1 16:11:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2EEAE2839C; Sun, 1 Oct 2017 16:11:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5011164E64; Sun, 1 Oct 2017 16:11:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v91GB8UJ024108; Sun, 1 Oct 2017 16:11:08 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v91GB8LM024101; Sun, 1 Oct 2017 16:11:08 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710011611.v91GB8LM024101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sun, 1 Oct 2017 16:11:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324163 - in head: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common cddl/co... X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common cddl/contrib/opensolaris/lib/lib... X-SVN-Commit-Revision: 324163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 16:11:09 -0000 Author: avg Date: Sun Oct 1 16:11:07 2017 New Revision: 324163 URL: https://svnweb.freebsd.org/changeset/base/324163 Log: MFV r323530,r323533,r323534: 7431 ZFS Channel Programs, and followups 7431 ZFS Channel Programs illumos/illumos-gate@dfc115332c94a2f62058ac7f2bce7631fbd20b3d https://github.com/illumos/illumos-gate/commit/dfc115332c94a2f62058ac7f2bce7631fbd20b3d https://www.illumos.org/issues/7431 ZFS channel programs (ZCP) adds support for performing compound ZFS administrative actions via Lua scripts in a sandboxed environment (with time and memory limits). This initial commit includes both base support for running ZCP scripts, and a small initial library of API calls which support getting properties and listing, destroying, and promoting datasets. Testing: in addition to the included unit tests, channel programs have been in use at Delphix for several months for batch destroying filesystems. The dsl_destroy_snaps_nvl() call has also been replaced with Reviewed by: Matthew Ahrens Reviewed by: George Wilson Reviewed by: John Kennedy Reviewed by: Dan Kimmel Approved by: Garrett D'Amore Author: Chris Williamson 8552 ZFS LUA code uses floating point math illumos/illumos-gate@916c8d881190bd2c3ca20d9fca919aecff504435 https://github.com/illumos/illumos-gate/commit/916c8d881190bd2c3ca20d9fca919aecff504435 https://www.illumos.org/issues/8552 In the LUA interpreter used by "zfs program", the lua format() function accidentally includes support for '%f' and friends, which can cause compilation problems when building on platforms that don't support floating-point math in the kernel (e.g. sparc). Support for '%f' friends (%f %e %E %g %G) should be removed, since there's no way to supply a floating-point value anyway (all numbers in ZFS LUA are int64_t's). Reviewed by: Yuri Pankov Reviewed by: Igor Kozhukhov Approved by: Dan McDonald Author: Matthew Ahrens 8590 memory leak in dsl_destroy_snapshots_nvl() illumos/illumos-gate@e6ab4525d156c82445c116ecf6b2b874d5e9009d https://github.com/illumos/illumos-gate/commit/e6ab4525d156c82445c116ecf6b2b874d5e9009d https://www.illumos.org/issues/8590 In dsl_destroy_snapshots_nvl(), "snaps_normalized" is not freed after it is added to "arg". Reviewed by: Pavel Zakharov Reviewed by: Steve Gonczi Reviewed by: George Wilson Approved by: Dan McDonald Author: Matthew Ahrens FreeBSD notes: - zfs-program.8 manual page is taken almost as is from the vendor repository, no FreeBSD-ification done - fixed multiple instances of NULL being used where an integer is expected - replaced ETIME and ECHRNG with ETIMEDOUT and EDOM respectively This commit adds a modified version of Lua 5.2.4 under sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua, mirroring the upstream. See README.zfs in that directory for the description of Lua customizations. See zfs-program.8 on how to use the new feature. MFC after: 5 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D12528 Added: head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/ - copied from r323530, vendor-sys/illumos/dist/uts/common/fs/zfs/lua/ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp.h - copied unchanged from r323530, vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zcp.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp_global.h - copied unchanged from r323530, vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zcp_global.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp_iter.h - copied unchanged from r323530, vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zcp_iter.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp_prop.h - copied unchanged from r323530, vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zcp_prop.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c - copied, changed from r323530, vendor-sys/illumos/dist/uts/common/fs/zfs/zcp.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c - copied, changed from r323530, vendor-sys/illumos/dist/uts/common/fs/zfs/zcp_get.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_global.c - copied, changed from r323530, vendor-sys/illumos/dist/uts/common/fs/zfs/zcp_global.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_iter.c - copied, changed from r323530, vendor-sys/illumos/dist/uts/common/fs/zfs/zcp_iter.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c - copied, changed from r323530, vendor-sys/illumos/dist/uts/common/fs/zfs/zcp_synctask.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h head/cddl/lib/libzpool/Makefile head/cddl/sbin/zfs/Makefile head/sys/cddl/compat/opensolaris/kern/opensolaris_sunddi.c head/sys/cddl/compat/opensolaris/sys/sunddi.h head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lbaselib.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/ldo.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/luaconf.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h head/sys/conf/files head/sys/conf/kern.pre.mk head/sys/modules/zfs/Makefile Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/zfs/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Added: head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Sun Oct 1 16:11:07 2017 (r324163) @@ -0,0 +1,499 @@ +.\" This file and its contents are supplied under the terms of the +.\" Common Development and Distribution License ("CDDL"), version 1.0. +.\" You may only use this file in accordance with the terms of version +.\" 1.0 of the CDDL. +.\" +.\" A full copy of the text of the CDDL should have accompanied this +.\" source. A copy of the CDDL is also available via the Internet at +.\" http://www.illumos.org/license/CDDL. +.\" +.\" +.\" Copyright (c) 2016 by Delphix. All Rights Reserved. +.\" +.Dd September 28, 2017 +.Dt ZFS-PROGRAM 1M +.Os +.Sh NAME +.Nm zfs program +.Nd executes ZFS channel programs +.Sh SYNOPSIS +.Cm zfs program +.Op Fl t Ar instruction-limit +.Op Fl m Ar memory-limit +.Ar pool +.Ar script +.\".Op Ar optional arguments to channel program +.Sh DESCRIPTION +The ZFS channel program interface allows ZFS administrative operations to be +run programmatically as a Lua script. +The entire script is executed atomically, with no other administrative +operations taking effect concurrently. +A library of ZFS calls is made available to channel program scripts. +Channel programs may only be run with root privileges. +.Pp +A modified version of the Lua 5.2 interpreter is used to run channel program +scripts. +The Lua 5.2 manual can be found at: +.Bd -centered -offset indent +.Lk http://www.lua.org/manual/5.2/ +.Ed +.Pp +The channel program given by +.Ar script +will be run on +.Ar pool , +and any attempts to access or modify other pools will cause an error. +.Sh OPTIONS +.Bl -tag -width "-t" +.It Fl t Ar instruction-limit +Execution time limit, in number of Lua instructions to execute. +If a channel program executes more than the specified number of instructions, +it will be stopped and an error will be returned. +The default limit is 10 million instructions, and it can be set to a maximum of +100 million instructions. +.It Fl m Ar memory-limit +Memory limit, in bytes. +If a channel program attempts to allocate more memory than the given limit, it +will be stopped and an error returned. +The default memory limit is 10 MB, and can be set to a maximum of 100 MB. +.El +.Pp +All remaining argument strings will be passed directly to the Lua script as +described in the +.Sx LUA INTERFACE +section below. +.Sh LUA INTERFACE +A channel program can be invoked either from the command line, or via a library +call to +.Fn lzc_channel_program . +.Ss Arguments +Arguments passed to the channel program are converted to a Lua table. +If invoked from the command line, extra arguments to the Lua script will be +accessible as an array stored in the argument table with the key 'argv': +.Bd -literal -offset indent +args = ... +argv = args["argv"] +-- argv == {1="arg1", 2="arg2", ...} +.Ed +.Pp +If invoked from the libZFS interface, an arbitrary argument list can be +passed to the channel program, which is accessible via the same +"..." syntax in Lua: +.Bd -literal -offset indent +args = ... +-- args == {"foo"="bar", "baz"={...}, ...} +.Ed +.Pp +Note that because Lua arrays are 1-indexed, arrays passed to Lua from the +libZFS interface will have their indices incremented by 1. +That is, the element +in +.Va arr[0] +in a C array passed to a channel program will be stored in +.Va arr[1] +when accessed from Lua. +.Ss Return Values +Lua return statements take the form: +.Bd -literal -offset indent +return ret0, ret1, ret2, ... +.Ed +.Pp +Return statements returning multiple values are permitted internally in a +channel program script, but attempting to return more than one value from the +top level of the channel program is not permitted and will throw an error. +However, tables containing multiple values can still be returned. +If invoked from the command line, a return statement: +.Bd -literal -offset indent +a = {foo="bar", baz=2} +return a +.Ed +.Pp +Will be output formatted as: +.Bd -literal -offset indent +Channel program fully executed with return value: + return: + baz: 2 + foo: 'bar' +.Ed +.Ss Fatal Errors +If the channel program encounters a fatal error while running, a non-zero exit +status will be returned. +If more information about the error is available, a singleton list will be +returned detailing the error: +.Bd -literal -offset indent +error: "error string, including Lua stack trace" +.Ed +.Pp +If a fatal error is returned, the channel program may have not executed at all, +may have partially executed, or may have fully executed but failed to pass a +return value back to userland. +.Pp +If the channel program exhausts an instruction or memory limit, a fatal error +will be generated and the program will be stopped, leaving the program partially +executed. +No attempt is made to reverse or undo any operations already performed. +Note that because both the instruction count and amount of memory used by a +channel program are deterministic when run against the same inputs and +filesystem state, as long as a channel program has run successfully once, you +can guarantee that it will finish successfully against a similar size system. +.Pp +If a channel program attempts to return too large a value, the program will +fully execute but exit with a nonzero status code and no return value. +.Pp +.Em Note: +ZFS API functions do not generate Fatal Errors when correctly invoked, they +return an error code and the channel program continues executing. +See the +.Sx ZFS API +section below for function-specific details on error return codes. +.Ss Lua to C Value Conversion +When invoking a channel program via the libZFS interface, it is necessary to +translate arguments and return values from Lua values to their C equivalents, +and vice-versa. +.Pp +There is a correspondence between nvlist values in C and Lua tables. +A Lua table which is returned from the channel program will be recursively +converted to an nvlist, with table values converted to their natural +equivalents: +.Bd -literal -offset indent +string -> string +number -> int64 +boolean -> boolean_value +nil -> boolean (no value) +table -> nvlist +.Ed +.Pp +Likewise, table keys are replaced by string equivalents as follows: +.Bd -literal -offset indent +string -> no change +number -> signed decimal string ("%lld") +boolean -> "true" | "false" +.Ed +.Pp +Any collision of table key strings (for example, the string "true" and a +true boolean value) will cause a fatal error. +.Pp +Lua numbers are represented internally as signed 64-bit integers. +.Sh LUA STANDARD LIBRARY +The following Lua built-in base library functions are available: +.Bd -literal -offset indent +assert rawlen +collectgarbage rawget +error rawset +getmetatable select +ipairs setmetatable +next tonumber +pairs tostring +rawequal type +.Ed +.Pp +All functions in the +.Em coroutine , +.Em string , +and +.Em table +built-in submodules are also available. +A complete list and documentation of these modules is available in the Lua +manual. +.Pp +The following functions base library functions have been disabled and are +not available for use in channel programs: +.Bd -literal -offset indent +dofile +loadfile +load +pcall +print +xpcall +.Ed +.Sh ZFS API +.Ss Function Arguments +Each API function takes a fixed set of required positional arguments and +optional keyword arguments. +For example, the destroy function takes a single positional string argument +(the name of the dataset to destroy) and an optional "defer" keyword boolean +argument. +When using parentheses to specify the arguments to a Lua function, only +positional arguments can be used: +.Bd -literal -offset indent +zfs.sync.destroy("rpool@snap") +.Ed +.Pp +To use keyword arguments, functions must be called with a single argument that +is a Lua table containing entries mapping integers to positional arguments and +strings to keyword arguments: +.Bd -literal -offset indent +zfs.sync.destroy({1="rpool@snap", defer=true}) +.Ed +.Pp +The Lua language allows curly braces to be used in place of parenthesis as +syntactic sugar for this calling convention: +.Bd -literal -offset indent +zfs.sync.snapshot{"rpool@snap", defer=true} +.Ed +.Ss Function Return Values +If an API function succeeds, it returns 0. +If it fails, it returns an error code and the channel program continues +executing. +API functions do not generate Fatal Errors except in the case of an +unrecoverable internal file system error. +.Pp +In addition to returning an error code, some functions also return extra +details describing what caused the error. +This extra description is given as a second return value, and will always be a +Lua table, or Nil if no error details were returned. +Different keys will exist in the error details table depending on the function +and error case. +Any such function may be called expecting a single return value: +.Bd -literal -offset indent +errno = zfs.sync.promote(dataset) +.Ed +.Pp +Or, the error details can be retrieved: +.Bd -literal -offset indent +errno, details = zfs.sync.promote(dataset) +if (errno == EEXIST) then + assert(details ~= Nil) + list_of_conflicting_snapshots = details +end +.Ed +.Pp +The following global aliases for API function error return codes are defined +for use in channel programs: +.Bd -literal -offset indent +EPERM ECHILD ENODEV ENOSPC +ENOENT EAGAIN ENOTDIR ESPIPE +ESRCH ENOMEM EISDIR EROFS +EINTR EACCES EINVAL EMLINK +EIO EFAULT ENFILE EPIPE +ENXIO ENOTBLK EMFILE EDOM +E2BIG EBUSY ENOTTY ERANGE +ENOEXEC EEXIST ETXTBSY EDQUOT +EBADF EXDEV EFBIG +.Ed +.Ss API Functions +For detailed descriptions of the exact behavior of any zfs administrative +operations, see the main +.Xr zfs 1 +manual page. +.Bl -tag -width "xx" +.It Em zfs.debug(msg) +Record a debug message in the zfs_dbgmsg log. +A log of these messages can be printed via mdb's "::zfs_dbgmsg" command, or +can be monitored live by running: +.Bd -literal -offset indent + dtrace -n 'zfs-dbgmsg{trace(stringof(arg0))}' +.Ed +.Pp +msg (string) +.Bd -ragged -compact -offset "xxxx" +Debug message to be printed. +.Ed +.It Em zfs.get_prop(dataset, property) +Returns two values. +First, a string, number or table containing the property value for the given +dataset. +Second, a string containing the source of the property (i.e. the name of the +dataset in which it was set or nil if it is readonly). +Throws a Lua error if the dataset is invalid or the property doesn't exist. +Note that Lua only supports int64 number types whereas ZFS number properties +are uint64. +This means very large values (like guid) may wrap around and appear negative. +.Pp +dataset (string) +.Bd -ragged -compact -offset "xxxx" +Filesystem or snapshot path to retrieve properties from. +.Ed +.Pp +property (string) +.Bd -ragged -compact -offset "xxxx" +Name of property to retrieve. +All filesystem, snapshot and volume properties are supported except +for 'mounted' and 'iscsioptions.' +Also supports the 'written@snap' and 'written#bookmark' properties and +the '@id' properties, though the id must be in numeric +form. +.Ed +.El +.Bl -tag -width "xx" +.It Sy zfs.sync submodule +The sync submodule contains functions that modify the on-disk state. +They are executed in "syncing context". +.Pp +The available sync submodule functions are as follows: +.Bl -tag -width "xx" +.It Em zfs.sync.destroy(dataset, [defer=true|false]) +Destroy the given dataset. +Returns 0 on successful destroy, or a nonzero error code if the dataset could +not be destroyed (for example, if the dataset has any active children or +clones). +.Pp +dataset (string) +.Bd -ragged -compact -offset "xxxx" +Filesystem or snapshot to be destroyed. +.Ed +.Pp +[optional] defer (boolean) +.Bd -ragged -compact -offset "xxxx" +Valid only for destroying snapshots. +If set to true, and the snapshot has holds or clones, allows the snapshot to be +marked for deferred deletion rather than failing. +.Ed +.It Em zfs.sync.promote(dataset) +Promote the given clone to a filesystem. +Returns 0 on successful promotion, or a nonzero error code otherwise. +If EEXIST is returned, the second return value will be an array of the clone's +snapshots whose names collide with snapshots of the parent filesystem. +.Pp +dataset (string) +.Bd -ragged -compact -offset "xxxx" +Clone to be promoted. +.Ed +.El +.It Sy zfs.check submodule +For each function in the zfs.sync submodule, there is a corresponding zfs.check +function which performs a "dry run" of the same operation. +Each takes the same arguments as its zfs.sync counterpart and returns 0 if the +operation would succeed, or a non-zero error code if it would fail, along with +any other error details. +That is, each has the same behavior as the corresponding sync function except +for actually executing the requested change. +For example, +.Em zfs.check.destroy("fs") +returns 0 if +.Em zfs.sync.destroy("fs") +would successfully destroy the dataset. +.Pp +The available zfs.check functions are: +.Bl -tag -width "xx" +.It Em zfs.check.destroy(dataset, [defer=true|false]) +.It Em zfs.check.promote(dataset) +.El +.It Sy zfs.list submodule +The zfs.list submodule provides functions for iterating over datasets and +properties. +Rather than returning tables, these functions act as Lua iterators, and are +generally used as follows: +.Bd -literal -offset indent +for child in zfs.list.children("rpool") do + ... +end +.Ed +.Pp +The available zfs.list functions are: +.Bl -tag -width "xx" +.It Em zfs.list.clones(snapshot) +Iterate through all clones of the given snapshot. +.Pp +snapshot (string) +.Bd -ragged -compact -offset "xxxx" +Must be a valid snapshot path in the current pool. +.Ed +.It Em zfs.list.snapshots(dataset) +Iterate through all snapshots of the given dataset. +Each snapshot is returned as a string containing the full dataset name, e.g. +"pool/fs@snap". +.Pp +dataset (string) +.Bd -ragged -compact -offset "xxxx" +Must be a valid filesystem or volume. +.Ed +.It Em zfs.list.children(dataset) +Iterate through all direct children of the given dataset. +Each child is returned as a string containing the full dataset name, e.g. +"pool/fs/child". +.Pp +dataset (string) +.Bd -ragged -compact -offset "xxxx" +Must be a valid filesystem or volume. +.Ed +.It Em zfs.list.properties(dataset) +Iterate through all user properties for the given dataset. +.Pp +dataset (string) +.Bd -ragged -compact -offset "xxxx" +Must be a valid filesystem, snapshot, or volume. +.Ed +.It Em zfs.list.system_properties(dataset) +Returns an array of strings, the names of the valid system (non-user defined) +properties for the given dataset. +Throws a Lua error if the dataset is invalid. +.Pp +dataset (string) +.Bd -ragged -compact -offset "xxxx" +Must be a valid filesystem, snapshot or volume. +.Ed +.El +.El +.Sh EXAMPLES +.Ss Example 1 +The following channel program recursively destroys a filesystem and all its +snapshots and children in a naive manner. +Note that this does not involve any error handling or reporting. +.Bd -literal -offset indent +function destroy_recursive(root) + for child in zfs.list.children(root) do + destroy_recursive(child) + end + for snap in zfs.list.snapshots(root) do + zfs.sync.destroy(snap) + end + zfs.sync.destroy(root) +end +destroy_recursive("pool/somefs") +.Ed +.Ss Example 2 +A more verbose and robust version of the same channel program, which +properly detects and reports errors, and also takes the dataset to destroy +as a command line argument, would be as follows: +.Bd -literal -offset indent +succeeded = {} +failed = {} + +function destroy_recursive(root) + for child in zfs.list.children(root) do + destroy_recursive(child) + end + for snap in zfs.list.snapshots(root) do + err = zfs.sync.destroy(snap) + if (err ~= 0) then + failed[snap] = err + else + succeeded[snap] = err + end + end + err = zfs.sync.destroy(root) + if (err ~= 0) then + failed[root] = err + else + succeeded[root] = err + end +end + +args = ... +argv = args["argv"] + +destroy_recursive(argv[1]) + +results = {} +results["succeeded"] = succeeded +results["failed"] = failed +return results +.Ed +.Ss Example 3 +The following function performs a forced promote operation by attempting to +promote the given clone and destroying any conflicting snapshots. +.Bd -literal -offset indent +function force_promote(ds) + errno, details = zfs.check.promote(ds) + if (errno == EEXIST) then + assert(details ~= Nil) + for i, snap in ipairs(details) do + zfs.sync.destroy(ds .. "@" .. snap) + end + elseif (errno ~= 0) then + return errno + end + return zfs.sync.promote(ds) +end +.Ed Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Oct 1 15:35:21 2017 (r324162) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Oct 1 16:11:07 2017 (r324163) @@ -286,6 +286,12 @@ .Ar snapshot .Op Ar snapshot Ns | Ns Ar filesystem .Nm +.Cm program +.Op Fl t Ar timeout +.Op Fl m Ar memory_limit +.Ar pool script +.Op Ar arg1 No ... +.Nm .Cm jail .Ar jailid Ns | Ns Ar jailname filesystem .Nm @@ -3284,6 +3290,48 @@ Give more parsable tab-separated output, without heade arrows. .It Fl t Display the path's inode change time as the first column of output. +.El +.It Xo +.Nm +.Cm program +.Op Fl t Ar timeout +.Op Fl m Ar memory_limit +.Ar pool script +.Op Ar arg1 No ... +.Xc +.Pp +Executes +.Ar script +as a ZFS channel program on +.Ar pool . +The ZFS channel +program interface allows ZFS administrative operations to be run +programmatically via a Lua script. +The entire script is executed atomically, with no other administrative +operations taking effect concurrently. +A library of ZFS calls is made available to channel program scripts. +Channel programs may only be run with root privileges. +.Pp +For full documentation of the ZFS channel program interface, see the manual +page for +.Xr zfs-program 8 . +.Bl -tag -width indent +.It Fl t Ar timeout +Execution time limit, in milliseconds. +If a channel program executes for longer than the provided timeout, it will +be stopped and an error will be returned. +The default timeout is 1000 ms, and can be set to a maximum of 10000 ms. +.It Fl m Ar memory-limit +Memory limit, in bytes. +If a channel program attempts to allocate more memory than the given limit, +it will be stopped and an error returned. +The default memory limit is 10 MB, and can be set to a maximum of 100 MB. +.Pp +All remaining argument strings are passed directly to the channel program as +arguments. +See +.Xr zfs-program 8 +for more information. .El .It Xo .Nm Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun Oct 1 15:35:21 2017 (r324162) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun Oct 1 16:11:07 2017 (r324163) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright 2012 Milan Jurik. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek. All rights reserved. @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -111,6 +112,7 @@ static int zfs_do_diff(int argc, char **argv); static int zfs_do_jail(int argc, char **argv); static int zfs_do_unjail(int argc, char **argv); static int zfs_do_bookmark(int argc, char **argv); +static int zfs_do_channel_program(int argc, char **argv); /* * Enable a reasonable set of defaults for libumem debugging on DEBUG builds. @@ -160,6 +162,7 @@ typedef enum { HELP_RELEASE, HELP_DIFF, HELP_BOOKMARK, + HELP_CHANNEL_PROGRAM, } zfs_help_t; typedef struct zfs_command { @@ -187,6 +190,7 @@ static zfs_command_t command_table[] = { { "promote", zfs_do_promote, HELP_PROMOTE }, { "rename", zfs_do_rename, HELP_RENAME }, { "bookmark", zfs_do_bookmark, HELP_BOOKMARK }, + { "program", zfs_do_channel_program, HELP_CHANNEL_PROGRAM }, { NULL }, { "list", zfs_do_list, HELP_LIST }, { NULL }, @@ -340,6 +344,10 @@ get_usage(zfs_help_t idx) "[snapshot|filesystem]\n")); case HELP_BOOKMARK: return (gettext("\tbookmark \n")); + case HELP_CHANNEL_PROGRAM: + return (gettext("\tprogram [-t ] " + "[-m ] " + "[lua args...]\n")); } abort(); @@ -368,6 +376,18 @@ safe_malloc(size_t size) return (data); } +void * +safe_realloc(void *data, size_t size) +{ + void *newp; + if ((newp = realloc(data, size)) == NULL) { + free(data); + nomem(); + } + + return (newp); +} + static char * safe_strdup(char *str) { @@ -7094,6 +7114,194 @@ zfs_do_bookmark(int argc, char **argv) dgettext(TEXT_DOMAIN, err_msg)); } + return (ret != 0); + +usage: + usage(B_FALSE); + return (-1); +} + +static int +zfs_do_channel_program(int argc, char **argv) +{ + int ret, fd; + char c; + char *progbuf, *filename, *poolname; + size_t progsize, progread; + nvlist_t *outnvl; + uint64_t instrlimit = ZCP_DEFAULT_INSTRLIMIT; + uint64_t memlimit = ZCP_DEFAULT_MEMLIMIT; + zpool_handle_t *zhp; + + /* check options */ + while (-1 != + (c = getopt(argc, argv, "t:(instr-limit)m:(memory-limit)"))) { + switch (c) { + case 't': + case 'm': { + uint64_t arg; + char *endp; + + errno = 0; + arg = strtoull(optarg, &endp, 0); + if (errno != 0 || *endp != '\0') { + (void) fprintf(stderr, gettext( + "invalid argument " + "'%s': expected integer\n"), optarg); + goto usage; + } + + if (c == 't') { + if (arg > ZCP_MAX_INSTRLIMIT || arg == 0) { + (void) fprintf(stderr, gettext( + "Invalid instruction limit: " + "%s\n"), optarg); + return (1); + } else { + instrlimit = arg; + } + } else { + ASSERT3U(c, ==, 'm'); + if (arg > ZCP_MAX_MEMLIMIT || arg == 0) { + (void) fprintf(stderr, gettext( + "Invalid memory limit: " + "%s\n"), optarg); + return (1); + } else { + memlimit = arg; + } + } + break; + } + case '?': + (void) fprintf(stderr, gettext("invalid option '%c'\n"), + optopt); + goto usage; + } + } + + argc -= optind; + argv += optind; + + if (argc < 2) { + (void) fprintf(stderr, + gettext("invalid number of arguments\n")); + goto usage; + } + + poolname = argv[0]; + filename = argv[1]; + if (strcmp(filename, "-") == 0) { + fd = 0; + filename = "standard input"; + } else if ((fd = open(filename, O_RDONLY)) < 0) { + (void) fprintf(stderr, gettext("cannot open '%s': %s\n"), + filename, strerror(errno)); + return (1); + } + + if ((zhp = zpool_open(g_zfs, poolname)) == NULL) { + (void) fprintf(stderr, gettext("cannot open pool '%s'"), + poolname); + return (1); + } + zpool_close(zhp); + + /* + * Read in the channel program, expanding the program buffer as + * necessary. + */ + progread = 0; + progsize = 1024; + progbuf = safe_malloc(progsize); + do { + ret = read(fd, progbuf + progread, progsize - progread); + progread += ret; + if (progread == progsize && ret > 0) { + progsize *= 2; + progbuf = safe_realloc(progbuf, progsize); + } + } while (ret > 0); + + if (fd != 0) + (void) close(fd); + if (ret < 0) { + free(progbuf); + (void) fprintf(stderr, + gettext("cannot read '%s': %s\n"), + filename, strerror(errno)); + return (1); + } + progbuf[progread] = '\0'; + + /* + * Any remaining arguments are passed as arguments to the lua script as + * a string array: + * { + * "argv" -> [ "arg 1", ... "arg n" ], + * } + */ + nvlist_t *argnvl = fnvlist_alloc(); + fnvlist_add_string_array(argnvl, ZCP_ARG_CLIARGV, argv + 2, argc - 2); + + ret = lzc_channel_program(poolname, progbuf, instrlimit, memlimit, + argnvl, &outnvl); + + if (ret != 0) { + /* + * On error, report the error message handed back by lua if one + * exists. Otherwise, generate an appropriate error message, + * falling back on strerror() for an unexpected return code. + */ + char *errstring = NULL; + if (nvlist_exists(outnvl, ZCP_RET_ERROR)) { + (void) nvlist_lookup_string(outnvl, + ZCP_RET_ERROR, &errstring); + if (errstring == NULL) + errstring = strerror(ret); + } else { + switch (ret) { + case EINVAL: + errstring = + "Invalid instruction or memory limit."; + break; + case ENOMEM: + errstring = "Return value too large."; + break; + case ENOSPC: + errstring = "Memory limit exhausted."; + break; +#ifdef illumos + case ETIME: +#else + case ETIMEDOUT: +#endif + errstring = "Timed out."; + break; + case EPERM: + errstring = "Permission denied. Channel " + "programs must be run as root."; + break; + default: + errstring = strerror(ret); + } + } + (void) fprintf(stderr, + gettext("Channel program execution failed:\n%s\n"), + errstring); + } else { + (void) printf("Channel program fully executed "); + if (nvlist_empty(outnvl)) { + (void) printf("with no return value.\n"); + } else { + (void) printf("with return value:\n"); + dump_nvlist(outnvl, 4); + } + } + + free(progbuf); + fnvlist_free(outnvl); + fnvlist_free(argnvl); return (ret != 0); usage: Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sun Oct 1 15:35:21 2017 (r324162) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sun Oct 1 16:11:07 2017 (r324163) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2012 by Frederik Wessels. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved. @@ -5253,6 +5253,11 @@ get_history_one(zpool_handle_t *zhp, void *data) (void) printf(" output:\n"); dump_nvlist(fnvlist_lookup_nvlist(rec, ZPOOL_HIST_OUTPUT_NVL), 8); + } + if (nvlist_exists(rec, ZPOOL_HIST_ERRNO)) { + (void) printf(" errno: %lld\n", + fnvlist_lookup_int64(rec, + ZPOOL_HIST_ERRNO)); } } else { if (!cb->internal) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun Oct 1 15:35:21 2017 (r324162) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun Oct 1 16:11:07 2017 (r324163) @@ -2355,6 +2355,74 @@ zfs_get_clones_nvl(zfs_handle_t *zhp) } /* + * Accepts a property and value and checks that the value + * matches the one found by the channel program. If they are + * not equal, print both of them. + */ +void +zcp_check(zfs_handle_t *zhp, zfs_prop_t prop, uint64_t intval, + const char *strval) +{ + if (!zhp->zfs_hdl->libzfs_prop_debug) + return; + int error; + char *poolname = zhp->zpool_hdl->zpool_name; + const char *program = + "args = ...\n" + "ds = args['dataset']\n" + "prop = args['property']\n" + "value, setpoint = zfs.get_prop(ds, prop)\n" + "return {value=value, setpoint=setpoint}\n"; + nvlist_t *outnvl; + nvlist_t *retnvl; + nvlist_t *argnvl = fnvlist_alloc(); + + fnvlist_add_string(argnvl, "dataset", zhp->zfs_name); + fnvlist_add_string(argnvl, "property", zfs_prop_to_name(prop)); + + error = lzc_channel_program(poolname, program, + 10 * 1000 * 1000, 10 * 1024 * 1024, argnvl, &outnvl); + + if (error == 0) { + retnvl = fnvlist_lookup_nvlist(outnvl, "return"); + if (zfs_prop_get_type(prop) == PROP_TYPE_NUMBER) { + int64_t ans; + error = nvlist_lookup_int64(retnvl, "value", &ans); + if (error != 0) { + (void) fprintf(stderr, "zcp check error: %u\n", + error); + return; + } + if (ans != intval) { + (void) fprintf(stderr, + "%s: zfs found %lld, but zcp found %lld\n", + zfs_prop_to_name(prop), + (longlong_t)intval, (longlong_t)ans); + } + } else { + char *str_ans; + error = nvlist_lookup_string(retnvl, "value", &str_ans); + if (error != 0) { + (void) fprintf(stderr, "zcp check error: %u\n", + error); + return; + } + if (strcmp(strval, str_ans) != 0) { + (void) fprintf(stderr, + "%s: zfs found %s, but zcp found %s\n", + zfs_prop_to_name(prop), + strval, str_ans); + } + } + } else { + (void) fprintf(stderr, + "zcp check failed, channel program error: %u\n", error); + } + nvlist_free(argnvl); + nvlist_free(outnvl); +} + +/* * Retrieve a property from the given object. If 'literal' is specified, then * numbers are left as exact values. Otherwise, numbers are converted to a * human-readable form. @@ -2400,6 +2468,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char &t) == 0) (void) snprintf(propbuf, proplen, "%llu", val); } + zcp_check(zhp, prop, val, NULL); break; case ZFS_PROP_MOUNTPOINT: @@ -2468,7 +2537,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char /* 'legacy' or 'none' */ (void) strlcpy(propbuf, str, proplen); } - + zcp_check(zhp, prop, NULL, propbuf); break; case ZFS_PROP_ORIGIN: @@ -2476,6 +2545,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char if (str == NULL) return (-1); (void) strlcpy(propbuf, str, proplen); + zcp_check(zhp, prop, NULL, str); break; case ZFS_PROP_CLONES: @@ -2490,7 +2560,6 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char if (get_numeric_property(zhp, prop, src, &source, &val) != 0) return (-1); - /* * If quota or reservation is 0, we translate this into 'none' * (unless literal is set), and indicate that it's the default @@ -2509,6 +2578,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char else zfs_nicenum(val, propbuf, proplen); } + zcp_check(zhp, prop, val, NULL); break; case ZFS_PROP_FILESYSTEM_LIMIT: @@ -2533,6 +2603,8 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char } else { zfs_nicenum(val, propbuf, proplen); } + + zcp_check(zhp, prop, val, NULL); break; case ZFS_PROP_REFRATIO: @@ -2542,6 +2614,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char (void) snprintf(propbuf, proplen, "%llu.%02llux", (u_longlong_t)(val / 100), (u_longlong_t)(val % 100)); + zcp_check(zhp, prop, val, NULL); break; case ZFS_PROP_TYPE: @@ -2562,6 +2635,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char abort(); } (void) snprintf(propbuf, proplen, "%s", str); + zcp_check(zhp, prop, NULL, propbuf); break; case ZFS_PROP_MOUNTED: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Oct 1 16:25:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6962E28877; Sun, 1 Oct 2017 16:25:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8621665525; Sun, 1 Oct 2017 16:25:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v91GPEaO028572; Sun, 1 Oct 2017 16:25:14 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v91GPEYg028571; Sun, 1 Oct 2017 16:25:14 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710011625.v91GPEYg028571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sun, 1 Oct 2017 16:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324164 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 324164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 16:25:15 -0000 Author: avg Date: Sun Oct 1 16:25:14 2017 New Revision: 324164 URL: https://svnweb.freebsd.org/changeset/base/324164 Log: fix up r324163, MFV of r323530,r323533,r323534, 7431 ZFS Channel Programs Add several new files to the files enabled by ZFS kernel option. MFC after: 5 weeks X-MFC with: r324163 Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Oct 1 16:11:07 2017 (r324163) +++ head/sys/conf/files Sun Oct 1 16:25:14 2017 (r324164) @@ -228,6 +228,11 @@ cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c optional zfs compile-with "${ZFS_C}" +cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c optional zfs compile-with "${ZFS_C}" +cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c optional zfs compile-with "${ZFS_C}" +cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_global.c optional zfs compile-with "${ZFS_C}" +cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_iter.c optional zfs compile-with "${ZFS_C}" +cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_byteswap.c optional zfs compile-with "${ZFS_C}" From owner-svn-src-head@freebsd.org Sun Oct 1 16:34:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5670FE28C20; Sun, 1 Oct 2017 16:34:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3326765BC8; Sun, 1 Oct 2017 16:34:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v91GYHaC032813; Sun, 1 Oct 2017 16:34:17 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v91GYGs8032808; Sun, 1 Oct 2017 16:34:16 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710011634.v91GYGs8032808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sun, 1 Oct 2017 16:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324166 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern sys X-SVN-Commit-Revision: 324166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 16:34:18 -0000 Author: avg Date: Sun Oct 1 16:34:16 2017 New Revision: 324166 URL: https://svnweb.freebsd.org/changeset/base/324166 Log: MFV r323531: 8521 nvlist memory leak in get_clones_stat() and spa_load_best() illumos/illumos-gate@7d3000f774e20097a1ee45cbd06d0e38065ddd5a https://github.com/illumos/illumos-gate/commit/7d3000f774e20097a1ee45cbd06d0e38065ddd5a https://www.illumos.org/issues/8521 Yuri reported this to the mailing list: doing a `reboot -d` on current illumos-gate HEAD gives the following ":: findleaks -dv" output: findleaks: maximum buffers => 301061 findleaks: actual buffers => 297587 findleaks: findleaks: potential pointers => 29289774 findleaks: dismissals => 26242305 (89.5%) findleaks: misses => 331153 ( 1.1%) findleaks: dups => 2419681 ( 8.2%) findleaks: follows => 296635 ( 1.0%) findleaks: findleaks: peak memory usage => 7353 kB findleaks: elapsed CPU time => 1.5 seconds findleaks: elapsed wall time => 2.0 seconds findleaks: CACHE LEAKED BUFCTL CALLER ffffff03d222b008 120 ffffff03ef7ceb78 nv_alloc_sys+0x1f ffffff03d222a448 123 ffffff03f4150cc8 nv_alloc_sys+0x1f ffffff03d222b448 5 ffffff03f28bd598 nv_alloc_sys+0x1f ffffff03d222b888 87 ffffff03f28c10f0 nv_alloc_sys+0x1f ffffff03d222c008 21 ffffff03f4139310 nv_alloc_sys+0x1f ffffff03d222b888 43 ffffff040ef3f3e8 nv_alloc_sys+0x1f ffffff03d222c008 120 ffffff03f4591e58 nv_alloc_sys+0x1f ffffff03d222b008 121 ffffff03f352c068 nv_alloc_sys+0x1f ffffff03d222a448 112 ffffff03f414e5f8 nv_alloc_sys+0x1f ffffff03d222b008 119 ffffff03ee92fdc0 nv_alloc_sys+0x1f ffffff03d222b888 46 ffffff03f28c1378 nv_alloc_sys+0x1f ffffff03d222b448 4 ffffff03f28c7708 nv_alloc_sys+0x1f ffffff03d222c008 20 ffffff03f2a6e7e8 nv_alloc_sys+0x1f Reviewed by: Steve Gonczi Reviewed by: George Wilson Reviewed by: Yuri Pankov Reviewed by: Matt Ahrens Approved by: Dan McDonald Author: Pavel Zakharov MFC after: 5 weeks X-MFC after: r324163 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/kern/kern_linker.c head/sys/kern/kern_sysctl.c head/sys/sys/sysctl.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sun Oct 1 16:29:20 2017 (r324165) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sun Oct 1 16:34:16 2017 (r324166) @@ -1808,10 +1808,10 @@ get_clones_stat(dsl_dataset_t *ds, nvlist_t *nv) fnvlist_add_nvlist(propval, ZPROP_VALUE, val); fnvlist_add_nvlist(nv, zfs_prop_to_name(ZFS_PROP_CLONES), propval); - } else { - nvlist_free(val); - nvlist_free(propval); } + + nvlist_free(val); + nvlist_free(propval); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Oct 1 16:29:20 2017 (r324165) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Oct 1 16:34:16 2017 (r324166) @@ -3096,6 +3096,8 @@ spa_load_best(spa_t *spa, spa_load_state_t state, int if (config && (rewind_error || state != SPA_LOAD_RECOVER)) spa_config_set(spa, config); + else + nvlist_free(config); if (state == SPA_LOAD_RECOVER) { ASSERT3P(loadinfo, ==, NULL); Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Sun Oct 1 16:29:20 2017 (r324165) +++ head/sys/kern/kern_linker.c Sun Oct 1 16:34:16 2017 (r324166) @@ -288,7 +288,7 @@ linker_file_sysuninit(linker_file_t lf) } static void -linker_file_register_sysctls(linker_file_t lf) +linker_file_register_sysctls(linker_file_t lf, bool enable) { struct sysctl_oid **start, **stop, **oidp; @@ -303,8 +303,34 @@ linker_file_register_sysctls(linker_file_t lf) sx_xunlock(&kld_sx); sysctl_wlock(); + for (oidp = start; oidp < stop; oidp++) { + if (enable) + sysctl_register_oid(*oidp); + else + sysctl_register_disabled_oid(*oidp); + } + sysctl_wunlock(); + sx_xlock(&kld_sx); +} + +static void +linker_file_enable_sysctls(linker_file_t lf) +{ + struct sysctl_oid **start, **stop, **oidp; + + KLD_DPF(FILE, + ("linker_file_enable_sysctls: enable SYSCTLs for %s\n", + lf->filename)); + + sx_assert(&kld_sx, SA_XLOCKED); + + if (linker_file_lookup_set(lf, "sysctl_set", &start, &stop, NULL) != 0) + return; + + sx_xunlock(&kld_sx); + sysctl_wlock(); for (oidp = start; oidp < stop; oidp++) - sysctl_register_oid(*oidp); + sysctl_enable_oid(*oidp); sysctl_wunlock(); sx_xlock(&kld_sx); } @@ -430,8 +456,9 @@ linker_load_file(const char *filename, linker_file_t * return (error); } modules = !TAILQ_EMPTY(&lf->modules); - linker_file_register_sysctls(lf); + linker_file_register_sysctls(lf, false); linker_file_sysinit(lf); + linker_file_enable_sysctls(lf); lf->flags |= LINKER_FILE_LINKED; /* @@ -692,8 +719,8 @@ linker_file_unload(linker_file_t file, int flags) */ if (file->flags & LINKER_FILE_LINKED) { file->flags &= ~LINKER_FILE_LINKED; - linker_file_sysuninit(file); linker_file_unregister_sysctls(file); + linker_file_sysuninit(file); } TAILQ_REMOVE(&linker_files, file, link); @@ -1642,7 +1669,7 @@ restart: if (linker_file_lookup_set(lf, "sysinit_set", &si_start, &si_stop, NULL) == 0) sysinit_add(si_start, si_stop); - linker_file_register_sysctls(lf); + linker_file_register_sysctls(lf, true); lf->flags |= LINKER_FILE_LINKED; continue; fail: Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Sun Oct 1 16:29:20 2017 (r324165) +++ head/sys/kern/kern_sysctl.c Sun Oct 1 16:34:16 2017 (r324166) @@ -408,8 +408,8 @@ SYSCTL_PROC(_sysctl, 0, reuse_test, CTLTYPE_STRING|CTL 0, 0, sysctl_reuse_test, "-", ""); #endif -void -sysctl_register_oid(struct sysctl_oid *oidp) +static void +sysctl_register_oid_impl(struct sysctl_oid *oidp, bool enable) { struct sysctl_oid_list *parent = oidp->oid_parent; struct sysctl_oid *p; @@ -491,6 +491,17 @@ retry: } /* update the OID number, if any */ oidp->oid_number = oid_number; + + /* + * Mark the leaf as dormant if it's not to be immediately enabled. + * We do not disable nodes as they can be shared between modules + * and it is always safe to access a node. + */ + if (!enable && (oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE) { + KASSERT((oidp->oid_kind & CTLFLAG_DORMANT) == 0, + ("internal flag is set in oid_kind")); + oidp->oid_kind |= CTLFLAG_DORMANT; + } if (q != NULL) SLIST_INSERT_AFTER(q, oidp, oid_link); else @@ -510,6 +521,35 @@ retry: } void +sysctl_register_oid(struct sysctl_oid *oidp) +{ + + sysctl_register_oid_impl(oidp, true); +} + +void +sysctl_register_disabled_oid(struct sysctl_oid *oidp) +{ + + sysctl_register_oid_impl(oidp, false); +} + +void +sysctl_enable_oid(struct sysctl_oid *oidp) +{ + + SYSCTL_ASSERT_WLOCKED(); + if ((oidp->oid_kind & CTLTYPE) == CTLTYPE_NODE) { + KASSERT((oidp->oid_kind & CTLFLAG_DORMANT) == 0, + ("sysctl node is marked as dormant")); + return; + } + KASSERT((oidp->oid_kind & CTLFLAG_DORMANT) != 0, + ("enabling already enabled sysctl oid")); + oidp->oid_kind &= ~CTLFLAG_DORMANT; +} + +void sysctl_unregister_oid(struct sysctl_oid *oidp) { struct sysctl_oid *p; @@ -1057,7 +1097,7 @@ sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int *next = oidp->oid_number; *oidpp = oidp; - if (oidp->oid_kind & CTLFLAG_SKIP) + if ((oidp->oid_kind & (CTLFLAG_SKIP | CTLFLAG_DORMANT)) != 0) continue; if (!namelen) { @@ -1878,6 +1918,8 @@ sysctl_find_oid(int *name, u_int namelen, struct sysct } lsp = SYSCTL_CHILDREN(oid); } else if (indx == namelen) { + if ((oid->oid_kind & CTLFLAG_DORMANT) != 0) + return (ENOENT); *noid = oid; if (nindx != NULL) *nindx = indx; Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Sun Oct 1 16:29:20 2017 (r324165) +++ head/sys/sys/sysctl.h Sun Oct 1 16:34:16 2017 (r324166) @@ -83,6 +83,7 @@ struct ctlname { #define CTLFLAG_RD 0x80000000 /* Allow reads of variable */ #define CTLFLAG_WR 0x40000000 /* Allow writes to the variable */ #define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR) +#define CTLFLAG_DORMANT 0x20000000 /* This sysctl is not active yet */ #define CTLFLAG_ANYBODY 0x10000000 /* All users can set this var */ #define CTLFLAG_SECURE 0x08000000 /* Permit set only if securelevel<=0 */ #define CTLFLAG_PRISON 0x04000000 /* Prisoned roots can fiddle */ @@ -219,6 +220,8 @@ int sysctl_dpcpu_quad(SYSCTL_HANDLER_ARGS); * These functions are used to add/remove an oid from the mib. */ void sysctl_register_oid(struct sysctl_oid *oidp); +void sysctl_register_disabled_oid(struct sysctl_oid *oidp); +void sysctl_enable_oid(struct sysctl_oid *oidp); void sysctl_unregister_oid(struct sysctl_oid *oidp); /* Declare a static oid to allow child oids to be added to it. */ From owner-svn-src-head@freebsd.org Sun Oct 1 16:37:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BC58E28D09; Sun, 1 Oct 2017 16:37:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4667165E18; Sun, 1 Oct 2017 16:37:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v91GbtDl033238; Sun, 1 Oct 2017 16:37:55 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v91Gbtmb033233; Sun, 1 Oct 2017 16:37:55 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710011637.v91Gbtmb033233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sun, 1 Oct 2017 16:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324167 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern sys X-SVN-Commit-Revision: 324167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 16:37:56 -0000 Author: avg Date: Sun Oct 1 16:37:54 2017 New Revision: 324167 URL: https://svnweb.freebsd.org/changeset/base/324167 Log: revert r324166, it has an unrelated change in it Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/kern/kern_linker.c head/sys/kern/kern_sysctl.c head/sys/sys/sysctl.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sun Oct 1 16:34:16 2017 (r324166) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sun Oct 1 16:37:54 2017 (r324167) @@ -1808,10 +1808,10 @@ get_clones_stat(dsl_dataset_t *ds, nvlist_t *nv) fnvlist_add_nvlist(propval, ZPROP_VALUE, val); fnvlist_add_nvlist(nv, zfs_prop_to_name(ZFS_PROP_CLONES), propval); + } else { + nvlist_free(val); + nvlist_free(propval); } - - nvlist_free(val); - nvlist_free(propval); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Oct 1 16:34:16 2017 (r324166) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Oct 1 16:37:54 2017 (r324167) @@ -3096,8 +3096,6 @@ spa_load_best(spa_t *spa, spa_load_state_t state, int if (config && (rewind_error || state != SPA_LOAD_RECOVER)) spa_config_set(spa, config); - else - nvlist_free(config); if (state == SPA_LOAD_RECOVER) { ASSERT3P(loadinfo, ==, NULL); Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Sun Oct 1 16:34:16 2017 (r324166) +++ head/sys/kern/kern_linker.c Sun Oct 1 16:37:54 2017 (r324167) @@ -288,7 +288,7 @@ linker_file_sysuninit(linker_file_t lf) } static void -linker_file_register_sysctls(linker_file_t lf, bool enable) +linker_file_register_sysctls(linker_file_t lf) { struct sysctl_oid **start, **stop, **oidp; @@ -303,34 +303,8 @@ linker_file_register_sysctls(linker_file_t lf, bool en sx_xunlock(&kld_sx); sysctl_wlock(); - for (oidp = start; oidp < stop; oidp++) { - if (enable) - sysctl_register_oid(*oidp); - else - sysctl_register_disabled_oid(*oidp); - } - sysctl_wunlock(); - sx_xlock(&kld_sx); -} - -static void -linker_file_enable_sysctls(linker_file_t lf) -{ - struct sysctl_oid **start, **stop, **oidp; - - KLD_DPF(FILE, - ("linker_file_enable_sysctls: enable SYSCTLs for %s\n", - lf->filename)); - - sx_assert(&kld_sx, SA_XLOCKED); - - if (linker_file_lookup_set(lf, "sysctl_set", &start, &stop, NULL) != 0) - return; - - sx_xunlock(&kld_sx); - sysctl_wlock(); for (oidp = start; oidp < stop; oidp++) - sysctl_enable_oid(*oidp); + sysctl_register_oid(*oidp); sysctl_wunlock(); sx_xlock(&kld_sx); } @@ -456,9 +430,8 @@ linker_load_file(const char *filename, linker_file_t * return (error); } modules = !TAILQ_EMPTY(&lf->modules); - linker_file_register_sysctls(lf, false); + linker_file_register_sysctls(lf); linker_file_sysinit(lf); - linker_file_enable_sysctls(lf); lf->flags |= LINKER_FILE_LINKED; /* @@ -719,8 +692,8 @@ linker_file_unload(linker_file_t file, int flags) */ if (file->flags & LINKER_FILE_LINKED) { file->flags &= ~LINKER_FILE_LINKED; - linker_file_unregister_sysctls(file); linker_file_sysuninit(file); + linker_file_unregister_sysctls(file); } TAILQ_REMOVE(&linker_files, file, link); @@ -1669,7 +1642,7 @@ restart: if (linker_file_lookup_set(lf, "sysinit_set", &si_start, &si_stop, NULL) == 0) sysinit_add(si_start, si_stop); - linker_file_register_sysctls(lf, true); + linker_file_register_sysctls(lf); lf->flags |= LINKER_FILE_LINKED; continue; fail: Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Sun Oct 1 16:34:16 2017 (r324166) +++ head/sys/kern/kern_sysctl.c Sun Oct 1 16:37:54 2017 (r324167) @@ -408,8 +408,8 @@ SYSCTL_PROC(_sysctl, 0, reuse_test, CTLTYPE_STRING|CTL 0, 0, sysctl_reuse_test, "-", ""); #endif -static void -sysctl_register_oid_impl(struct sysctl_oid *oidp, bool enable) +void +sysctl_register_oid(struct sysctl_oid *oidp) { struct sysctl_oid_list *parent = oidp->oid_parent; struct sysctl_oid *p; @@ -491,17 +491,6 @@ retry: } /* update the OID number, if any */ oidp->oid_number = oid_number; - - /* - * Mark the leaf as dormant if it's not to be immediately enabled. - * We do not disable nodes as they can be shared between modules - * and it is always safe to access a node. - */ - if (!enable && (oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE) { - KASSERT((oidp->oid_kind & CTLFLAG_DORMANT) == 0, - ("internal flag is set in oid_kind")); - oidp->oid_kind |= CTLFLAG_DORMANT; - } if (q != NULL) SLIST_INSERT_AFTER(q, oidp, oid_link); else @@ -521,35 +510,6 @@ retry: } void -sysctl_register_oid(struct sysctl_oid *oidp) -{ - - sysctl_register_oid_impl(oidp, true); -} - -void -sysctl_register_disabled_oid(struct sysctl_oid *oidp) -{ - - sysctl_register_oid_impl(oidp, false); -} - -void -sysctl_enable_oid(struct sysctl_oid *oidp) -{ - - SYSCTL_ASSERT_WLOCKED(); - if ((oidp->oid_kind & CTLTYPE) == CTLTYPE_NODE) { - KASSERT((oidp->oid_kind & CTLFLAG_DORMANT) == 0, - ("sysctl node is marked as dormant")); - return; - } - KASSERT((oidp->oid_kind & CTLFLAG_DORMANT) != 0, - ("enabling already enabled sysctl oid")); - oidp->oid_kind &= ~CTLFLAG_DORMANT; -} - -void sysctl_unregister_oid(struct sysctl_oid *oidp) { struct sysctl_oid *p; @@ -1097,7 +1057,7 @@ sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int *next = oidp->oid_number; *oidpp = oidp; - if ((oidp->oid_kind & (CTLFLAG_SKIP | CTLFLAG_DORMANT)) != 0) + if (oidp->oid_kind & CTLFLAG_SKIP) continue; if (!namelen) { @@ -1918,8 +1878,6 @@ sysctl_find_oid(int *name, u_int namelen, struct sysct } lsp = SYSCTL_CHILDREN(oid); } else if (indx == namelen) { - if ((oid->oid_kind & CTLFLAG_DORMANT) != 0) - return (ENOENT); *noid = oid; if (nindx != NULL) *nindx = indx; Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Sun Oct 1 16:34:16 2017 (r324166) +++ head/sys/sys/sysctl.h Sun Oct 1 16:37:54 2017 (r324167) @@ -83,7 +83,6 @@ struct ctlname { #define CTLFLAG_RD 0x80000000 /* Allow reads of variable */ #define CTLFLAG_WR 0x40000000 /* Allow writes to the variable */ #define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR) -#define CTLFLAG_DORMANT 0x20000000 /* This sysctl is not active yet */ #define CTLFLAG_ANYBODY 0x10000000 /* All users can set this var */ #define CTLFLAG_SECURE 0x08000000 /* Permit set only if securelevel<=0 */ #define CTLFLAG_PRISON 0x04000000 /* Prisoned roots can fiddle */ @@ -220,8 +219,6 @@ int sysctl_dpcpu_quad(SYSCTL_HANDLER_ARGS); * These functions are used to add/remove an oid from the mib. */ void sysctl_register_oid(struct sysctl_oid *oidp); -void sysctl_register_disabled_oid(struct sysctl_oid *oidp); -void sysctl_enable_oid(struct sysctl_oid *oidp); void sysctl_unregister_oid(struct sysctl_oid *oidp); /* Declare a static oid to allow child oids to be added to it. */ From owner-svn-src-head@freebsd.org Sun Oct 1 16:41:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28136E28DB8; Sun, 1 Oct 2017 16:41:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03EED66002; Sun, 1 Oct 2017 16:41:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v91Gf6TM034106; Sun, 1 Oct 2017 16:41:06 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v91Gf6jj034102; Sun, 1 Oct 2017 16:41:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710011641.v91Gf6jj034102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sun, 1 Oct 2017 16:41:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324168 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 324168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 16:41:07 -0000 Author: avg Date: Sun Oct 1 16:41:05 2017 New Revision: 324168 URL: https://svnweb.freebsd.org/changeset/base/324168 Log: MFV r323531: 8521 nvlist memory leak in get_clones_stat() and spa_load_best() illumos/illumos-gate@7d3000f774e20097a1ee45cbd06d0e38065ddd5a https://github.com/illumos/illumos-gate/commit/7d3000f774e20097a1ee45cbd06d0e38065ddd5a https://www.illumos.org/issues/8521 Yuri reported this to the mailing list: doing a `reboot -d` on current illumos-gate HEAD gives the following ":: findleaks -dv" output: findleaks: maximum buffers => 301061 findleaks: actual buffers => 297587 findleaks: findleaks: potential pointers => 29289774 findleaks: dismissals => 26242305 (89.5%) findleaks: misses => 331153 ( 1.1%) findleaks: dups => 2419681 ( 8.2%) findleaks: follows => 296635 ( 1.0%) findleaks: findleaks: peak memory usage => 7353 kB findleaks: elapsed CPU time => 1.5 seconds findleaks: elapsed wall time => 2.0 seconds findleaks: CACHE LEAKED BUFCTL CALLER ffffff03d222b008 120 ffffff03ef7ceb78 nv_alloc_sys+0x1f ffffff03d222a448 123 ffffff03f4150cc8 nv_alloc_sys+0x1f ffffff03d222b448 5 ffffff03f28bd598 nv_alloc_sys+0x1f ffffff03d222b888 87 ffffff03f28c10f0 nv_alloc_sys+0x1f ffffff03d222c008 21 ffffff03f4139310 nv_alloc_sys+0x1f ffffff03d222b888 43 ffffff040ef3f3e8 nv_alloc_sys+0x1f ffffff03d222c008 120 ffffff03f4591e58 nv_alloc_sys+0x1f ffffff03d222b008 121 ffffff03f352c068 nv_alloc_sys+0x1f ffffff03d222a448 112 ffffff03f414e5f8 nv_alloc_sys+0x1f ffffff03d222b008 119 ffffff03ee92fdc0 nv_alloc_sys+0x1f ffffff03d222b888 46 ffffff03f28c1378 nv_alloc_sys+0x1f ffffff03d222b448 4 ffffff03f28c7708 nv_alloc_sys+0x1f ffffff03d222c008 20 ffffff03f2a6e7e8 nv_alloc_sys+0x1f Reviewed by: Steve Gonczi Reviewed by: George Wilson Reviewed by: Yuri Pankov Reviewed by: Matt Ahrens Approved by: Dan McDonald Author: Pavel Zakharov MFC after: 5 weeks X-MFC after: r324163 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sun Oct 1 16:37:54 2017 (r324167) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sun Oct 1 16:41:05 2017 (r324168) @@ -1808,10 +1808,10 @@ get_clones_stat(dsl_dataset_t *ds, nvlist_t *nv) fnvlist_add_nvlist(propval, ZPROP_VALUE, val); fnvlist_add_nvlist(nv, zfs_prop_to_name(ZFS_PROP_CLONES), propval); - } else { - nvlist_free(val); - nvlist_free(propval); } + + nvlist_free(val); + nvlist_free(propval); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Oct 1 16:37:54 2017 (r324167) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Oct 1 16:41:05 2017 (r324168) @@ -3096,6 +3096,8 @@ spa_load_best(spa_t *spa, spa_load_state_t state, int if (config && (rewind_error || state != SPA_LOAD_RECOVER)) spa_config_set(spa, config); + else + nvlist_free(config); if (state == SPA_LOAD_RECOVER) { ASSERT3P(loadinfo, ==, NULL); From owner-svn-src-head@freebsd.org Sun Oct 1 16:48:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C8FEE2916A; Sun, 1 Oct 2017 16:48:38 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC46466587; Sun, 1 Oct 2017 16:48:37 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v91GmbsD037520; Sun, 1 Oct 2017 16:48:37 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v91Gma16037517; Sun, 1 Oct 2017 16:48:36 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201710011648.v91Gma16037517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 1 Oct 2017 16:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324169 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 324169 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 16:48:38 -0000 Author: ian Date: Sun Oct 1 16:48:36 2017 New Revision: 324169 URL: https://svnweb.freebsd.org/changeset/base/324169 Log: Work around bcm283x silicon bugs to make i2c repeat-start work for the most common case where it's needed -- a write followed by a read to the same slave. The i2c controller in this chip only performs complete transfers, it does not provide control over start/repeat-start/stop operations on the bus. Thus, we have gotten a full stop/start sequence rather than a repeat-start when doing a typical i2c slave access of "write address, read data". Some i2c slave devices require a repeat-start to work correctly. These changes cause the controller to do a repeat-start by pre-staging the read parameters in the controller registers immediate after the controller has latched the values for the initial write operation, but before any bytes are actually written. With the values pre-staged, when the write portion of the transfer completes, the state machine in the silicon sees a new start operation already staged and that causes it to perform a repeat-start. The key to tricking the buggy hardware into doing this is to avoid prefilling any output data in the transmit FIFO so that it is possible to catch the silicon in the state where transmit values are latched but the transmit isn't completed yet. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c head/sys/arm/broadcom/bcm2835/bcm2835_bscreg.h head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Sun Oct 1 16:41:05 2017 (r324168) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Sun Oct 1 16:48:36 2017 (r324169) @@ -2,6 +2,7 @@ * Copyright (c) 2001 Tsubai Masanari. * Copyright (c) 2012 Oleksandr Tymoshenko * Copyright (c) 2013 Luiz Otavio O Souza + * Copyright (c) 2017 Ian Lepore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,6 +30,57 @@ #include __FBSDID("$FreeBSD$"); +/* + * Driver for bcm2835 i2c-compatible two-wire bus, named 'BSC' on this SoC. + * + * This controller can only perform complete transfers, it does not provide + * low-level control over sending start/repeat-start/stop sequences on the bus. + * In addition, bugs in the silicon make it somewhat difficult to perform a + * repeat-start, and limit the repeat-start to a read following a write on + * the same slave device. (The i2c protocol allows a repeat start to change + * direction or not, and change slave address or not at any time.) + * + * The repeat-start bug and workaround are described in a problem report at + * https://github.com/raspberrypi/linux/issues/254 with the crucial part being + * in a comment block from a fragment of a GPU i2c driver, containing this: + * + * ----------------------------------------------------------------------------- + * - See i2c.v: The I2C peripheral samples the values for rw_bit and xfer_count + * - in the IDLE state if start is set. + * - + * - We want to generate a ReSTART not a STOP at the end of the TX phase. In + * - order to do that we must ensure the state machine goes RACK1 -> RACK2 -> + * - SRSTRT1 (not RACK1 -> RACK2 -> SSTOP1). + * - + * - So, in the RACK2 state when (TX) xfer_count==0 we must therefore have + * - already set, ready to be sampled: + * - READ ; rw_bit <= I2CC bit 0 -- must be "read" + * - ST; start <= I2CC bit 7 -- must be "Go" in order to not issue STOP + * - DLEN; xfer_count <= I2CDLEN -- must be equal to our read amount + * - + * - The plan to do this is: + * - 1. Start the sub-address write, but don't let it finish + * - (keep xfer_count > 0) + * - 2. Populate READ, DLEN and ST in preparation for ReSTART read sequence + * - 3. Let TX finish (write the rest of the data) + * - 4. Read back data as it arrives + * ----------------------------------------------------------------------------- + * + * The transfer function below scans the list of messages passed to it, looking + * for a read following a write to the same slave. When it finds that, it + * starts the write without prefilling the tx fifo, which holds xfer_count>0, + * then presets the direction, length, and start command for the following read, + * as described above. Then the tx fifo is filled and the rest of the transfer + * proceeds as normal, with the controller automatically supplying a + * repeat-start on the bus when the write operation finishes. + * + * XXX I suspect the controller may be able to do a repeat-start on any + * write->read or write->write transition, even when the slave addresses differ. + * It's unclear whether the slave address can be prestaged along with the + * direction and length while the write xfer_count is being held at zero. In + * fact, if it can't do this, then it couldn't be used to read EDID data. + */ + #include #include #include @@ -59,6 +111,14 @@ static struct ofw_compat_data compat_data[] = { {NULL, 0} }; +#define DEVICE_DEBUGF(sc, lvl, fmt, args...) \ + if ((lvl) <= (sc)->sc_debug) \ + device_printf((sc)->sc_dev, fmt, ##args) + +#define DEBUGF(sc, lvl, fmt, args...) \ + if ((lvl) <= (sc)->sc_debug) \ + printf(fmt, ##args) + static void bcm_bsc_intr(void *); static int bcm_bsc_detach(device_t); @@ -198,6 +258,9 @@ bcm_bsc_sysctl_init(struct bcm_bsc_softc *sc) SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "rise_edge_delay", CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), bcm_bsc_rise_proc, "IU", "I2C BUS rising edge delay"); + SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "debug", + CTLFLAG_RWTUN, &sc->sc_debug, 0, + "Enable debug; 1=reads/writes, 2=add starts/stops"); } static void @@ -323,6 +386,8 @@ bcm_bsc_detach(device_t dev) bus_generic_detach(dev); sc = device_get_softc(dev); + if (sc->sc_iicbus != NULL) + device_delete_child(dev, sc->sc_iicbus); mtx_destroy(&sc->sc_mtx); if (sc->sc_intrhand) bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intrhand); @@ -335,6 +400,76 @@ bcm_bsc_detach(device_t dev) } static void +bcm_bsc_empty_rx_fifo(struct bcm_bsc_softc *sc) +{ + uint32_t status; + + /* Assumes sc_totlen > 0 and BCM_BSC_STATUS_RXD is asserted on entry. */ + do { + if (sc->sc_resid == 0) { + sc->sc_data = sc->sc_curmsg->buf; + sc->sc_dlen = sc->sc_curmsg->len; + sc->sc_resid = sc->sc_dlen; + ++sc->sc_curmsg; + } + do { + *sc->sc_data = BCM_BSC_READ(sc, BCM_BSC_DATA); + DEBUGF(sc, 1, "0x%02x ", *sc->sc_data); + ++sc->sc_data; + --sc->sc_resid; + --sc->sc_totlen; + status = BCM_BSC_READ(sc, BCM_BSC_STATUS); + } while (sc->sc_resid > 0 && (status & BCM_BSC_STATUS_RXD)); + } while (sc->sc_totlen > 0 && (status & BCM_BSC_STATUS_RXD)); +} + +static void +bcm_bsc_fill_tx_fifo(struct bcm_bsc_softc *sc) +{ + uint32_t status; + + /* Assumes sc_totlen > 0 and BCM_BSC_STATUS_TXD is asserted on entry. */ + do { + if (sc->sc_resid == 0) { + sc->sc_data = sc->sc_curmsg->buf; + sc->sc_dlen = sc->sc_curmsg->len; + sc->sc_resid = sc->sc_dlen; + ++sc->sc_curmsg; + } + do { + BCM_BSC_WRITE(sc, BCM_BSC_DATA, *sc->sc_data); + DEBUGF(sc, 1, "0x%02x ", *sc->sc_data); + ++sc->sc_data; + --sc->sc_resid; + --sc->sc_totlen; + status = BCM_BSC_READ(sc, BCM_BSC_STATUS); + } while (sc->sc_resid > 0 && (status & BCM_BSC_STATUS_TXD)); + /* + * If a repeat-start was pending and we just hit the end of a tx + * buffer, see if it's also the end of the writes that preceeded + * the repeat-start. If so, log the repeat-start and the start + * of the following read, and return because we're not writing + * anymore (and TXD will be true because there's room to write + * in the fifo). + */ + if (sc->sc_replen > 0 && sc->sc_resid == 0) { + sc->sc_replen -= sc->sc_dlen; + if (sc->sc_replen == 0) { + DEBUGF(sc, 1, " err=0\n"); + DEVICE_DEBUGF(sc, 2, "rstart 0x%02x\n", + sc->sc_curmsg->slave | 0x01); + DEVICE_DEBUGF(sc, 1, + "read 0x%02x len %d: ", + sc->sc_curmsg->slave | 0x01, + sc->sc_totlen); + sc->sc_flags |= BCM_I2C_READ; + return; + } + } + } while (sc->sc_totlen > 0 && (status & BCM_BSC_STATUS_TXD)); +} + +static void bcm_bsc_intr(void *arg) { struct bcm_bsc_softc *sc; @@ -351,35 +486,28 @@ bcm_bsc_intr(void *arg) } status = BCM_BSC_READ(sc, BCM_BSC_STATUS); + DEBUGF(sc, 4, " ", status); - /* Check for errors. */ - if (status & (BCM_BSC_STATUS_CLKT | BCM_BSC_STATUS_ERR)) { - /* Disable interrupts. */ - bcm_bsc_reset(sc); - sc->sc_flags |= BCM_I2C_ERROR; - wakeup(sc->sc_dev); - BCM_BSC_UNLOCK(sc); - return; - } + /* RXD and DONE can assert together, empty fifo before checking done. */ + if ((sc->sc_flags & BCM_I2C_READ) && (status & BCM_BSC_STATUS_RXD)) + bcm_bsc_empty_rx_fifo(sc); - if (sc->sc_flags & BCM_I2C_READ) { - while (sc->sc_resid > 0 && (status & BCM_BSC_STATUS_RXD)) { - *sc->sc_data++ = BCM_BSC_READ(sc, BCM_BSC_DATA); - sc->sc_resid--; - status = BCM_BSC_READ(sc, BCM_BSC_STATUS); - } - } else { - while (sc->sc_resid > 0 && (status & BCM_BSC_STATUS_TXD)) { - BCM_BSC_WRITE(sc, BCM_BSC_DATA, *sc->sc_data++); - sc->sc_resid--; - status = BCM_BSC_READ(sc, BCM_BSC_STATUS); - } - } - - if (status & BCM_BSC_STATUS_DONE) { + /* Check for completion. */ + if (status & (BCM_BSC_STATUS_ERRBITS | BCM_BSC_STATUS_DONE)) { + sc->sc_flags |= BCM_I2C_DONE; + if (status & BCM_BSC_STATUS_ERRBITS) + sc->sc_flags |= BCM_I2C_ERROR; /* Disable interrupts. */ bcm_bsc_reset(sc); - wakeup(sc->sc_dev); + wakeup(sc); + } else if (!(sc->sc_flags & BCM_I2C_READ)) { + /* + * Don't check for TXD until after determining whether the + * transfer is complete; TXD will be asserted along with ERR or + * DONE if there is room in the fifo. + */ + if (status & BCM_BSC_STATUS_TXD) + bcm_bsc_fill_tx_fifo(sc); } BCM_BSC_UNLOCK(sc); @@ -389,8 +517,11 @@ static int bcm_bsc_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) { struct bcm_bsc_softc *sc; - uint32_t intr, read, status; - int i, err; + struct iic_msg *endmsgs, *nxtmsg; + uint32_t readctl, status; + int err; + uint16_t curlen; + uint8_t curisread, curslave, nxtisread, nxtslave; sc = device_get_softc(dev); BCM_BSC_LOCK(sc); @@ -402,53 +533,156 @@ bcm_bsc_transfer(device_t dev, struct iic_msg *msgs, u /* Now we have control over the BSC controller. */ sc->sc_flags = BCM_I2C_BUSY; + DEVICE_DEBUGF(sc, 3, "Transfer %d msgs\n", nmsgs); + /* Clear the FIFO and the pending interrupts. */ bcm_bsc_reset(sc); + /* + * Perform all the transfers requested in the array of msgs. Note that + * it is bcm_bsc_empty_rx_fifo() and bcm_bsc_fill_tx_fifo() that advance + * sc->sc_curmsg through the array of messages, as the data from each + * message is fully consumed, but it is this loop that notices when we + * have no more messages to process. + */ err = 0; - for (i = 0; i < nmsgs; i++) { + sc->sc_resid = 0; + sc->sc_curmsg = msgs; + endmsgs = &msgs[nmsgs]; + while (sc->sc_curmsg < endmsgs) { + readctl = 0; + curslave = sc->sc_curmsg->slave >> 1; + curisread = sc->sc_curmsg->flags & IIC_M_RD; + sc->sc_replen = 0; + sc->sc_totlen = sc->sc_curmsg->len; + /* + * Scan for scatter/gather IO (same slave and direction) or + * repeat-start (read following write for the same slave). + */ + for (nxtmsg = sc->sc_curmsg + 1; nxtmsg < endmsgs; ++nxtmsg) { + nxtslave = nxtmsg->slave >> 1; + if (curslave == nxtslave) { + nxtisread = nxtmsg->flags & IIC_M_RD; + if (curisread == nxtisread) { + /* + * Same slave and direction, this + * message will be part of the same + * transfer as the previous one. + */ + sc->sc_totlen += nxtmsg->len; + continue; + } else if (curisread == IIC_M_WR) { + /* + * Read after write to same slave means + * repeat-start, remember how many bytes + * come before the repeat-start, switch + * the direction to IIC_M_RD, and gather + * up following reads to the same slave. + */ + curisread = IIC_M_RD; + sc->sc_replen = sc->sc_totlen; + sc->sc_totlen += nxtmsg->len; + continue; + } + } + break; + } + /* + * curslave and curisread temporaries from above may refer to + * the after-repstart msg, reset them to reflect sc_curmsg. + */ + curisread = (sc->sc_curmsg->flags & IIC_M_RD) ? 1 : 0; + curslave = sc->sc_curmsg->slave | curisread; + /* Write the slave address. */ - BCM_BSC_WRITE(sc, BCM_BSC_SLAVE, msgs[i].slave >> 1); + BCM_BSC_WRITE(sc, BCM_BSC_SLAVE, curslave >> 1); - /* Write the data length. */ - BCM_BSC_WRITE(sc, BCM_BSC_DLEN, msgs[i].len); + DEVICE_DEBUGF(sc, 2, "start 0x%02x\n", curslave); - sc->sc_data = msgs[i].buf; - sc->sc_resid = msgs[i].len; - if ((msgs[i].flags & IIC_M_RD) == 0) { - /* Fill up the TX FIFO. */ - status = BCM_BSC_READ(sc, BCM_BSC_STATUS); - while (sc->sc_resid > 0 && - (status & BCM_BSC_STATUS_TXD)) { - BCM_BSC_WRITE(sc, BCM_BSC_DATA, *sc->sc_data); - sc->sc_data++; - sc->sc_resid--; - status = BCM_BSC_READ(sc, BCM_BSC_STATUS); + /* + * Either set up read length and direction variables for a + * simple transfer or get the hardware started on the first + * piece of a transfer that involves a repeat-start and set up + * the read length and direction vars for the second piece. + */ + if (sc->sc_replen == 0) { + DEVICE_DEBUGF(sc, 1, "%-6s 0x%02x len %d: ", + (curisread) ? "readctl" : "write", curslave, + sc->sc_totlen); + curlen = sc->sc_totlen; + if (curisread) { + readctl = BCM_BSC_CTRL_READ; + sc->sc_flags |= BCM_I2C_READ; + } else { + readctl = 0; + sc->sc_flags &= ~BCM_I2C_READ; } - read = 0; - intr = BCM_BSC_CTRL_INTT; - sc->sc_flags &= ~BCM_I2C_READ; } else { - sc->sc_flags |= BCM_I2C_READ; - read = BCM_BSC_CTRL_READ; - intr = BCM_BSC_CTRL_INTR; + DEVICE_DEBUGF(sc, 1, "%-6s 0x%02x len %d: ", + (curisread) ? "readctl" : "write", curslave, + sc->sc_replen); + + /* + * Start the write transfer with an empty fifo and wait + * for the 'transfer active' status bit to light up; + * that indicates that the hardware has latched the + * direction and length for the write, and we can safely + * reload those registers and issue the start for the + * following read; interrupts are not enabled here. + */ + BCM_BSC_WRITE(sc, BCM_BSC_DLEN, sc->sc_replen); + BCM_BSC_WRITE(sc, BCM_BSC_CTRL, BCM_BSC_CTRL_I2CEN | + BCM_BSC_CTRL_ST); + do { + status = BCM_BSC_READ(sc, BCM_BSC_STATUS); + if (status & BCM_BSC_STATUS_ERR) { + /* no ACK on slave addr */ + err = EIO; + goto xfer_done; + } + } while ((status & BCM_BSC_STATUS_TA) == 0); + /* + * Set curlen and readctl for the repeat-start read that + * we need to set up below, but set sc_flags to write, + * because that is the operation in progress right now. + */ + curlen = sc->sc_totlen - sc->sc_replen; + readctl = BCM_BSC_CTRL_READ; + sc->sc_flags &= ~BCM_I2C_READ; } - intr |= BCM_BSC_CTRL_INTD; - /* Start the transfer. */ - BCM_BSC_WRITE(sc, BCM_BSC_CTRL, BCM_BSC_CTRL_I2CEN | - BCM_BSC_CTRL_ST | read | intr); + /* + * Start the transfer with interrupts enabled, then if doing a + * write, fill the tx fifo. Not prefilling the fifo until after + * this start command is the key workaround for making + * repeat-start work, and it's harmless to do it in this order + * for a regular write too. + */ + BCM_BSC_WRITE(sc, BCM_BSC_DLEN, curlen); + BCM_BSC_WRITE(sc, BCM_BSC_CTRL, readctl | BCM_BSC_CTRL_I2CEN | + BCM_BSC_CTRL_ST | BCM_BSC_CTRL_INT_ALL); - /* Wait for the transaction to complete. */ - err = mtx_sleep(dev, &sc->sc_mtx, 0, "bsciow", hz); + if (!(sc->sc_curmsg->flags & IIC_M_RD)) { + bcm_bsc_fill_tx_fifo(sc); + } + /* Wait for the transaction to complete. */ + while (err == 0 && !(sc->sc_flags & BCM_I2C_DONE)) { + err = mtx_sleep(sc, &sc->sc_mtx, 0, "bsciow", hz); + } /* Check for errors. */ if (err == 0 && (sc->sc_flags & BCM_I2C_ERROR)) err = EIO; +xfer_done: + DEBUGF(sc, 1, " err=%d\n", err); + DEVICE_DEBUGF(sc, 2, "stop\n"); if (err != 0) break; } + + /* Disable interrupts, clean fifo, etc. */ + bcm_bsc_reset(sc); /* Clean the controller flags. */ sc->sc_flags = 0; Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bscreg.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_bscreg.h Sun Oct 1 16:41:05 2017 (r324168) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bscreg.h Sun Oct 1 16:48:36 2017 (r324169) @@ -40,6 +40,9 @@ #define BCM_BSC_CTRL_CLEAR1 (1 << 5) #define BCM_BSC_CTRL_CLEAR0 (1 << 4) #define BCM_BSC_CTRL_READ (1 << 0) +#define BCM_BSC_CTRL_INT_ALL \ + (BCM_BSC_CTRL_INTR | BCM_BSC_CTRL_INTT | BCM_BSC_CTRL_INTD) + #define BCM_BSC_STATUS 0x04 #define BCM_BSC_STATUS_CLKT (1 << 9) #define BCM_BSC_STATUS_ERR (1 << 8) @@ -51,6 +54,9 @@ #define BCM_BSC_STATUS_TXW (1 << 2) #define BCM_BSC_STATUS_DONE (1 << 1) #define BCM_BSC_STATUS_TA (1 << 0) +#define BCM_BSC_STATUS_ERRBITS \ + (BCM_BSC_STATUS_CLKT | BCM_BSC_STATUS_ERR) + #define BCM_BSC_DLEN 0x08 #define BCM_BSC_SLAVE 0x0c #define BCM_BSC_DATA 0x10 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h Sun Oct 1 16:41:05 2017 (r324168) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h Sun Oct 1 16:48:36 2017 (r324169) @@ -40,23 +40,31 @@ struct { }; #define BCM_BSC_BASE_MASK 0x00ffffff +struct iic_msg; + struct bcm_bsc_softc { device_t sc_dev; device_t sc_iicbus; struct mtx sc_mtx; struct resource * sc_mem_res; struct resource * sc_irq_res; + void * sc_intrhand; + struct iic_msg * sc_curmsg; bus_space_tag_t sc_bst; bus_space_handle_t sc_bsh; + int sc_debug; + uint16_t sc_replen; + uint16_t sc_totlen; uint16_t sc_resid; - uint8_t *sc_data; + uint16_t sc_dlen; + uint8_t * sc_data; uint8_t sc_flags; - void * sc_intrhand; }; #define BCM_I2C_BUSY 0x01 #define BCM_I2C_READ 0x02 #define BCM_I2C_ERROR 0x04 +#define BCM_I2C_DONE 0x08 #define BCM_BSC_WRITE(_sc, _off, _val) \ bus_space_write_4((_sc)->sc_bst, (_sc)->sc_bsh, _off, _val) From owner-svn-src-head@freebsd.org Sun Oct 1 16:51:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8FF3E29244; Sun, 1 Oct 2017 16:51:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 948756676C; Sun, 1 Oct 2017 16:51:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v91Gp5Ur039804; Sun, 1 Oct 2017 16:51:05 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v91Gp56C039802; Sun, 1 Oct 2017 16:51:05 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710011651.v91Gp56C039802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sun, 1 Oct 2017 16:51:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324170 - in head: cddl/contrib/opensolaris/cmd/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 324170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 16:51:06 -0000 Author: avg Date: Sun Oct 1 16:51:05 2017 New Revision: 324170 URL: https://svnweb.freebsd.org/changeset/base/324170 Log: MFV r323794: 8605 zfs channel programs: zfs.exists undocumented and non-working illumos/illumos-gate@5f39f884e2035d671ec02148fc4d8420c670bcb4 https://github.com/illumos/illumos-gate/commit/5f39f884e2035d671ec02148fc4d8420c670bcb4 https://www.illumos.org/issues/8605 zfs.exists() in channel programs doesn't return any result, and should have a man page entry. Reviewed by: Paul Dagnelie Reviewed by: Dan Kimmel Reviewed by: Matt Ahrens Approved by: Robert Mustacchi Author: Chris Williamson MFC after: 5 weeks X-MFC after: r324163 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Sun Oct 1 16:48:36 2017 (r324169) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Sun Oct 1 16:51:05 2017 (r324170) @@ -289,6 +289,18 @@ msg (string) .Bd -ragged -compact -offset "xxxx" Debug message to be printed. .Ed +.It Em zfs.exists(dataset) +Returns true if the given dataset exists, or false if it doesn't. +A fatal error will be thrown if the dataset is not in the target pool. +That is, in a channel program running on rpool, +zfs.exists("rpool/nonexistent_fs") returns false, but +zfs.exists("somepool/fs_that_may_exist") will error. +.Pp +dataset (string) +.Bd -ragged -compact -offset "xxxx" +Dataset to check for existence. +Must be in the target pool. +.Ed .It Em zfs.get_prop(dataset, property) Returns two values. First, a string, number or table containing the property value for the given Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c Sun Oct 1 16:48:36 2017 (r324169) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c Sun Oct 1 16:51:05 2017 (r324170) @@ -717,7 +717,7 @@ zcp_exists(lua_State *state) return (luaL_error(state, "unexpected error %d", error)); } - return (0); + return (1); } /* From owner-svn-src-head@freebsd.org Sun Oct 1 16:59:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28074E295CB; Sun, 1 Oct 2017 16:59:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB31D66CC3; Sun, 1 Oct 2017 16:59:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v91Gx34r041849; Sun, 1 Oct 2017 16:59:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v91Gx3wM041848; Sun, 1 Oct 2017 16:59:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201710011659.v91Gx3wM041848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 1 Oct 2017 16:59:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324172 - head/usr.sbin/diskinfo X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/usr.sbin/diskinfo X-SVN-Commit-Revision: 324172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 16:59:04 -0000 Author: mav Date: Sun Oct 1 16:59:02 2017 New Revision: 324172 URL: https://svnweb.freebsd.org/changeset/base/324172 Log: Align test I/O buffer to page boundary. This is more alike to typical kernel behavior, that can be useful from benchmarking point of view. MFC after: 1 week Modified: head/usr.sbin/diskinfo/diskinfo.c Modified: head/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- head/usr.sbin/diskinfo/diskinfo.c Sun Oct 1 16:57:08 2017 (r324171) +++ head/usr.sbin/diskinfo/diskinfo.c Sun Oct 1 16:59:02 2017 (r324172) @@ -50,6 +50,8 @@ #include #define NAIO 128 +#define MAXTX (8*1024*1024) +#define MEGATX (1024*1024) static void usage(void) @@ -67,12 +69,14 @@ static void slogbench(int fd, int isreg, off_t mediasi static int zonecheck(int fd, uint32_t *zone_mode, char *zone_str, size_t zone_str_len); +static uint8_t *buf; + int main(int argc, char **argv) { struct stat sb; int i, ch, fd, error, exitval = 0; - char buf[BUFSIZ], ident[DISK_IDENT_SIZE], physpath[MAXPATHLEN]; + char tstr[BUFSIZ], ident[DISK_IDENT_SIZE], physpath[MAXPATHLEN]; char zone_desc[64]; struct diocgattr_arg arg; off_t mediasize, stripesize, stripeoffset; @@ -129,11 +133,13 @@ main(int argc, char **argv) usage(); } + if (posix_memalign((void **)&buf, PAGE_SIZE, MAXTX)) + errx(1, "Can't allocate memory buffer"); for (i = 0; i < argc; i++) { fd = open(argv[i], (opt_w ? O_RDWR : O_RDONLY) | O_DIRECT); if (fd < 0 && errno == ENOENT && *argv[i] != '/') { - snprintf(buf, BUFSIZ, "%s%s", _PATH_DEV, argv[i]); - fd = open(buf, O_RDONLY); + snprintf(tstr, sizeof(tstr), "%s%s", _PATH_DEV, argv[i]); + fd = open(tstr, O_RDONLY); } if (fd < 0) { warn("%s", argv[i]); @@ -216,12 +222,12 @@ main(int argc, char **argv) printf("\t%u", fwsectors); } } else { - humanize_number(buf, 5, (int64_t)mediasize, "", + humanize_number(tstr, 5, (int64_t)mediasize, "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); printf("%s\n", argv[i]); printf("\t%-12u\t# sectorsize\n", sectorsize); printf("\t%-12jd\t# mediasize in bytes (%s)\n", - (intmax_t)mediasize, buf); + (intmax_t)mediasize, tstr); printf("\t%-12jd\t# mediasize in sectors\n", (intmax_t)mediasize/sectorsize); printf("\t%-12jd\t# stripesize\n", stripesize); @@ -255,12 +261,9 @@ main(int argc, char **argv) out: close(fd); } + free(buf); exit (exitval); } - -#define MAXTX (8*1024*1024) -#define MEGATX (1024*1024) -static uint8_t buf[MAXTX]; static void rdsect(int fd, off_t blockno, u_int sectorsize) From owner-svn-src-head@freebsd.org Sun Oct 1 17:04:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B07C5E2995B; Sun, 1 Oct 2017 17:04:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8084F6711C; Sun, 1 Oct 2017 17:04:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v91H4QZv045870; Sun, 1 Oct 2017 17:04:26 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v91H4QXJ045869; Sun, 1 Oct 2017 17:04:26 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201710011704.v91H4QXJ045869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 1 Oct 2017 17:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324173 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 324173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 17:04:27 -0000 Author: alc Date: Sun Oct 1 17:04:26 2017 New Revision: 324173 URL: https://svnweb.freebsd.org/changeset/base/324173 Log: When an I/O error occurs on page out, there is no need to dirty the page, because it is already dirty. Instead, assert that the page is dirty. Reviewed by: kib, markj MFC after: 1 week Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sun Oct 1 16:59:02 2017 (r324172) +++ head/sys/vm/swap_pager.c Sun Oct 1 17:04:26 2017 (r324173) @@ -1524,7 +1524,7 @@ swp_pager_async_iodone(struct buf *bp) * so it doesn't clog the inactive list, * then finish the I/O. */ - vm_page_dirty(m); + MPASS(m->dirty == VM_PAGE_BITS_ALL); vm_page_lock(m); vm_page_activate(m); vm_page_unlock(m); From owner-svn-src-head@freebsd.org Sun Oct 1 17:11:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD76FE29D00 for ; Sun, 1 Oct 2017 17:11:18 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC85E6759B for ; Sun, 1 Oct 2017 17:11:18 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 893ef16c-a6cb-11e7-a937-4f970e858fdb X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 893ef16c-a6cb-11e7-a937-4f970e858fdb; Sun, 01 Oct 2017 17:11:17 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v91HBA4x001518; Sun, 1 Oct 2017 11:11:10 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1506877870.22078.28.camel@freebsd.org> Subject: Re: svn commit: r324163 - in head: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common cddl/co... From: Ian Lepore To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 01 Oct 2017 11:11:10 -0600 In-Reply-To: <201710011611.v91GB8LM024101@repo.freebsd.org> References: <201710011611.v91GB8LM024101@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 17:11:18 -0000 On Sun, 2017-10-01 at 16:11 +0000, Andriy Gapon wrote: > Author: avg > Date: Sun Oct  1 16:11:07 2017 > New Revision: 324163 > URL: https://svnweb.freebsd.org/changeset/base/324163 > > Log: >   MFV r323530,r323533,r323534: 7431 ZFS Channel Programs, and > followups >    Powerpc and sparc builds are dying on: src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c:870: warning: comparison is always true due to limited range of data type "(unsigned char)anything >= 0" is also always true on clang, so I'm not sure why it doesn't warn too. -- Ian From owner-svn-src-head@freebsd.org Sun Oct 1 17:19:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E92DE29FFD; Sun, 1 Oct 2017 17:19:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8BCB67AED; Sun, 1 Oct 2017 17:19:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::5418:83f5:156:40c8] (unknown [IPv6:2001:470:7a58:0:5418:83f5:156:40c8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id BC9F632ED2; Sun, 1 Oct 2017 19:19:22 +0200 (CEST) From: Dimitry Andric Message-Id: <76C2AE49-9202-4187-A23C-3110F08EBBD5@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_2AEC4A16-8414-456C-AC62-2CFAFF92FE2A"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r324163 - in head: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common cddl/co... Date: Sun, 1 Oct 2017 19:19:22 +0200 In-Reply-To: <1506877870.22078.28.camel@freebsd.org> Cc: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Ian Lepore References: <201710011611.v91GB8LM024101@repo.freebsd.org> <1506877870.22078.28.camel@freebsd.org> X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 17:19:26 -0000 --Apple-Mail=_2AEC4A16-8414-456C-AC62-2CFAFF92FE2A Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 1 Oct 2017, at 19:11, Ian Lepore wrote: > > On Sun, 2017-10-01 at 16:11 +0000, Andriy Gapon wrote: >> Author: avg >> Date: Sun Oct 1 16:11:07 2017 >> New Revision: 324163 >> URL: https://svnweb.freebsd.org/changeset/base/324163 >> >> Log: >> MFV r323530,r323533,r323534: 7431 ZFS Channel Programs, and >> followups >> > > Powerpc and sparc builds are dying on: > > src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c:870: > warning: comparison is always true due to limited range of data type > > "(unsigned char)anything >= 0" is also always true on clang, so I'm not > sure why it doesn't warn too. We've been using the clang-specific flag -Wno-error-tautological-compare since some time, so it warns, but doesn't error out on it. Fixing all the occurrences in the kernel was too disruptive at the time. -Dimitry --Apple-Mail=_2AEC4A16-8414-456C-AC62-2CFAFF92FE2A Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWdEjmgAKCRCwXqMKLiCW o4LgAJ9V8lLjg9l4rSHy4iY++465xbdb5gCdG2oCsghZyr0N+fFaKAuhtTlq5qg= =kLU5 -----END PGP SIGNATURE----- --Apple-Mail=_2AEC4A16-8414-456C-AC62-2CFAFF92FE2A-- From owner-svn-src-head@freebsd.org Sun Oct 1 19:03:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18E6DE2C28F; Sun, 1 Oct 2017 19:03:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCCB86B151; Sun, 1 Oct 2017 19:03:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v91J3Mnk095191; Sun, 1 Oct 2017 19:03:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v91J3MnQ095190; Sun, 1 Oct 2017 19:03:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710011903.v91J3MnQ095190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 1 Oct 2017 19:03:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324174 - head/sys/dev/smbus X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/smbus X-SVN-Commit-Revision: 324174 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 19:03:23 -0000 Author: kib Date: Sun Oct 1 19:03:21 2017 New Revision: 324174 URL: https://svnweb.freebsd.org/changeset/base/324174 Log: Fix supposed typo in the include guard symbol name, use full path for the name. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/smbus/smbconf.h Modified: head/sys/dev/smbus/smbconf.h ============================================================================== --- head/sys/dev/smbus/smbconf.h Sun Oct 1 17:04:26 2017 (r324173) +++ head/sys/dev/smbus/smbconf.h Sun Oct 1 19:03:21 2017 (r324174) @@ -25,8 +25,8 @@ * * $FreeBSD$ */ -#ifndef __SMBONF_H -#define __SMBONF_H +#ifndef __DEV_SMBUS_SMBCONF_H +#define __DEV_SMBUS_SMBCONF_H #include @@ -124,4 +124,4 @@ extern devclass_t smbus_devclass; #define SMBUS_MAXVER 1 #define SMBUS_PREFVER SMBUS_MODVER -#endif +#endif /* __DEV_SMBUS_SMBCONF_H */ From owner-svn-src-head@freebsd.org Sun Oct 1 19:52:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F10DE2D286; Sun, 1 Oct 2017 19:52:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 699DB6CB22; Sun, 1 Oct 2017 19:52:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v91JqmBQ016139; Sun, 1 Oct 2017 19:52:48 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v91JqmUS016132; Sun, 1 Oct 2017 19:52:48 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201710011952.v91JqmUS016132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 1 Oct 2017 19:52:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324177 - in head/sys: amd64/amd64 amd64/include conf dev/efidev modules/efirt sys X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/include conf dev/efidev modules/efirt sys X-SVN-Commit-Revision: 324177 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 19:52:49 -0000 Author: andrew Date: Sun Oct 1 19:52:47 2017 New Revision: 324177 URL: https://svnweb.freebsd.org/changeset/base/324177 Log: To prepare for adding EFI runtime services support on arm64 move the machine independent parts of the existing code to a new file that can be shared between amd64 and arm64. Reviewed by: kib (previous version), imp Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12434 Added: head/sys/amd64/amd64/efirt_machdep.c - copied, changed from r324176, head/sys/amd64/amd64/efirt.c head/sys/dev/efidev/efirt.c - copied, changed from r324100, head/sys/amd64/amd64/efirt.c Deleted: head/sys/amd64/amd64/efirt.c Modified: head/sys/amd64/include/efi.h head/sys/conf/files head/sys/conf/files.amd64 head/sys/modules/efirt/Makefile head/sys/sys/efi.h Copied and modified: head/sys/amd64/amd64/efirt_machdep.c (from r324176, head/sys/amd64/amd64/efirt.c) ============================================================================== --- head/sys/amd64/amd64/efirt.c Sun Oct 1 19:40:29 2017 (r324176, copy source) +++ head/sys/amd64/amd64/efirt_machdep.c Sun Oct 1 19:52:47 2017 (r324177) @@ -60,53 +60,11 @@ __FBSDID("$FreeBSD$"); #include #include -static struct efi_systbl *efi_systbl; -static struct efi_cfgtbl *efi_cfgtbl; -static struct efi_rt *efi_runtime; - -static int efi_status2err[25] = { - 0, /* EFI_SUCCESS */ - ENOEXEC, /* EFI_LOAD_ERROR */ - EINVAL, /* EFI_INVALID_PARAMETER */ - ENOSYS, /* EFI_UNSUPPORTED */ - EMSGSIZE, /* EFI_BAD_BUFFER_SIZE */ - EOVERFLOW, /* EFI_BUFFER_TOO_SMALL */ - EBUSY, /* EFI_NOT_READY */ - EIO, /* EFI_DEVICE_ERROR */ - EROFS, /* EFI_WRITE_PROTECTED */ - EAGAIN, /* EFI_OUT_OF_RESOURCES */ - EIO, /* EFI_VOLUME_CORRUPTED */ - ENOSPC, /* EFI_VOLUME_FULL */ - ENXIO, /* EFI_NO_MEDIA */ - ESTALE, /* EFI_MEDIA_CHANGED */ - ENOENT, /* EFI_NOT_FOUND */ - EACCES, /* EFI_ACCESS_DENIED */ - ETIMEDOUT, /* EFI_NO_RESPONSE */ - EADDRNOTAVAIL, /* EFI_NO_MAPPING */ - ETIMEDOUT, /* EFI_TIMEOUT */ - EDOOFUS, /* EFI_NOT_STARTED */ - EALREADY, /* EFI_ALREADY_STARTED */ - ECANCELED, /* EFI_ABORTED */ - EPROTO, /* EFI_ICMP_ERROR */ - EPROTO, /* EFI_TFTP_ERROR */ - EPROTO /* EFI_PROTOCOL_ERROR */ -}; - -static int -efi_status_to_errno(efi_status status) -{ - u_long code; - - code = status & 0x3ffffffffffffffful; - return (code < nitems(efi_status2err) ? efi_status2err[code] : EDOOFUS); -} - -static struct mtx efi_lock; static pml4_entry_t *efi_pml4; static vm_object_t obj_1t1_pt; static vm_page_t efi_pml4_page; -static void +void efi_destroy_1t1_map(void) { vm_page_t m; @@ -185,7 +143,7 @@ efi_1t1_pte(vm_offset_t va) return (pte); } -static bool +bool efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz) { struct efi_md *p; @@ -288,22 +246,13 @@ fail: * firmware/SMM long operation, which would negatively affect IPIs, * esp. TLB shootdown requests. */ -static int -efi_enter(void) +int +efi_arch_enter(void) { pmap_t curpmap; - int error; - if (efi_runtime == NULL) - return (ENXIO); curpmap = PCPU_GET(curpmap); - PMAP_LOCK(curpmap); - mtx_lock(&efi_lock); - error = fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX); - if (error != 0) { - PMAP_UNLOCK(curpmap); - return (error); - } + PMAP_LOCK_ASSERT(curpmap, MA_OWNED); /* * IPI TLB shootdown handler invltlb_pcid_handler() reloads @@ -326,8 +275,8 @@ efi_enter(void) return (0); } -static void -efi_leave(void) +void +efi_arch_leave(void) { pmap_t curpmap; @@ -338,262 +287,7 @@ efi_leave(void) curpmap->pm_pcids[PCPU_GET(cpuid)].pm_pcid : 0)); if (!pmap_pcid_enabled) invltlb(); - - fpu_kern_leave(curthread, NULL); - mtx_unlock(&efi_lock); - PMAP_UNLOCK(curpmap); } - -static int -efi_init(void) -{ - struct efi_map_header *efihdr; - struct efi_md *map; - caddr_t kmdp; - size_t efisz; - - mtx_init(&efi_lock, "efi", NULL, MTX_DEF); - - if (efi_systbl_phys == 0) { - if (bootverbose) - printf("EFI systbl not available\n"); - return (0); - } - efi_systbl = (struct efi_systbl *)PHYS_TO_DMAP(efi_systbl_phys); - if (efi_systbl->st_hdr.th_sig != EFI_SYSTBL_SIG) { - efi_systbl = NULL; - if (bootverbose) - printf("EFI systbl signature invalid\n"); - return (0); - } - efi_cfgtbl = (efi_systbl->st_cfgtbl == 0) ? NULL : - (struct efi_cfgtbl *)efi_systbl->st_cfgtbl; - if (efi_cfgtbl == NULL) { - if (bootverbose) - printf("EFI config table is not present\n"); - } - - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - efihdr = (struct efi_map_header *)preload_search_info(kmdp, - MODINFO_METADATA | MODINFOMD_EFI_MAP); - if (efihdr == NULL) { - if (bootverbose) - printf("EFI map is not present\n"); - return (0); - } - efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf; - map = (struct efi_md *)((uint8_t *)efihdr + efisz); - if (efihdr->descriptor_size == 0) - return (ENOMEM); - - if (!efi_create_1t1_map(map, efihdr->memory_size / - efihdr->descriptor_size, efihdr->descriptor_size)) { - if (bootverbose) - printf("EFI cannot create runtime map\n"); - return (ENOMEM); - } - - efi_runtime = (efi_systbl->st_rt == 0) ? NULL : - (struct efi_rt *)efi_systbl->st_rt; - if (efi_runtime == NULL) { - if (bootverbose) - printf("EFI runtime services table is not present\n"); - efi_destroy_1t1_map(); - return (ENXIO); - } - - return (0); -} - -static void -efi_uninit(void) -{ - - efi_destroy_1t1_map(); - - efi_systbl = NULL; - efi_cfgtbl = NULL; - efi_runtime = NULL; - - mtx_destroy(&efi_lock); -} - -int -efi_rt_ok(void) -{ - - if (efi_runtime == NULL) - return (ENXIO); - return (0); -} - -int -efi_get_table(struct uuid *uuid, void **ptr) -{ - struct efi_cfgtbl *ct; - u_long count; - - if (efi_cfgtbl == NULL || efi_systbl == NULL) - return (ENXIO); - count = efi_systbl->st_entries; - ct = efi_cfgtbl; - while (count--) { - if (!bcmp(&ct->ct_uuid, uuid, sizeof(*uuid))) { - *ptr = (void *)PHYS_TO_DMAP(ct->ct_data); - return (0); - } - ct++; - } - return (ENOENT); -} - -int -efi_get_time_locked(struct efi_tm *tm) -{ - efi_status status; - int error; - - mtx_assert(&atrtc_time_lock, MA_OWNED); - error = efi_enter(); - if (error != 0) - return (error); - status = efi_runtime->rt_gettime(tm, NULL); - efi_leave(); - error = efi_status_to_errno(status); - return (error); -} - -int -efi_get_time(struct efi_tm *tm) -{ - int error; - - if (efi_runtime == NULL) - return (ENXIO); - mtx_lock(&atrtc_time_lock); - error = efi_get_time_locked(tm); - mtx_unlock(&atrtc_time_lock); - return (error); -} - -int -efi_reset_system(void) -{ - int error; - - error = efi_enter(); - if (error != 0) - return (error); - efi_runtime->rt_reset(EFI_RESET_WARM, 0, 0, NULL); - efi_leave(); - return (EIO); -} - -int -efi_set_time_locked(struct efi_tm *tm) -{ - efi_status status; - int error; - - mtx_assert(&atrtc_time_lock, MA_OWNED); - error = efi_enter(); - if (error != 0) - return (error); - status = efi_runtime->rt_settime(tm); - efi_leave(); - error = efi_status_to_errno(status); - return (error); -} - -int -efi_set_time(struct efi_tm *tm) -{ - int error; - - if (efi_runtime == NULL) - return (ENXIO); - mtx_lock(&atrtc_time_lock); - error = efi_set_time_locked(tm); - mtx_unlock(&atrtc_time_lock); - return (error); -} - -int -efi_var_get(efi_char *name, struct uuid *vendor, uint32_t *attrib, - size_t *datasize, void *data) -{ - efi_status status; - int error; - - error = efi_enter(); - if (error != 0) - return (error); - status = efi_runtime->rt_getvar(name, vendor, attrib, datasize, data); - efi_leave(); - error = efi_status_to_errno(status); - return (error); -} - -int -efi_var_nextname(size_t *namesize, efi_char *name, struct uuid *vendor) -{ - efi_status status; - int error; - - error = efi_enter(); - if (error != 0) - return (error); - status = efi_runtime->rt_scanvar(namesize, name, vendor); - efi_leave(); - error = efi_status_to_errno(status); - return (error); -} - -int -efi_var_set(efi_char *name, struct uuid *vendor, uint32_t attrib, - size_t datasize, void *data) -{ - efi_status status; - int error; - - error = efi_enter(); - if (error != 0) - return (error); - status = efi_runtime->rt_setvar(name, vendor, attrib, datasize, data); - efi_leave(); - error = efi_status_to_errno(status); - return (error); -} - -static int -efirt_modevents(module_t m, int event, void *arg __unused) -{ - - switch (event) { - case MOD_LOAD: - return (efi_init()); - - case MOD_UNLOAD: - efi_uninit(); - return (0); - - case MOD_SHUTDOWN: - return (0); - - default: - return (EOPNOTSUPP); - } -} - -static moduledata_t efirt_moddata = { - .name = "efirt", - .evhand = efirt_modevents, - .priv = NULL, -}; -DECLARE_MODULE(efirt, efirt_moddata, SI_SUB_VM_CONF, SI_ORDER_ANY); -MODULE_VERSION(efirt, 1); /* XXX debug stuff */ static int Modified: head/sys/amd64/include/efi.h ============================================================================== --- head/sys/amd64/include/efi.h Sun Oct 1 19:40:29 2017 (r324176) +++ head/sys/amd64/include/efi.h Sun Oct 1 19:52:47 2017 (r324177) @@ -32,6 +32,8 @@ #ifndef __AMD64_INCLUDE_EFI_H_ #define __AMD64_INCLUDE_EFI_H_ +#include + /* * XXX: from gcc 6.2 manual: * Note, the ms_abi attribute for Microsoft Windows 64-bit targets @@ -45,22 +47,8 @@ #define EFIABI_ATTR __attribute__((ms_abi)) #endif -#ifdef _KERNEL -struct uuid; -struct efi_tm; - -int efi_rt_ok(void); -int efi_get_table(struct uuid *uuid, void **ptr); -int efi_get_time(struct efi_tm *tm); -int efi_get_time_locked(struct efi_tm *tm); -int efi_reset_system(void); -int efi_set_time(struct efi_tm *tm); -int efi_set_time_locked(struct efi_tm *tm); -int efi_var_get(uint16_t *name, struct uuid *vendor, uint32_t *attrib, - size_t *datasize, void *data); -int efi_var_nextname(size_t *namesize, uint16_t *name, struct uuid *vendor); -int efi_var_set(uint16_t *name, struct uuid *vendor, uint32_t attrib, - size_t datasize, void *data); -#endif +#define EFI_TIME_LOCK() mtx_lock(&atrtc_time_lock); +#define EFI_TIME_UNLOCK() mtx_unlock(&atrtc_time_lock); +#define EFI_TIME_OWNED() mtx_assert(&atrtc_time_lock, MA_OWNED); #endif /* __AMD64_INCLUDE_EFI_H_ */ Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Oct 1 19:40:29 2017 (r324176) +++ head/sys/conf/files Sun Oct 1 19:52:47 2017 (r324177) @@ -1614,6 +1614,7 @@ dev/ed/if_ed_rtl80x9.c optional ed dev/ed/if_ed_pccard.c optional ed pccard dev/ed/if_ed_pci.c optional ed pci dev/efidev/efidev.c optional efirt +dev/efidev/efirt.c optional efirt dev/e1000/if_em.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/em_txrx.c optional em \ Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun Oct 1 19:40:29 2017 (r324176) +++ head/sys/conf/files.amd64 Sun Oct 1 19:52:47 2017 (r324177) @@ -133,7 +133,7 @@ amd64/amd64/cpu_switch.S standard amd64/amd64/db_disasm.c optional ddb amd64/amd64/db_interface.c optional ddb amd64/amd64/db_trace.c optional ddb -amd64/amd64/efirt.c optional efirt +amd64/amd64/efirt_machdep.c optional efirt amd64/amd64/elf_machdep.c standard amd64/amd64/exception.S standard amd64/amd64/fpu.c standard Copied and modified: head/sys/dev/efidev/efirt.c (from r324100, head/sys/amd64/amd64/efirt.c) ============================================================================== --- head/sys/amd64/amd64/efirt.c Fri Sep 29 07:44:48 2017 (r324100, copy source) +++ head/sys/dev/efidev/efirt.c Sun Oct 1 19:52:47 2017 (r324177) @@ -46,19 +46,15 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include + #include #include #include -#include -#include #include + #include #include #include -#include -#include -#include static struct efi_systbl *efi_systbl; static struct efi_cfgtbl *efi_cfgtbl; @@ -102,249 +98,8 @@ efi_status_to_errno(efi_status status) } static struct mtx efi_lock; -static pml4_entry_t *efi_pml4; -static vm_object_t obj_1t1_pt; -static vm_page_t efi_pml4_page; -static void -efi_destroy_1t1_map(void) -{ - vm_page_t m; - - if (obj_1t1_pt != NULL) { - VM_OBJECT_RLOCK(obj_1t1_pt); - TAILQ_FOREACH(m, &obj_1t1_pt->memq, listq) - m->wire_count = 0; - atomic_subtract_int(&vm_cnt.v_wire_count, - obj_1t1_pt->resident_page_count); - VM_OBJECT_RUNLOCK(obj_1t1_pt); - vm_object_deallocate(obj_1t1_pt); - } - - obj_1t1_pt = NULL; - efi_pml4 = NULL; - efi_pml4_page = NULL; -} - -static vm_page_t -efi_1t1_page(vm_pindex_t idx) -{ - - return (vm_page_grab(obj_1t1_pt, idx, VM_ALLOC_NOBUSY | - VM_ALLOC_WIRED | VM_ALLOC_ZERO)); -} - -static pt_entry_t * -efi_1t1_pte(vm_offset_t va) -{ - pml4_entry_t *pml4e; - pdp_entry_t *pdpe; - pd_entry_t *pde; - pt_entry_t *pte; - vm_page_t m; - vm_pindex_t pml4_idx, pdp_idx, pd_idx; - vm_paddr_t mphys; - - pml4_idx = pmap_pml4e_index(va); - pml4e = &efi_pml4[pml4_idx]; - if (*pml4e == 0) { - m = efi_1t1_page(1 + pml4_idx); - mphys = VM_PAGE_TO_PHYS(m); - *pml4e = mphys | X86_PG_RW | X86_PG_V; - } else { - mphys = *pml4e & ~PAGE_MASK; - } - - pdpe = (pdp_entry_t *)PHYS_TO_DMAP(mphys); - pdp_idx = pmap_pdpe_index(va); - pdpe += pdp_idx; - if (*pdpe == 0) { - m = efi_1t1_page(1 + NPML4EPG + (pml4_idx + 1) * (pdp_idx + 1)); - mphys = VM_PAGE_TO_PHYS(m); - *pdpe = mphys | X86_PG_RW | X86_PG_V; - } else { - mphys = *pdpe & ~PAGE_MASK; - } - - pde = (pd_entry_t *)PHYS_TO_DMAP(mphys); - pd_idx = pmap_pde_index(va); - pde += pd_idx; - if (*pde == 0) { - m = efi_1t1_page(1 + NPML4EPG + NPML4EPG * NPDPEPG + - (pml4_idx + 1) * (pdp_idx + 1) * (pd_idx + 1)); - mphys = VM_PAGE_TO_PHYS(m); - *pde = mphys | X86_PG_RW | X86_PG_V; - } else { - mphys = *pde & ~PAGE_MASK; - } - - pte = (pt_entry_t *)PHYS_TO_DMAP(mphys); - pte += pmap_pte_index(va); - KASSERT(*pte == 0, ("va %#jx *pt %#jx", va, *pte)); - - return (pte); -} - -static bool -efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz) -{ - struct efi_md *p; - pt_entry_t *pte; - vm_offset_t va; - uint64_t idx; - int bits, i, mode; - - obj_1t1_pt = vm_pager_allocate(OBJT_PHYS, NULL, ptoa(1 + - NPML4EPG + NPML4EPG * NPDPEPG + NPML4EPG * NPDPEPG * NPDEPG), - VM_PROT_ALL, 0, NULL); - VM_OBJECT_WLOCK(obj_1t1_pt); - efi_pml4_page = efi_1t1_page(0); - VM_OBJECT_WUNLOCK(obj_1t1_pt); - efi_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(efi_pml4_page)); - pmap_pinit_pml4(efi_pml4_page); - - for (i = 0, p = map; i < ndesc; i++, p = efi_next_descriptor(p, - descsz)) { - if ((p->md_attr & EFI_MD_ATTR_RT) == 0) - continue; - if (p->md_virt != NULL) { - if (bootverbose) - printf("EFI Runtime entry %d is mapped\n", i); - goto fail; - } - if ((p->md_phys & EFI_PAGE_MASK) != 0) { - if (bootverbose) - printf("EFI Runtime entry %d is not aligned\n", - i); - goto fail; - } - if (p->md_phys + p->md_pages * EFI_PAGE_SIZE < p->md_phys || - p->md_phys + p->md_pages * EFI_PAGE_SIZE >= - VM_MAXUSER_ADDRESS) { - printf("EFI Runtime entry %d is not in mappable for RT:" - "base %#016jx %#jx pages\n", - i, (uintmax_t)p->md_phys, - (uintmax_t)p->md_pages); - goto fail; - } - if ((p->md_attr & EFI_MD_ATTR_WB) != 0) - mode = VM_MEMATTR_WRITE_BACK; - else if ((p->md_attr & EFI_MD_ATTR_WT) != 0) - mode = VM_MEMATTR_WRITE_THROUGH; - else if ((p->md_attr & EFI_MD_ATTR_WC) != 0) - mode = VM_MEMATTR_WRITE_COMBINING; - else if ((p->md_attr & EFI_MD_ATTR_WP) != 0) - mode = VM_MEMATTR_WRITE_PROTECTED; - else if ((p->md_attr & EFI_MD_ATTR_UC) != 0) - mode = VM_MEMATTR_UNCACHEABLE; - else { - if (bootverbose) - printf("EFI Runtime entry %d mapping " - "attributes unsupported\n", i); - mode = VM_MEMATTR_UNCACHEABLE; - } - bits = pmap_cache_bits(kernel_pmap, mode, FALSE) | X86_PG_RW | - X86_PG_V; - VM_OBJECT_WLOCK(obj_1t1_pt); - for (va = p->md_phys, idx = 0; idx < p->md_pages; idx++, - va += PAGE_SIZE) { - pte = efi_1t1_pte(va); - pte_store(pte, va | bits); - } - VM_OBJECT_WUNLOCK(obj_1t1_pt); - } - - return (true); - -fail: - efi_destroy_1t1_map(); - return (false); -} - -/* - * Create an environment for the EFI runtime code call. The most - * important part is creating the required 1:1 physical->virtual - * mappings for the runtime segments. To do that, we manually create - * page table which unmap userspace but gives correct kernel mapping. - * The 1:1 mappings for runtime segments usually occupy low 4G of the - * physical address map. - * - * The 1:1 mappings were chosen over the SetVirtualAddressMap() EFI RT - * service, because there are some BIOSes which fail to correctly - * relocate itself on the call, requiring both 1:1 and virtual - * mapping. As result, we must provide 1:1 mapping anyway, so no - * reason to bother with the virtual map, and no need to add a - * complexity into loader. - * - * The fpu_kern_enter() call allows firmware to use FPU, as mandated - * by the specification. In particular, CR0.TS bit is cleared. Also - * it enters critical section, giving us neccessary protection against - * context switch. - * - * There is no need to disable interrupts around the change of %cr3, - * the kernel mappings are correct, while we only grabbed the - * userspace portion of VA. Interrupts handlers must not access - * userspace. Having interrupts enabled fixes the issue with - * firmware/SMM long operation, which would negatively affect IPIs, - * esp. TLB shootdown requests. - */ static int -efi_enter(void) -{ - pmap_t curpmap; - int error; - - if (efi_runtime == NULL) - return (ENXIO); - curpmap = PCPU_GET(curpmap); - PMAP_LOCK(curpmap); - mtx_lock(&efi_lock); - error = fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX); - if (error != 0) { - PMAP_UNLOCK(curpmap); - return (error); - } - - /* - * IPI TLB shootdown handler invltlb_pcid_handler() reloads - * %cr3 from the curpmap->pm_cr3, which would disable runtime - * segments mappings. Block the handler's action by setting - * curpmap to impossible value. See also comment in - * pmap.c:pmap_activate_sw(). - */ - if (pmap_pcid_enabled && !invpcid_works) - PCPU_SET(curpmap, NULL); - - load_cr3(VM_PAGE_TO_PHYS(efi_pml4_page) | (pmap_pcid_enabled ? - curpmap->pm_pcids[PCPU_GET(cpuid)].pm_pcid : 0)); - /* - * If PCID is enabled, the clear CR3_PCID_SAVE bit in the loaded %cr3 - * causes TLB invalidation. - */ - if (!pmap_pcid_enabled) - invltlb(); - return (0); -} - -static void -efi_leave(void) -{ - pmap_t curpmap; - - curpmap = &curproc->p_vmspace->vm_pmap; - if (pmap_pcid_enabled && !invpcid_works) - PCPU_SET(curpmap, curpmap); - load_cr3(curpmap->pm_cr3 | (pmap_pcid_enabled ? - curpmap->pm_pcids[PCPU_GET(cpuid)].pm_pcid : 0)); - if (!pmap_pcid_enabled) - invltlb(); - - fpu_kern_leave(curthread, NULL); - mtx_unlock(&efi_lock); - PMAP_UNLOCK(curpmap); -} - -static int efi_init(void) { struct efi_map_header *efihdr; @@ -429,6 +184,43 @@ efi_rt_ok(void) return (0); } +static int +efi_enter(void) +{ + struct thread *td; + pmap_t curpmap; + int error; + + if (efi_runtime == NULL) + return (ENXIO); + td = curthread; + curpmap = &td->td_proc->p_vmspace->vm_pmap; + PMAP_LOCK(curpmap); + mtx_lock(&efi_lock); + error = fpu_kern_enter(td, NULL, FPU_KERN_NOCTX); + if (error != 0) { + PMAP_UNLOCK(curpmap); + return (error); + } + + return (efi_arch_enter()); +} + +static void +efi_leave(void) +{ + struct thread *td; + pmap_t curpmap; + + efi_arch_leave(); + + curpmap = &curproc->p_vmspace->vm_pmap; + td = curthread; + fpu_kern_leave(td, NULL); + mtx_unlock(&efi_lock); + PMAP_UNLOCK(curpmap); +} + int efi_get_table(struct uuid *uuid, void **ptr) { @@ -449,13 +241,13 @@ efi_get_table(struct uuid *uuid, void **ptr) return (ENOENT); } -int +static int efi_get_time_locked(struct efi_tm *tm) { efi_status status; int error; - mtx_assert(&atrtc_time_lock, MA_OWNED); + EFI_TIME_OWNED() error = efi_enter(); if (error != 0) return (error); @@ -472,9 +264,9 @@ efi_get_time(struct efi_tm *tm) if (efi_runtime == NULL) return (ENXIO); - mtx_lock(&atrtc_time_lock); + EFI_TIME_LOCK() error = efi_get_time_locked(tm); - mtx_unlock(&atrtc_time_lock); + EFI_TIME_UNLOCK() return (error); } @@ -491,13 +283,13 @@ efi_reset_system(void) return (EIO); } -int +static int efi_set_time_locked(struct efi_tm *tm) { efi_status status; int error; - mtx_assert(&atrtc_time_lock, MA_OWNED); + EFI_TIME_OWNED(); error = efi_enter(); if (error != 0) return (error); @@ -514,9 +306,9 @@ efi_set_time(struct efi_tm *tm) if (efi_runtime == NULL) return (ENXIO); - mtx_lock(&atrtc_time_lock); + EFI_TIME_LOCK() error = efi_set_time_locked(tm); - mtx_unlock(&atrtc_time_lock); + EFI_TIME_UNLOCK() return (error); } @@ -594,26 +386,3 @@ static moduledata_t efirt_moddata = { }; DECLARE_MODULE(efirt, efirt_moddata, SI_SUB_VM_CONF, SI_ORDER_ANY); MODULE_VERSION(efirt, 1); - -/* XXX debug stuff */ -static int -efi_time_sysctl_handler(SYSCTL_HANDLER_ARGS) -{ - struct efi_tm tm; - int error, val; - - val = 0; - error = sysctl_handle_int(oidp, &val, 0, req); - if (error != 0 || req->newptr == NULL) - return (error); - error = efi_get_time(&tm); - if (error == 0) { - uprintf("EFI reports: Year %d Month %d Day %d Hour %d Min %d " - "Sec %d\n", tm.tm_year, tm.tm_mon, tm.tm_mday, tm.tm_hour, - tm.tm_min, tm.tm_sec); - } - return (error); -} - -SYSCTL_PROC(_debug, OID_AUTO, efi_time, CTLTYPE_INT | CTLFLAG_RW, NULL, 0, - efi_time_sysctl_handler, "I", ""); Modified: head/sys/modules/efirt/Makefile ============================================================================== --- head/sys/modules/efirt/Makefile Sun Oct 1 19:40:29 2017 (r324176) +++ head/sys/modules/efirt/Makefile Sun Oct 1 19:52:47 2017 (r324177) @@ -4,7 +4,7 @@ .PATH: ${SRCTOP}/sys/dev/efidev KMOD= efirt -SRCS= efirt.c efidev.c +SRCS= efirt.c efirt_machdep.c efidev.c SRCS+= device_if.h bus_if.h .include Modified: head/sys/sys/efi.h ============================================================================== --- head/sys/sys/efi.h Sun Oct 1 19:40:29 2017 (r324176) +++ head/sys/sys/efi.h Sun Oct 1 19:52:47 2017 (r324177) @@ -168,6 +168,25 @@ struct efi_systbl { }; extern vm_paddr_t efi_systbl_phys; + +/* Internal MD EFI functions */ +int efi_arch_enter(void); +void efi_arch_leave(void); +bool efi_create_1t1_map(struct efi_md *, int, int); +void efi_destroy_1t1_map(void); + +/* Public MI EFI functions */ +int efi_rt_ok(void); +int efi_get_table(struct uuid *uuid, void **ptr); +int efi_get_time(struct efi_tm *tm); +int efi_reset_system(void); +int efi_set_time(struct efi_tm *tm); +int efi_var_get(uint16_t *name, struct uuid *vendor, uint32_t *attrib, + size_t *datasize, void *data); +int efi_var_nextname(size_t *namesize, uint16_t *name, struct uuid *vendor); +int efi_var_set(uint16_t *name, struct uuid *vendor, uint32_t attrib, + size_t datasize, void *data); + #endif /* _KERNEL */ #endif /* _SYS_EFI_H_ */ From owner-svn-src-head@freebsd.org Sun Oct 1 20:12:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A82DEE2D753; Sun, 1 Oct 2017 20:12:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63E2D6D3E3; Sun, 1 Oct 2017 20:12:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v91KCUIh024560; Sun, 1 Oct 2017 20:12:30 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v91KCUvU024559; Sun, 1 Oct 2017 20:12:30 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710012012.v91KCUvU024559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sun, 1 Oct 2017 20:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324178 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua X-SVN-Commit-Revision: 324178 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 20:12:31 -0000 Author: avg Date: Sun Oct 1 20:12:30 2017 New Revision: 324178 URL: https://svnweb.freebsd.org/changeset/base/324178 Log: unbreak kernel builds on sparc64 and powerpc after r324163, ZFS Channel Programs The custom iscntrl() in ZFS Lua code expects a signed argumnet, so remove the harmful cast. Reported by: ian MFC after: 5 weeks X-MFC with: r324163 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c Sun Oct 1 19:52:47 2017 (r324177) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c Sun Oct 1 20:12:30 2017 (r324178) @@ -867,7 +867,7 @@ static void addquoted (lua_State *L, luaL_Buffer *b, i luaL_addchar(b, '\\'); luaL_addchar(b, *s); } - else if (*s == '\0' || iscntrl(uchar(*s))) { + else if (*s == '\0' || iscntrl(*s)) { char buff[10]; if (!isdigit(uchar(*(s+1)))) sprintf(buff, "\\%d", (int)uchar(*s)); From owner-svn-src-head@freebsd.org Sun Oct 1 20:36:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAC3EE2DFAB; Sun, 1 Oct 2017 20:36:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 249A16DF72; Sun, 1 Oct 2017 20:36:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA07125; Sun, 01 Oct 2017 23:36:11 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1dykyB-000IeD-IT; Sun, 01 Oct 2017 23:36:11 +0300 Subject: Re: svn commit: r324163 - in head: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common cddl/co... To: Ian Lepore , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201710011611.v91GB8LM024101@repo.freebsd.org> <1506877870.22078.28.camel@freebsd.org> From: Andriy Gapon Message-ID: <61cbd210-a316-5f29-ce52-da40e4added5@FreeBSD.org> Date: Sun, 1 Oct 2017 23:35:14 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1506877870.22078.28.camel@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 20:36:22 -0000 On 01/10/2017 20:11, Ian Lepore wrote: > On Sun, 2017-10-01 at 16:11 +0000, Andriy Gapon wrote: >> Author: avg >> Date: Sun Oct  1 16:11:07 2017 >> New Revision: 324163 >> URL: https://svnweb.freebsd.org/changeset/base/324163 >> >> Log: >>   MFV r323530,r323533,r323534: 7431 ZFS Channel Programs, and >> followups >>    > > Powerpc and sparc builds are dying on: > > src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c:870: > warning: comparison is always true due to limited range of data type > > "(unsigned char)anything >= 0" is also always true on clang, so I'm not > sure why it doesn't warn too. That's what I get for forgetting that other architectures use ZFS as well and, thus, not building universe. I've just committed a naive / trivial fix. Seems like there was just a single problem and not a systemic issue. Thank you for the report! -- Andriy Gapon From owner-svn-src-head@freebsd.org Sun Oct 1 20:37:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17648E2E020; Sun, 1 Oct 2017 20:37:24 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 881A36E0CD; Sun, 1 Oct 2017 20:37:23 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([78.53.138.91]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MX1dc-1dmbsM2ruW-00W0WN; Sun, 01 Oct 2017 22:37:14 +0200 Date: Sun, 1 Oct 2017 22:37:07 +0200 From: "O. Hartmann" To: Andriy Gapon Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324178 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua Message-ID: <20171001223707.574cde55@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201710012012.v91KCUvU024559@repo.freebsd.org> References: <201710012012.v91KCUvU024559@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/gUatc3cd7sv0Nvvw5jqFa6W"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:pba9SuM1jreTa2fIn17UsIW6NpCBzM7+D8Zbqh8+/myZPJtKh+h pMksc0musYBHyCzBZkXAobEE5eSyJRRQ8JUrf1AxrGyAe5avrRqYYS2jYEOT5dfxCEEcgg7 LkAo/U7TtbCmPkaoMAN4thdQFL7c9etdtd15ychEFaK02uSYlFNp3WmWVm2P1MrL4NGI6c9 UYR+gcmell/dUZR7Sl/Pw== X-UI-Out-Filterresults: notjunk:1;V01:K0:CjSsEtgPgLo=:u/zVRe9hnEqYxQbfmFO/TN WJ9X4USWjg6K1xQQBPKhVqzbGWEZ/crAQq3aWY7bWcWusB0PNT3Hg2dKmwcRR/M6pXVYIgqYx 4VjykJhVyya4iLkgIurOTvsBRin4M2XROym0fQwMc+ZOocioLLqb/s6k0ulqvAheCAHML3MH9 36yNXekriH8JdS5xMTIQ4DZtGNj9Jec5hnDrSFP8G+f+LeR+64kf21nZIL0jPn6pRPR2dL3oY HvHyeTmx9UQGyZTqsKKJkvSoKs31iY03ktfzADlr5wXFeUJiENw3QHP3JmdV/IbJtGg54JHJX Hb2YN0XMeXF/YxII8InRemfcG1ragNy5gG2ALgyBT7/Ns0YOEhSGpr1q91lPmv7JipfOdZRX8 USgWSlK6y3LKKf0B0X2yrGkxYFvISlZOS4bU5NndZjmN8BCKZ0wEdRxLxvvESNgyA9uKOCFbI NhryczXTFVHTPw5UfYK//MyBiIiYOcGSGsFnylkLVt5y/F4aymSJbkIBVWFQiIjk3fsYvNHcO Aem2JCihJssCv3lCAhXQGT9HllcJiwbVKdRlleiZzI3xCEHIEqbunXjf27APViSjlFNcptisn oy0ycgauCdcGJsQ8m/sBKB0Tj0GtHGYV77OGctLhv1sVv/xzan2GTgqEH8f5QhoyLoD7AWbyK 1nYm2ldK5szkB5B+qQ5kO8TFkYdnzoERN2EHl9o28e0Cx7DZVVsBwcuxza8DVQx4aMTqaStCa Ni2tvi7iWK60EuLhs7Z0RDYJ6qM8QBBgWYTO7z3UNprbGPI4AFtLLu/LkLHi3dA/LNKmabeB0 Kf2R5OxU4G6r1+ZQ6+mc3pprYVadQ== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 20:37:24 -0000 --Sig_/gUatc3cd7sv0Nvvw5jqFa6W Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Sun, 1 Oct 2017 20:12:30 +0000 (UTC) Andriy Gapon schrieb: > Author: avg > Date: Sun Oct 1 20:12:30 2017 > New Revision: 324178 > URL: https://svnweb.freebsd.org/changeset/base/324178 >=20 > Log: > unbreak kernel builds on sparc64 and powerpc after r324163, ZFS Channel= Programs > =20 > The custom iscntrl() in ZFS Lua code expects a signed argumnet, so > remove the harmful cast. > =20 > Reported by: ian > MFC after: 5 weeks > X-MFC with: r324163 >=20 > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c >=20 > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib= .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/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c Sun= Oct 1 > 19:52:47 2017 (r324177) +++ > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c Sun Oct= 1 > 20:12:30 2017 (r324178) @@ -867,7 +867,7 @@ static void addquoted (lua_St= ate *L, > luaL_Buffer *b, i luaL_addchar(b, '\\'); luaL_addchar(b, *s); > } > - else if (*s =3D=3D '\0' || iscntrl(uchar(*s))) { > + else if (*s =3D=3D '\0' || iscntrl(*s)) { > char buff[10]; > if (!isdigit(uchar(*(s+1)))) > sprintf(buff, "\\%d", (int)uchar(*s)); > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" The build of world fails for me with the error shown below: [...] Building /usr/obj/usr/src/cddl/lib/libzpool/lapi.o --- lstrlib.o --- /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c:114:1= 2: warning: implicitly declaring library function 'tolower' with type 'int (int)' [-Wimplicit-function-declaration] p[i] =3D tolower(uchar(s[i])); ^ /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c:114:1= 2: note: include the header or explicitly provide a declaration for 'tolower' /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrl= ib.c:127:12: warning: implicitly declaring library function 'toupper' with type 'int (int)' [-Wimplicit-function-declaration] p[i] =3D toupper(uchar(s[i])); --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/gUatc3cd7sv0Nvvw5jqFa6W Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWdFR8wAKCRDS528fyFhY lO+3AgCG98hzR6klneCBzM9ESDen+hDdR3X+1R8j495xxBIQVYaycVpmGtja2ZGm lujaRHd4WMXP/jEwU6bTsEd26ribAf9ebi8MdvsX/Dx6kIazaspOT0plWZFew07j tR9MtRWCSX0AMfDitTU+WY2Ktomgk73wAATnVnZ5WAjgtiQhww8s =C3W6 -----END PGP SIGNATURE----- --Sig_/gUatc3cd7sv0Nvvw5jqFa6W-- From owner-svn-src-head@freebsd.org Sun Oct 1 20:47:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E442E2E404 for ; Sun, 1 Oct 2017 20:47:53 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 213DE6E857 for ; Sun, 1 Oct 2017 20:47:52 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: cd6ae58a-a6e9-11e7-a937-4f970e858fdb X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id cd6ae58a-a6e9-11e7-a937-4f970e858fdb; Sun, 01 Oct 2017 20:47:56 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v91Klncs001816; Sun, 1 Oct 2017 14:47:49 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1506890869.22078.45.camel@freebsd.org> Subject: Re: svn commit: r324178 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua From: Ian Lepore To: "O. Hartmann" , Andriy Gapon Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 01 Oct 2017 14:47:49 -0600 In-Reply-To: <20171001223707.574cde55@thor.intern.walstatt.dynvpn.de> References: <201710012012.v91KCUvU024559@repo.freebsd.org> <20171001223707.574cde55@thor.intern.walstatt.dynvpn.de> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 20:47:53 -0000 On Sun, 2017-10-01 at 22:37 +0200, O. Hartmann wrote: > Am Sun, 1 Oct 2017 20:12:30 +0000 (UTC) > Andriy Gapon schrieb: > > > > > Author: avg > > Date: Sun Oct  1 20:12:30 2017 > > New Revision: 324178 > > URL: https://svnweb.freebsd.org/changeset/base/324178 > > > > Log: > >   unbreak kernel builds on sparc64 and powerpc after r324163, ZFS > > Channel Programs > >    > >   The custom iscntrl() in ZFS Lua code expects a signed argumnet, > > so > >   remove the harmful cast. > >    > >   Reported by: ian > >   MFC after: 5 weeks > >   X-MFC with: r324163 > > > > Modified: > >   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c > > > > Modified: > > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c > > =================================================================== > > =========== > > --- > > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c > > Sun Oct  1 > > 19:52:47 2017 (r324177) +++ > > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c > > Sun Oct  1 > > 20:12:30 2017 (r324178) @@ -867,7 +867,7 @@ static void > > addquoted (lua_State *L, > > luaL_Buffer *b, i luaL_addchar(b, '\\'); luaL_addchar(b, *s); > >      } > > -    else if (*s == '\0' || iscntrl(uchar(*s))) { > > +    else if (*s == '\0' || iscntrl(*s)) { > >        char buff[10]; > >        if (!isdigit(uchar(*(s+1)))) > >          sprintf(buff, "\\%d", (int)uchar(*s)); > > _______________________________________________ > > svn-src-head@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd. > > org" > The build of world fails for me with the error shown below: > > > [...] > Building /usr/obj/usr/src/cddl/lib/libzpool/lapi.o > --- lstrlib.o --- > /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c > :114:12: warning: > implicitly declaring library function 'tolower' with type 'int > (int)' [-Wimplicit-function-declaration] p[i] = tolower(uchar(s[i])); > ^ > /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c > :114:12: note: > include the header or explicitly provide a declaration for > 'tolower' > /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c > :127:12: > warning: implicitly declaring library function 'toupper' with type > 'int > (int)' [-Wimplicit-function-declaration] p[i] = toupper(uchar(s[i])); > > Also, removing the cast won't really be a fix on a platform that has default unsigned chars (which arm does, but arm doesn't use gcc; not sure about other platforms). -- Ian From owner-svn-src-head@freebsd.org Sun Oct 1 21:02:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B8D6E2E86C; Sun, 1 Oct 2017 21:02:32 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lf0-x236.google.com (mail-lf0-x236.google.com [IPv6:2a00:1450:4010:c07::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 84DBA6EFD1; Sun, 1 Oct 2017 21:02:31 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lf0-x236.google.com with SMTP id q132so4112299lfe.5; Sun, 01 Oct 2017 14:02:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=gbCZnClSlV7ozhSwXAuvecrYNSb8saTHnvYHLQ9C7gM=; b=I4qfTXADn4hmG8Yigid8kIuxtx4QCbGmLdHroYrPScU3IDLd0KIrlx2Ly5oxdcV5Ad x3qAuAqdkJiv8lIGTP2t+Oy9LXWQjVowcQqnae6VePa+EavPYBmchYFonacZqK/UNrDi vudfmJ5XbXyeqTu1nJz+uiBB7zUSNk9i+eT62bk1rbRbwcFo0FyxZmATCaMIQhfvP8kO pjI2cjxN7XRV4uKM/tZrZHq+l07fYczY6sD30FepjXRNkYwDlUzFl8LiYASG0abQGdwj RIMh7+R/HiqnWFsbYCBM4of2dyV03dEESmE2IFkui3Vnl29rWgR/iSZUJXNG+Q/CQ0qP YcTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=gbCZnClSlV7ozhSwXAuvecrYNSb8saTHnvYHLQ9C7gM=; b=R/aazezYmvhSk5oeZyDSd4hEhbBeJTawVSUJFsVIdbDSdApmXshqd+OLNB3m1OM+Zo QjQSNY+7Hy5ETy0b5LyMWtDLy+b18qwhiicYnifkDWTrzODbGLr2gAnIjwpzeP2gqfsO 3UrlxiXUE0PVsGUt73l2eRR6RmugWKt9oljKWjW+ijsfrgqsIp7uZKHr7cAUpNP1L0DE 8qLe/Cj9P1nMnRWDlfHQI6Bd4V1GA7j9y4MOPZVGKb61exqHDsHbPn+4STis/j/jukVJ JpludEhHGveX6nq4oz8XdE9bD1YFDmw3FkwAlFtGw9F3DoK+nJrOKlbd5d0CVVeK3MG8 fY1A== X-Gm-Message-State: AHPjjUjbLjDc39DCB0jE9/gcjrS6+eHBUyniLLQLwpf6FlcLSiwi5HDq w8bKpo7y1R4umWxjL1lfjSra86Tx0CzCZUFUnno= X-Google-Smtp-Source: AOwi7QCTHheGYr7Zm2gm/w0q7pHl4ORDNlLDHmZVbadTAnC2yI6GErhW2fMUYJGNXPAIDrmBcReHgyTVSS4UZfL+v/I= X-Received: by 10.46.70.18 with SMTP id t18mr6163302lja.31.1506891749183; Sun, 01 Oct 2017 14:02:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.86.77 with HTTP; Sun, 1 Oct 2017 14:02:28 -0700 (PDT) Received: by 10.46.86.77 with HTTP; Sun, 1 Oct 2017 14:02:28 -0700 (PDT) In-Reply-To: <1506890869.22078.45.camel@freebsd.org> References: <201710012012.v91KCUvU024559@repo.freebsd.org> <20171001223707.574cde55@thor.intern.walstatt.dynvpn.de> <1506890869.22078.45.camel@freebsd.org> From: Justin Hibbits Date: Sun, 1 Oct 2017 16:02:28 -0500 Message-ID: Subject: Re: svn commit: r324178 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua To: Ian Lepore Cc: Andriy Gapon , svn-src-head@freebsd.org, svn-src-all@freebsd.org, "O. Hartmann" , src-committers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 21:02:32 -0000 On Oct 1, 2017 15:48, "Ian Lepore" wrote: On Sun, 2017-10-01 at 22:37 +0200, O. Hartmann wrote: > Am Sun, 1 Oct 2017 20:12:30 +0000 (UTC) > Andriy Gapon schrieb: > > > > > Author: avg > > Date: Sun Oct 1 20:12:30 2017 > > New Revision: 324178 > > URL: https://svnweb.freebsd.org/changeset/base/324178 > > > > Log: > > unbreak kernel builds on sparc64 and powerpc after r324163, ZFS > > Channel Programs > > > > The custom iscntrl() in ZFS Lua code expects a signed argumnet, > > so > > remove the harmful cast. > > > > Reported by: ian > > MFC after: 5 weeks > > X-MFC with: r324163 > > > > Modified: > > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c > > > > Modified: > > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c > > =================================================================== > > =========== > > --- > > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c > > Sun Oct 1 > > 19:52:47 2017 (r324177) +++ > > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c > > Sun Oct 1 > > 20:12:30 2017 (r324178) @@ -867,7 +867,7 @@ static void > > addquoted (lua_State *L, > > luaL_Buffer *b, i luaL_addchar(b, '\\'); luaL_addchar(b, *s); > > } > > - else if (*s == '\0' || iscntrl(uchar(*s))) { > > + else if (*s == '\0' || iscntrl(*s)) { > > char buff[10]; > > if (!isdigit(uchar(*(s+1)))) > > sprintf(buff, "\\%d", (int)uchar(*s)); > > _______________________________________________ > > svn-src-head@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd. > > org" > The build of world fails for me with the error shown below: > > > [...] > Building /usr/obj/usr/src/cddl/lib/libzpool/lapi.o > --- lstrlib.o --- > /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c > :114:12: warning: > implicitly declaring library function 'tolower' with type 'int > (int)' [-Wimplicit-function-declaration] p[i] = tolower(uchar(s[i])); > ^ > /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c > :114:12: note: > include the header or explicitly provide a declaration for > 'tolower' > /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c > :127:12: > warning: implicitly declaring library function 'toupper' with type > 'int > (int)' [-Wimplicit-function-declaration] p[i] = toupper(uchar(s[i])); > > Also, removing the cast won't really be a fix on a platform that has default unsigned chars (which arm does, but arm doesn't use gcc; not sure about other platforms). -- Ian PowerPC uses unsigned char by default. - Justin From owner-svn-src-head@freebsd.org Sun Oct 1 21:04:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71BBFE2E8F3; Sun, 1 Oct 2017 21:04:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 4BB6F6F13A; Sun, 1 Oct 2017 21:04:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA07195; Mon, 02 Oct 2017 00:04:31 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1dylPb-000Ift-5E; Mon, 02 Oct 2017 00:04:31 +0300 Subject: Re: svn commit: r324178 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua To: "O. Hartmann" Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201710012012.v91KCUvU024559@repo.freebsd.org> <20171001223707.574cde55@thor.intern.walstatt.dynvpn.de> From: Andriy Gapon Message-ID: <3a9a611f-677e-a4b7-897b-c05bebd776cc@FreeBSD.org> Date: Mon, 2 Oct 2017 00:03:35 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171001223707.574cde55@thor.intern.walstatt.dynvpn.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 21:04:34 -0000 On 01/10/2017 23:37, O. Hartmann wrote: > The build of world fails for me with the error shown below: > > > [...] > Building /usr/obj/usr/src/cddl/lib/libzpool/lapi.o > --- lstrlib.o --- > /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c:114:12: warning: > implicitly declaring library function 'tolower' with type 'int > (int)' [-Wimplicit-function-declaration] p[i] = tolower(uchar(s[i])); ^ > /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c:114:12: note: > include the header or explicitly provide a declaration for > 'tolower' /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c:127:12: > warning: implicitly declaring library function 'toupper' with type 'int > (int)' [-Wimplicit-function-declaration] p[i] = toupper(uchar(s[i])); I also see this _warning_, but the build does not fail for me in this place. -- Andriy Gapon From owner-svn-src-head@freebsd.org Sun Oct 1 21:05:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FE67E2E960; Sun, 1 Oct 2017 21:05:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id A596C6F281; Sun, 1 Oct 2017 21:05:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA07206; Mon, 02 Oct 2017 00:05:16 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1dylQJ-000Ifu-S9; Mon, 02 Oct 2017 00:05:15 +0300 Subject: Re: svn commit: r324178 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua To: Justin Hibbits , Ian Lepore Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org References: <201710012012.v91KCUvU024559@repo.freebsd.org> <20171001223707.574cde55@thor.intern.walstatt.dynvpn.de> <1506890869.22078.45.camel@freebsd.org> From: Andriy Gapon Message-ID: <7e3a4be9-6f10-f735-7272-5899a67907a5@FreeBSD.org> Date: Mon, 2 Oct 2017 00:04:25 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 21:05:19 -0000 On 02/10/2017 00:02, Justin Hibbits wrote: > PowerPC uses unsigned char by default. PowerPC kernel build worked for me. -- Andriy Gapon From owner-svn-src-head@freebsd.org Sun Oct 1 21:20:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 086E2E2ED6D; Sun, 1 Oct 2017 21:20:30 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9F396F869; Sun, 1 Oct 2017 21:20:29 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v91LKS0o050146; Sun, 1 Oct 2017 21:20:28 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v91LKSH1050145; Sun, 1 Oct 2017 21:20:28 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201710012120.v91LKSH1050145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Sun, 1 Oct 2017 21:20:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324179 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jch X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 324179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 21:20:30 -0000 Author: jch Date: Sun Oct 1 21:20:28 2017 New Revision: 324179 URL: https://svnweb.freebsd.org/changeset/base/324179 Log: Fix an infinite loop in tcp_tw_2msl_scan() when an INP_TIMEWAIT inp has been destroyed before its tcptw with INVARIANTS undefined. This is a symmetric change of r307551: A INP_TIMEWAIT inp should not be destroyed before its tcptw, and INVARIANTS will catch this case. If INVARIANTS is undefined it will emit a log(LOG_ERR) and avoid a hard to debug infinite loop in tcp_tw_2msl_scan(). Reported by: Ben Rubson, hselasky Submitted by: hselasky Tested by: Ben Rubson, jch MFC after: 1 week Sponsored by: Verisign, inc Differential Revision: https://reviews.freebsd.org/D12267 Modified: head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Sun Oct 1 20:12:30 2017 (r324178) +++ head/sys/netinet/tcp_timewait.c Sun Oct 1 21:20:28 2017 (r324179) @@ -709,10 +709,29 @@ tcp_tw_2msl_scan(int reuse) INP_WLOCK(inp); tw = intotw(inp); if (in_pcbrele_wlocked(inp)) { - KASSERT(tw == NULL, ("%s: held last inp " - "reference but tw not NULL", __func__)); - INP_INFO_RUNLOCK(&V_tcbinfo); - continue; + if (__predict_true(tw == NULL)) { + INP_INFO_RUNLOCK(&V_tcbinfo); + continue; + } else { + /* This should not happen as in TIMEWAIT + * state the inp should not be destroyed + * before its tcptw. If INVARIANTS is + * defined panic. + */ +#ifdef INVARIANTS + panic("%s: Panic before an infinite " + "loop: INP_TIMEWAIT && (INP_FREED " + "|| inp last reference) && tw != " + "NULL", __func__); +#else + log(LOG_ERR, "%s: Avoid an infinite " + "loop: INP_TIMEWAIT && (INP_FREED " + "|| inp last reference) && tw != " + "NULL", __func__); +#endif + INP_INFO_RUNLOCK(&V_tcbinfo); + break; + } } if (tw == NULL) { From owner-svn-src-head@freebsd.org Sun Oct 1 21:58:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0590E2F907; Sun, 1 Oct 2017 21:58:09 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A8A6708CA; Sun, 1 Oct 2017 21:58:08 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([78.53.138.91]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MSMw7-1dsMR12j3D-00TSsf; Sun, 01 Oct 2017 23:58:00 +0200 Date: Sun, 1 Oct 2017 23:57:48 +0200 From: "O. Hartmann" To: Andriy Gapon Cc: "O. Hartmann" , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r324178 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua Message-ID: <20171001235748.611c8376@thor.intern.walstatt.dynvpn.de> In-Reply-To: <3a9a611f-677e-a4b7-897b-c05bebd776cc@FreeBSD.org> References: <201710012012.v91KCUvU024559@repo.freebsd.org> <20171001223707.574cde55@thor.intern.walstatt.dynvpn.de> <3a9a611f-677e-a4b7-897b-c05bebd776cc@FreeBSD.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/Mloa73tViw6kghOlNQZC7f+"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:bWvc79uBv/tPHewo/bOmJ+Eqaa/JexAUEvVtao0D01nLn9p9skb fQfQx5ICHBykBWxmgPhtc7SCUba5glPtvyAuo//kOxa4to8vc3djEtx2lAqRrGDrlq9l+Jz QyRmp54rNMvAe9hWoF/vNngS4ty6W6ETrBLkgHctEcerKHixX2Bm44ITohMvqx6YD2DES4o QOE3kFPyjFuHsad1ikFaA== X-UI-Out-Filterresults: notjunk:1;V01:K0:EhqA7REQDIM=:2VsqnWENVKnXA4QaA7LQt0 AKnmZFj90OX3xs68j3WT3M02DGvXegvtV3Doc+Ym4EwkNo08QkZuUl5G+hjSO+2WldN873f4h 8OI2z3IrjH4AF7lZnTOaAVDvCyUVC0sfsn33ksqcxTO/MWT+XXSFLL5sryxGDPDaOHVqv/Q0i J+eGm77nLU5VXveTyFoa5CpEUyw9uXns+NvoE6ZZ5oynJc6dkBoDh13zh75WDjjTSiDoq7Hlf HJw3e0K76opbDOPQvr0o8AvMYbpQlVubrRzEINNSzb/2CIOmE6YBZBRsrskNcqfvMhrZOSkbN mqvogf0mSXAcbjxooHhux6qRXj7YBvVjHmky67BeZx5YnIwHqGCQoKsshm4Pu0yCb9bPONDQ8 xkvquvIB+MXABGOvcoy37EOD7fnr36gm1ONDvJ3oJw9o/k8YErnz4scm54/OL9Ep9OYlsSTul Roe9B7edTZ8rYn6pbYF5n2DPPyKcb10uRCFsz836zs5QZDmObBF1LsB+KVpfGsphnQls6absE Tt7ZzvJP/hjn6MGsPuMxMZR1kuFAsW1Yjj0Zq6qmHoFRfIbkZ2eUOYsBsm4GWZpTpuTNYrVW3 VxVSRJTepI1rqUYu2YItr7fAEkz6XxYeWlafV70QK0mpjYjlqKBsmebqSjkiTwv/0rUIkdBbW V0hecKLGy+2y0ksudGHxvt1ytlnx83csAEq4zhXx8Ze0XYYVN5qXklbnsje0V2zWDtKumqXQE l+8MTp4Ss+KDPm/Le/ide0Qi+kcWtWi53E1y3Um8z7ZJaKsuntnJL09x+6KmwiXEfOY7Q9SJu SCdDbnKrQzXfhXXknhXVwV1wSOXPw== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 21:58:09 -0000 --Sig_/Mloa73tViw6kghOlNQZC7f+ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Mon, 2 Oct 2017 00:03:35 +0300 Andriy Gapon schrieb: > On 01/10/2017 23:37, O. Hartmann wrote: > > The build of world fails for me with the error shown below: > >=20 > >=20 > > [...] > > Building /usr/obj/usr/src/cddl/lib/libzpool/lapi.o > > --- lstrlib.o --- > > /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c:1= 14:12: warning: > > implicitly declaring library function 'tolower' with type 'int > > (int)' [-Wimplicit-function-declaration] p[i] =3D tolower(uchar(s[i]));= ^ > > /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c:1= 14:12: note: > > include the header or explicitly provide a declaration for > > 'tolower' /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/l= strlib.c:127:12: > > warning: implicitly declaring library function 'toupper' with type 'int > > (int)' [-Wimplicit-function-declaration] p[i] =3D toupper(uchar(s[i]));= =20 >=20 > I also see this _warning_, but the build does not fail for me in this pla= ce. >=20 Oh, very sorry, I took the wrong terminal, the error occurs in the uefi cha= nges: [...] Building /usr/obj/usr/src/lib/libefivar/efivar.o --- efivar.o --- In file included from /usr/src/lib/libefivar/efivar.c:30: In file included from /usr/src/lib/libefivar/efivar.h:33: In file included from /usr/obj/usr/src/tmp/usr/include/sys/efi.h:33: /usr/obj/usr/src/tmp/usr/include/machine/efi.h:35:10: fatal error: 'isa/rtc= .h' file not found #include ^~~~~~~~~~~ Regards, Oliver --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/Mloa73tViw6kghOlNQZC7f+ Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWdFk3AAKCRDS528fyFhY lE48AgCU33SuTxHFLwrUQuleNGbJ8RxHJmi55Kmkd91/eJo5vSYlgb8SvZW06RKf L8aST9VC7eIO0qTiLQv3hahJdboIAgCZyP+qI31pIyuzKnrnWVBY2Pp0Y2kgJydT iR5WyDAL76GFSx+qm9RVyDpo9PonPhfdcE8661C/EDnF0djYWNs6 =tI+U -----END PGP SIGNATURE----- --Sig_/Mloa73tViw6kghOlNQZC7f+-- From owner-svn-src-head@freebsd.org Sun Oct 1 23:37:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D76DE31079; Sun, 1 Oct 2017 23:37:19 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEA4C72CAE; Sun, 1 Oct 2017 23:37:18 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v91NbI8G007550; Sun, 1 Oct 2017 23:37:18 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v91NbItG007549; Sun, 1 Oct 2017 23:37:18 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201710012337.v91NbItG007549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Sun, 1 Oct 2017 23:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324181 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 324181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 23:37:19 -0000 Author: pkelsey Date: Sun Oct 1 23:37:17 2017 New Revision: 324181 URL: https://svnweb.freebsd.org/changeset/base/324181 Log: The soisconnected() call removed from syncache_socket() in r307966 was not extraneous in the TCP Fast Open (TFO) passive-open case. In the TFO passive-open case, syncache_socket() is being called during processing of a TFO SYN bearing a valid cookie, and a call to soisconnected() is required in order to allow the application to immediately consume any data delivered in the SYN and to have a chance to generate response data to accompany the SYN-ACK. The removal of this call to soisconnected() effectively converted all TFO passive opens to having the same RTT cost as a standard 3WHS. This commit adds a call to soisconnected() to syncache_tfo_expand() so that it is only in the TFO passive-open path, thereby restoring TFO passve-open RTT performance and preserving the non-TFO connection-rate performance gains realized by r307966. MFC after: 1 week Sponsored by: Limelight Networks Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sun Oct 1 21:45:15 2017 (r324180) +++ head/sys/netinet/tcp_syncache.c Sun Oct 1 23:37:17 2017 (r324181) @@ -1195,6 +1195,7 @@ syncache_tfo_expand(struct syncache *sc, struct socket TCPSTAT_INC(tcps_sc_aborted); atomic_subtract_int(pending_counter, 1); } else { + soisconnected(*lsop); inp = sotoinpcb(*lsop); tp = intotcpcb(inp); tp->t_flags |= TF_FASTOPEN; From owner-svn-src-head@freebsd.org Mon Oct 2 00:49:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8575CE32622; Mon, 2 Oct 2017 00:49:35 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 511CB748AA; Mon, 2 Oct 2017 00:49:35 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v920nYgt036436; Mon, 2 Oct 2017 00:49:34 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v920nYtW036432; Mon, 2 Oct 2017 00:49:34 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201710020049.v920nYtW036432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 2 Oct 2017 00:49:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324184 - in head/sys: arm/broadcom/bcm2835 boot/fdt/dts/arm dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: arm/broadcom/bcm2835 boot/fdt/dts/arm dev/usb/net X-SVN-Commit-Revision: 324184 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 00:49:35 -0000 Author: ian Date: Mon Oct 2 00:49:33 2017 New Revision: 324184 URL: https://svnweb.freebsd.org/changeset/base/324184 Log: Allow Raspberry Pi platform and drivers to be configured with upstream DTBs. - Added more compatibility strings to drivers not yet converted - Added new RPI platform code compatibility string to match the ones used upstream - Adapted RPI and RPI2 DTS to match the new platform code compatibility string The goal is to use the upstream DTBs as a replacement for our custom one. This is now possible with these changes. Additionally, as the RPI firmware automatically chooses the right DTB for us, this would allow to have one common armv6 kernel for RPI0 and RPI1 (BCM2835-based), and one common armv7 kernel for RPI2 v1.1 (BCM2836-based), and RPI2 v1.2 / RPI3 (BCM2837-based). Submitted by: Sylvain Garrigues Differential Revision: https://reviews.freebsd.org/D12360 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c head/sys/arm/broadcom/bcm2835/bcm2835_rng.c head/sys/boot/fdt/dts/arm/rpi2.dts head/sys/dev/usb/net/if_smsc.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Mon Oct 2 00:08:58 2017 (r324183) +++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Mon Oct 2 00:49:33 2017 (r324184) @@ -133,7 +133,8 @@ static platform_method_t bcm2835_methods[] = { PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(bcm2835, "bcm2835", 0, "raspberrypi,model-b", 100); +FDT_PLATFORM_DEF2(bcm2835, bcm2835_legacy, "bcm2835 (legacy)", 0, "raspberrypi,model-b", 100); +FDT_PLATFORM_DEF2(bcm2835, bcm2835, "bcm2835", 0, "brcm,bcm2835", 100); #endif #ifdef SOC_BCM2836 @@ -149,5 +150,6 @@ static platform_method_t bcm2836_methods[] = { PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(bcm2836, "bcm2836", 0, "brcm,bcm2709", 100); +FDT_PLATFORM_DEF2(bcm2836, bcm2836_legacy, "bcm2836 (legacy)", 0, "brcm,bcm2709", 100); +FDT_PLATFORM_DEF2(bcm2836, bcm2836, "bcm2836", 0, "brcm,bcm2836", 100); #endif Modified: head/sys/arm/broadcom/bcm2835/bcm2835_rng.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_rng.c Mon Oct 2 00:08:58 2017 (r324183) +++ head/sys/arm/broadcom/bcm2835/bcm2835_rng.c Mon Oct 2 00:49:33 2017 (r324184) @@ -109,6 +109,12 @@ struct bcm2835_rng_softc { long sc_underrun; }; +static struct ofw_compat_data compat_data[] = { + {"broadcom,bcm2835-rng", 1}, + {"brcm,bcm2835-rng", 1}, + {NULL, 0} +}; + static __inline void bcm2835_rng_stat_inc_underrun(struct bcm2835_rng_softc *sc) { @@ -364,7 +370,7 @@ bcm2835_rng_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-rng")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "Broadcom BCM2835 RNG"); Modified: head/sys/boot/fdt/dts/arm/rpi2.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/rpi2.dts Mon Oct 2 00:08:58 2017 (r324183) +++ head/sys/boot/fdt/dts/arm/rpi2.dts Mon Oct 2 00:49:33 2017 (r324184) @@ -30,7 +30,7 @@ / { model = "Raspberry Pi 2 Model B"; - compatible = "brcm,bcm2709"; + compatible = "brcm,bcm2836"; memreserve = <0x08000000 0x08000000>; /* Set by VideoCore */ Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Mon Oct 2 00:08:58 2017 (r324183) +++ head/sys/dev/usb/net/if_smsc.c Mon Oct 2 00:49:33 2017 (r324184) @@ -1568,8 +1568,9 @@ smsc_fdt_find_eth_node(phandle_t start) /* Traverse through entire tree to find usb ethernet nodes. */ for (node = OF_child(start); node != 0; node = OF_peer(node)) { - if (ofw_bus_node_is_compatible(node, "net,ethernet") && - ofw_bus_node_is_compatible(node, "usb,device")) + if ((ofw_bus_node_is_compatible(node, "net,ethernet") && + ofw_bus_node_is_compatible(node, "usb,device")) || + ofw_bus_node_is_compatible(node, "usb424,ec00")) return (node); child = smsc_fdt_find_eth_node(node); if (child != -1) From owner-svn-src-head@freebsd.org Mon Oct 2 01:03:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37676E32B18; Mon, 2 Oct 2017 01:03:20 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA1E7750F3; Mon, 2 Oct 2017 01:03:19 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9213I3n044285; Mon, 2 Oct 2017 01:03:18 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9213IYu044283; Mon, 2 Oct 2017 01:03:18 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201710020103.v9213IYu044283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 2 Oct 2017 01:03:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324185 - head/sys/arm/ti X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/ti X-SVN-Commit-Revision: 324185 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 01:03:20 -0000 Author: ian Date: Mon Oct 2 01:03:18 2017 New Revision: 324185 URL: https://svnweb.freebsd.org/changeset/base/324185 Log: Enhance the interrupt capabilities of ti_pruss driver. The existing ti_pruss driver for the PRUSS Hardware provided by the AM335x ARM CPU has basic interrupt capabilities. This updated driver provides some more options: - Sysctl based configuration for the interrupts (for some examples, see the test plan in the phabricator review cited below). - A device file (/dev/pruss0.irqN) for each enabled interrupt. This file can be read and the device blocks if no irq has happened or returns an uint64_t timestamp based on nanouptime(). - Each interrupt device file provides kqueue-based event notification, blocking read(), or select(). Submitted by: Manuel Stuhn Differential Revision: https://reviews.freebsd.org/D11959 Modified: head/sys/arm/ti/ti_pruss.c head/sys/arm/ti/ti_pruss.h Modified: head/sys/arm/ti/ti_pruss.c ============================================================================== --- head/sys/arm/ti/ti_pruss.c Mon Oct 2 00:49:33 2017 (r324184) +++ head/sys/arm/ti/ti_pruss.c Mon Oct 2 01:03:18 2017 (r324185) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2013 Rui Paulo + * Copyright (c) 2017 Manuel Stuehn * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,27 +27,32 @@ #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 @@ -59,27 +65,72 @@ __FBSDID("$FreeBSD$"); #define DPRINTF(fmt, ...) #endif +static d_open_t ti_pruss_irq_open; +static d_read_t ti_pruss_irq_read; +static d_poll_t ti_pruss_irq_poll; + static device_probe_t ti_pruss_probe; static device_attach_t ti_pruss_attach; static device_detach_t ti_pruss_detach; static void ti_pruss_intr(void *); static d_open_t ti_pruss_open; static d_mmap_t ti_pruss_mmap; -static void ti_pruss_kq_read_detach(struct knote *); -static int ti_pruss_kq_read_event(struct knote *, long); -static d_kqfilter_t ti_pruss_kqfilter; +static void ti_pruss_irq_kqread_detach(struct knote *); +static int ti_pruss_irq_kqevent(struct knote *, long); +static d_kqfilter_t ti_pruss_irq_kqfilter; +static void ti_pruss_privdtor(void *data); -#define TI_PRUSS_IRQS 8 +#define TI_PRUSS_PRU_IRQS 2 +#define TI_PRUSS_HOST_IRQS 8 +#define TI_PRUSS_IRQS (TI_PRUSS_HOST_IRQS+TI_PRUSS_PRU_IRQS) +#define TI_PRUSS_EVENTS 64 +#define NOT_SET_STR "NONE" +#define TI_TS_ARRAY 16 +struct ctl +{ + size_t cnt; + size_t idx; +}; + +struct ts_ring_buf +{ + struct ctl ctl; + uint64_t ts[TI_TS_ARRAY]; +}; + +struct ti_pruss_irqsc +{ + struct mtx sc_mtx; + struct cdev *sc_pdev; + struct selinfo sc_selinfo; + int8_t channel; + int8_t last; + int8_t event; + bool enable; + struct ts_ring_buf tstamps; +}; + +static struct cdevsw ti_pruss_cdevirq = { + .d_version = D_VERSION, + .d_name = "ti_pruss_irq", + .d_open = ti_pruss_irq_open, + .d_read = ti_pruss_irq_read, + .d_poll = ti_pruss_irq_poll, + .d_kqfilter = ti_pruss_irq_kqfilter, +}; + struct ti_pruss_softc { struct mtx sc_mtx; struct resource *sc_mem_res; - struct resource *sc_irq_res[TI_PRUSS_IRQS]; - void *sc_intr[TI_PRUSS_IRQS]; + struct resource *sc_irq_res[TI_PRUSS_HOST_IRQS]; + void *sc_intr[TI_PRUSS_HOST_IRQS]; + struct ti_pruss_irqsc sc_irq_devs[TI_PRUSS_IRQS]; bus_space_tag_t sc_bt; bus_space_handle_t sc_bh; struct cdev *sc_pdev; struct selinfo sc_selinfo; + bool sc_glob_irqen; }; static struct cdevsw ti_pruss_cdevsw = { @@ -87,7 +138,6 @@ static struct cdevsw ti_pruss_cdevsw = { .d_name = "ti_pruss", .d_open = ti_pruss_open, .d_mmap = ti_pruss_mmap, - .d_kqfilter = ti_pruss_kqfilter, }; static device_method_t ti_pruss_methods[] = { @@ -107,6 +157,7 @@ static driver_t ti_pruss_driver = { static devclass_t ti_pruss_devclass; DRIVER_MODULE(ti_pruss, simplebus, ti_pruss_driver, ti_pruss_devclass, 0, 0); +MODULE_DEPEND(ti_pruss, ti_prcm, 1, 1, 1); static struct resource_spec ti_pruss_irq_spec[] = { { SYS_RES_IRQ, 0, RF_ACTIVE }, @@ -119,8 +170,112 @@ static struct resource_spec ti_pruss_irq_spec[] = { { SYS_RES_IRQ, 7, RF_ACTIVE }, { -1, 0, 0 } }; -CTASSERT(TI_PRUSS_IRQS == nitems(ti_pruss_irq_spec) - 1); +CTASSERT(TI_PRUSS_HOST_IRQS == nitems(ti_pruss_irq_spec) - 1); +static int +ti_pruss_irq_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +{ + struct ctl* irqs; + struct ti_pruss_irqsc *sc; + sc = dev->si_drv1; + + irqs = malloc(sizeof(struct ctl), M_DEVBUF, M_WAITOK); + if (!irqs) + return (ENOMEM); + + irqs->cnt = sc->tstamps.ctl.cnt; + irqs->idx = sc->tstamps.ctl.idx; + + return devfs_set_cdevpriv(irqs, ti_pruss_privdtor); +} + +static void +ti_pruss_privdtor(void *data) +{ + free(data, M_DEVBUF); +} + +static int +ti_pruss_irq_poll(struct cdev *dev, int events, struct thread *td) +{ + struct ctl* irqs; + struct ti_pruss_irqsc *sc; + sc = dev->si_drv1; + + devfs_get_cdevpriv((void**)&irqs); + + if (events & (POLLIN | POLLRDNORM)) { + if (sc->tstamps.ctl.cnt != irqs->cnt) + return events & (POLLIN | POLLRDNORM); + else + selrecord(td, &sc->sc_selinfo); + } + return 0; +} + +static int +ti_pruss_irq_read(struct cdev *cdev, struct uio *uio, int ioflag) +{ + const size_t ts_len = sizeof(uint64_t); + struct ti_pruss_irqsc* irq; + struct ctl* priv; + int error = 0; + size_t idx; + ssize_t level; + + irq = cdev->si_drv1; + + if (uio->uio_resid < ts_len) + return (EINVAL); + + error = devfs_get_cdevpriv((void**)&priv); + if (error) + return (error); + + mtx_lock(&irq->sc_mtx); + + if (irq->tstamps.ctl.cnt - priv->cnt > TI_TS_ARRAY) + { + priv->cnt = irq->tstamps.ctl.cnt; + priv->idx = irq->tstamps.ctl.idx; + mtx_unlock(&irq->sc_mtx); + return (ENXIO); + } + + do { + idx = priv->idx; + level = irq->tstamps.ctl.idx - idx; + if (level < 0) + level += TI_TS_ARRAY; + + if (level == 0) { + if (ioflag & O_NONBLOCK) { + mtx_unlock(&irq->sc_mtx); + return (EWOULDBLOCK); + } + + error = msleep(irq, &irq->sc_mtx, PCATCH | PDROP, + "pruirq", 0); + if (error) + return error; + + mtx_lock(&irq->sc_mtx); + } + }while(level == 0); + + mtx_unlock(&irq->sc_mtx); + + error = uiomove(&irq->tstamps.ts[idx], ts_len, uio); + + if (++idx == TI_TS_ARRAY) + idx = 0; + priv->idx = idx; + + atomic_add_32(&priv->cnt, 1); + + return (error); +} + static struct ti_pruss_irq_arg { int irq; struct ti_pruss_softc *sc; @@ -138,7 +293,205 @@ ti_pruss_reg_write(struct ti_pruss_softc *sc, uint32_t bus_space_write_4(sc->sc_bt, sc->sc_bh, reg, val); } +static __inline void +ti_pruss_interrupts_clear(struct ti_pruss_softc *sc) +{ + /* disable global interrupt */ + ti_pruss_reg_write(sc, PRUSS_INTC_GER, 0 ); + + /* clear all events */ + ti_pruss_reg_write(sc, PRUSS_INTC_SECR0, 0xFFFFFFFF); + ti_pruss_reg_write(sc, PRUSS_INTC_SECR1, 0xFFFFFFFF); + + /* disable all host interrupts */ + ti_pruss_reg_write(sc, PRUSS_INTC_HIER, 0); +} + +static __inline int +ti_pruss_interrupts_enable(struct ti_pruss_softc *sc, int8_t irq, bool enable) +{ + if (enable && ((sc->sc_irq_devs[irq].channel == -1) || + (sc->sc_irq_devs[irq].event== -1))) + { + device_printf( sc->sc_pdev->si_drv1, + "Interrupt chain not fully configured, not possible to enable\n" ); + return (EINVAL); + } + + sc->sc_irq_devs[irq].enable = enable; + + if (sc->sc_irq_devs[irq].sc_pdev) { + destroy_dev(sc->sc_irq_devs[irq].sc_pdev); + sc->sc_irq_devs[irq].sc_pdev = NULL; + } + + if (enable) { + sc->sc_irq_devs[irq].sc_pdev = make_dev(&ti_pruss_cdevirq, 0, UID_ROOT, GID_WHEEL, + 0600, "pruss%d.irq%d", device_get_unit(sc->sc_pdev->si_drv1), irq); + sc->sc_irq_devs[irq].sc_pdev->si_drv1 = &sc->sc_irq_devs[irq]; + + sc->sc_irq_devs[irq].tstamps.ctl.idx = 0; + } + + uint32_t reg = enable ? PRUSS_INTC_HIEISR : PRUSS_INTC_HIDISR; + ti_pruss_reg_write(sc, reg, sc->sc_irq_devs[irq].channel); + + reg = enable ? PRUSS_INTC_EISR : PRUSS_INTC_EICR; + ti_pruss_reg_write(sc, reg, sc->sc_irq_devs[irq].event ); + + return (0); +} + +static __inline void +ti_pruss_map_write(struct ti_pruss_softc *sc, uint32_t basereg, uint8_t index, uint8_t content) +{ + const size_t regadr = basereg + index & ~0x03; + const size_t bitpos = (index & 0x03) * 8; + uint32_t rmw = ti_pruss_reg_read(sc, regadr); + rmw = (rmw & ~( 0xF << bitpos)) | ( (content & 0xF) << bitpos); + ti_pruss_reg_write(sc, regadr, rmw); +} + static int +ti_pruss_event_map( SYSCTL_HANDLER_ARGS ) +{ + struct ti_pruss_softc *sc; + const int8_t irq = arg2; + int err; + char event[sizeof(NOT_SET_STR)]; + + sc = arg1; + + if(sc->sc_irq_devs[irq].event == -1) + bcopy(NOT_SET_STR, event, sizeof(event)); + else + snprintf(event, sizeof(event), "%d", sc->sc_irq_devs[irq].event); + + err = sysctl_handle_string(oidp, event, sizeof(event), req); + if(err != 0) + return (err); + + if (req->newptr) { // write event + if (strcmp(NOT_SET_STR, event) == 0) { + ti_pruss_interrupts_enable(sc, irq, false); + sc->sc_irq_devs[irq].event = -1; + } else { + if (sc->sc_irq_devs[irq].channel == -1) { + device_printf( sc->sc_pdev->si_drv1, + "corresponding channel not configured\n"); + return (ENXIO); + } + + const int8_t channelnr = sc->sc_irq_devs[irq].channel; + const int8_t eventnr = strtol( event, NULL, 10 ); // TODO: check if strol is valid + if (eventnr > TI_PRUSS_EVENTS || eventnr < 0) { + device_printf( sc->sc_pdev->si_drv1, + "Event number %d not valid (0 - %d)", + channelnr, TI_PRUSS_EVENTS -1); + return (EINVAL); + } + + sc->sc_irq_devs[irq].channel = channelnr; + sc->sc_irq_devs[irq].event = eventnr; + + // event[nr] <= channel + ti_pruss_map_write(sc, PRUSS_INTC_CMR_BASE, + eventnr, channelnr); + } + } + return (err); +} + +static int +ti_pruss_channel_map(SYSCTL_HANDLER_ARGS) +{ + struct ti_pruss_softc *sc; + int err; + char channel[sizeof(NOT_SET_STR)]; + const int8_t irq = arg2; + + sc = arg1; + + if (sc->sc_irq_devs[irq].channel == -1) + bcopy(NOT_SET_STR, channel, sizeof(channel)); + else + snprintf(channel, sizeof(channel), "%d", sc->sc_irq_devs[irq].channel); + + err = sysctl_handle_string(oidp, channel, sizeof(channel), req); + if (err != 0) + return (err); + + if (req->newptr) { // write event + if (strcmp(NOT_SET_STR, channel) == 0) { + ti_pruss_interrupts_enable(sc, irq, false); + ti_pruss_reg_write(sc, PRUSS_INTC_HIDISR, + sc->sc_irq_devs[irq].channel); + sc->sc_irq_devs[irq].channel = -1; + } else { + const int8_t channelnr = strtol(channel, NULL, 10); // TODO: check if strol is valid + if (channelnr > TI_PRUSS_IRQS || channelnr < 0) + { + device_printf(sc->sc_pdev->si_drv1, + "Channel number %d not valid (0 - %d)", + channelnr, TI_PRUSS_IRQS-1); + return (EINVAL); + } + + sc->sc_irq_devs[irq].channel = channelnr; + sc->sc_irq_devs[irq].last = -1; + + // channel[nr] <= irqnr + ti_pruss_map_write(sc, PRUSS_INTC_HMR_BASE, + irq, channelnr); + } + } + + return (err); +} + +static int +ti_pruss_interrupt_enable(SYSCTL_HANDLER_ARGS) +{ + struct ti_pruss_softc *sc; + int err; + bool irqenable; + const int8_t irq = arg2; + + sc = arg1; + irqenable = sc->sc_irq_devs[arg2].enable; + + err = sysctl_handle_bool(oidp, &irqenable, arg2, req); + if (err != 0) + return (err); + + if (req->newptr) // write enable + return ti_pruss_interrupts_enable(sc, irq, irqenable); + + return (err); +} + +static int +ti_pruss_global_interrupt_enable(SYSCTL_HANDLER_ARGS) +{ + struct ti_pruss_softc *sc; + int err; + bool glob_irqen; + + sc = arg1; + glob_irqen = sc->sc_glob_irqen; + + err = sysctl_handle_bool(oidp, &glob_irqen, arg2, req); + if (err != 0) + return (err); + + if (req->newptr) { + sc->sc_glob_irqen = glob_irqen; + ti_pruss_reg_write(sc, PRUSS_INTC_GER, glob_irqen); + } + + return (err); +} +static int ti_pruss_probe(device_t dev) { @@ -167,13 +520,31 @@ ti_pruss_attach(device_t dev) sc = device_get_softc(dev); rid = 0; mtx_init(&sc->sc_mtx, "TI PRUSS", NULL, MTX_DEF); - knlist_init_mtx(&sc->sc_selinfo.si_note, &sc->sc_mtx); sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->sc_mem_res == NULL) { device_printf(dev, "could not allocate memory resource\n"); return (ENXIO); } + + struct sysctl_ctx_list *clist = device_get_sysctl_ctx(dev); + if (!clist) + return (EINVAL); + + struct sysctl_oid *poid; + poid = device_get_sysctl_tree( dev ); + if (!poid) + return (EINVAL); + + sc->sc_glob_irqen = false; + struct sysctl_oid *irq_root = SYSCTL_ADD_NODE(clist, SYSCTL_CHILDREN(poid), + OID_AUTO, "irq", CTLFLAG_RD, 0, + "PRUSS Host Interrupts"); + SYSCTL_ADD_PROC(clist, SYSCTL_CHILDREN(poid), OID_AUTO, + "global_interrupt_enable", CTLFLAG_RW | CTLTYPE_U8, + sc, 0, ti_pruss_global_interrupt_enable, + "CU", "Global interrupt enable"); + sc->sc_bt = rman_get_bustag(sc->sc_mem_res); sc->sc_bh = rman_get_bushandle(sc->sc_mem_res); if (bus_alloc_resources(dev, ti_pruss_irq_spec, sc->sc_irq_res) != 0) { @@ -181,48 +552,91 @@ ti_pruss_attach(device_t dev) ti_pruss_detach(dev); return (ENXIO); } + + ti_pruss_interrupts_clear(sc); + for (i = 0; i < TI_PRUSS_IRQS; i++) { - ti_pruss_irq_args[i].irq = i; - ti_pruss_irq_args[i].sc = sc; - if (bus_setup_intr(dev, sc->sc_irq_res[i], - INTR_MPSAFE | INTR_TYPE_MISC, - NULL, ti_pruss_intr, &ti_pruss_irq_args[i], - &sc->sc_intr[i]) != 0) { - device_printf(dev, - "unable to setup the interrupt handler\n"); - ti_pruss_detach(dev); - return (ENXIO); + char name[8]; + snprintf(name, sizeof(name), "%d", i); + + struct sysctl_oid *irq_nodes = SYSCTL_ADD_NODE(clist, SYSCTL_CHILDREN(irq_root), + OID_AUTO, name, CTLFLAG_RD, 0, + "PRUSS Interrupts"); + SYSCTL_ADD_PROC(clist, SYSCTL_CHILDREN(irq_nodes), OID_AUTO, + "channel", CTLFLAG_RW | CTLTYPE_STRING, sc, i, ti_pruss_channel_map, + "A", "Channel attached to this irq"); + SYSCTL_ADD_PROC(clist, SYSCTL_CHILDREN(irq_nodes), OID_AUTO, + "event", CTLFLAG_RW | CTLTYPE_STRING, sc, i, ti_pruss_event_map, + "A", "Event attached to this irq"); + SYSCTL_ADD_PROC(clist, SYSCTL_CHILDREN(irq_nodes), OID_AUTO, + "enable", CTLFLAG_RW | CTLTYPE_U8, sc, i, ti_pruss_interrupt_enable, + "CU", "Enable/Disable interrupt"); + + sc->sc_irq_devs[i].event = -1; + sc->sc_irq_devs[i].channel = -1; + sc->sc_irq_devs[i].tstamps.ctl.idx = 0; + + if (i < TI_PRUSS_HOST_IRQS) { + ti_pruss_irq_args[i].irq = i; + ti_pruss_irq_args[i].sc = sc; + if (bus_setup_intr(dev, sc->sc_irq_res[i], + INTR_MPSAFE | INTR_TYPE_MISC, + NULL, ti_pruss_intr, &ti_pruss_irq_args[i], + &sc->sc_intr[i]) != 0) { + device_printf(dev, + "unable to setup the interrupt handler\n"); + ti_pruss_detach(dev); + + return (ENXIO); + } + mtx_init(&sc->sc_irq_devs[i].sc_mtx, "TI PRUSS IRQ", NULL, MTX_DEF); + knlist_init_mtx(&sc->sc_irq_devs[i].sc_selinfo.si_note, &sc->sc_irq_devs[i].sc_mtx); } } - if (ti_pruss_reg_read(sc, PRUSS_AM18XX_INTC) == PRUSS_AM18XX_REV) - device_printf(dev, "AM18xx PRU-ICSS\n"); - else if (ti_pruss_reg_read(sc, PRUSS_AM33XX_INTC) == PRUSS_AM33XX_REV) + + if (ti_pruss_reg_read(sc, PRUSS_AM33XX_INTC) == PRUSS_AM33XX_REV) device_printf(dev, "AM33xx PRU-ICSS\n"); sc->sc_pdev = make_dev(&ti_pruss_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "pruss%d", device_get_unit(dev)); sc->sc_pdev->si_drv1 = dev; + /* Acc. to datasheet always write 1 to polarity registers */ + ti_pruss_reg_write(sc, PRUSS_INTC_SIPR0, 0xFFFFFFFF); + ti_pruss_reg_write(sc, PRUSS_INTC_SIPR1, 0xFFFFFFFF); + + /* Acc. to datasheet always write 0 to event type registers */ + ti_pruss_reg_write(sc, PRUSS_INTC_SITR0, 0); + ti_pruss_reg_write(sc, PRUSS_INTC_SITR1, 0); + return (0); } static int ti_pruss_detach(device_t dev) { - struct ti_pruss_softc *sc; - int i; + struct ti_pruss_softc *sc = device_get_softc(dev); - sc = device_get_softc(dev); - for (i = 0; i < TI_PRUSS_IRQS; i++) { + ti_pruss_interrupts_clear(sc); + + for (int i = 0; i < TI_PRUSS_HOST_IRQS; i++) { + ti_pruss_interrupts_enable( sc, i, false ); + if (sc->sc_intr[i]) bus_teardown_intr(dev, sc->sc_irq_res[i], sc->sc_intr[i]); if (sc->sc_irq_res[i]) bus_release_resource(dev, SYS_RES_IRQ, rman_get_rid(sc->sc_irq_res[i]), sc->sc_irq_res[i]); + knlist_clear(&sc->sc_irq_devs[i].sc_selinfo.si_note, 0); + mtx_lock(&sc->sc_irq_devs[i].sc_mtx); + if (!knlist_empty(&sc->sc_irq_devs[i].sc_selinfo.si_note)) + printf("IRQ %d KQueue not empty!\n", i ); + mtx_unlock(&sc->sc_irq_devs[i].sc_mtx); + knlist_destroy(&sc->sc_irq_devs[i].sc_selinfo.si_note); + mtx_destroy(&sc->sc_irq_devs[i].sc_mtx); } - knlist_clear(&sc->sc_selinfo.si_note, 0); - knlist_destroy(&sc->sc_selinfo.si_note); + mtx_destroy(&sc->sc_mtx); if (sc->sc_mem_res) bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(sc->sc_mem_res), @@ -240,19 +654,38 @@ ti_pruss_intr(void *arg) struct ti_pruss_irq_arg *iap = arg; struct ti_pruss_softc *sc = iap->sc; /* - * Interrupts pr1_host_intr[0:7] are mapped to + * Interrupts pr1_host_intr[0:7] are mapped to * Host-2 to Host-9 of PRU-ICSS IRQ-controller. */ - const int pru_int = iap->irq + 2; + const int pru_int = iap->irq + TI_PRUSS_PRU_IRQS; const int pru_int_mask = (1 << pru_int); + const int pru_channel = sc->sc_irq_devs[pru_int].channel; + const int pru_event = sc->sc_irq_devs[pru_channel].event; - val = ti_pruss_reg_read(sc, PRUSS_AM33XX_INTC + PRUSS_INTC_HIER); - DPRINTF("interrupt %p, %d", sc, pru_int); + val = ti_pruss_reg_read(sc, PRUSS_INTC_HIER); if (!(val & pru_int_mask)) return; - ti_pruss_reg_write(sc, PRUSS_AM33XX_INTC + PRUSS_INTC_HIDISR, - pru_int); - KNOTE_UNLOCKED(&sc->sc_selinfo.si_note, pru_int); + + ti_pruss_reg_write(sc, PRUSS_INTC_HIDISR, pru_int); + ti_pruss_reg_write(sc, PRUSS_INTC_SICR, pru_event); + ti_pruss_reg_write(sc, PRUSS_INTC_HIEISR, pru_int); + + struct ti_pruss_irqsc* irq = &sc->sc_irq_devs[pru_channel]; + size_t wr = irq->tstamps.ctl.idx; + + struct timespec ts; + nanouptime(&ts); + irq->tstamps.ts[wr] = ts.tv_sec * 1000000000 + ts.tv_nsec; + + if (++wr == TI_TS_ARRAY) + wr = 0; + atomic_add_32(&irq->tstamps.ctl.cnt, 1); + + irq->tstamps.ctl.idx = wr; + + KNOTE_UNLOCKED(&irq->sc_selinfo.si_note, pru_int); + wakeup(irq); + selwakeup(&irq->sc_selinfo); } static int @@ -270,7 +703,7 @@ ti_pruss_mmap(struct cdev *cdev, vm_ooffset_t offset, struct ti_pruss_softc *sc = device_get_softc(dev); if (offset > rman_get_size(sc->sc_mem_res)) - return (-1); + return (ENOSPC); *paddr = rman_get_start(sc->sc_mem_res) + offset; *memattr = VM_MEMATTR_UNCACHEABLE; @@ -279,31 +712,43 @@ ti_pruss_mmap(struct cdev *cdev, vm_ooffset_t offset, static struct filterops ti_pruss_kq_read = { .f_isfd = 1, - .f_detach = ti_pruss_kq_read_detach, - .f_event = ti_pruss_kq_read_event, + .f_detach = ti_pruss_irq_kqread_detach, + .f_event = ti_pruss_irq_kqevent, }; static void -ti_pruss_kq_read_detach(struct knote *kn) +ti_pruss_irq_kqread_detach(struct knote *kn) { - struct ti_pruss_softc *sc = kn->kn_hook; + struct ti_pruss_irqsc *sc = kn->kn_hook; knlist_remove(&sc->sc_selinfo.si_note, kn, 0); } static int -ti_pruss_kq_read_event(struct knote *kn, long hint) +ti_pruss_irq_kqevent(struct knote *kn, long hint) { - kn->kn_data = hint; + struct ti_pruss_irqsc* irq_sc; + int notify; - return (hint); + irq_sc = kn->kn_hook; + + if (hint > 0) + kn->kn_data = hint - 2; + + if (hint > 0 || irq_sc->last > 0) + notify = 1; + else + notify = 0; + + irq_sc->last = hint; + + return (notify); } static int -ti_pruss_kqfilter(struct cdev *cdev, struct knote *kn) +ti_pruss_irq_kqfilter(struct cdev *cdev, struct knote *kn) { - device_t dev = cdev->si_drv1; - struct ti_pruss_softc *sc = device_get_softc(dev); + struct ti_pruss_irqsc *sc = cdev->si_drv1; switch (kn->kn_filter) { case EVFILT_READ: Modified: head/sys/arm/ti/ti_pruss.h ============================================================================== --- head/sys/arm/ti/ti_pruss.h Mon Oct 2 00:49:33 2017 (r324184) +++ head/sys/arm/ti/ti_pruss.h Mon Oct 2 01:03:18 2017 (r324185) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2013 Rui Paulo + * Copyright (c) 2017 Manuel Stuehn * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,8 +34,22 @@ #define PRUSS_AM33XX_REV 0x4e82A900 #define PRUSS_AM33XX_INTC 0x20000 -#define PRUSS_INTC_HIER 0x1500 -#define PRUSS_INTC_HIDISR 0x0038 -#define PRUSS_INTC_HIPIR_BASE 0x0900 +#define PRUSS_INTC_GER (PRUSS_AM33XX_INTC + 0x0010) +#define PRUSS_INTC_SISR (PRUSS_AM33XX_INTC + 0x0020) +#define PRUSS_INTC_SICR (PRUSS_AM33XX_INTC + 0x0024) +#define PRUSS_INTC_EISR (PRUSS_AM33XX_INTC + 0x0028) +#define PRUSS_INTC_EICR (PRUSS_AM33XX_INTC + 0x002C) +#define PRUSS_INTC_HIEISR (PRUSS_AM33XX_INTC + 0x0034) +#define PRUSS_INTC_HIDISR (PRUSS_AM33XX_INTC + 0x0038) +#define PRUSS_INTC_SECR0 (PRUSS_AM33XX_INTC + 0x0280) +#define PRUSS_INTC_SECR1 (PRUSS_AM33XX_INTC + 0x0284) +#define PRUSS_INTC_CMR_BASE (PRUSS_AM33XX_INTC + 0x0400) +#define PRUSS_INTC_HMR_BASE (PRUSS_AM33XX_INTC + 0x0800) +#define PRUSS_INTC_HIPIR_BASE (PRUSS_AM33XX_INTC + 0x0900) +#define PRUSS_INTC_SIPR0 (PRUSS_AM33XX_INTC + 0x0D00) +#define PRUSS_INTC_SIPR1 (PRUSS_AM33XX_INTC + 0x0D04) +#define PRUSS_INTC_SITR0 (PRUSS_AM33XX_INTC + 0x0D80) +#define PRUSS_INTC_SITR1 (PRUSS_AM33XX_INTC + 0x0D84) +#define PRUSS_INTC_HIER (PRUSS_AM33XX_INTC + 0x1500) #endif /* _TI_PRUSS_H_ */ From owner-svn-src-head@freebsd.org Mon Oct 2 02:58:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12940E346F4; Mon, 2 Oct 2017 02:58:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0E0577A51; Mon, 2 Oct 2017 02:58:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v922wTBe089650; Mon, 2 Oct 2017 02:58:29 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v922wSTU089643; Mon, 2 Oct 2017 02:58:28 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201710020258.v922wSTU089643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 2 Oct 2017 02:58:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324186 - in head/sys: arm/allwinner arm/freescale/imx arm/nvidia dev/ahci X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: arm/allwinner arm/freescale/imx arm/nvidia dev/ahci X-SVN-Commit-Revision: 324186 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 02:58:30 -0000 Author: ian Date: Mon Oct 2 02:58:28 2017 New Revision: 324186 URL: https://svnweb.freebsd.org/changeset/base/324186 Log: Define a single instance of ahci_devclass and reference it from all the attachment code for various SOCs and busses. Remove all the static and should-have-been-static and named-differently instances of it. This should eliminate the recently-grown build warnings about multiple definitions when building arm kernels. Modified: head/sys/arm/allwinner/a10_ahci.c head/sys/arm/freescale/imx/imx6_ahci.c head/sys/arm/nvidia/tegra_ahci.c head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci.h head/sys/dev/ahci/ahci_mv_fdt.c head/sys/dev/ahci/ahci_pci.c Modified: head/sys/arm/allwinner/a10_ahci.c ============================================================================== --- head/sys/arm/allwinner/a10_ahci.c Mon Oct 2 01:03:18 2017 (r324185) +++ head/sys/arm/allwinner/a10_ahci.c Mon Oct 2 02:58:28 2017 (r324186) @@ -373,8 +373,6 @@ ahci_a10_detach(device_t dev) return (ahci_detach(dev)); } -static devclass_t ahci_devclass; - static device_method_t ahci_ata_methods[] = { DEVMETHOD(device_probe, ahci_a10_probe), DEVMETHOD(device_attach, ahci_a10_attach), Modified: head/sys/arm/freescale/imx/imx6_ahci.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_ahci.c Mon Oct 2 01:03:18 2017 (r324185) +++ head/sys/arm/freescale/imx/imx6_ahci.c Mon Oct 2 02:58:28 2017 (r324186) @@ -330,8 +330,6 @@ imx6_ahci_detach(device_t dev) return (ahci_detach(dev)); } -devclass_t ahci_devclass; - static device_method_t imx6_ahci_ata_methods[] = { /* device probe, attach and detach methods */ DEVMETHOD(device_probe, imx6_ahci_probe), Modified: head/sys/arm/nvidia/tegra_ahci.c ============================================================================== --- head/sys/arm/nvidia/tegra_ahci.c Mon Oct 2 01:03:18 2017 (r324185) +++ head/sys/arm/nvidia/tegra_ahci.c Mon Oct 2 02:58:28 2017 (r324186) @@ -618,8 +618,7 @@ static device_method_t tegra_ahci_methods[] = { DEVMETHOD_END }; -static devclass_t tegra_ahci_devclass; static DEFINE_CLASS_0(ahci, tegra_ahci_driver, tegra_ahci_methods, sizeof(struct tegra_ahci_sc)); -DRIVER_MODULE(tegra_ahci, simplebus, tegra_ahci_driver, tegra_ahci_devclass, +DRIVER_MODULE(tegra_ahci, simplebus, tegra_ahci_driver, ahci_devclass, NULL, NULL); Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Mon Oct 2 01:03:18 2017 (r324185) +++ head/sys/dev/ahci/ahci.c Mon Oct 2 02:58:28 2017 (r324186) @@ -2747,5 +2747,8 @@ ahcipoll(struct cam_sim *sim) ahci_reset_to(ch); } } + +devclass_t ahci_devclass; + MODULE_VERSION(ahci, 1); MODULE_DEPEND(ahci, cam, 1, 1, 1); Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Mon Oct 2 01:03:18 2017 (r324185) +++ head/sys/dev/ahci/ahci.h Mon Oct 2 02:58:28 2017 (r324186) @@ -649,3 +649,6 @@ bus_dma_tag_t ahci_get_dma_tag(device_t dev, device_t int ahci_ctlr_reset(device_t dev); int ahci_ctlr_setup(device_t dev); void ahci_free_mem(device_t dev); + +extern devclass_t ahci_devclass; + Modified: head/sys/dev/ahci/ahci_mv_fdt.c ============================================================================== --- head/sys/dev/ahci/ahci_mv_fdt.c Mon Oct 2 01:03:18 2017 (r324185) +++ head/sys/dev/ahci/ahci_mv_fdt.c Mon Oct 2 02:58:28 2017 (r324186) @@ -145,7 +145,6 @@ static device_method_t ahci_methods[] = { DEVMETHOD_END }; -static devclass_t ahci_devclass; static driver_t ahci_driver = { "ahci", ahci_methods, Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Mon Oct 2 01:03:18 2017 (r324185) +++ head/sys/dev/ahci/ahci_pci.c Mon Oct 2 02:58:28 2017 (r324186) @@ -636,7 +636,6 @@ ahci_pci_resume(device_t dev) return (bus_generic_resume(dev)); } -devclass_t ahci_devclass; static device_method_t ahci_methods[] = { DEVMETHOD(device_probe, ahci_probe), DEVMETHOD(device_attach, ahci_pci_attach), From owner-svn-src-head@freebsd.org Mon Oct 2 03:54:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 791F9E3536C; Mon, 2 Oct 2017 03:54:52 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DF397D587; Mon, 2 Oct 2017 03:54:52 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1129) id A9275F9A5; Mon, 2 Oct 2017 03:54:51 +0000 (UTC) Date: Mon, 2 Oct 2017 03:54:51 +0000 From: Li-Wen Hsu To: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324177 - in head/sys: amd64/amd64 amd64/include conf dev/efidev modules/efirt sys Message-ID: <20171002035451.GA73956@freefall.freebsd.org> References: <201710011952.v91JqmUS016132@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201710011952.v91JqmUS016132@repo.freebsd.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 03:54:52 -0000 On Sun, Oct 01, 2017 at 19:52:48 +0000, Andrew Turner wrote: > Author: andrew > Date: Sun Oct 1 19:52:47 2017 > New Revision: 324177 > URL: https://svnweb.freebsd.org/changeset/base/324177 > > Log: > To prepare for adding EFI runtime services support on arm64 move the > machine independent parts of the existing code to a new file that can be > shared between amd64 and arm64. > > Reviewed by: kib (previous version), imp > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D12434 > > Added: > head/sys/amd64/amd64/efirt_machdep.c > - copied, changed from r324176, head/sys/amd64/amd64/efirt.c > head/sys/dev/efidev/efirt.c > - copied, changed from r324100, head/sys/amd64/amd64/efirt.c > Deleted: > head/sys/amd64/amd64/efirt.c > Modified: > head/sys/amd64/include/efi.h > head/sys/conf/files > head/sys/conf/files.amd64 > head/sys/modules/efirt/Makefile > head/sys/sys/efi.h [...] > Modified: head/sys/amd64/include/efi.h > ============================================================================== > --- head/sys/amd64/include/efi.h Sun Oct 1 19:40:29 2017 (r324176) > +++ head/sys/amd64/include/efi.h Sun Oct 1 19:52:47 2017 (r324177) > @@ -32,6 +32,8 @@ > #ifndef __AMD64_INCLUDE_EFI_H_ > #define __AMD64_INCLUDE_EFI_H_ > > +#include > + Hi, This seems breaking build, could you check this: 00:10:09.430 --- all_subdir_lib/libefivar --- 00:10:09.430 In file included from /usr/src/lib/libefivar/efivar.c:30: 00:10:09.430 In file included from /usr/src/lib/libefivar/efivar.h:33: 00:10:09.430 In file included from /usr/obj/usr/src/tmp/usr/include/sys/efi.h:33: 00:10:09.430 /usr/obj/usr/src/tmp/usr/include/machine/efi.h:35:10: fatal error: 'isa/rtc.h' file not found 00:10:09.430 #include 00:10:09.430 ^~~~~~~~~~~ Full log: https://ci.freebsd.org/job/FreeBSD-head-amd64-build/5244/console Thanks, Li-Wen -- Li-Wen Hsu https://lwhsu.org From owner-svn-src-head@freebsd.org Mon Oct 2 04:29:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69012E35BF8; Mon, 2 Oct 2017 04:29:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 7DDD57E11B; Mon, 2 Oct 2017 04:29:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 2DE09D68D4B; Mon, 2 Oct 2017 15:03:24 +1100 (AEDT) Date: Mon, 2 Oct 2017 15:03:23 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: "O. Hartmann" , Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324178 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua In-Reply-To: <1506890869.22078.45.camel@freebsd.org> Message-ID: <20171002133948.A909@besplex.bde.org> References: <201710012012.v91KCUvU024559@repo.freebsd.org> <20171001223707.574cde55@thor.intern.walstatt.dynvpn.de> <1506890869.22078.45.camel@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=bc8baKHB c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=u2xrDbtID_9GnvEGlPIA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 04:29:15 -0000 On Sun, 1 Oct 2017, Ian Lepore wrote: > On Sun, 2017-10-01 at 22:37 +0200, O. Hartmann wrote: >>> Author: avg >>> Log: >>> \xa0 unbreak kernel builds on sparc64 and powerpc after r324163, ZFS >>> Channel Programs >>> \xa0\xa0 >>> \xa0 The custom iscntrl() in ZFS Lua code expects a signed argumnet, >>> so >>> \xa0 remove the harmful cast. [Context lost to mangling of whitespace] Removing the cast is more fragile than the usual "fix" for warnings about checking that unsigned values are less than 0. Robust code must do such checks in case the type is changed to a correctly signed type, unless the type is specified as unsigned in an API (then it is the API that is broken, but this is hard to fix). Here the behaviour of the function iscntrl(3) is undefined unless the value is representable as and unsigned char or has the value of the macro EOF, so iscntl() on a signed character is undefined except when the value of the character is EOF in which case the result is wrong iff that character is a control character. So iscntrl(*s) for char *s is undefined for about half of all characters when chars are signed. This is normally "fixed" by casting *s to u_char. This is broken for at least the signed char with value EOF if that character is a control character, and it is unclear what happens for other negative characters, especially on exotic arches with sizeof(char) == sizeof(int) where promotion to int doesn't change the size. The ctype API itself is broken as designed on these arches (there is no space to keep EOF separate from characters). However, the function here is iscntrl(9). This is only implemented for cddl and is undodocumented, so no one knows what it does. Looking at its internals, it is easy to see that it accepts negative values and treats them as non-control characters, and that since the check for negative numbers is the tautologic comparison (C) >= 0 if the arg is unsigned (as it is on arches with unsigned chars) or just known to be nonnegative (it might be an unsigned char promoted to int)), there must be another bug for the warning to not occur in the implementation too. This other bug seems to be just that the kernel is not compiled -Wsystem-headers to unbreak such warnings. Userland adds -Wsystem-headers at WARNS >= 1, but kernel makefiles have never added it. Kernel makefiles used to use -I- and this should made all headers non-system. This is broken now -- -I- was not converted to -Iquote. > Also, removing the cast won't really be a fix on a platform that has > default unsigned chars (which arm does, but arm doesn't use gcc; not > sure about other platforms). It is really a break on arches with signed char and a different implementation of iscntrl(), and should have no effect on arches with unsigned chars, since the arg is alread unsigned then. gcc has some magic to reduce warnings about tautological comparisons. Such warnings are usually just harmful, so they shouldn't be printed unless the compiler can prove that the tautology is independent of the arch. The u_char cast allows it to do that. But when the type is char, its unsigneness is MD, so the warning should never be printed. But gcc is apparently not smart enough to do this. I checked in userland with -funsigned-char on amd64. gcc -Wall warns then. Another bug in clang is that it doesn't warn then. clang doesn't even warn about nnon-forced unsigned char with clang -Wall -Wtautological-compare. The expression in the test was (c >= 0). It takes -Wsign-compare to get a warning about this. Compilers can prove that values are in a certain range on all arches and shouldn't warn then either. The most interesting case is comparing a loop index against an unsigned variable: int i; for (i = 0; i < 1U; i++) foo(); Compilers shouldn't warn about this, since the int variable is provably always 0 or 1, and thus cannout e negative, and thus cannot cause any sign or unsign-extension bugs in the comparison, but ones like clang -Wsign-compare do. "Fix"ing this warning by changing i to unsigned then tends causes actual unsign-extension bugs and further unsigned poisoning in more complicated code. The unsigned type for the limit often occurs naturally as sizeof() due to the bug that sizeof() is unsigned. (In K&R1, size_t didn't exist and the type of sizeof() wasn't specified. It was presumably int. This was unimproved by specifying size_t to be an unsigned type.) Bruce From owner-svn-src-head@freebsd.org Mon Oct 2 06:05:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A167E37194; Mon, 2 Oct 2017 06:05:20 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EDE8803BE; Mon, 2 Oct 2017 06:05:20 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9265JXr068401; Mon, 2 Oct 2017 06:05:19 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9265Jbg068400; Mon, 2 Oct 2017 06:05:19 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201710020605.v9265Jbg068400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Mon, 2 Oct 2017 06:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324187 - head/sys/powerpc/include X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: head/sys/powerpc/include X-SVN-Commit-Revision: 324187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 06:05:20 -0000 Author: wma Date: Mon Oct 2 06:05:19 2017 New Revision: 324187 URL: https://svnweb.freebsd.org/changeset/base/324187 Log: PPC: increase MAX_PICS to 32 Previous value was too low on dual-socket POWER8 system. Submitted by: Wojciech Macek Reviewed by: nwhitehorn Obtained from: Semihalf Sponsored by: QCM Technologies Differential revision: https://reviews.freebsd.org/D12540 Modified: head/sys/powerpc/include/intr_machdep.h Modified: head/sys/powerpc/include/intr_machdep.h ============================================================================== --- head/sys/powerpc/include/intr_machdep.h Mon Oct 2 02:58:28 2017 (r324186) +++ head/sys/powerpc/include/intr_machdep.h Mon Oct 2 06:05:19 2017 (r324187) @@ -30,7 +30,7 @@ #define INTR_VECTORS 256 -#define MAX_PICS 16 +#define MAX_PICS 32 #define MAP_IRQ(node, pin) powerpc_get_irq(node, pin) /* From owner-svn-src-head@freebsd.org Mon Oct 2 07:14:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43AA2E3869F; Mon, 2 Oct 2017 07:14:33 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 105DC8248E; Mon, 2 Oct 2017 07:14:32 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v927EW3Q097271; Mon, 2 Oct 2017 07:14:32 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v927EWxk097270; Mon, 2 Oct 2017 07:14:32 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201710020714.v927EWxk097270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 2 Oct 2017 07:14:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324189 - head/sys/dev/md X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/dev/md X-SVN-Commit-Revision: 324189 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 07:14:33 -0000 Author: alc Date: Mon Oct 2 07:14:32 2017 New Revision: 324189 URL: https://svnweb.freebsd.org/changeset/base/324189 Log: When mdstart_swap() accesses a page that is already in the active queue, mark the page as referenced rather than calling vm_page_activate(). This allows the page's act_count to grow beyond ACT_INIT and better reflect its usage. (See also r324146, which modified a function used by tmpfs, uiomove_object_page(), to behave in the same way.) Reviewed by: kib, markj MFC after: 2 weeks Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Mon Oct 2 06:48:56 2017 (r324188) +++ head/sys/dev/md/md.c Mon Oct 2 07:14:32 2017 (r324189) @@ -1111,7 +1111,10 @@ mdstart_swap(struct md_s *sc, struct bio *bp) if (m != NULL) { vm_page_xunbusy(m); vm_page_lock(m); - vm_page_activate(m); + if (vm_page_active(m)) + vm_page_reference(m); + else + vm_page_activate(m); vm_page_unlock(m); } From owner-svn-src-head@freebsd.org Mon Oct 2 07:30:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE854E388E7; Mon, 2 Oct 2017 07:30:22 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 994B182926; Mon, 2 Oct 2017 07:30:22 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v927ULYG001641; Mon, 2 Oct 2017 07:30:21 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v927ULnb001640; Mon, 2 Oct 2017 07:30:21 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201710020730.v927ULnb001640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 2 Oct 2017 07:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324190 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 07:30:22 -0000 Author: alc Date: Mon Oct 2 07:30:21 2017 New Revision: 324190 URL: https://svnweb.freebsd.org/changeset/base/324190 Log: Use vm_page_active() rather than directly accessing the page's queue field. Reviewed by: kib, markj MFC after: 2 weeks X-MFC with: r324146 Modified: head/sys/kern/uipc_shm.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Mon Oct 2 07:14:32 2017 (r324189) +++ head/sys/kern/uipc_shm.c Mon Oct 2 07:30:21 2017 (r324190) @@ -209,10 +209,10 @@ uiomove_object_page(vm_object_t obj, size_t len, struc } vm_page_lock(m); vm_page_hold(m); - if (m->queue != PQ_ACTIVE) - vm_page_activate(m); - else + if (vm_page_active(m)) vm_page_reference(m); + else + vm_page_activate(m); vm_page_unlock(m); VM_OBJECT_WUNLOCK(obj); error = uiomove_fromphys(&m, offset, tlen, uio); From owner-svn-src-head@freebsd.org Mon Oct 2 08:37:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B476E39930; Mon, 2 Oct 2017 08:37:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D82184487; Mon, 2 Oct 2017 08:37:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v928bhQg030172; Mon, 2 Oct 2017 08:37:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v928bhKP030171; Mon, 2 Oct 2017 08:37:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710020837.v928bhKP030171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 2 Oct 2017 08:37:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324191 - head/sys/amd64/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/include X-SVN-Commit-Revision: 324191 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 08:37:44 -0000 Author: kib Date: Mon Oct 2 08:37:43 2017 New Revision: 324191 URL: https://svnweb.freebsd.org/changeset/base/324191 Log: Hide kernel stuff from userspace. Sponsored by: Mellanox Technologies Modified: head/sys/amd64/include/efi.h Modified: head/sys/amd64/include/efi.h ============================================================================== --- head/sys/amd64/include/efi.h Mon Oct 2 07:30:21 2017 (r324190) +++ head/sys/amd64/include/efi.h Mon Oct 2 08:37:43 2017 (r324191) @@ -32,8 +32,6 @@ #ifndef __AMD64_INCLUDE_EFI_H_ #define __AMD64_INCLUDE_EFI_H_ -#include - /* * XXX: from gcc 6.2 manual: * Note, the ms_abi attribute for Microsoft Windows 64-bit targets @@ -47,8 +45,12 @@ #define EFIABI_ATTR __attribute__((ms_abi)) #endif +#ifdef _KERNEL +#include + #define EFI_TIME_LOCK() mtx_lock(&atrtc_time_lock); #define EFI_TIME_UNLOCK() mtx_unlock(&atrtc_time_lock); #define EFI_TIME_OWNED() mtx_assert(&atrtc_time_lock, MA_OWNED); +#endif #endif /* __AMD64_INCLUDE_EFI_H_ */ From owner-svn-src-head@freebsd.org Mon Oct 2 09:45:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81B77E3ACCD; Mon, 2 Oct 2017 09:45:18 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4EEFD182D; Mon, 2 Oct 2017 09:45:18 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v929jHrK058806; Mon, 2 Oct 2017 09:45:17 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v929jH93058805; Mon, 2 Oct 2017 09:45:17 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201710020945.v929jH93058805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Mon, 2 Oct 2017 09:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324193 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jch X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 324193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 09:45:18 -0000 Author: jch Date: Mon Oct 2 09:45:17 2017 New Revision: 324193 URL: https://svnweb.freebsd.org/changeset/base/324193 Log: Forgotten bits in r324179: Include sys/syslog.h if INVARIANTS is not defined MFC after: 1 week X-MFC with: r324179 Pointy hat to: jch Modified: head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Mon Oct 2 09:11:48 2017 (r324192) +++ head/sys/netinet/tcp_timewait.c Mon Oct 2 09:45:17 2017 (r324193) @@ -47,6 +47,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifndef INVARIANTS +#include +#endif #include #include From owner-svn-src-head@freebsd.org Mon Oct 2 11:07:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADFD1E3C7B1; Mon, 2 Oct 2017 11:07:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CD4C63517; Mon, 2 Oct 2017 11:07:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92B7mAo092553; Mon, 2 Oct 2017 11:07:48 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92B7mNS092552; Mon, 2 Oct 2017 11:07:48 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710021107.v92B7mNS092552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 2 Oct 2017 11:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324194 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 324194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 11:07:49 -0000 Author: avg Date: Mon Oct 2 11:07:48 2017 New Revision: 324194 URL: https://svnweb.freebsd.org/changeset/base/324194 Log: fix incorrect use of getzfsvfs_impl in r324163, ZFS Channel Programs getzfsvfs_impl() returns a referenced, not busied, filesystem, so the matching call is vfs_rel, not vfs_unbusy. MFC after: 4 weeks X-MFC with: r324163 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c Mon Oct 2 09:45:17 2017 (r324193) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c Mon Oct 2 11:07:48 2017 (r324194) @@ -288,7 +288,7 @@ get_temporary_prop(dsl_dataset_t *ds, zfs_prop_t zfs_p #ifdef illumos VFS_RELE(vfsp); #else - vfs_unbusy(vfsp); + vfs_rel(vfsp); #endif return (ENOENT); } @@ -296,7 +296,7 @@ get_temporary_prop(dsl_dataset_t *ds, zfs_prop_t zfs_p #ifdef illumos VFS_RELE(vfsp); #else - vfs_unbusy(vfsp); + vfs_rel(vfsp); #endif if (tmp != *val) { (void) strcpy(setpoint, "temporary"); From owner-svn-src-head@freebsd.org Mon Oct 2 11:12:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8008E3CB63; Mon, 2 Oct 2017 11:12:27 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wr0-x233.google.com (mail-wr0-x233.google.com [IPv6:2a00:1450:400c:c0c::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 7A7B0639B9; Mon, 2 Oct 2017 11:12:27 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wr0-x233.google.com with SMTP id y95so3620036wrb.4; Mon, 02 Oct 2017 04:12:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=NslUVxkCt0CHsMCHgfgqvwR0AFTf+K0a/EwLN3RKiic=; b=ja9Zta1oTypEmsgn3PaA02eJ9WqqriQuomTDcFLG+aul3dEEYgh4+75wYgj5vrUgiQ /LH7+L446V+2dPOTyUXySXaMNzV/HIOPfp3TNFvlBIiFFvuTmhbPqpu60xcMekrm27k0 2Lt9Z7dnm80EOcwjaDxCkTyBpvtqd6RNbIORUoRXezSxqGZgyU4xbL4Jr+yukr5AEeL2 ENyJpBMEON/0XZ9mXMnQe3ze5bK8qpWypb/YsDvRzv2MqHvdOGLw2dVuweZdSBJYepK9 jAiQHfITWnum146I3CdfwJcFVrz/jLaRv4sJ/UroqMOChPlAXTyXJZRms6nklEV/pL20 F6RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=NslUVxkCt0CHsMCHgfgqvwR0AFTf+K0a/EwLN3RKiic=; b=T2yUcuUGNvZ35tYXMSmt+DGOJR2wroNUmjiKk5TsmhQuH21FZbqkFr5yEjPHhoWnjB h9dWRfWkCmwtSTm833t3k92l+mHdXo/yyX9wi+H2FXvnMOT+qZm8MXGGkh1WDlnZYE/b RQbjVOVQIoJbZS1JUtcCMa+XOae9scZqdYbKBICkeGPTqGDKbhRz67cOgpKb2nHaSFWC GDZ4HuMMOi5qUD4V/g2V+4mUCQRpArzzI258gF+iP0eFUp9rSnjObtdxQuwxCUs4HYbA Egs84FgpIMnjiCL25RCgDdx6C8wPQMRpX8yeJCKN8qHGx39ZLKz1eHn+9C90RLgLLqSr g++A== X-Gm-Message-State: AHPjjUg1pGPgBr+xOotnJQPA5vp4OTbwwMYEHD/Eo0B24QPyKaztZJ6D 52vSWEZ+U+gnKe2i7au7Qc745g== X-Google-Smtp-Source: AOwi7QCQ5QTAsNoweSg/zm/MpHlmXNGlWKteNSpt8dr9QoG46XAqDpcjKbN+oEZREZMD2Igo+Nqh3w== X-Received: by 10.223.145.5 with SMTP id j5mr13666010wrj.114.1506942745634; Mon, 02 Oct 2017 04:12:25 -0700 (PDT) Received: from ernst.home (p578E321D.dip0.t-ipconnect.de. [87.142.50.29]) by smtp.gmail.com with ESMTPSA id f11sm308305wra.79.2017.10.02.04.12.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Oct 2017 04:12:24 -0700 (PDT) Date: Mon, 2 Oct 2017 13:12:18 +0200 From: Gary Jennejohn To: Julien Charbon Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324179 - head/sys/netinet Message-ID: <20171002131218.3160093f@ernst.home> In-Reply-To: <201710012120.v91LKSH1050145@repo.freebsd.org> References: <201710012120.v91LKSH1050145@repo.freebsd.org> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.15.1 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 11:12:28 -0000 On Sun, 1 Oct 2017 21:20:28 +0000 (UTC) Julien Charbon wrote: > Author: jch > Date: Sun Oct 1 21:20:28 2017 > New Revision: 324179 > URL: https://svnweb.freebsd.org/changeset/base/324179 > > Log: > Fix an infinite loop in tcp_tw_2msl_scan() when an INP_TIMEWAIT inp has > been destroyed before its tcptw with INVARIANTS undefined. > > This is a symmetric change of r307551: > > A INP_TIMEWAIT inp should not be destroyed before its tcptw, and INVARIANTS > will catch this case. If INVARIANTS is undefined it will emit a log(LOG_ERR) > and avoid a hard to debug infinite loop in tcp_tw_2msl_scan(). > > Reported by: Ben Rubson, hselasky > Submitted by: hselasky > Tested by: Ben Rubson, jch > MFC after: 1 week > Sponsored by: Verisign, inc > Differential Revision: https://reviews.freebsd.org/D12267 > > Modified: > head/sys/netinet/tcp_timewait.c > > Modified: head/sys/netinet/tcp_timewait.c > ============================================================================== > --- head/sys/netinet/tcp_timewait.c Sun Oct 1 20:12:30 2017 (r324178) > +++ head/sys/netinet/tcp_timewait.c Sun Oct 1 21:20:28 2017 (r324179) > @@ -709,10 +709,29 @@ tcp_tw_2msl_scan(int reuse) > INP_WLOCK(inp); > tw = intotw(inp); > if (in_pcbrele_wlocked(inp)) { > - KASSERT(tw == NULL, ("%s: held last inp " > - "reference but tw not NULL", __func__)); > - INP_INFO_RUNLOCK(&V_tcbinfo); > - continue; > + if (__predict_true(tw == NULL)) { > + INP_INFO_RUNLOCK(&V_tcbinfo); > + continue; > + } else { > + /* This should not happen as in TIMEWAIT > + * state the inp should not be destroyed > + * before its tcptw. If INVARIANTS is > + * defined panic. > + */ > +#ifdef INVARIANTS > + panic("%s: Panic before an infinite " > + "loop: INP_TIMEWAIT && (INP_FREED " > + "|| inp last reference) && tw != " > + "NULL", __func__); > +#else > + log(LOG_ERR, "%s: Avoid an infinite " > + "loop: INP_TIMEWAIT && (INP_FREED " > + "|| inp last reference) && tw != " > + "NULL", __func__); > +#endif > + INP_INFO_RUNLOCK(&V_tcbinfo); > + break; > + } > } > > if (tw == NULL) { > This file needs to include sys/syslog.h, otherwise LOG_ERR is not defined and the kernel build fails when INVARIANTS is not defined in the kernel config file. -- Gary Jennejohn From owner-svn-src-head@freebsd.org Mon Oct 2 11:15:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F042E3CBEB; Mon, 2 Oct 2017 11:15:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45B9063B3D; Mon, 2 Oct 2017 11:15:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92BFWtF096482; Mon, 2 Oct 2017 11:15:32 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92BFW7l096479; Mon, 2 Oct 2017 11:15:32 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710021115.v92BFW7l096479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 2 Oct 2017 11:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324195 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 324195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 11:15:33 -0000 Author: avg Date: Mon Oct 2 11:15:32 2017 New Revision: 324195 URL: https://svnweb.freebsd.org/changeset/base/324195 Log: MFV r323795: 8604 Avoid unnecessary work search in VFS when unmounting snapshots illumos/illumos-gate@ed992b0aac4e5b70dc1273b1d055c0d471fbb4b1 https://github.com/illumos/illumos-gate/commit/ed992b0aac4e5b70dc1273b1d055c0d471fbb4b1 https://www.illumos.org/issues/8604 Every time we want to unmount a snapshot (happens during snapshot deletion or renaming) we unnecessarily iterate through all the mountpoints in the VFS layer (see zfs_get_vfs). Ideally we would just put a hold on the snapshot and access its respective VFS resource directly. Reviewed by: Matt Ahrens Reviewed by: George Wilson Reviewed by: Andy Stormont Approved by: Robert Mustacchi Author: Serapheim Dimitropoulos FreeBSD note: I added a FreeBSD specific function getzfsvfs_ref() which is like getzfsvfs() but returns a filesystem referenced, not busied. We want a busied filesystem in most cases, because we access its private data and, thus, we need to prevent the filesystem from being unmounted and its private data destroyed. But in some cases we can either get away with just a referenced filesystem or we must not busy the filesystem. Unmounting the filesystem is one of such cases. MFC after: 5 weeks X-MFC after: r324163 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Mon Oct 2 11:07:48 2017 (r324194) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Mon Oct 2 11:15:32 2017 (r324195) @@ -488,23 +488,29 @@ dsl_destroy_snapshots_nvl(nvlist_t *snaps, boolean_t d if (nvlist_next_nvpair(snaps, NULL) == NULL) return (0); - nvlist_t *arg = fnvlist_alloc(); - nvlist_t *snaps_normalized = fnvlist_alloc(); /* * lzc_destroy_snaps() is documented to take an nvlist whose - * values "don't matter". We need to convert that nvlist to one - * that we know can be converted to LUA. + * values "don't matter". We need to convert that nvlist to + * one that we know can be converted to LUA. We also don't + * care about any duplicate entries because the nvlist will + * be converted to a LUA table which should take care of this. */ + nvlist_t *snaps_normalized; + VERIFY0(nvlist_alloc(&snaps_normalized, 0, KM_SLEEP)); for (nvpair_t *pair = nvlist_next_nvpair(snaps, NULL); pair != NULL; pair = nvlist_next_nvpair(snaps, pair)) { fnvlist_add_boolean_value(snaps_normalized, nvpair_name(pair), B_TRUE); } + + nvlist_t *arg; + VERIFY0(nvlist_alloc(&arg, 0, KM_SLEEP)); fnvlist_add_nvlist(arg, "snaps", snaps_normalized); fnvlist_free(snaps_normalized); fnvlist_add_boolean_value(arg, "defer", defer); - nvlist_t *wrapper = fnvlist_alloc(); + nvlist_t *wrapper; + VERIFY0(nvlist_alloc(&wrapper, 0, KM_SLEEP)); fnvlist_add_nvlist(wrapper, ZCP_ARG_ARGLIST, arg); fnvlist_free(arg); @@ -538,7 +544,7 @@ dsl_destroy_snapshots_nvl(nvlist_t *snaps, boolean_t d program, 0, zfs_lua_max_memlimit, - fnvlist_lookup_nvpair(wrapper, ZCP_ARG_ARGLIST), result); + nvlist_next_nvpair(wrapper, NULL), result); if (error != 0) { char *errorstr = NULL; (void) nvlist_lookup_string(result, ZCP_RET_ERROR, &errorstr); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Mon Oct 2 11:07:48 2017 (r324194) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Mon Oct 2 11:15:32 2017 (r324195) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek. All rights reserved. - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2017 by Delphix. All rights reserved. * Copyright 2016 RackTop Systems. * Copyright (c) 2014 Integros [integros.com] */ @@ -424,9 +424,10 @@ extern int zfs_secpolicy_snapshot_perms(const char *, extern int zfs_secpolicy_rename_perms(const char *, const char *, cred_t *); extern int zfs_secpolicy_destroy_perms(const char *, cred_t *); extern int zfs_busy(void); -extern int zfs_unmount_snap(const char *); +extern void zfs_unmount_snap(const char *); extern void zfs_destroy_unmount_origin(const char *); extern int getzfsvfs_impl(struct objset *, struct zfsvfs **); +extern int getzfsvfs(const char *, struct zfsvfs **); /* * ZFS minor numbers can refer to either a control device instance or Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Oct 2 11:07:48 2017 (r324194) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Oct 2 11:15:32 2017 (r324195) @@ -1460,7 +1460,8 @@ getzfsvfs_impl(objset_t *os, zfsvfs_t **zfvp) return (error); } -static int +#ifdef illumos +int getzfsvfs(const char *dsname, zfsvfs_t **zfvp) { objset_t *os; @@ -1472,16 +1473,44 @@ getzfsvfs(const char *dsname, zfsvfs_t **zfvp) error = getzfsvfs_impl(os, zfvp); dmu_objset_rele(os, FTAG); - if (error == 0) { - error = vfs_busy((*zfvp)->z_vfs, 0); - vfs_rel((*zfvp)->z_vfs); - if (error != 0) { - *zfvp = NULL; - error = SET_ERROR(ESRCH); - } + return (error); +} + +#else + +static int +getzfsvfs_ref(const char *dsname, zfsvfs_t **zfvp) +{ + objset_t *os; + int error; + + error = dmu_objset_hold(dsname, FTAG, &os); + if (error != 0) + return (error); + + error = getzfsvfs_impl(os, zfvp); + dmu_objset_rele(os, FTAG); + return (error); +} + +int +getzfsvfs(const char *dsname, zfsvfs_t **zfvp) +{ + objset_t *os; + int error; + + error = getzfsvfs_ref(dsname, zfvp); + if (error != 0) + return (error); + error = vfs_busy((*zfvp)->z_vfs, 0); + vfs_rel((*zfvp)->z_vfs); + if (error != 0) { + *zfvp = NULL; + error = SET_ERROR(ESRCH); } return (error); } +#endif /* * Find a zfsvfs_t for a mounted filesystem, or create our own, in which @@ -3055,27 +3084,6 @@ zfs_ioc_get_fsacl(zfs_cmd_t *zc) return (error); } -/* - * Search the vfs list for a specified resource. Returns a pointer to it - * or NULL if no suitable entry is found. The caller of this routine - * is responsible for releasing the returned vfs pointer. - */ -static vfs_t * -zfs_get_vfs(const char *resource) -{ - vfs_t *vfsp; - - mtx_lock(&mountlist_mtx); - TAILQ_FOREACH(vfsp, &mountlist, mnt_list) { - if (strcmp(refstr_value(vfsp->vfs_resource), resource) == 0) { - vfs_ref(vfsp); - break; - } - } - mtx_unlock(&mountlist_mtx); - return (vfsp); -} - /* ARGSUSED */ static void zfs_create_cb(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx) @@ -3557,30 +3565,29 @@ zfs_ioc_nextboot(const char *unused, nvlist_t *innvl, * Returns 0 if the argument is not a snapshot, or it is not currently a * filesystem, or we were able to unmount it. Returns error code otherwise. */ -int +void zfs_unmount_snap(const char *snapname) { - vfs_t *vfsp; - zfsvfs_t *zfsvfs; -#ifdef illumos - int err; -#endif + vfs_t *vfsp = NULL; + zfsvfs_t *zfsvfs = NULL; if (strchr(snapname, '@') == NULL) - return (0); + return; - vfsp = zfs_get_vfs(snapname); - if (vfsp == NULL) - return (0); + int err = getzfsvfs_ref(snapname, &zfsvfs); + if (err != 0) { + ASSERT3P(zfsvfs, ==, NULL); + return; + } + vfsp = zfsvfs->z_vfs; - zfsvfs = vfsp->vfs_data; ASSERT(!dsl_pool_config_held(dmu_objset_pool(zfsvfs->z_os))); #ifdef illumos err = vn_vfswlock(vfsp->vfs_vnodecovered); VFS_RELE(vfsp); if (err != 0) - return (SET_ERROR(err)); + return; #endif /* @@ -3591,14 +3598,14 @@ zfs_unmount_snap(const char *snapname) #else (void) dounmount(vfsp, MS_FORCE, curthread); #endif - return (0); } /* ARGSUSED */ static int zfs_unmount_snap_cb(const char *snapname, void *arg) { - return (zfs_unmount_snap(snapname)); + zfs_unmount_snap(snapname); + return (0); } /* @@ -3621,7 +3628,7 @@ zfs_destroy_unmount_origin(const char *fsname) char originname[ZFS_MAX_DATASET_NAME_LEN]; dsl_dataset_name(ds->ds_prev, originname); dmu_objset_rele(os, FTAG); - (void) zfs_unmount_snap(originname); + zfs_unmount_snap(originname); } else { dmu_objset_rele(os, FTAG); } @@ -3662,9 +3669,7 @@ zfs_ioc_destroy_snaps(const char *poolname, nvlist_t * (name[poollen] != '/' && name[poollen] != '@')) return (SET_ERROR(EXDEV)); - error = zfs_unmount_snap(name); - if (error != 0) - return (error); + zfs_unmount_snap(nvpair_name(pair)); #if defined(__FreeBSD__) zvol_remove_minors(name); #endif @@ -3810,11 +3815,8 @@ zfs_ioc_destroy(zfs_cmd_t *zc) { int err; - if (zc->zc_objset_type == DMU_OST_ZFS) { - err = zfs_unmount_snap(zc->zc_name); - if (err != 0) - return (err); - } + if (zc->zc_objset_type == DMU_OST_ZFS) + zfs_unmount_snap(zc->zc_name); if (strchr(zc->zc_name, '@')) err = dsl_destroy_snapshot(zc->zc_name, zc->zc_defer_destroy); @@ -3886,7 +3888,9 @@ recursive_unmount(const char *fsname, void *arg) char fullname[ZFS_MAX_DATASET_NAME_LEN]; (void) snprintf(fullname, sizeof (fullname), "%s@%s", fsname, snapname); - return (zfs_unmount_snap(fullname)); + zfs_unmount_snap(fullname); + + return (0); } /* From owner-svn-src-head@freebsd.org Mon Oct 2 11:16:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9785AE3CC69; Mon, 2 Oct 2017 11:16:46 +0000 (UTC) (envelope-from julien.charbon@gmail.com) Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) (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 3853363C98; Mon, 2 Oct 2017 11:16:45 +0000 (UTC) (envelope-from julien.charbon@gmail.com) Received: by mail-wm0-f41.google.com with SMTP id e195so6100084wma.5; Mon, 02 Oct 2017 04:16:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Sbuf7RpKkhvbLtr9tar9fFRZuafZYFm7dKgfgrnCfzc=; b=LBqPGbYn2ET066dveHE3xgqZLVQ0aa2bXzkMsTeXjUdbCuUeyuZoFxDtgKdenO07ZW h8Qbx12KvtAEaoju+eqtzO8uJBVGGyNZFw+WYSuiFySAOk7bvUYIx1CFAJ6S7GObNe/O vU1vcGRvCjjHQO1sxhubKJMZsIp519G7Dyif2OrdEwA3YNVtZI86Cc1wPoDNZ7QpMtlD 3jLFQkffFupybfkNWPu8ddaduOy+FucwLvQwLJWKo4MDrOzL9GifU60lFwLA+yPTssmS FtoukGUEGgAULFT43F2t8Q+TikMgvvfeu4M1mvlMoTLgjm9H+XoqIR1SMevEmKBr/Bez 5mlw== X-Gm-Message-State: AHPjjUiKKrsmLOMCtsuVF8nNhjEw9nAQSgfXAh4u3SB3e1LJNkG/+0fP WCKu6Ym2Fz477IjX2/oSh2357ybt X-Google-Smtp-Source: AOwi7QAOhbrpxb/QdvfODYoGiqNTJO2haWs8/raPR5usmVtErBIY7pRA2Flp7Pp5tkWQIli4FQl2HQ== X-Received: by 10.80.129.68 with SMTP id 62mr19784459edc.175.1506943003863; Mon, 02 Oct 2017 04:16:43 -0700 (PDT) Received: from [10.100.64.27] ([217.30.88.7]) by smtp.gmail.com with ESMTPSA id j62sm1084623edd.62.2017.10.02.04.16.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Oct 2017 04:16:43 -0700 (PDT) Subject: Re: svn commit: r324179 - head/sys/netinet To: gljennjohn@gmail.com Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710012120.v91LKSH1050145@repo.freebsd.org> <20171002131218.3160093f@ernst.home> From: Julien Charbon Message-ID: <5c69c015-f3ae-954c-0f54-bf487eb6cab4@freebsd.org> Date: Mon, 2 Oct 2017 13:16:42 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171002131218.3160093f@ernst.home> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 11:16:46 -0000 On 10/2/17 1:12 PM, Gary Jennejohn wrote: > On Sun, 1 Oct 2017 21:20:28 +0000 (UTC) > Julien Charbon wrote: > >> Author: jch >> Date: Sun Oct 1 21:20:28 2017 >> New Revision: 324179 >> URL: https://svnweb.freebsd.org/changeset/base/324179 >> >> Log: >> Fix an infinite loop in tcp_tw_2msl_scan() when an INP_TIMEWAIT inp has >> been destroyed before its tcptw with INVARIANTS undefined. >> >> This is a symmetric change of r307551: >> >> A INP_TIMEWAIT inp should not be destroyed before its tcptw, and INVARIANTS >> will catch this case. If INVARIANTS is undefined it will emit a log(LOG_ERR) >> and avoid a hard to debug infinite loop in tcp_tw_2msl_scan(). >> >> Reported by: Ben Rubson, hselasky >> Submitted by: hselasky >> Tested by: Ben Rubson, jch >> MFC after: 1 week >> Sponsored by: Verisign, inc >> Differential Revision: https://reviews.freebsd.org/D12267 >> >> Modified: >> head/sys/netinet/tcp_timewait.c >> >> Modified: head/sys/netinet/tcp_timewait.c >> ============================================================================== >> --- head/sys/netinet/tcp_timewait.c Sun Oct 1 20:12:30 2017 (r324178) >> +++ head/sys/netinet/tcp_timewait.c Sun Oct 1 21:20:28 2017 (r324179) >> @@ -709,10 +709,29 @@ tcp_tw_2msl_scan(int reuse) >> INP_WLOCK(inp); >> tw = intotw(inp); >> if (in_pcbrele_wlocked(inp)) { >> - KASSERT(tw == NULL, ("%s: held last inp " >> - "reference but tw not NULL", __func__)); >> - INP_INFO_RUNLOCK(&V_tcbinfo); >> - continue; >> + if (__predict_true(tw == NULL)) { >> + INP_INFO_RUNLOCK(&V_tcbinfo); >> + continue; >> + } else { >> + /* This should not happen as in TIMEWAIT >> + * state the inp should not be destroyed >> + * before its tcptw. If INVARIANTS is >> + * defined panic. >> + */ >> +#ifdef INVARIANTS >> + panic("%s: Panic before an infinite " >> + "loop: INP_TIMEWAIT && (INP_FREED " >> + "|| inp last reference) && tw != " >> + "NULL", __func__); >> +#else >> + log(LOG_ERR, "%s: Avoid an infinite " >> + "loop: INP_TIMEWAIT && (INP_FREED " >> + "|| inp last reference) && tw != " >> + "NULL", __func__); >> +#endif >> + INP_INFO_RUNLOCK(&V_tcbinfo); >> + break; >> + } >> } >> >> if (tw == NULL) { >> > > This file needs to include sys/syslog.h, otherwise LOG_ERR is > not defined and the kernel build fails when INVARIANTS is not > defined in the kernel config file. You are correct and thanks for the report. I had sys/syslog.h already included as part of unrelated changes, then I forgot to push it: Fixed in r324193: https://svnweb.freebsd.org/base?view=revision&revision=324193 https://svnweb.freebsd.org/base/head/sys/netinet/tcp_timewait.c?r1=324193&r2=324192&pathrev=324193 -- Julien From owner-svn-src-head@freebsd.org Mon Oct 2 11:23:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16468E3CEF4; Mon, 2 Oct 2017 11:23:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E23AB64097; Mon, 2 Oct 2017 11:23:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92BNWhF001052; Mon, 2 Oct 2017 11:23:32 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92BNVWW001048; Mon, 2 Oct 2017 11:23:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710021123.v92BNVWW001048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 2 Oct 2017 11:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324196 - in head: cddl/contrib/opensolaris/cmd/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 324196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 11:23:33 -0000 Author: avg Date: Mon Oct 2 11:23:31 2017 New Revision: 324196 URL: https://svnweb.freebsd.org/changeset/base/324196 Log: MFV r323912: 8592 ZFS channel programs - rollback illumos/illumos-gate@000cce6b6fad4a8b0eecef6e1251f6aca1719c55 https://github.com/illumos/illumos-gate/commit/000cce6b6fad4a8b0eecef6e1251f6aca1719c55 https://www.illumos.org/issues/8592 ZFS channel programs should be able to perform a rollback. This logic will probably look pretty similar to zfs.sync.destroy(). Reviewed by: Chris Williamson Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Brad Lewis MFC after: 5 weeks X-MFC after: r324163 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Mon Oct 2 11:15:32 2017 (r324195) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Mon Oct 2 11:23:31 2017 (r324196) @@ -8,9 +8,9 @@ .\" http://www.illumos.org/license/CDDL. .\" .\" -.\" Copyright (c) 2016 by Delphix. All Rights Reserved. +.\" Copyright (c) 2016, 2017 by Delphix. All rights reserved. .\" -.Dd September 28, 2017 +.Dd October 02, 2016 .Dt ZFS-PROGRAM 1M .Os .Sh NAME @@ -361,6 +361,17 @@ dataset (string) .Bd -ragged -compact -offset "xxxx" Clone to be promoted. .Ed +.It Em zfs.sync.rollback(filesystem) +Rollback to the previous snapshot for a dataset. +Returns 0 on successful rollback, or a nonzero error code otherwise. +Rollbacks can be performed on filesystems or zvols, but not on snapshots +or mounted datasets. +EBUSY is returned in the case where the filesystem is mounted. +.Pp +filesystem (string) +.Bd -ragged -compact -offset "xxxx" +Filesystem to rollback. +.Ed .El .It Sy zfs.check submodule For each function in the zfs.sync submodule, there is a corresponding zfs.check @@ -380,6 +391,7 @@ The available zfs.check functions are: .Bl -tag -width "xx" .It Em zfs.check.destroy(dataset, [defer=true|false]) .It Em zfs.check.promote(dataset) +.It Em zfs.check.rollback(filesystem) .El .It Sy zfs.list submodule The zfs.list submodule provides functions for iterating over datasets and Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Mon Oct 2 11:15:32 2017 (r324195) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Mon Oct 2 11:23:31 2017 (r324196) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Portions Copyright (c) 2011 Martin Matuska - * Copyright (c) 2011, 2016 by Delphix. All rights reserved. + * Copyright (c) 2011, 2017 by Delphix. All rights reserved. * Copyright (c) 2014, Joyent, Inc. All rights reserved. * Copyright (c) 2014 RackTop Systems. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. @@ -2538,14 +2538,7 @@ dsl_dataset_handoff_check(dsl_dataset_t *ds, void *own return (0); } -typedef struct dsl_dataset_rollback_arg { - const char *ddra_fsname; - const char *ddra_tosnap; - void *ddra_owner; - nvlist_t *ddra_result; -} dsl_dataset_rollback_arg_t; - -static int +int dsl_dataset_rollback_check(void *arg, dmu_tx_t *tx) { dsl_dataset_rollback_arg_t *ddra = arg; @@ -2653,7 +2646,7 @@ dsl_dataset_rollback_check(void *arg, dmu_tx_t *tx) return (0); } -static void +void dsl_dataset_rollback_sync(void *arg, dmu_tx_t *tx) { dsl_dataset_rollback_arg_t *ddra = arg; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Mon Oct 2 11:15:32 2017 (r324195) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Mon Oct 2 11:23:31 2017 (r324196) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2017 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. @@ -237,6 +237,13 @@ typedef struct dsl_dataset_promote_arg { cred_t *cr; } dsl_dataset_promote_arg_t; +typedef struct dsl_dataset_rollback_arg { + const char *ddra_fsname; + const char *ddra_tosnap; + void *ddra_owner; + nvlist_t *ddra_result; +} dsl_dataset_rollback_arg_t; + /* * The max length of a temporary tag prefix is the number of hex digits * required to express UINT64_MAX plus one for the hyphen. @@ -375,6 +382,9 @@ void dsl_dataset_set_refreservation_sync_impl(dsl_data void dsl_dataset_zapify(dsl_dataset_t *ds, dmu_tx_t *tx); boolean_t dsl_dataset_is_zapified(dsl_dataset_t *ds); boolean_t dsl_dataset_has_resume_receive_state(dsl_dataset_t *ds); + +int dsl_dataset_rollback_check(void *arg, dmu_tx_t *tx); +void dsl_dataset_rollback_sync(void *arg, dmu_tx_t *tx); int dsl_dataset_rollback(const char *fsname, const char *tosnap, void *owner, nvlist_t *result); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c Mon Oct 2 11:15:32 2017 (r324195) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c Mon Oct 2 11:23:31 2017 (r324196) @@ -14,7 +14,7 @@ */ /* - * Copyright (c) 2016 by Delphix. All rights reserved. + * Copyright (c) 2016, 2017 by Delphix. All rights reserved. */ #include "lua.h" @@ -177,6 +177,37 @@ zcp_synctask_promote(lua_State *state, boolean_t sync, return (err); } +static int zcp_synctask_rollback(lua_State *, boolean_t, nvlist_t *err_details); +static zcp_synctask_info_t zcp_synctask_rollback_info = { + .name = "rollback", + .func = zcp_synctask_rollback, + .space_check = ZFS_SPACE_CHECK_RESERVED, + .blocks_modified = 1, + .pargs = { + {.za_name = "filesystem", .za_lua_type = LUA_TSTRING}, + {NULL, 0} + }, + .kwargs = { + {NULL, 0} + } +}; + +static int +zcp_synctask_rollback(lua_State *state, boolean_t sync, nvlist_t *err_details) +{ + int err; + const char *dsname = lua_tostring(state, 1); + dsl_dataset_rollback_arg_t ddra = { 0 }; + + ddra.ddra_fsname = dsname; + ddra.ddra_result = err_details; + + err = zcp_sync_task(state, dsl_dataset_rollback_check, + dsl_dataset_rollback_sync, &ddra, sync, dsname); + + return (err); +} + void zcp_synctask_wrapper_cleanup(void *arg) { @@ -247,6 +278,7 @@ zcp_load_synctask_lib(lua_State *state, boolean_t sync zcp_synctask_info_t *zcp_synctask_funcs[] = { &zcp_synctask_destroy_info, &zcp_synctask_promote_info, + &zcp_synctask_rollback_info, NULL }; From owner-svn-src-head@freebsd.org Mon Oct 2 11:32:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E9EAE3CFE3; Mon, 2 Oct 2017 11:32:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C16264480; Mon, 2 Oct 2017 11:32:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92BW9jP005248; Mon, 2 Oct 2017 11:32:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92BW8tm005238; Mon, 2 Oct 2017 11:32:08 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710021132.v92BW8tm005238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 2 Oct 2017 11:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324197 - in head: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs_core/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/commo... X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs_core/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 324197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 11:32:10 -0000 Author: avg Date: Mon Oct 2 11:32:08 2017 New Revision: 324197 URL: https://svnweb.freebsd.org/changeset/base/324197 Log: MFV r323913: 8600 ZFS channel programs - snapshot illumos/illumos-gate@2840dce1a029098fb784afd951d5f98089f850d8 https://github.com/illumos/illumos-gate/commit/2840dce1a029098fb784afd951d5f98089f850d8 https://www.illumos.org/issues/8600 ZFS channel programs should be able to create snapshots. In addition to the base snapshot functionality, this will likely entail adding extra logic to handle edge cases which were formerly not possible, such as creating then destroying a snapshot in the same transaction sync. Reviewed by: Matthew Ahrens Reviewed by: John Kennedy Reviewed by: Brad Lewis Approved by: Robert Mustacchi Author: Chris Williamson MFC after: 5 weeks X-MFC after: r324163 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_global.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Mon Oct 2 11:23:31 2017 (r324196) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Mon Oct 2 11:32:08 2017 (r324197) @@ -10,7 +10,7 @@ .\" .\" Copyright (c) 2016, 2017 by Delphix. All rights reserved. .\" -.Dd October 02, 2016 +.Dd October 02, 2017 .Dt ZFS-PROGRAM 1M .Os .Sh NAME @@ -372,6 +372,18 @@ filesystem (string) .Bd -ragged -compact -offset "xxxx" Filesystem to rollback. .Ed +.It Em zfs.sync.snapshot(dataset) +Create a snapshot of a filesystem. +Returns 0 if the snapshot was successfully created, +and a nonzero error code otherwise. +.Pp +Note: Taking a snapshot will fail on any pool older than legacy version 27. +To enable taking snapshots from ZCP scripts, the pool must be upgraded. +.Pp +dataset (string) +.Bd -ragged -compact -offset "xxxx" +Name of snapshot to create. +.Ed .El .It Sy zfs.check submodule For each function in the zfs.sync submodule, there is a corresponding zfs.check @@ -392,6 +404,7 @@ The available zfs.check functions are: .It Em zfs.check.destroy(dataset, [defer=true|false]) .It Em zfs.check.promote(dataset) .It Em zfs.check.rollback(filesystem) +.It Em zfs.check.snapshot(dataset) .El .It Sy zfs.list submodule The zfs.list submodule provides functions for iterating over datasets and Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Mon Oct 2 11:23:31 2017 (r324196) +++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Mon Oct 2 11:32:08 2017 (r324197) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2017 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2017 RackTop Systems. @@ -160,7 +160,12 @@ lzc_ioctl(zfs_ioc_t ioc, const char *name, if (resultp != NULL) { *resultp = NULL; - zc.zc_nvlist_dst_size = MAX(size * 2, 128 * 1024); + if (ioc == ZFS_IOC_CHANNEL_PROGRAM) { + zc.zc_nvlist_dst_size = fnvlist_lookup_uint64(source, + ZCP_ARG_MEMLIMIT); + } else { + zc.zc_nvlist_dst_size = MAX(size * 2, 128 * 1024); + } zc.zc_nvlist_dst = (uint64_t)(uintptr_t) malloc(zc.zc_nvlist_dst_size); #ifdef illumos @@ -178,7 +183,7 @@ lzc_ioctl(zfs_ioc_t ioc, const char *name, * If ioctl exited with ENOMEM, we retry the ioctl after * increasing the size of the destination nvlist. * - * Channel programs that exit with ENOMEM probably ran over the + * Channel programs that exit with ENOMEM ran over the * lua memory sandbox; they should not be retried. */ if (errno == ENOMEM && resultp != NULL && Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Mon Oct 2 11:23:31 2017 (r324196) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Mon Oct 2 11:32:08 2017 (r324197) @@ -1134,13 +1134,6 @@ dsl_dataset_snapshot_reserve_space(dsl_dataset_t *ds, return (0); } -typedef struct dsl_dataset_snapshot_arg { - nvlist_t *ddsa_snaps; - nvlist_t *ddsa_props; - nvlist_t *ddsa_errors; - cred_t *ddsa_cr; -} dsl_dataset_snapshot_arg_t; - int dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, const char *snapname, dmu_tx_t *tx, boolean_t recv, uint64_t cnt, cred_t *cr) @@ -1200,7 +1193,7 @@ dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, con return (0); } -static int +int dsl_dataset_snapshot_check(void *arg, dmu_tx_t *tx) { dsl_dataset_snapshot_arg_t *ddsa = arg; @@ -1477,7 +1470,7 @@ dsl_dataset_snapshot_sync_impl(dsl_dataset_t *ds, cons spa_history_log_internal_ds(ds->ds_prev, "snapshot", tx, ""); } -static void +void dsl_dataset_snapshot_sync(void *arg, dmu_tx_t *tx) { dsl_dataset_snapshot_arg_t *ddsa = arg; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Mon Oct 2 11:23:31 2017 (r324196) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Mon Oct 2 11:32:08 2017 (r324197) @@ -244,6 +244,13 @@ typedef struct dsl_dataset_rollback_arg { nvlist_t *ddra_result; } dsl_dataset_rollback_arg_t; +typedef struct dsl_dataset_snapshot_arg { + nvlist_t *ddsa_snaps; + nvlist_t *ddsa_props; + nvlist_t *ddsa_errors; + cred_t *ddsa_cr; +} dsl_dataset_snapshot_arg_t; + /* * The max length of a temporary tag prefix is the number of hex digits * required to express UINT64_MAX plus one for the hyphen. @@ -276,6 +283,8 @@ uint64_t dsl_dataset_create_sync(dsl_dir_t *pds, const dsl_dataset_t *origin, uint64_t flags, cred_t *, dmu_tx_t *); uint64_t dsl_dataset_create_sync_dd(dsl_dir_t *dd, dsl_dataset_t *origin, uint64_t flags, dmu_tx_t *tx); +void dsl_dataset_snapshot_sync(void *arg, dmu_tx_t *tx); +int dsl_dataset_snapshot_check(void *arg, dmu_tx_t *tx); int dsl_dataset_snapshot(nvlist_t *snaps, nvlist_t *props, nvlist_t *errors); void dsl_dataset_promote_sync(void *arg, dmu_tx_t *tx); int dsl_dataset_promote_check(void *arg, dmu_tx_t *tx); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp.h Mon Oct 2 11:23:31 2017 (r324196) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp.h Mon Oct 2 11:32:08 2017 (r324197) @@ -14,7 +14,7 @@ */ /* - * Copyright (c) 2016 by Delphix. All rights reserved. + * Copyright (c) 2016, 2017 by Delphix. All rights reserved. */ #ifndef _SYS_ZCP_H @@ -136,8 +136,6 @@ typedef struct zcp_lib_info { const zcp_arg_t pargs[4]; const zcp_arg_t kwargs[2]; } zcp_lib_info_t; - -int zcp_nvlist_to_lua(lua_State *, nvlist_t *, char *, int); #ifdef __cplusplus } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c Mon Oct 2 11:23:31 2017 (r324196) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c Mon Oct 2 11:32:08 2017 (r324197) @@ -14,7 +14,7 @@ */ /* - * Copyright (c) 2016 by Delphix. All rights reserved. + * Copyright (c) 2016, 2017 by Delphix. All rights reserved. */ /* @@ -109,10 +109,15 @@ #define ETIME ETIMEDOUT #endif +#define ZCP_NVLIST_MAX_DEPTH 20 + uint64_t zfs_lua_check_instrlimit_interval = 100; uint64_t zfs_lua_max_instrlimit = ZCP_MAX_INSTRLIMIT; uint64_t zfs_lua_max_memlimit = ZCP_MAX_MEMLIMIT; +/* + * Forward declarations for mutually recursive functions + */ static int zcp_nvpair_value_to_lua(lua_State *, nvpair_t *, char *, int); static int zcp_lua_to_nvlist_impl(lua_State *, int, nvlist_t *, const char *, int); @@ -219,8 +224,6 @@ zcp_cleanup(lua_State *state) zcp_clear_cleanup(state); } } - -#define ZCP_NVLIST_MAX_DEPTH 20 /* * Convert the lua table at the given index on the Lua stack to an nvlist Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_global.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_global.c Mon Oct 2 11:23:31 2017 (r324196) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_global.c Mon Oct 2 11:32:08 2017 (r324197) @@ -14,7 +14,7 @@ */ /* - * Copyright (c) 2016 by Delphix. All rights reserved. + * Copyright (c) 2016, 2017 by Delphix. All rights reserved. */ #include @@ -62,7 +62,12 @@ static const zcp_errno_global_t errno_globals[] = { {"EPIPE", EPIPE}, {"EDOM", EDOM}, {"ERANGE", ERANGE}, + {"EDEADLK", EDEADLK}, + {"ENOLCK", ENOLCK}, + {"ECANCELED", ECANCELED}, + {"ENOTSUP", ENOTSUP}, {"EDQUOT", EDQUOT}, + {"ENAMETOOLONG", ENAMETOOLONG}, {NULL, 0} }; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c Mon Oct 2 11:23:31 2017 (r324196) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c Mon Oct 2 11:32:08 2017 (r324197) @@ -39,10 +39,10 @@ typedef int (zcp_synctask_func_t)(lua_State *, boolean typedef struct zcp_synctask_info { const char *name; zcp_synctask_func_t *func; - zfs_space_check_t space_check; - int blocks_modified; const zcp_arg_t pargs[4]; const zcp_arg_t kwargs[2]; + zfs_space_check_t space_check; + int blocks_modified; } zcp_synctask_info_t; /* @@ -91,8 +91,6 @@ static int zcp_synctask_destroy(lua_State *, boolean_t static zcp_synctask_info_t zcp_synctask_destroy_info = { .name = "destroy", .func = zcp_synctask_destroy, - .space_check = ZFS_SPACE_CHECK_NONE, - .blocks_modified = 0, .pargs = { {.za_name = "filesystem | snapshot", .za_lua_type = LUA_TSTRING}, {NULL, 0} @@ -100,7 +98,9 @@ static zcp_synctask_info_t zcp_synctask_destroy_info = .kwargs = { {.za_name = "defer", .za_lua_type = LUA_TBOOLEAN}, {NULL, 0} - } + }, + .space_check = ZFS_SPACE_CHECK_NONE, + .blocks_modified = 0 }; /* ARGSUSED */ @@ -140,19 +140,19 @@ zcp_synctask_destroy(lua_State *state, boolean_t sync, return (err); } -static int zcp_synctask_promote(lua_State *, boolean_t, nvlist_t *err_details); +static int zcp_synctask_promote(lua_State *, boolean_t, nvlist_t *); static zcp_synctask_info_t zcp_synctask_promote_info = { .name = "promote", .func = zcp_synctask_promote, - .space_check = ZFS_SPACE_CHECK_RESERVED, - .blocks_modified = 3, .pargs = { {.za_name = "clone", .za_lua_type = LUA_TSTRING}, {NULL, 0} }, .kwargs = { {NULL, 0} - } + }, + .space_check = ZFS_SPACE_CHECK_RESERVED, + .blocks_modified = 3 }; static int @@ -208,6 +208,58 @@ zcp_synctask_rollback(lua_State *state, boolean_t sync return (err); } +static int zcp_synctask_snapshot(lua_State *, boolean_t, nvlist_t *); +static zcp_synctask_info_t zcp_synctask_snapshot_info = { + .name = "snapshot", + .func = zcp_synctask_snapshot, + .pargs = { + {.za_name = "filesystem@snapname | volume@snapname", + .za_lua_type = LUA_TSTRING}, + {NULL, 0} + }, + .kwargs = { + {NULL, 0} + }, + .space_check = ZFS_SPACE_CHECK_NORMAL, + .blocks_modified = 3 +}; + +/* ARGSUSED */ +static int +zcp_synctask_snapshot(lua_State *state, boolean_t sync, nvlist_t *err_details) +{ + int err; + dsl_dataset_snapshot_arg_t ddsa = { 0 }; + const char *dsname = lua_tostring(state, 1); + zcp_run_info_t *ri = zcp_run_info(state); + + /* + * We only allow for a single snapshot rather than a list, so the + * error list output is unnecessary. + */ + ddsa.ddsa_errors = NULL; + ddsa.ddsa_props = NULL; + ddsa.ddsa_cr = ri->zri_cred; + ddsa.ddsa_snaps = fnvlist_alloc(); + fnvlist_add_boolean(ddsa.ddsa_snaps, dsname); + + /* + * On old pools, the ZIL must not be active when a snapshot is created, + * but we can't suspend the ZIL because we're already in syncing + * context. + */ + if (spa_version(ri->zri_pool->dp_spa) < SPA_VERSION_FAST_SNAP) { + return (ENOTSUP); + } + + err = zcp_sync_task(state, dsl_dataset_snapshot_check, + dsl_dataset_snapshot_sync, &ddsa, sync, dsname); + + fnvlist_free(ddsa.ddsa_snaps); + + return (err); +} + void zcp_synctask_wrapper_cleanup(void *arg) { @@ -279,6 +331,7 @@ zcp_load_synctask_lib(lua_State *state, boolean_t sync &zcp_synctask_destroy_info, &zcp_synctask_promote_info, &zcp_synctask_rollback_info, + &zcp_synctask_snapshot_info, NULL }; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Oct 2 11:23:31 2017 (r324196) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Oct 2 11:32:08 2017 (r324197) @@ -27,7 +27,7 @@ * Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014, 2016 Joyent, Inc. All rights reserved. - * Copyright (c) 2011, 2016 by Delphix. All rights reserved. + * Copyright (c) 2011, 2017 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Integros [integros.com] @@ -3795,7 +3795,7 @@ zfs_ioc_channel_program(const char *poolname, nvlist_t if (instrlimit == 0 || instrlimit > zfs_lua_max_instrlimit) return (EINVAL); - if (memlimit == 0 || memlimit > ZCP_MAX_MEMLIMIT) + if (memlimit == 0 || memlimit > zfs_lua_max_memlimit) return (EINVAL); return (zcp_eval(poolname, program, instrlimit, memlimit, From owner-svn-src-head@freebsd.org Mon Oct 2 11:40:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 671D8E3D19D; Mon, 2 Oct 2017 11:40:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1AF3164695; Mon, 2 Oct 2017 11:40:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA09252; Mon, 02 Oct 2017 14:40:27 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1dyz5H-000JHa-NX; Mon, 02 Oct 2017 14:40:27 +0300 Subject: Re: svn commit: r324196 - in head: cddl/contrib/opensolaris/cmd/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201710021123.v92BNVWW001048@repo.freebsd.org> From: Andriy Gapon Message-ID: <8aadf3dc-ab48-9c78-99a8-1059e312c1b6@FreeBSD.org> Date: Mon, 2 Oct 2017 14:39:06 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <201710021123.v92BNVWW001048@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 11:40:32 -0000 On 02/10/2017 14:23, Andriy Gapon wrote: > -.Dd September 28, 2017 > +.Dd October 02, 2016 This was a typo, fixed in the next commit. -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Oct 2 11:57:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B829E3D73F; Mon, 2 Oct 2017 11:57:02 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEDAB65254; Mon, 2 Oct 2017 11:57:01 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92Bv1v2013453; Mon, 2 Oct 2017 11:57:01 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92Bv1LE013452; Mon, 2 Oct 2017 11:57:01 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201710021157.v92Bv1LE013452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 2 Oct 2017 11:57:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324199 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 324199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 11:57:02 -0000 Author: trasz Date: Mon Oct 2 11:57:00 2017 New Revision: 324199 URL: https://svnweb.freebsd.org/changeset/base/324199 Log: Clear G_CF_ORPHAN when attaching. This fixes cases where the same GEOM consumer can be orphaned, and then reattach to another provider. From a user point of view, this makes gmountver(4) work again. Reviewed by: avg, mav MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12228 Modified: head/sys/geom/geom_subr.c Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Mon Oct 2 11:55:11 2017 (r324198) +++ head/sys/geom/geom_subr.c Mon Oct 2 11:57:00 2017 (r324199) @@ -828,6 +828,7 @@ g_attach(struct g_consumer *cp, struct g_provider *pp) g_trace(G_T_TOPOLOGY, "g_attach(%p, %p)", cp, pp); KASSERT(cp->provider == NULL, ("attach but attached")); cp->provider = pp; + cp->flags &= ~G_CF_ORPHAN; LIST_INSERT_HEAD(&pp->consumers, cp, consumers); error = redo_rank(cp->geom); if (error) { From owner-svn-src-head@freebsd.org Mon Oct 2 12:05:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44FBEE3E015; Mon, 2 Oct 2017 12:05:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F1AD65A68; Mon, 2 Oct 2017 12:05:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92C5dtq017856; Mon, 2 Oct 2017 12:05:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92C5dww017852; Mon, 2 Oct 2017 12:05:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710021205.v92C5dww017852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 2 Oct 2017 12:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324200 - head/sys/dev/mlx4/mlx4_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx4/mlx4_en X-SVN-Commit-Revision: 324200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 12:05:40 -0000 Author: hselasky Date: Mon Oct 2 12:05:38 2017 New Revision: 324200 URL: https://svnweb.freebsd.org/changeset/base/324200 Log: Implement SIOCGIFRSS{KEY,HASH} for the mlx4en(4) driver. Differential Revision: https://reviews.freebsd.org/D12176 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx4/mlx4_en/en.h head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Modified: head/sys/dev/mlx4/mlx4_en/en.h ============================================================================== --- head/sys/dev/mlx4/mlx4_en/en.h Mon Oct 2 11:57:00 2017 (r324199) +++ head/sys/dev/mlx4/mlx4_en/en.h Mon Oct 2 12:05:38 2017 (r324200) @@ -795,6 +795,8 @@ int mlx4_en_map_buffer(struct mlx4_buf *buf); void mlx4_en_unmap_buffer(struct mlx4_buf *buf); void mlx4_en_calc_rx_buf(struct net_device *dev); +const u32 *mlx4_en_get_rss_key(struct mlx4_en_priv *priv, u16 *keylen); +u8 mlx4_en_get_rss_mask(struct mlx4_en_priv *priv); int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv); void mlx4_en_release_rss_steer(struct mlx4_en_priv *priv); int mlx4_en_create_drop_qp(struct mlx4_en_priv *priv); Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c ============================================================================== --- head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Mon Oct 2 11:57:00 2017 (r324199) +++ head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Mon Oct 2 12:05:38 2017 (r324200) @@ -1896,6 +1896,10 @@ static int mlx4_en_ioctl(struct ifnet *dev, u_long com struct ifreq *ifr; int error; int mask; + struct ifrsskey *ifrk; + const u32 *key; + struct ifrsshash *ifrh; + u8 rss_mask; error = 0; mask = 0; @@ -2024,6 +2028,39 @@ out: break; } #endif + case SIOCGIFRSSKEY: + ifrk = (struct ifrsskey *)data; + ifrk->ifrk_func = RSS_FUNC_TOEPLITZ; + mutex_lock(&mdev->state_lock); + key = mlx4_en_get_rss_key(priv, &ifrk->ifrk_keylen); + if (ifrk->ifrk_keylen > RSS_KEYLEN) + error = EINVAL; + else + memcpy(ifrk->ifrk_key, key, ifrk->ifrk_keylen); + mutex_unlock(&mdev->state_lock); + break; + + case SIOCGIFRSSHASH: + mutex_lock(&mdev->state_lock); + rss_mask = mlx4_en_get_rss_mask(priv); + mutex_unlock(&mdev->state_lock); + ifrh = (struct ifrsshash *)data; + ifrh->ifrh_func = RSS_FUNC_TOEPLITZ; + ifrh->ifrh_types = 0; + if (rss_mask & MLX4_RSS_IPV4) + ifrh->ifrh_types |= RSS_TYPE_IPV4; + if (rss_mask & MLX4_RSS_TCP_IPV4) + ifrh->ifrh_types |= RSS_TYPE_TCP_IPV4; + if (rss_mask & MLX4_RSS_IPV6) + ifrh->ifrh_types |= RSS_TYPE_IPV6; + if (rss_mask & MLX4_RSS_TCP_IPV6) + ifrh->ifrh_types |= RSS_TYPE_TCP_IPV6; + if (rss_mask & MLX4_RSS_UDP_IPV4) + ifrh->ifrh_types |= RSS_TYPE_UDP_IPV4; + if (rss_mask & MLX4_RSS_UDP_IPV6) + ifrh->ifrh_types |= RSS_TYPE_UDP_IPV6; + break; + default: error = ether_ioctl(dev, command, data); break; Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c ============================================================================== --- head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Mon Oct 2 11:57:00 2017 (r324199) +++ head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Mon Oct 2 12:05:38 2017 (r324200) @@ -814,6 +814,38 @@ void mlx4_en_destroy_drop_qp(struct mlx4_en_priv *priv mlx4_qp_release_range(priv->mdev->dev, qpn, 1); } +const u32 * +mlx4_en_get_rss_key(struct mlx4_en_priv *priv __unused, + u16 *keylen) +{ + static const u32 rsskey[10] = { + cpu_to_be32(0xD181C62C), + cpu_to_be32(0xF7F4DB5B), + cpu_to_be32(0x1983A2FC), + cpu_to_be32(0x943E1ADB), + cpu_to_be32(0xD9389E6B), + cpu_to_be32(0xD1039C2C), + cpu_to_be32(0xA74499AD), + cpu_to_be32(0x593D56D9), + cpu_to_be32(0xF3253C06), + cpu_to_be32(0x2ADC1FFC) + }; + + if (keylen != NULL) + *keylen = sizeof(rsskey); + return (rsskey); +} + +u8 mlx4_en_get_rss_mask(struct mlx4_en_priv *priv) +{ + u8 rss_mask = (MLX4_RSS_IPV4 | MLX4_RSS_TCP_IPV4 | MLX4_RSS_IPV6 | + MLX4_RSS_TCP_IPV6); + + if (priv->mdev->profile.udp_rss) + rss_mask |= MLX4_RSS_UDP_IPV4 | MLX4_RSS_UDP_IPV6; + return (rss_mask); +} + /* Allocate rx qp's and configure them according to rss map */ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv) { @@ -821,16 +853,12 @@ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv struct mlx4_en_rss_map *rss_map = &priv->rss_map; struct mlx4_qp_context context; struct mlx4_rss_context *rss_context; + const u32 *key; int rss_rings; void *ptr; - u8 rss_mask = (MLX4_RSS_IPV4 | MLX4_RSS_TCP_IPV4 | MLX4_RSS_IPV6 | - MLX4_RSS_TCP_IPV6); int i; int err = 0; int good_qps = 0; - static const u32 rsskey[10] = { 0xD181C62C, 0xF7F4DB5B, 0x1983A2FC, - 0x943E1ADB, 0xD9389E6B, 0xD1039C2C, 0xA74499AD, - 0x593D56D9, 0xF3253C06, 0x2ADC1FFC}; en_dbg(DRV, priv, "Configuring rss steering\n"); err = mlx4_qp_reserve_range(mdev->dev, priv->rx_ring_num, @@ -874,14 +902,13 @@ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv rss_context->base_qpn = cpu_to_be32(ilog2(rss_rings) << 24 | (rss_map->base_qpn)); rss_context->default_qpn = cpu_to_be32(rss_map->base_qpn); - if (priv->mdev->profile.udp_rss) { - rss_mask |= MLX4_RSS_UDP_IPV4 | MLX4_RSS_UDP_IPV6; + if (priv->mdev->profile.udp_rss) rss_context->base_qpn_udp = rss_context->default_qpn; - } - rss_context->flags = rss_mask; + rss_context->flags = mlx4_en_get_rss_mask(priv); rss_context->hash_fn = MLX4_RSS_HASH_TOP; + key = mlx4_en_get_rss_key(priv, NULL); for (i = 0; i < 10; i++) - rss_context->rss_key[i] = cpu_to_be32(rsskey[i]); + rss_context->rss_key[i] = key[i]; err = mlx4_qp_to_ready(mdev->dev, &priv->res.mtt, &context, &rss_map->indir_qp, &rss_map->indir_state); From owner-svn-src-head@freebsd.org Mon Oct 2 12:11:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAEBFE3E267; Mon, 2 Oct 2017 12:11:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5E5265FCC; Mon, 2 Oct 2017 12:11:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92CBhiV018893; Mon, 2 Oct 2017 12:11:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92CBhes018892; Mon, 2 Oct 2017 12:11:43 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710021211.v92CBhes018892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 2 Oct 2017 12:11:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324201 - head/sys/dev/mlx4/mlx4_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx4/mlx4_en X-SVN-Commit-Revision: 324201 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 12:11:44 -0000 Author: hselasky Date: Mon Oct 2 12:11:43 2017 New Revision: 324201 URL: https://svnweb.freebsd.org/changeset/base/324201 Log: Setup mbuf hash type properly when receiving IP packets in the mlx4en(4) driver. Submitted by: sephe@ Differential Revision: https://reviews.freebsd.org/D12229 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c ============================================================================== --- head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Mon Oct 2 12:05:38 2017 (r324200) +++ head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Mon Oct 2 12:11:43 2017 (r324201) @@ -555,6 +555,51 @@ mlx4_en_rx_mb(struct mlx4_en_priv *priv, struct mlx4_e return (mb); } +static __inline int +mlx4_en_rss_hash(__be16 status, int udp_rss) +{ + const __be16 status_all = cpu_to_be16( + MLX4_CQE_STATUS_IPV4 | + MLX4_CQE_STATUS_IPV4F | + MLX4_CQE_STATUS_IPV6 | + MLX4_CQE_STATUS_TCP | + MLX4_CQE_STATUS_UDP); + const __be16 status_ipv4_tcp = cpu_to_be16( + MLX4_CQE_STATUS_IPV4 | + MLX4_CQE_STATUS_TCP); + const __be16 status_ipv6_tcp = cpu_to_be16( + MLX4_CQE_STATUS_IPV6 | + MLX4_CQE_STATUS_TCP); + const __be16 status_ipv4_udp = cpu_to_be16( + MLX4_CQE_STATUS_IPV4 | + MLX4_CQE_STATUS_UDP); + const __be16 status_ipv6_udp = cpu_to_be16( + MLX4_CQE_STATUS_IPV6 | + MLX4_CQE_STATUS_UDP); + const __be16 status_ipv4 = cpu_to_be16(MLX4_CQE_STATUS_IPV4); + const __be16 status_ipv6 = cpu_to_be16(MLX4_CQE_STATUS_IPV6); + + status &= status_all; + switch (status) { + case status_ipv4_tcp: + return (M_HASHTYPE_RSS_TCP_IPV4); + case status_ipv6_tcp: + return (M_HASHTYPE_RSS_TCP_IPV6); + case status_ipv4_udp: + return (udp_rss ? M_HASHTYPE_RSS_UDP_IPV4 + : M_HASHTYPE_RSS_IPV4); + case status_ipv6_udp: + return (udp_rss ? M_HASHTYPE_RSS_UDP_IPV6 + : M_HASHTYPE_RSS_IPV6); + default: + if (status & status_ipv4) + return (M_HASHTYPE_RSS_IPV4); + if (status & status_ipv6) + return (M_HASHTYPE_RSS_IPV6); + return (M_HASHTYPE_OPAQUE_HASH); + } +} + /* For cpu arch with cache line of 64B the performance is better when cqe size==64B * To enlarge cqe size from 32B to 64B --> 32B of garbage (i.e. 0xccccccc) * was added in the beginning of each cqe (the real data is in the corresponding 32B). @@ -578,6 +623,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, stru u32 size_mask = ring->size_mask; int size = cq->size; int factor = priv->cqe_factor; + const int udp_rss = priv->mdev->profile.udp_rss; if (!priv->port_up) return 0; @@ -625,7 +671,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, stru /* forward Toeplitz compatible hash value */ mb->m_pkthdr.flowid = be32_to_cpu(cqe->immed_rss_invalid); - M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE_HASH); + M_HASHTYPE_SET(mb, mlx4_en_rss_hash(cqe->status, udp_rss)); mb->m_pkthdr.rcvif = dev; if (be32_to_cpu(cqe->vlan_my_qpn) & MLX4_CQE_VLAN_PRESENT_MASK) { From owner-svn-src-head@freebsd.org Mon Oct 2 12:20:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E695EE3E561; Mon, 2 Oct 2017 12:20:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB79C6632B; Mon, 2 Oct 2017 12:20:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92CKtZ4022061; Mon, 2 Oct 2017 12:20:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92CKtnh022056; Mon, 2 Oct 2017 12:20:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710021220.v92CKtnh022056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 2 Oct 2017 12:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324202 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 324202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 12:20:57 -0000 Author: hselasky Date: Mon Oct 2 12:20:55 2017 New Revision: 324202 URL: https://svnweb.freebsd.org/changeset/base/324202 Log: Make sure the doorbell lock is valid for the i386 version of the mlx5en(4) driver. Tested by: gallatin @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Mon Oct 2 12:11:43 2017 (r324201) +++ head/sys/dev/mlx5/mlx5_en/en.h Mon Oct 2 12:20:55 2017 (r324202) @@ -800,12 +800,12 @@ mlx5e_tx_notify_hw(struct mlx5e_sq *sq, u32 *wqe, int } static inline void -mlx5e_cq_arm(struct mlx5e_cq *cq) +mlx5e_cq_arm(struct mlx5e_cq *cq, spinlock_t *dblock) { struct mlx5_core_cq *mcq; mcq = &cq->mcq; - mlx5_cq_arm(mcq, MLX5_CQ_DB_REQ_NOT, mcq->uar->map, NULL, cq->wq.cc); + mlx5_cq_arm(mcq, MLX5_CQ_DB_REQ_NOT, mcq->uar->map, dblock, cq->wq.cc); } extern const struct ethtool_ops mlx5e_ethtool_ops; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Oct 2 12:11:43 2017 (r324201) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Oct 2 12:20:55 2017 (r324202) @@ -1408,7 +1408,7 @@ mlx5e_enable_cq(struct mlx5e_cq *cq, struct mlx5e_cq_p if (err) return (err); - mlx5e_cq_arm(cq); + mlx5e_cq_arm(cq, MLX5_GET_DOORBELL_LOCK(&cq->priv->doorbell_lock)); return (0); } Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Oct 2 12:11:43 2017 (r324201) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Oct 2 12:20:55 2017 (r324202) @@ -430,7 +430,7 @@ mlx5e_rx_cq_comp(struct mlx5_core_cq *mcq) mlx5e_post_rx_wqes(rq); } mlx5e_post_rx_wqes(rq); - mlx5e_cq_arm(&rq->cq); + mlx5e_cq_arm(&rq->cq, MLX5_GET_DOORBELL_LOCK(&rq->channel->priv->doorbell_lock)); tcp_lro_flush_all(&rq->lro); mtx_unlock(&rq->mtx); } Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Mon Oct 2 12:11:43 2017 (r324201) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Mon Oct 2 12:20:55 2017 (r324202) @@ -574,7 +574,7 @@ mlx5e_tx_cq_comp(struct mlx5_core_cq *mcq) mtx_lock(&sq->comp_lock); mlx5e_poll_tx_cq(sq, MLX5E_BUDGET_MAX); - mlx5e_cq_arm(&sq->cq); + mlx5e_cq_arm(&sq->cq, MLX5_GET_DOORBELL_LOCK(&sq->priv->doorbell_lock)); mtx_unlock(&sq->comp_lock); } From owner-svn-src-head@freebsd.org Mon Oct 2 14:19:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 124F1E40580; Mon, 2 Oct 2017 14:19:33 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2B5169F54; Mon, 2 Oct 2017 14:19:32 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92EJV2u071190; Mon, 2 Oct 2017 14:19:31 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92EJVQe071189; Mon, 2 Oct 2017 14:19:31 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201710021419.v92EJVQe071189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Mon, 2 Oct 2017 14:19:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324206 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 324206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 14:19:33 -0000 Author: allanjude Date: Mon Oct 2 14:19:31 2017 New Revision: 324206 URL: https://svnweb.freebsd.org/changeset/base/324206 Log: bsdinstall(8) hardening menu: Utilize new kern.randompid=1 behaviour Enabling the PID randomization option in bsdinstall(8)'s hardening menu now randomizes the effective value of kern.randompid on each boot. Previous behaviour: When kern.randompid was enabled via the the bsdinstall(8) hardening menu, a random value was generated and placed in the systems /etc/sysctl.conf as kern.randompid=value This makes the value of kern.randompid static across reboots. New behaviour: When kern.randompid is enabled via the bsdinstall(8) hardening menu, the line kern.randompid=1 is placed in the systems /etc/sysctl.conf. This takes advantage of a new kernel feature and makes the value of kern.randompid be randomized by the kernel on each reboot. Submitted by: Marie Helene Kvello-Aune Reviewed by: des MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12433 Modified: head/usr.sbin/bsdinstall/scripts/hardening Modified: head/usr.sbin/bsdinstall/scripts/hardening ============================================================================== --- head/usr.sbin/bsdinstall/scripts/hardening Mon Oct 2 12:54:01 2017 (r324205) +++ head/usr.sbin/bsdinstall/scripts/hardening Mon Oct 2 14:19:31 2017 (r324206) @@ -66,7 +66,7 @@ for feature in $FEATURES; do echo security.bsd.unprivileged_proc_debug=0 >> $BSDINSTALL_TMPETC/sysctl.conf.hardening fi if [ "$feature" = "random_pid" ]; then - echo kern.randompid=$(jot -r 1 9999) >> $BSDINSTALL_TMPETC/sysctl.conf.hardening + echo kern.randompid=1 >> $BSDINSTALL_TMPETC/sysctl.conf.hardening fi if [ "$feature" = "clear_tmp" ]; then echo 'clear_tmp_enable="YES"' >> $BSDINSTALL_TMPETC/rc.conf.hardening From owner-svn-src-head@freebsd.org Mon Oct 2 14:22:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B920E40806; Mon, 2 Oct 2017 14:22:36 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 286866A478; Mon, 2 Oct 2017 14:22:36 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92EMZdX075439; Mon, 2 Oct 2017 14:22:35 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92EMZxe075438; Mon, 2 Oct 2017 14:22:35 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201710021422.v92EMZxe075438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 2 Oct 2017 14:22:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324207 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 324207 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 14:22:36 -0000 Author: andrew Date: Mon Oct 2 14:22:35 2017 New Revision: 324207 URL: https://svnweb.freebsd.org/changeset/base/324207 Log: Add a memory barrier to ensure the atomic write is visible to the other CPUs before waking them up. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/mp_machdep.c Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Mon Oct 2 14:19:31 2017 (r324206) +++ head/sys/arm64/arm64/mp_machdep.c Mon Oct 2 14:22:35 2017 (r324207) @@ -236,7 +236,10 @@ release_aps(void *dummy __unused) atomic_store_rel_int(&aps_ready, 1); /* Wake up the other CPUs */ - __asm __volatile("sev"); + __asm __volatile( + "dsb ishst \n" + "sev \n" + ::: "memory"); printf("Release APs\n"); From owner-svn-src-head@freebsd.org Mon Oct 2 15:48:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30FD2E41CE7; Mon, 2 Oct 2017 15:48:41 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D431E6C890; Mon, 2 Oct 2017 15:48:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92Fme0m008533; Mon, 2 Oct 2017 15:48:40 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92Fmd8o008531; Mon, 2 Oct 2017 15:48:39 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201710021548.v92Fmd8o008531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 2 Oct 2017 15:48:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324208 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 324208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 15:48:41 -0000 Author: manu Date: Mon Oct 2 15:48:39 2017 New Revision: 324208 URL: https://svnweb.freebsd.org/changeset/base/324208 Log: Allwinner H3 ccu: Use clock/reset IDs from dt-bindings Do not redefines resets and clocks ID which are already in the dt-bindings include directory. Those files are under dual licence GPL2/MIT so use them directly. Modified: head/sys/arm/allwinner/clkng/ccu_h3.c head/sys/arm/allwinner/clkng/ccu_h3.h Modified: head/sys/arm/allwinner/clkng/ccu_h3.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_h3.c Mon Oct 2 14:22:35 2017 (r324207) +++ head/sys/arm/allwinner/clkng/ccu_h3.c Mon Oct 2 15:48:39 2017 (r324208) @@ -43,157 +43,198 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include "ccu_h3.h" +/* Non-exported resets */ +#define RST_BUS_SCR 53 + +/* Non-exported clocks */ +#define CLK_PLL_CPUX 0 +#define CLK_PLL_AUDIO_BASE 1 +#define CLK_PLL_AUDIO 2 +#define CLK_PLL_AUDIO_2X 3 +#define CLK_PLL_AUDIO_4X 4 +#define CLK_PLL_AUDIO_8X 5 +#define CLK_PLL_VIDEO 6 +#define CLK_PLL_VE 7 +#define CLK_PLL_DDR 8 +#define CLK_PLL_PERIPH0_2X 10 +#define CLK_PLL_GPU 11 +#define CLK_PLL_PERIPH1 12 +#define CLK_PLL_DE 13 + +#define CLK_AXI 15 +#define CLK_AHB1 16 +#define CLK_APB1 17 +#define CLK_APB2 18 +#define CLK_AHB2 19 + +#define CLK_BUS_SCR 66 + +#define CLK_USBPHY0 88 +#define CLK_USBPHY1 89 +#define CLK_USBPHY2 90 +#define CLK_USBPHY3 91 +#define CLK_USBOHCI0 92 +#define CLK_USBOHCI1 93 +#define CLK_USBOHCI2 94 +#define CLK_USBOHCI3 95 +#define CLK_DRAM 96 + +#define CLK_MBUS 113 + static struct aw_ccung_reset h3_ccu_resets[] = { - CCU_RESET(H3_RST_USB_PHY0, 0xcc, 0) - CCU_RESET(H3_RST_USB_PHY1, 0xcc, 1) - CCU_RESET(H3_RST_USB_PHY2, 0xcc, 2) - CCU_RESET(H3_RST_USB_PHY3, 0xcc, 3) + CCU_RESET(RST_USB_PHY0, 0xcc, 0) + CCU_RESET(RST_USB_PHY1, 0xcc, 1) + CCU_RESET(RST_USB_PHY2, 0xcc, 2) + CCU_RESET(RST_USB_PHY3, 0xcc, 3) - CCU_RESET(H3_RST_MBUS, 0xfc, 31) + CCU_RESET(RST_MBUS, 0xfc, 31) - CCU_RESET(H3_RST_BUS_CE, 0x2c0, 5) - CCU_RESET(H3_RST_BUS_DMA, 0x2c0, 6) - CCU_RESET(H3_RST_BUS_MMC0, 0x2c0, 8) - CCU_RESET(H3_RST_BUS_MMC1, 0x2c0, 9) - CCU_RESET(H3_RST_BUS_MMC2, 0x2c0, 10) - CCU_RESET(H3_RST_BUS_NAND, 0x2c0, 13) - CCU_RESET(H3_RST_BUS_DRAM, 0x2c0, 14) - CCU_RESET(H3_RST_BUS_EMAC, 0x2c0, 17) - CCU_RESET(H3_RST_BUS_TS, 0x2c0, 18) - CCU_RESET(H3_RST_BUS_HSTIMER, 0x2c0, 19) - CCU_RESET(H3_RST_BUS_SPI0, 0x2c0, 20) - CCU_RESET(H3_RST_BUS_SPI1, 0x2c0, 21) - CCU_RESET(H3_RST_BUS_OTG, 0x2c0, 23) - CCU_RESET(H3_RST_BUS_EHCI0, 0x2c0, 24) - CCU_RESET(H3_RST_BUS_EHCI1, 0x2c0, 25) - CCU_RESET(H3_RST_BUS_EHCI2, 0x2c0, 26) - CCU_RESET(H3_RST_BUS_EHCI3, 0x2c0, 27) - CCU_RESET(H3_RST_BUS_OHCI0, 0x2c0, 28) - CCU_RESET(H3_RST_BUS_OHCI1, 0x2c0, 29) - CCU_RESET(H3_RST_BUS_OHCI2, 0x2c0, 30) - CCU_RESET(H3_RST_BUS_OHCI3, 0x2c0, 31) + CCU_RESET(RST_BUS_CE, 0x2c0, 5) + CCU_RESET(RST_BUS_DMA, 0x2c0, 6) + CCU_RESET(RST_BUS_MMC0, 0x2c0, 8) + CCU_RESET(RST_BUS_MMC1, 0x2c0, 9) + CCU_RESET(RST_BUS_MMC2, 0x2c0, 10) + CCU_RESET(RST_BUS_NAND, 0x2c0, 13) + CCU_RESET(RST_BUS_DRAM, 0x2c0, 14) + CCU_RESET(RST_BUS_EMAC, 0x2c0, 17) + CCU_RESET(RST_BUS_TS, 0x2c0, 18) + CCU_RESET(RST_BUS_HSTIMER, 0x2c0, 19) + CCU_RESET(RST_BUS_SPI0, 0x2c0, 20) + CCU_RESET(RST_BUS_SPI1, 0x2c0, 21) + CCU_RESET(RST_BUS_OTG, 0x2c0, 23) + CCU_RESET(RST_BUS_EHCI0, 0x2c0, 24) + CCU_RESET(RST_BUS_EHCI1, 0x2c0, 25) + CCU_RESET(RST_BUS_EHCI2, 0x2c0, 26) + CCU_RESET(RST_BUS_EHCI3, 0x2c0, 27) + CCU_RESET(RST_BUS_OHCI0, 0x2c0, 28) + CCU_RESET(RST_BUS_OHCI1, 0x2c0, 29) + CCU_RESET(RST_BUS_OHCI2, 0x2c0, 30) + CCU_RESET(RST_BUS_OHCI3, 0x2c0, 31) - CCU_RESET(H3_RST_BUS_VE, 0x2c4, 0) - CCU_RESET(H3_RST_BUS_TCON0, 0x2c4, 3) - CCU_RESET(H3_RST_BUS_TCON1, 0x2c4, 4) - CCU_RESET(H3_RST_BUS_DEINTERLACE, 0x2c4, 5) - CCU_RESET(H3_RST_BUS_CSI, 0x2c4, 8) - CCU_RESET(H3_RST_BUS_TVE, 0x2c4, 9) - CCU_RESET(H3_RST_BUS_HDMI0, 0x2c4, 10) - CCU_RESET(H3_RST_BUS_HDMI1, 0x2c4, 11) - CCU_RESET(H3_RST_BUS_DE, 0x2c4, 12) - CCU_RESET(H3_RST_BUS_GPU, 0x2c4, 20) - CCU_RESET(H3_RST_BUS_MSGBOX, 0x2c4, 21) - CCU_RESET(H3_RST_BUS_SPINLOCK, 0x2c4, 22) - CCU_RESET(H3_RST_BUS_DBG, 0x2c4, 31) + CCU_RESET(RST_BUS_VE, 0x2c4, 0) + CCU_RESET(RST_BUS_TCON0, 0x2c4, 3) + CCU_RESET(RST_BUS_TCON1, 0x2c4, 4) + CCU_RESET(RST_BUS_DEINTERLACE, 0x2c4, 5) + CCU_RESET(RST_BUS_CSI, 0x2c4, 8) + CCU_RESET(RST_BUS_TVE, 0x2c4, 9) + CCU_RESET(RST_BUS_HDMI0, 0x2c4, 10) + CCU_RESET(RST_BUS_HDMI1, 0x2c4, 11) + CCU_RESET(RST_BUS_DE, 0x2c4, 12) + CCU_RESET(RST_BUS_GPU, 0x2c4, 20) + CCU_RESET(RST_BUS_MSGBOX, 0x2c4, 21) + CCU_RESET(RST_BUS_SPINLOCK, 0x2c4, 22) + CCU_RESET(RST_BUS_DBG, 0x2c4, 31) - CCU_RESET(H3_RST_BUS_EPHY, 0x2c8, 2) + CCU_RESET(RST_BUS_EPHY, 0x2c8, 2) - CCU_RESET(H3_RST_BUS_CODEC, 0x2d0, 0) - CCU_RESET(H3_RST_BUS_SPDIF, 0x2d0, 1) - CCU_RESET(H3_RST_BUS_THS, 0x2d0, 8) - CCU_RESET(H3_RST_BUS_I2S0, 0x2d0, 12) - CCU_RESET(H3_RST_BUS_I2S1, 0x2d0, 13) - CCU_RESET(H3_RST_BUS_I2S2, 0x2d0, 14) + CCU_RESET(RST_BUS_CODEC, 0x2d0, 0) + CCU_RESET(RST_BUS_SPDIF, 0x2d0, 1) + CCU_RESET(RST_BUS_THS, 0x2d0, 8) + CCU_RESET(RST_BUS_I2S0, 0x2d0, 12) + CCU_RESET(RST_BUS_I2S1, 0x2d0, 13) + CCU_RESET(RST_BUS_I2S2, 0x2d0, 14) - CCU_RESET(H3_RST_BUS_I2C0, 0x2d8, 0) - CCU_RESET(H3_RST_BUS_I2C1, 0x2d8, 1) - CCU_RESET(H3_RST_BUS_I2C2, 0x2d8, 2) - CCU_RESET(H3_RST_BUS_UART0, 0x2d8, 16) - CCU_RESET(H3_RST_BUS_UART1, 0x2d8, 17) - CCU_RESET(H3_RST_BUS_UART2, 0x2d8, 18) - CCU_RESET(H3_RST_BUS_UART3, 0x2d8, 19) - CCU_RESET(H3_RST_BUS_SCR, 0x2d8, 20) + CCU_RESET(RST_BUS_I2C0, 0x2d8, 0) + CCU_RESET(RST_BUS_I2C1, 0x2d8, 1) + CCU_RESET(RST_BUS_I2C2, 0x2d8, 2) + CCU_RESET(RST_BUS_UART0, 0x2d8, 16) + CCU_RESET(RST_BUS_UART1, 0x2d8, 17) + CCU_RESET(RST_BUS_UART2, 0x2d8, 18) + CCU_RESET(RST_BUS_UART3, 0x2d8, 19) + CCU_RESET(RST_BUS_SCR, 0x2d8, 20) }; static struct aw_ccung_gate h3_ccu_gates[] = { - CCU_GATE(H3_CLK_BUS_CE, "bus-ce", "ahb1", 0x60, 5) - CCU_GATE(H3_CLK_BUS_DMA, "bus-dma", "ahb1", 0x60, 6) - CCU_GATE(H3_CLK_BUS_MMC0, "bus-mmc0", "ahb1", 0x60, 8) - CCU_GATE(H3_CLK_BUS_MMC1, "bus-mmc1", "ahb1", 0x60, 9) - CCU_GATE(H3_CLK_BUS_MMC2, "bus-mmc2", "ahb1", 0x60, 10) - CCU_GATE(H3_CLK_BUS_NAND, "bus-nand", "ahb1", 0x60, 13) - CCU_GATE(H3_CLK_BUS_DRAM, "bus-dram", "ahb1", 0x60, 14) - CCU_GATE(H3_CLK_BUS_EMAC, "bus-emac", "ahb2", 0x60, 17) - CCU_GATE(H3_CLK_BUS_TS, "bus-ts", "ahb1", 0x60, 18) - CCU_GATE(H3_CLK_BUS_HSTIMER, "bus-hstimer", "ahb1", 0x60, 19) - CCU_GATE(H3_CLK_BUS_SPI0, "bus-spi0", "ahb1", 0x60, 20) - CCU_GATE(H3_CLK_BUS_SPI1, "bus-spi1", "ahb1", 0x60, 21) - CCU_GATE(H3_CLK_BUS_OTG, "bus-otg", "ahb1", 0x60, 23) - CCU_GATE(H3_CLK_BUS_EHCI0, "bus-ehci0", "ahb1", 0x60, 24) - CCU_GATE(H3_CLK_BUS_EHCI1, "bus-ehci1", "ahb2", 0x60, 25) - CCU_GATE(H3_CLK_BUS_EHCI2, "bus-ehci2", "ahb2", 0x60, 26) - CCU_GATE(H3_CLK_BUS_EHCI3, "bus-ehci3", "ahb2", 0x60, 27) - CCU_GATE(H3_CLK_BUS_OHCI0, "bus-ohci0", "ahb1", 0x60, 28) - CCU_GATE(H3_CLK_BUS_OHCI1, "bus-ohci1", "ahb2", 0x60, 29) - CCU_GATE(H3_CLK_BUS_OHCI2, "bus-ohci2", "ahb2", 0x60, 30) - CCU_GATE(H3_CLK_BUS_OHCI3, "bus-ohci3", "ahb2", 0x60, 31) + CCU_GATE(CLK_BUS_CE, "bus-ce", "ahb1", 0x60, 5) + CCU_GATE(CLK_BUS_DMA, "bus-dma", "ahb1", 0x60, 6) + CCU_GATE(CLK_BUS_MMC0, "bus-mmc0", "ahb1", 0x60, 8) + CCU_GATE(CLK_BUS_MMC1, "bus-mmc1", "ahb1", 0x60, 9) + CCU_GATE(CLK_BUS_MMC2, "bus-mmc2", "ahb1", 0x60, 10) + CCU_GATE(CLK_BUS_NAND, "bus-nand", "ahb1", 0x60, 13) + CCU_GATE(CLK_BUS_DRAM, "bus-dram", "ahb1", 0x60, 14) + CCU_GATE(CLK_BUS_EMAC, "bus-emac", "ahb2", 0x60, 17) + CCU_GATE(CLK_BUS_TS, "bus-ts", "ahb1", 0x60, 18) + CCU_GATE(CLK_BUS_HSTIMER, "bus-hstimer", "ahb1", 0x60, 19) + CCU_GATE(CLK_BUS_SPI0, "bus-spi0", "ahb1", 0x60, 20) + CCU_GATE(CLK_BUS_SPI1, "bus-spi1", "ahb1", 0x60, 21) + CCU_GATE(CLK_BUS_OTG, "bus-otg", "ahb1", 0x60, 23) + CCU_GATE(CLK_BUS_EHCI0, "bus-ehci0", "ahb1", 0x60, 24) + CCU_GATE(CLK_BUS_EHCI1, "bus-ehci1", "ahb2", 0x60, 25) + CCU_GATE(CLK_BUS_EHCI2, "bus-ehci2", "ahb2", 0x60, 26) + CCU_GATE(CLK_BUS_EHCI3, "bus-ehci3", "ahb2", 0x60, 27) + CCU_GATE(CLK_BUS_OHCI0, "bus-ohci0", "ahb1", 0x60, 28) + CCU_GATE(CLK_BUS_OHCI1, "bus-ohci1", "ahb2", 0x60, 29) + CCU_GATE(CLK_BUS_OHCI2, "bus-ohci2", "ahb2", 0x60, 30) + CCU_GATE(CLK_BUS_OHCI3, "bus-ohci3", "ahb2", 0x60, 31) - CCU_GATE(H3_CLK_BUS_VE, "bus-ve", "ahb1", 0x64, 0) - CCU_GATE(H3_CLK_BUS_TCON0, "bus-tcon0", "ahb1", 0x64, 3) - CCU_GATE(H3_CLK_BUS_TCON1, "bus-tcon1", "ahb1", 0x64, 4) - CCU_GATE(H3_CLK_BUS_DEINTERLACE, "bus-deinterlace", "ahb1", 0x64, 5) - CCU_GATE(H3_CLK_BUS_CSI, "bus-csi", "ahb1", 0x64, 8) - CCU_GATE(H3_CLK_BUS_TVE, "bus-tve", "ahb1", 0x64, 9) - CCU_GATE(H3_CLK_BUS_HDMI, "bus-hdmi", "ahb1", 0x64, 11) - CCU_GATE(H3_CLK_BUS_DE, "bus-de", "ahb1", 0x64, 12) - CCU_GATE(H3_CLK_BUS_GPU, "bus-gpu", "ahb1", 0x64, 20) - CCU_GATE(H3_CLK_BUS_MSGBOX, "bus-msgbox", "ahb1", 0x64, 21) - CCU_GATE(H3_CLK_BUS_SPINLOCK, "bus-spinlock", "ahb1", 0x64, 22) + CCU_GATE(CLK_BUS_VE, "bus-ve", "ahb1", 0x64, 0) + CCU_GATE(CLK_BUS_TCON0, "bus-tcon0", "ahb1", 0x64, 3) + CCU_GATE(CLK_BUS_TCON1, "bus-tcon1", "ahb1", 0x64, 4) + CCU_GATE(CLK_BUS_DEINTERLACE, "bus-deinterlace", "ahb1", 0x64, 5) + CCU_GATE(CLK_BUS_CSI, "bus-csi", "ahb1", 0x64, 8) + CCU_GATE(CLK_BUS_TVE, "bus-tve", "ahb1", 0x64, 9) + CCU_GATE(CLK_BUS_HDMI, "bus-hdmi", "ahb1", 0x64, 11) + CCU_GATE(CLK_BUS_DE, "bus-de", "ahb1", 0x64, 12) + CCU_GATE(CLK_BUS_GPU, "bus-gpu", "ahb1", 0x64, 20) + CCU_GATE(CLK_BUS_MSGBOX, "bus-msgbox", "ahb1", 0x64, 21) + CCU_GATE(CLK_BUS_SPINLOCK, "bus-spinlock", "ahb1", 0x64, 22) - CCU_GATE(H3_CLK_BUS_CODEC, "bus-codec", "apb1", 0x68, 0) - CCU_GATE(H3_CLK_BUS_SPDIF, "bus-spdif", "apb1", 0x68, 1) - CCU_GATE(H3_CLK_BUS_PIO, "bus-pio", "apb1", 0x68, 5) - CCU_GATE(H3_CLK_BUS_THS, "bus-ths", "apb1", 0x68, 8) - CCU_GATE(H3_CLK_BUS_I2S0, "bus-i2s0", "apb1", 0x68, 12) - CCU_GATE(H3_CLK_BUS_I2S1, "bus-i2s1", "apb1", 0x68, 13) - CCU_GATE(H3_CLK_BUS_I2S2, "bus-i2s2", "apb1", 0x68, 14) + CCU_GATE(CLK_BUS_CODEC, "bus-codec", "apb1", 0x68, 0) + CCU_GATE(CLK_BUS_SPDIF, "bus-spdif", "apb1", 0x68, 1) + CCU_GATE(CLK_BUS_PIO, "bus-pio", "apb1", 0x68, 5) + CCU_GATE(CLK_BUS_THS, "bus-ths", "apb1", 0x68, 8) + CCU_GATE(CLK_BUS_I2S0, "bus-i2s0", "apb1", 0x68, 12) + CCU_GATE(CLK_BUS_I2S1, "bus-i2s1", "apb1", 0x68, 13) + CCU_GATE(CLK_BUS_I2S2, "bus-i2s2", "apb1", 0x68, 14) - CCU_GATE(H3_CLK_BUS_I2C0, "bus-i2c0", "apb2", 0x6c, 0) - CCU_GATE(H3_CLK_BUS_I2C1, "bus-i2c1", "apb2", 0x6c, 1) - CCU_GATE(H3_CLK_BUS_I2C2, "bus-i2c2", "apb2", 0x6c, 2) - CCU_GATE(H3_CLK_BUS_UART0, "bus-uart0", "apb2", 0x6c, 16) - CCU_GATE(H3_CLK_BUS_UART1, "bus-uart1", "apb2", 0x6c, 17) - CCU_GATE(H3_CLK_BUS_UART2, "bus-uart2", "apb2", 0x6c, 18) - CCU_GATE(H3_CLK_BUS_UART3, "bus-uart3", "apb2", 0x6c, 19) - CCU_GATE(H3_CLK_BUS_SCR, "bus-scr", "apb2", 0x6c, 20) + CCU_GATE(CLK_BUS_I2C0, "bus-i2c0", "apb2", 0x6c, 0) + CCU_GATE(CLK_BUS_I2C1, "bus-i2c1", "apb2", 0x6c, 1) + CCU_GATE(CLK_BUS_I2C2, "bus-i2c2", "apb2", 0x6c, 2) + CCU_GATE(CLK_BUS_UART0, "bus-uart0", "apb2", 0x6c, 16) + CCU_GATE(CLK_BUS_UART1, "bus-uart1", "apb2", 0x6c, 17) + CCU_GATE(CLK_BUS_UART2, "bus-uart2", "apb2", 0x6c, 18) + CCU_GATE(CLK_BUS_UART3, "bus-uart3", "apb2", 0x6c, 19) + CCU_GATE(CLK_BUS_SCR, "bus-scr", "apb2", 0x6c, 20) - CCU_GATE(H3_CLK_BUS_EPHY, "bus-ephy", "ahb1", 0x70, 0) - CCU_GATE(H3_CLK_BUS_DBG, "bus-dbg", "ahb1", 0x70, 7) + CCU_GATE(CLK_BUS_EPHY, "bus-ephy", "ahb1", 0x70, 0) + CCU_GATE(CLK_BUS_DBG, "bus-dbg", "ahb1", 0x70, 7) - CCU_GATE(H3_CLK_USBPHY0, "usb-phy0", "osc24M", 0xcc, 8) - CCU_GATE(H3_CLK_USBPHY1, "usb-phy1", "osc24M", 0xcc, 9) - CCU_GATE(H3_CLK_USBPHY2, "usb-phy2", "osc24M", 0xcc, 10) - CCU_GATE(H3_CLK_USBPHY3, "usb-phy3", "osc24M", 0xcc, 11) - CCU_GATE(H3_CLK_USBOHCI0, "usb-ohci0", "osc24M", 0xcc, 16) - CCU_GATE(H3_CLK_USBOHCI1, "usb-ohci1", "osc24M", 0xcc, 17) - CCU_GATE(H3_CLK_USBOHCI2, "usb-ohci2", "osc24M", 0xcc, 18) - CCU_GATE(H3_CLK_USBOHCI3, "usb-ohci3", "osc24M", 0xcc, 19) + CCU_GATE(CLK_USBPHY0, "usb-phy0", "osc24M", 0xcc, 8) + CCU_GATE(CLK_USBPHY1, "usb-phy1", "osc24M", 0xcc, 9) + CCU_GATE(CLK_USBPHY2, "usb-phy2", "osc24M", 0xcc, 10) + CCU_GATE(CLK_USBPHY3, "usb-phy3", "osc24M", 0xcc, 11) + CCU_GATE(CLK_USBOHCI0, "usb-ohci0", "osc24M", 0xcc, 16) + CCU_GATE(CLK_USBOHCI1, "usb-ohci1", "osc24M", 0xcc, 17) + CCU_GATE(CLK_USBOHCI2, "usb-ohci2", "osc24M", 0xcc, 18) + CCU_GATE(CLK_USBOHCI3, "usb-ohci3", "osc24M", 0xcc, 19) - CCU_GATE(H3_CLK_THS, "ths", "thsdiv", 0x74, 31) - CCU_GATE(H3_CLK_I2S0, "i2s0", "i2s0mux", 0xB0, 31) - CCU_GATE(H3_CLK_I2S1, "i2s1", "i2s1mux", 0xB4, 31) - CCU_GATE(H3_CLK_I2S2, "i2s2", "i2s2mux", 0xB8, 31) + CCU_GATE(CLK_THS, "ths", "thsdiv", 0x74, 31) + CCU_GATE(CLK_I2S0, "i2s0", "i2s0mux", 0xB0, 31) + CCU_GATE(CLK_I2S1, "i2s1", "i2s1mux", 0xB4, 31) + CCU_GATE(CLK_I2S2, "i2s2", "i2s2mux", 0xB8, 31) - CCU_GATE(H3_CLK_DRAM_VE, "dram-ve", "dram", 0x100, 0) - CCU_GATE(H3_CLK_DRAM_CSI, "dram-csi", "dram", 0x100, 1) - CCU_GATE(H3_CLK_DRAM_DEINTERLACE, "dram-deinterlace", "dram", 0x100, 2) - CCU_GATE(H3_CLK_DRAM_TS, "dram-ts", "dram", 0x100, 3) + CCU_GATE(CLK_DRAM_VE, "dram-ve", "dram", 0x100, 0) + CCU_GATE(CLK_DRAM_CSI, "dram-csi", "dram", 0x100, 1) + CCU_GATE(CLK_DRAM_DEINTERLACE, "dram-deinterlace", "dram", 0x100, 2) + CCU_GATE(CLK_DRAM_TS, "dram-ts", "dram", 0x100, 3) - CCU_GATE(H3_CLK_AC_DIG, "ac-dig", "pll_audio", 0x140, 31) + CCU_GATE(CLK_AC_DIG, "ac-dig", "pll_audio", 0x140, 31) - CCU_GATE(H3_CLK_AVS, "avs", "osc24M", 0x144, 31) + CCU_GATE(CLK_AVS, "avs", "osc24M", 0x144, 31) - CCU_GATE(H3_CLK_CSI_MISC, "csi-misc", "osc24M", 0x130, 31) + CCU_GATE(CLK_CSI_MISC, "csi-misc", "osc24M", 0x130, 31) - CCU_GATE(H3_CLK_HDMI_DDC, "hdmi-ddc", "osc24M", 0x154, 31) + CCU_GATE(CLK_HDMI_DDC, "hdmi-ddc", "osc24M", 0x154, 31) }; static const char *pll_cpux_parents[] = {"osc24M"}; NKMP_CLK(pll_cpux_clk, - H3_CLK_PLL_CPUX, /* id */ + CLK_PLL_CPUX, /* id */ "pll_cpux", pll_cpux_parents, /* name, parents */ 0x00, /* offset */ 8, 5, 0, 0, /* n factor */ @@ -206,7 +247,7 @@ NKMP_CLK(pll_cpux_clk, static const char *pll_audio_parents[] = {"osc24M"}; NKMP_CLK(pll_audio_clk, - H3_CLK_PLL_AUDIO, /* id */ + CLK_PLL_AUDIO, /* id */ "pll_audio", pll_audio_parents, /* name, parents */ 0x08, /* offset */ 8, 7, 0, 0, /* n factor */ @@ -219,7 +260,7 @@ NKMP_CLK(pll_audio_clk, static const char *pll_audio_mult_parents[] = {"pll_audio"}; FIXED_CLK(pll_audio_2x_clk, - H3_CLK_PLL_AUDIO_2X, /* id */ + CLK_PLL_AUDIO_2X, /* id */ "pll_audio-2x", /* name */ pll_audio_mult_parents, /* parent */ 0, /* freq */ @@ -227,7 +268,7 @@ FIXED_CLK(pll_audio_2x_clk, 1, /* div */ 0); /* flags */ FIXED_CLK(pll_audio_4x_clk, - H3_CLK_PLL_AUDIO_4X, /* id */ + CLK_PLL_AUDIO_4X, /* id */ "pll_audio-4x", /* name */ pll_audio_mult_parents, /* parent */ 0, /* freq */ @@ -235,7 +276,7 @@ FIXED_CLK(pll_audio_4x_clk, 1, /* div */ 0); /* flags */ FIXED_CLK(pll_audio_8x_clk, - H3_CLK_PLL_AUDIO_8X, /* id */ + CLK_PLL_AUDIO_8X, /* id */ "pll_audio-8x", /* name */ pll_audio_mult_parents, /* parent */ 0, /* freq */ @@ -245,7 +286,7 @@ FIXED_CLK(pll_audio_8x_clk, static const char *pll_video_parents[] = {"osc24M"}; NM_CLK_WITH_FRAC(pll_video_clk, - H3_CLK_PLL_VIDEO, /* id */ + CLK_PLL_VIDEO, /* id */ "pll_video", pll_video_parents, /* name, parents */ 0x10, /* offset */ 8, 7, 0, 0, /* n factor */ @@ -257,7 +298,7 @@ NM_CLK_WITH_FRAC(pll_video_clk, static const char *pll_ve_parents[] = {"osc24M"}; NM_CLK_WITH_FRAC(pll_ve_clk, - H3_CLK_PLL_VE, /* id */ + CLK_PLL_VE, /* id */ "pll_ve", pll_ve_parents, /* name, parents */ 0x18, /* offset */ 8, 7, 0, 0, /* n factor */ @@ -269,7 +310,7 @@ NM_CLK_WITH_FRAC(pll_ve_clk, static const char *pll_ddr_parents[] = {"osc24M"}; NKMP_CLK_WITH_UPDATE(pll_ddr_clk, - H3_CLK_PLL_DDR, /* id */ + CLK_PLL_DDR, /* id */ "pll_ddr", pll_ddr_parents, /* name, parents */ 0x20, /* offset */ 8, 5, 0, 0, /* n factor */ @@ -284,7 +325,7 @@ NKMP_CLK_WITH_UPDATE(pll_ddr_clk, static const char *pll_periph0_parents[] = {"osc24M"}; static const char *pll_periph0_2x_parents[] = {"pll_periph0"}; NKMP_CLK(pll_periph0_clk, - H3_CLK_PLL_PERIPH0, /* id */ + CLK_PLL_PERIPH0, /* id */ "pll_periph0", pll_periph0_parents, /* name, parents */ 0x28, /* offset */ 8, 5, 0, 0, /* n factor */ @@ -295,7 +336,7 @@ NKMP_CLK(pll_periph0_clk, 28, 1000, /* lock */ AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ FIXED_CLK(pll_periph0_2x_clk, - H3_CLK_PLL_PERIPH0_2X, /* id */ + CLK_PLL_PERIPH0_2X, /* id */ "pll_periph0-2x", /* name */ pll_periph0_2x_parents, /* parent */ 0, /* freq */ @@ -305,7 +346,7 @@ FIXED_CLK(pll_periph0_2x_clk, static const char *pll_gpu_parents[] = {"osc24M"}; NM_CLK_WITH_FRAC(pll_gpu_clk, - H3_CLK_PLL_GPU, /* id */ + CLK_PLL_GPU, /* id */ "pll_gpu", pll_gpu_parents, /* name, parents */ 0x38, /* offset */ 8, 7, 0, 0, /* n factor */ @@ -317,7 +358,7 @@ NM_CLK_WITH_FRAC(pll_gpu_clk, static const char *pll_periph1_parents[] = {"osc24M"}; NKMP_CLK(pll_periph1_clk, - H3_CLK_PLL_PERIPH1, /* id */ + CLK_PLL_PERIPH1, /* id */ "pll_periph1", pll_periph1_parents, /* name, parents */ 0x44, /* offset */ 8, 5, 0, 0, /* n factor */ @@ -330,7 +371,7 @@ NKMP_CLK(pll_periph1_clk, static const char *pll_de_parents[] = {"osc24M"}; NM_CLK_WITH_FRAC(pll_de_clk, - H3_CLK_PLL_DE, /* id */ + CLK_PLL_DE, /* id */ "pll_de", pll_de_parents, /* name, parents */ 0x48, /* offset */ 8, 7, 0, 0, /* n factor */ @@ -342,20 +383,20 @@ NM_CLK_WITH_FRAC(pll_de_clk, static const char *cpux_parents[] = {"osc32k", "osc24M", "pll_cpux", "pll_cpux"}; MUX_CLK(cpux_clk, - H3_CLK_CPUX, /* id */ + CLK_CPUX, /* id */ "cpux", cpux_parents, /* name, parents */ 0x50, 16, 2); /* offset, shift, width */ static const char *axi_parents[] = {"cpux"}; DIV_CLK(axi_clk, - H3_CLK_AXI, /* id */ + CLK_AXI, /* id */ "axi", axi_parents, /* name, parents */ 0x50, /* offset */ 0, 2, /* shift, width */ 0, NULL); /* flags, div table */ static const char *ahb1_parents[] = {"osc32k", "osc24M", "axi", "pll_periph0"}; -PREDIV_CLK(ahb1_clk, H3_CLK_AHB1, /* id */ +PREDIV_CLK(ahb1_clk, CLK_AHB1, /* id */ "ahb1", ahb1_parents, /* name, parents */ 0x54, /* offset */ 12, 2, /* mux */ @@ -372,7 +413,7 @@ static struct clk_div_table apb1_div_table[] = { { }, }; DIV_CLK(apb1_clk, - H3_CLK_APB1, /* id */ + CLK_APB1, /* id */ "apb1", apb1_parents, /* name, parents */ 0x54, /* offset */ 8, 2, /* shift, width */ @@ -381,7 +422,7 @@ DIV_CLK(apb1_clk, static const char *apb2_parents[] = {"osc32k", "osc24M", "pll_periph0", "pll_periph0"}; NM_CLK(apb2_clk, - H3_CLK_APB2, /* id */ + CLK_APB2, /* id */ "apb2", apb2_parents, /* name, parents */ 0x58, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ @@ -391,7 +432,7 @@ NM_CLK(apb2_clk, AW_CLK_HAS_MUX); static const char *ahb2_parents[] = {"ahb1", "pll_periph0"}; -PREDIV_CLK(ahb2_clk, H3_CLK_AHB2, /* id */ +PREDIV_CLK(ahb2_clk, CLK_AHB2, /* id */ "ahb2", ahb2_parents, /* name, parents */ 0x5c, /* offset */ 0, 2, /* mux */ @@ -408,7 +449,7 @@ static struct clk_div_table ths_div_table[] = { { }, }; DIV_CLK(thsdiv_clk, - 0, /* id */ + 0, /* id */ "thsdiv", ths_parents, /* name, parents */ 0x74, /* offset */ 0, 2, /* shift, width */ @@ -417,7 +458,7 @@ DIV_CLK(thsdiv_clk, static const char *mod_parents[] = {"osc24M", "pll_periph0", "pll_periph1"}; NM_CLK(nand_clk, - H3_CLK_NAND, "nand", mod_parents, /* id, name, parents */ + CLK_NAND, "nand", mod_parents, /* id, name, parents */ 0x80, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -426,7 +467,7 @@ NM_CLK(nand_clk, AW_CLK_HAS_GATE | AW_CLK_HAS_MUX); /* flags */ NM_CLK(mmc0_clk, - H3_CLK_MMC0, "mmc0", mod_parents, /* id, name, parents */ + CLK_MMC0, "mmc0", mod_parents, /* id, name, parents */ 0x88, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -436,7 +477,7 @@ NM_CLK(mmc0_clk, AW_CLK_REPARENT); /* flags */ NM_CLK(mmc1_clk, - H3_CLK_MMC1, "mmc1", mod_parents, /* id, name, parents */ + CLK_MMC1, "mmc1", mod_parents, /* id, name, parents */ 0x8c, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -446,7 +487,7 @@ NM_CLK(mmc1_clk, AW_CLK_REPARENT); /* flags */ NM_CLK(mmc2_clk, - H3_CLK_MMC2, "mmc2", mod_parents, /* id, name, parents */ + CLK_MMC2, "mmc2", mod_parents, /* id, name, parents */ 0x90, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -457,7 +498,7 @@ NM_CLK(mmc2_clk, static const char *ts_parents[] = {"osc24M", "pll_periph0"}; NM_CLK(ts_clk, - H3_CLK_TS, "ts", ts_parents, /* id, name, parents */ + CLK_TS, "ts", ts_parents, /* id, name, parents */ 0x98, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -466,7 +507,7 @@ NM_CLK(ts_clk, AW_CLK_HAS_GATE | AW_CLK_HAS_MUX); /* flags */ NM_CLK(ce_clk, - H3_CLK_CE, "ce", mod_parents, /* id, name, parents */ + CLK_CE, "ce", mod_parents, /* id, name, parents */ 0x9C, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -475,7 +516,7 @@ NM_CLK(ce_clk, AW_CLK_HAS_GATE | AW_CLK_HAS_MUX); /* flags */ NM_CLK(spi0_clk, - H3_CLK_SPI0, "spi0", mod_parents, /* id, name, parents */ + CLK_SPI0, "spi0", mod_parents, /* id, name, parents */ 0xA0, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -485,7 +526,7 @@ NM_CLK(spi0_clk, AW_CLK_REPARENT); /* flags */ NM_CLK(spi1_clk, - H3_CLK_SPI1, "spi1", mod_parents, /* id, name, parents */ + CLK_SPI1, "spi1", mod_parents, /* id, name, parents */ 0xA4, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -507,7 +548,7 @@ MUX_CLK(i2s2mux_clk, static const char *spdif_parents[] = {"pll_audio"}; NM_CLK(spdif_clk, - H3_CLK_SPDIF, "spdif", spdif_parents, /* id, name, parents */ + CLK_SPDIF, "spdif", spdif_parents, /* id, name, parents */ 0xC0, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake); */ 0, 4, 0, 0, /* m factor */ @@ -517,7 +558,7 @@ NM_CLK(spdif_clk, static const char *dram_parents[] = {"pll_ddr", "pll_periph0-2x"}; NM_CLK(dram_clk, - H3_CLK_DRAM, "dram", dram_parents, /* id, name, parents */ + CLK_DRAM, "dram", dram_parents, /* id, name, parents */ 0xF4, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -527,7 +568,7 @@ NM_CLK(dram_clk, static const char *de_parents[] = {"pll_periph0-2x", "pll_de"}; NM_CLK(de_clk, - H3_CLK_DE, "de", de_parents, /* id, name, parents */ + CLK_DE, "de", de_parents, /* id, name, parents */ 0x104, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -537,7 +578,7 @@ NM_CLK(de_clk, static const char *tcon0_parents[] = {"pll_video"}; NM_CLK(tcon0_clk, - H3_CLK_TCON0, "tcon0", tcon0_parents, /* id, name, parents */ + CLK_TCON0, "tcon0", tcon0_parents, /* id, name, parents */ 0x118, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -547,7 +588,7 @@ NM_CLK(tcon0_clk, static const char *tve_parents[] = {"pll_de", "pll_periph1"}; NM_CLK(tve_clk, - H3_CLK_TVE, "tve", tve_parents, /* id, name, parents */ + CLK_TVE, "tve", tve_parents, /* id, name, parents */ 0x120, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -557,7 +598,7 @@ NM_CLK(tve_clk, static const char *deinterlace_parents[] = {"pll_periph0", "pll_periph1"}; NM_CLK(deinterlace_clk, - H3_CLK_DEINTERLACE, "deinterlace", deinterlace_parents, /* id, name, parents */ + CLK_DEINTERLACE, "deinterlace", deinterlace_parents, /* id, name, parents */ 0x124, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -567,7 +608,7 @@ NM_CLK(deinterlace_clk, static const char *csi_sclk_parents[] = {"pll_periph0", "pll_periph1"}; NM_CLK(csi_sclk_clk, - H3_CLK_CSI_SCLK, "csi-sclk", csi_sclk_parents, /* id, name, parents */ + CLK_CSI_SCLK, "csi-sclk", csi_sclk_parents, /* id, name, parents */ 0x134, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 16, 4, 0, 0, /* m factor */ @@ -577,7 +618,7 @@ NM_CLK(csi_sclk_clk, static const char *csi_mclk_parents[] = {"osc24M", "pll_video", "pll_periph1"}; NM_CLK(csi_mclk_clk, - H3_CLK_CSI_MCLK, "csi-mclk", csi_mclk_parents, /* id, name, parents */ + CLK_CSI_MCLK, "csi-mclk", csi_mclk_parents, /* id, name, parents */ 0x134, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -587,7 +628,7 @@ NM_CLK(csi_mclk_clk, static const char *ve_parents[] = {"pll_ve"}; NM_CLK(ve_clk, - H3_CLK_VE, "ve", ve_parents, /* id, name, parents */ + CLK_VE, "ve", ve_parents, /* id, name, parents */ 0x13C, /* offset */ 16, 3, 0, 0, /* n factor */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* m factor (fake) */ @@ -597,7 +638,7 @@ NM_CLK(ve_clk, static const char *hdmi_parents[] = {"pll_video"}; NM_CLK(hdmi_clk, - H3_CLK_HDMI, "hdmi", hdmi_parents, /* id, name, parents */ + CLK_HDMI, "hdmi", hdmi_parents, /* id, name, parents */ 0x150, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -607,7 +648,7 @@ NM_CLK(hdmi_clk, static const char *mbus_parents[] = {"osc24M", "pll_periph0-2x", "pll_ddr"}; NM_CLK(mbus_clk, - H3_CLK_MBUS, "mbus", mbus_parents, /* id, name, parents */ + CLK_MBUS, "mbus", mbus_parents, /* id, name, parents */ 0x15C, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 3, 0, 0, /* m factor */ @@ -617,7 +658,7 @@ NM_CLK(mbus_clk, static const char *gpu_parents[] = {"pll_gpu"}; NM_CLK(gpu_clk, - H3_CLK_GPU, "gpu", gpu_parents, /* id, name, parents */ + CLK_GPU, "gpu", gpu_parents, /* id, name, parents */ 0x1A0, /* offset */ 0, 2, 0, 0, /* n factor */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* m factor (fake) */ Modified: head/sys/arm/allwinner/clkng/ccu_h3.h ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_h3.h Mon Oct 2 14:22:35 2017 (r324207) +++ head/sys/arm/allwinner/clkng/ccu_h3.h Mon Oct 2 15:48:39 2017 (r324208) @@ -29,177 +29,6 @@ #ifndef __CCU_H3_H__ #define __CCU_H3_H__ -#define H3_RST_USB_PHY0 0 -#define H3_RST_USB_PHY1 1 -#define H3_RST_USB_PHY2 2 -#define H3_RST_USB_PHY3 3 -#define H3_RST_MBUS 4 -#define H3_RST_BUS_CE 5 -#define H3_RST_BUS_DMA 6 -#define H3_RST_BUS_MMC0 7 -#define H3_RST_BUS_MMC1 8 -#define H3_RST_BUS_MMC2 9 -#define H3_RST_BUS_NAND 10 -#define H3_RST_BUS_DRAM 11 -#define H3_RST_BUS_EMAC 12 -#define H3_RST_BUS_TS 13 -#define H3_RST_BUS_HSTIMER 14 -#define H3_RST_BUS_SPI0 15 -#define H3_RST_BUS_SPI1 16 -#define H3_RST_BUS_OTG 17 -#define H3_RST_BUS_EHCI0 18 -#define H3_RST_BUS_EHCI1 19 -#define H3_RST_BUS_EHCI2 20 -#define H3_RST_BUS_EHCI3 21 -#define H3_RST_BUS_OHCI0 22 -#define H3_RST_BUS_OHCI1 23 -#define H3_RST_BUS_OHCI2 24 -#define H3_RST_BUS_OHCI3 25 -#define H3_RST_BUS_VE 26 -#define H3_RST_BUS_TCON0 27 -#define H3_RST_BUS_TCON1 28 -#define H3_RST_BUS_DEINTERLACE 29 -#define H3_RST_BUS_CSI 30 -#define H3_RST_BUS_TVE 31 -#define H3_RST_BUS_HDMI0 32 -#define H3_RST_BUS_HDMI1 33 -#define H3_RST_BUS_DE 34 -#define H3_RST_BUS_GPU 35 -#define H3_RST_BUS_MSGBOX 36 -#define H3_RST_BUS_SPINLOCK 37 -#define H3_RST_BUS_DBG 38 -#define H3_RST_BUS_EPHY 39 -#define H3_RST_BUS_CODEC 40 -#define H3_RST_BUS_SPDIF 41 -#define H3_RST_BUS_THS 42 -#define H3_RST_BUS_I2S0 43 -#define H3_RST_BUS_I2S1 44 -#define H3_RST_BUS_I2S2 45 -#define H3_RST_BUS_I2C0 46 -#define H3_RST_BUS_I2C1 47 -#define H3_RST_BUS_I2C2 48 -#define H3_RST_BUS_UART0 49 -#define H3_RST_BUS_UART1 50 -#define H3_RST_BUS_UART2 51 -#define H3_RST_BUS_UART3 52 -#define H3_RST_BUS_SCR 53 - -#define H3_CLK_PLL_CPUX 0 -#define H3_CLK_PLL_AUDIO_BASE 1 -#define H3_CLK_PLL_AUDIO 2 -#define H3_CLK_PLL_AUDIO_2X 3 -#define H3_CLK_PLL_AUDIO_4X 4 -#define H3_CLK_PLL_AUDIO_8X 5 -#define H3_CLK_PLL_VIDEO 6 -#define H3_CLK_PLL_VE 7 -#define H3_CLK_PLL_DDR 8 -#define H3_CLK_PLL_PERIPH0 9 -#define H3_CLK_PLL_PERIPH0_2X 10 -#define H3_CLK_PLL_GPU 11 -#define H3_CLK_PLL_PERIPH1 12 -#define H3_CLK_PLL_DE 13 -#define H3_CLK_CPUX 14 -#define H3_CLK_AXI 15 -#define H3_CLK_AHB1 16 -#define H3_CLK_APB1 17 -#define H3_CLK_APB2 18 -#define H3_CLK_AHB2 19 -#define H3_CLK_BUS_CE 20 -#define H3_CLK_BUS_DMA 21 -#define H3_CLK_BUS_MMC0 22 -#define H3_CLK_BUS_MMC1 23 -#define H3_CLK_BUS_MMC2 24 -#define H3_CLK_BUS_NAND 25 -#define H3_CLK_BUS_DRAM 26 -#define H3_CLK_BUS_EMAC 27 -#define H3_CLK_BUS_TS 28 -#define H3_CLK_BUS_HSTIMER 29 -#define H3_CLK_BUS_SPI0 30 -#define H3_CLK_BUS_SPI1 31 -#define H3_CLK_BUS_OTG 32 -#define H3_CLK_BUS_EHCI0 33 -#define H3_CLK_BUS_EHCI1 34 -#define H3_CLK_BUS_EHCI2 35 -#define H3_CLK_BUS_EHCI3 36 -#define H3_CLK_BUS_OHCI0 37 -#define H3_CLK_BUS_OHCI1 38 -#define H3_CLK_BUS_OHCI2 39 -#define H3_CLK_BUS_OHCI3 40 -#define H3_CLK_BUS_VE 41 -#define H3_CLK_BUS_TCON0 42 -#define H3_CLK_BUS_TCON1 43 -#define H3_CLK_BUS_DEINTERLACE 44 -#define H3_CLK_BUS_CSI 45 -#define H3_CLK_BUS_TVE 46 -#define H3_CLK_BUS_HDMI 47 -#define H3_CLK_BUS_DE 48 -#define H3_CLK_BUS_GPU 49 -#define H3_CLK_BUS_MSGBOX 50 -#define H3_CLK_BUS_SPINLOCK 51 -#define H3_CLK_BUS_CODEC 52 -#define H3_CLK_BUS_SPDIF 53 -#define H3_CLK_BUS_PIO 54 -#define H3_CLK_BUS_THS 55 -#define H3_CLK_BUS_I2S0 56 -#define H3_CLK_BUS_I2S1 57 -#define H3_CLK_BUS_I2S2 58 -#define H3_CLK_BUS_I2C0 59 -#define H3_CLK_BUS_I2C1 60 -#define H3_CLK_BUS_I2C2 61 -#define H3_CLK_BUS_UART0 62 -#define H3_CLK_BUS_UART1 63 -#define H3_CLK_BUS_UART2 64 -#define H3_CLK_BUS_UART3 65 -#define H3_CLK_BUS_SCR 66 -#define H3_CLK_BUS_EPHY 67 -#define H3_CLK_BUS_DBG 68 -#define H3_CLK_THS 69 -#define H3_CLK_NAND 70 -#define H3_CLK_MMC0 71 -#define H3_CLK_MMC0_SAMPLE 72 -#define H3_CLK_MMC0_OUTPUT 73 -#define H3_CLK_MMC1 74 -#define H3_CLK_MMC1_SAMPLE 75 -#define H3_CLK_MMC1_OUTPUT 76 -#define H3_CLK_MMC2 77 -#define H3_CLK_MMC2_SAMPLE 78 -#define H3_CLK_MMC2_OUTPUT 79 -#define H3_CLK_TS 80 -#define H3_CLK_CE 81 -#define H3_CLK_SPI0 82 -#define H3_CLK_SPI1 83 -#define H3_CLK_I2S0 84 -#define H3_CLK_I2S1 85 -#define H3_CLK_I2S2 86 -#define H3_CLK_SPDIF 87 -#define H3_CLK_USBPHY0 88 -#define H3_CLK_USBPHY1 89 -#define H3_CLK_USBPHY2 90 -#define H3_CLK_USBPHY3 91 -#define H3_CLK_USBOHCI0 92 -#define H3_CLK_USBOHCI1 93 -#define H3_CLK_USBOHCI2 94 -#define H3_CLK_USBOHCI3 95 -#define H3_CLK_DRAM 96 -#define H3_CLK_DRAM_VE 97 -#define H3_CLK_DRAM_CSI 98 -#define H3_CLK_DRAM_DEINTERLACE 99 -#define H3_CLK_DRAM_TS 100 -#define H3_CLK_DE 101 -#define H3_CLK_TCON0 102 -#define H3_CLK_TVE 103 -#define H3_CLK_DEINTERLACE 104 -#define H3_CLK_CSI_MISC 105 -#define H3_CLK_CSI_SCLK 106 -#define H3_CLK_CSI_MCLK 107 -#define H3_CLK_VE 108 -#define H3_CLK_AC_DIG 109 -#define H3_CLK_AVS 110 -#define H3_CLK_HDMI 111 -#define H3_CLK_HDMI_DDC 112 -#define H3_CLK_MBUS 113 -#define H3_CLK_GPU 114 - void ccu_h3_register_clocks(struct aw_ccung_softc *sc); #endif /* __CCU_H3_H__ */ From owner-svn-src-head@freebsd.org Mon Oct 2 15:56:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 508BCE0D211; Mon, 2 Oct 2017 15:56:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CA8E6CEB4; Mon, 2 Oct 2017 15:56:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92FukjZ012987; Mon, 2 Oct 2017 15:56:46 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92FujTh012978; Mon, 2 Oct 2017 15:56:45 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201710021556.v92FujTh012978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 2 Oct 2017 15:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324209 - head/release/arm X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/arm X-SVN-Commit-Revision: 324209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 15:56:47 -0000 Author: gjb Date: Mon Oct 2 15:56:45 2017 New Revision: 324209 URL: https://svnweb.freebsd.org/changeset/base/324209 Log: Bump armv6 SoC images to 2.25GB. RPI-B is full, so increase all image sizes for consistency. Submitted by: manu Sponsored by: The FreeBSD Foundation Modified: head/release/arm/BANANAPI.conf head/release/arm/BEAGLEBONE.conf head/release/arm/CUBIEBOARD.conf head/release/arm/CUBIEBOARD2.conf head/release/arm/CUBOX-HUMMINGBOARD.conf head/release/arm/GUMSTIX.conf head/release/arm/PANDABOARD.conf head/release/arm/RPI-B.conf head/release/arm/RPI2.conf Modified: head/release/arm/BANANAPI.conf ============================================================================== --- head/release/arm/BANANAPI.conf Mon Oct 2 15:48:39 2017 (r324208) +++ head/release/arm/BANANAPI.conf Mon Oct 2 15:56:45 2017 (r324209) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-bananapi" KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" -IMAGE_SIZE="1536M" +IMAGE_SIZE="2560M" PART_SCHEME="MBR" FAT_SIZE="32m -b 1m" FAT_TYPE="16" Modified: head/release/arm/BEAGLEBONE.conf ============================================================================== --- head/release/arm/BEAGLEBONE.conf Mon Oct 2 15:48:39 2017 (r324208) +++ head/release/arm/BEAGLEBONE.conf Mon Oct 2 15:56:45 2017 (r324209) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-beaglebone" KERNEL="BEAGLEBONE" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" -IMAGE_SIZE="1536M" +IMAGE_SIZE="2560M" PART_SCHEME="MBR" FAT_SIZE="2m" FAT_TYPE="12" Modified: head/release/arm/CUBIEBOARD.conf ============================================================================== --- head/release/arm/CUBIEBOARD.conf Mon Oct 2 15:48:39 2017 (r324208) +++ head/release/arm/CUBIEBOARD.conf Mon Oct 2 15:56:45 2017 (r324209) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-cubieboard" KERNEL="ALLWINNER_UP" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" -IMAGE_SIZE="1536M" +IMAGE_SIZE="2560M" PART_SCHEME="MBR" FAT_SIZE="32m -b 1m" FAT_TYPE="16" Modified: head/release/arm/CUBIEBOARD2.conf ============================================================================== --- head/release/arm/CUBIEBOARD2.conf Mon Oct 2 15:48:39 2017 (r324208) +++ head/release/arm/CUBIEBOARD2.conf Mon Oct 2 15:56:45 2017 (r324209) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-cubieboard2" KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" -IMAGE_SIZE="1536M" +IMAGE_SIZE="2560M" PART_SCHEME="MBR" FAT_SIZE="32m -b 1m" FAT_TYPE="16" Modified: head/release/arm/CUBOX-HUMMINGBOARD.conf ============================================================================== --- head/release/arm/CUBOX-HUMMINGBOARD.conf Mon Oct 2 15:48:39 2017 (r324208) +++ head/release/arm/CUBOX-HUMMINGBOARD.conf Mon Oct 2 15:56:45 2017 (r324209) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-cubox-hummingboard" KERNEL="IMX6" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x12000000" -IMAGE_SIZE="1536M" +IMAGE_SIZE="2560M" PART_SCHEME="MBR" FAT_SIZE="50m -b 16384" FAT_TYPE="16" Modified: head/release/arm/GUMSTIX.conf ============================================================================== --- head/release/arm/GUMSTIX.conf Mon Oct 2 15:48:39 2017 (r324208) +++ head/release/arm/GUMSTIX.conf Mon Oct 2 15:56:45 2017 (r324209) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-duovero" KERNEL="GUMSTIX" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" -IMAGE_SIZE="1536M" +IMAGE_SIZE="2560M" PART_SCHEME="MBR" FAT_SIZE="2m" FAT_TYPE="12" Modified: head/release/arm/PANDABOARD.conf ============================================================================== --- head/release/arm/PANDABOARD.conf Mon Oct 2 15:48:39 2017 (r324208) +++ head/release/arm/PANDABOARD.conf Mon Oct 2 15:56:45 2017 (r324209) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-pandaboard" KERNEL="PANDABOARD" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" -IMAGE_SIZE="1536M" +IMAGE_SIZE="2560M" PART_SCHEME="MBR" FAT_SIZE="2m" FAT_TYPE="12" Modified: head/release/arm/RPI-B.conf ============================================================================== --- head/release/arm/RPI-B.conf Mon Oct 2 15:48:39 2017 (r324208) +++ head/release/arm/RPI-B.conf Mon Oct 2 15:56:45 2017 (r324209) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-rpi" KERNEL="RPI-B" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" -IMAGE_SIZE="1536M" +IMAGE_SIZE="2560M" PART_SCHEME="MBR" FAT_SIZE="17m" FAT_TYPE="16" Modified: head/release/arm/RPI2.conf ============================================================================== --- head/release/arm/RPI2.conf Mon Oct 2 15:48:39 2017 (r324208) +++ head/release/arm/RPI2.conf Mon Oct 2 15:56:45 2017 (r324209) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-rpi2" KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" -IMAGE_SIZE="1536M" +IMAGE_SIZE="2560M" PART_SCHEME="MBR" FAT_SIZE="50m" FAT_TYPE="16" From owner-svn-src-head@freebsd.org Mon Oct 2 16:12:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DE0FE0D863; Mon, 2 Oct 2017 16:12:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C44236D611; Mon, 2 Oct 2017 16:12:07 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92GC7ad018785; Mon, 2 Oct 2017 16:12:07 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92GC7VD018783; Mon, 2 Oct 2017 16:12:07 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201710021612.v92GC7VD018783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 2 Oct 2017 16:12:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324210 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 324210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 16:12:08 -0000 Author: manu Date: Mon Oct 2 16:12:06 2017 New Revision: 324210 URL: https://svnweb.freebsd.org/changeset/base/324210 Log: Allwinner A64 ccu: Use clock/reset IDs from dt-bindings Do not redefines resets and clocks ID which are already in the dt-bindings include directory. Those files are under dual licenced under GPL2/MIT so use them directly. Modified: head/sys/arm/allwinner/clkng/ccu_a64.c head/sys/arm/allwinner/clkng/ccu_a64.h Modified: head/sys/arm/allwinner/clkng/ccu_a64.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a64.c Mon Oct 2 15:56:45 2017 (r324209) +++ head/sys/arm/allwinner/clkng/ccu_a64.c Mon Oct 2 16:12:06 2017 (r324210) @@ -43,143 +43,178 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include "ccu_a64.h" +/* Non-exported clocks */ + +#define CLK_OSC_12M 0 +#define CLK_PLL_CPUX 1 +#define CLK_PLL_AUDIO_BASE 2 +#define CLK_PLL_AUDIO 3 +#define CLK_PLL_AUDIO_2X 4 +#define CLK_PLL_AUDIO_4X 5 +#define CLK_PLL_AUDIO_8X 6 +#define CLK_PLL_VIDEO0 7 +#define CLK_PLL_VIDEO0_2X 8 +#define CLK_PLL_VE 9 +#define CLK_PLL_DDR0 10 +#define CLK_PLL_PERIPH0_2X 12 +#define CLK_PLL_PERIPH1 13 +#define CLK_PLL_PERIPH1_2X 14 +#define CLK_PLL_VIDEO1 15 +#define CLK_PLL_GPU 16 +#define CLK_PLL_HSIC 18 +#define CLK_PLL_DE 19 +#define CLK_PLL_DDR1 20 +#define CLK_CPUX 21 +#define CLK_AXI 22 +#define CLK_APB 23 +#define CLK_AHB1 24 +#define CLK_APB1 25 +#define CLK_APB2 26 +#define CLK_AHB2 27 +#define CLK_DRAM 94 + +#define CLK_MBUS 112 + static struct aw_ccung_reset a64_ccu_resets[] = { - CCU_RESET(A64_RST_USB_PHY0, 0x0cc, 0) - CCU_RESET(A64_RST_USB_PHY1, 0x0cc, 1) - CCU_RESET(A64_RST_USB_HSIC, 0x0cc, 2) + CCU_RESET(RST_USB_PHY0, 0x0cc, 0) + CCU_RESET(RST_USB_PHY1, 0x0cc, 1) + CCU_RESET(RST_USB_HSIC, 0x0cc, 2) - CCU_RESET(A64_RST_BUS_MIPI_DSI, 0x2c0, 1) - CCU_RESET(A64_RST_BUS_CE, 0x2c0, 5) - CCU_RESET(A64_RST_BUS_DMA, 0x2c0, 6) - CCU_RESET(A64_RST_BUS_MMC0, 0x2c0, 8) - CCU_RESET(A64_RST_BUS_MMC1, 0x2c0, 9) - CCU_RESET(A64_RST_BUS_MMC2, 0x2c0, 10) - CCU_RESET(A64_RST_BUS_NAND, 0x2c0, 13) - CCU_RESET(A64_RST_BUS_DRAM, 0x2c0, 14) - CCU_RESET(A64_RST_BUS_EMAC, 0x2c0, 17) - CCU_RESET(A64_RST_BUS_TS, 0x2c0, 18) - CCU_RESET(A64_RST_BUS_HSTIMER, 0x2c0, 19) - CCU_RESET(A64_RST_BUS_SPI0, 0x2c0, 20) - CCU_RESET(A64_RST_BUS_SPI1, 0x2c0, 21) - CCU_RESET(A64_RST_BUS_OTG, 0x2c0, 23) - CCU_RESET(A64_RST_BUS_EHCI0, 0x2c0, 24) - CCU_RESET(A64_RST_BUS_EHCI1, 0x2c0, 25) - CCU_RESET(A64_RST_BUS_OHCI0, 0x2c0, 28) - CCU_RESET(A64_RST_BUS_OHCI1, 0x2c0, 29) + CCU_RESET(RST_BUS_MIPI_DSI, 0x2c0, 1) + CCU_RESET(RST_BUS_CE, 0x2c0, 5) + CCU_RESET(RST_BUS_DMA, 0x2c0, 6) + CCU_RESET(RST_BUS_MMC0, 0x2c0, 8) + CCU_RESET(RST_BUS_MMC1, 0x2c0, 9) + CCU_RESET(RST_BUS_MMC2, 0x2c0, 10) + CCU_RESET(RST_BUS_NAND, 0x2c0, 13) + CCU_RESET(RST_BUS_DRAM, 0x2c0, 14) + CCU_RESET(RST_BUS_EMAC, 0x2c0, 17) + CCU_RESET(RST_BUS_TS, 0x2c0, 18) + CCU_RESET(RST_BUS_HSTIMER, 0x2c0, 19) + CCU_RESET(RST_BUS_SPI0, 0x2c0, 20) + CCU_RESET(RST_BUS_SPI1, 0x2c0, 21) + CCU_RESET(RST_BUS_OTG, 0x2c0, 23) + CCU_RESET(RST_BUS_EHCI0, 0x2c0, 24) + CCU_RESET(RST_BUS_EHCI1, 0x2c0, 25) + CCU_RESET(RST_BUS_OHCI0, 0x2c0, 28) + CCU_RESET(RST_BUS_OHCI1, 0x2c0, 29) - CCU_RESET(A64_RST_BUS_VE, 0x2c4, 0) - CCU_RESET(A64_RST_BUS_TCON0, 0x2c4, 3) - CCU_RESET(A64_RST_BUS_TCON1, 0x2c4, 4) - CCU_RESET(A64_RST_BUS_DEINTERLACE, 0x2c4, 5) - CCU_RESET(A64_RST_BUS_CSI, 0x2c4, 8) - CCU_RESET(A64_RST_BUS_HDMI0, 0x2c4, 10) - CCU_RESET(A64_RST_BUS_HDMI1, 0x2c4, 11) - CCU_RESET(A64_RST_BUS_DE, 0x2c4, 12) - CCU_RESET(A64_RST_BUS_GPU, 0x2c4, 20) - CCU_RESET(A64_RST_BUS_MSGBOX, 0x2c4, 21) - CCU_RESET(A64_RST_BUS_SPINLOCK, 0x2c4, 22) - CCU_RESET(A64_RST_BUS_DBG, 0x2c4, 31) + CCU_RESET(RST_BUS_VE, 0x2c4, 0) + CCU_RESET(RST_BUS_TCON0, 0x2c4, 3) + CCU_RESET(RST_BUS_TCON1, 0x2c4, 4) + CCU_RESET(RST_BUS_DEINTERLACE, 0x2c4, 5) + CCU_RESET(RST_BUS_CSI, 0x2c4, 8) + CCU_RESET(RST_BUS_HDMI0, 0x2c4, 10) + CCU_RESET(RST_BUS_HDMI1, 0x2c4, 11) + CCU_RESET(RST_BUS_DE, 0x2c4, 12) + CCU_RESET(RST_BUS_GPU, 0x2c4, 20) + CCU_RESET(RST_BUS_MSGBOX, 0x2c4, 21) + CCU_RESET(RST_BUS_SPINLOCK, 0x2c4, 22) + CCU_RESET(RST_BUS_DBG, 0x2c4, 31) - CCU_RESET(A64_RST_BUS_LVDS, 0x2C8, 31) + CCU_RESET(RST_BUS_LVDS, 0x2C8, 31) - CCU_RESET(A64_RST_BUS_CODEC, 0x2D0, 0) - CCU_RESET(A64_RST_BUS_SPDIF, 0x2D0, 1) - CCU_RESET(A64_RST_BUS_THS, 0x2D0, 8) - CCU_RESET(A64_RST_BUS_I2S0, 0x2D0, 12) - CCU_RESET(A64_RST_BUS_I2S1, 0x2D0, 13) - CCU_RESET(A64_RST_BUS_I2S2, 0x2D0, 14) + CCU_RESET(RST_BUS_CODEC, 0x2D0, 0) + CCU_RESET(RST_BUS_SPDIF, 0x2D0, 1) + CCU_RESET(RST_BUS_THS, 0x2D0, 8) + CCU_RESET(RST_BUS_I2S0, 0x2D0, 12) + CCU_RESET(RST_BUS_I2S1, 0x2D0, 13) + CCU_RESET(RST_BUS_I2S2, 0x2D0, 14) - CCU_RESET(A64_RST_BUS_I2C0, 0x2D8, 0) - CCU_RESET(A64_RST_BUS_I2C1, 0x2D8, 1) - CCU_RESET(A64_RST_BUS_I2C2, 0x2D8, 2) - CCU_RESET(A64_RST_BUS_SCR, 0x2D8, 5) - CCU_RESET(A64_RST_BUS_UART0, 0x2D8, 16) - CCU_RESET(A64_RST_BUS_UART1, 0x2D8, 17) - CCU_RESET(A64_RST_BUS_UART2, 0x2D8, 18) - CCU_RESET(A64_RST_BUS_UART3, 0x2D8, 19) - CCU_RESET(A64_RST_BUS_UART4, 0x2D8, 20) + CCU_RESET(RST_BUS_I2C0, 0x2D8, 0) + CCU_RESET(RST_BUS_I2C1, 0x2D8, 1) + CCU_RESET(RST_BUS_I2C2, 0x2D8, 2) + CCU_RESET(RST_BUS_SCR, 0x2D8, 5) + CCU_RESET(RST_BUS_UART0, 0x2D8, 16) + CCU_RESET(RST_BUS_UART1, 0x2D8, 17) + CCU_RESET(RST_BUS_UART2, 0x2D8, 18) + CCU_RESET(RST_BUS_UART3, 0x2D8, 19) + CCU_RESET(RST_BUS_UART4, 0x2D8, 20) }; static struct aw_ccung_gate a64_ccu_gates[] = { - CCU_GATE(A64_CLK_BUS_MIPI_DSI, "bus-mipi-dsi", "ahb1", 0x60, 1) - CCU_GATE(A64_CLK_BUS_CE, "bus-ce", "ahb1", 0x60, 5) - CCU_GATE(A64_CLK_BUS_DMA, "bus-dma", "ahb1", 0x60, 6) - CCU_GATE(A64_CLK_BUS_MMC0, "bus-mmc0", "ahb1", 0x60, 8) - CCU_GATE(A64_CLK_BUS_MMC1, "bus-mmc1", "ahb1", 0x60, 9) - CCU_GATE(A64_CLK_BUS_MMC2, "bus-mmc2", "ahb1", 0x60, 10) - CCU_GATE(A64_CLK_BUS_NAND, "bus-nand", "ahb1", 0x60, 13) - CCU_GATE(A64_CLK_BUS_DRAM, "bus-dram", "ahb1", 0x60, 14) - CCU_GATE(A64_CLK_BUS_EMAC, "bus-emac", "ahb2", 0x60, 16) - CCU_GATE(A64_CLK_BUS_TS, "bus-ts", "ahb1", 0x60, 18) - CCU_GATE(A64_CLK_BUS_HSTIMER, "bus-hstimer", "ahb1", 0x60, 19) - CCU_GATE(A64_CLK_BUS_SPI0, "bus-spi0", "ahb1", 0x60, 20) - CCU_GATE(A64_CLK_BUS_SPI1, "bus-spi1", "ahb1", 0x60, 21) - CCU_GATE(A64_CLK_BUS_OTG, "bus-otg", "ahb1", 0x60, 23) - CCU_GATE(A64_CLK_BUS_EHCI0, "bus-ehci0", "ahb1", 0x60, 24) - CCU_GATE(A64_CLK_BUS_EHCI1, "bus-ehci1", "ahb2", 0x60, 25) - CCU_GATE(A64_CLK_BUS_OHCI0, "bus-ohci0", "ahb1", 0x60, 28) - CCU_GATE(A64_CLK_BUS_OHCI1, "bus-ohci1", "ahb2", 0x60, 29) + CCU_GATE(CLK_BUS_MIPI_DSI, "bus-mipi-dsi", "ahb1", 0x60, 1) + CCU_GATE(CLK_BUS_CE, "bus-ce", "ahb1", 0x60, 5) + CCU_GATE(CLK_BUS_DMA, "bus-dma", "ahb1", 0x60, 6) + CCU_GATE(CLK_BUS_MMC0, "bus-mmc0", "ahb1", 0x60, 8) + CCU_GATE(CLK_BUS_MMC1, "bus-mmc1", "ahb1", 0x60, 9) + CCU_GATE(CLK_BUS_MMC2, "bus-mmc2", "ahb1", 0x60, 10) + CCU_GATE(CLK_BUS_NAND, "bus-nand", "ahb1", 0x60, 13) + CCU_GATE(CLK_BUS_DRAM, "bus-dram", "ahb1", 0x60, 14) + CCU_GATE(CLK_BUS_EMAC, "bus-emac", "ahb2", 0x60, 16) + CCU_GATE(CLK_BUS_TS, "bus-ts", "ahb1", 0x60, 18) + CCU_GATE(CLK_BUS_HSTIMER, "bus-hstimer", "ahb1", 0x60, 19) + CCU_GATE(CLK_BUS_SPI0, "bus-spi0", "ahb1", 0x60, 20) + CCU_GATE(CLK_BUS_SPI1, "bus-spi1", "ahb1", 0x60, 21) + CCU_GATE(CLK_BUS_OTG, "bus-otg", "ahb1", 0x60, 23) + CCU_GATE(CLK_BUS_EHCI0, "bus-ehci0", "ahb1", 0x60, 24) + CCU_GATE(CLK_BUS_EHCI1, "bus-ehci1", "ahb2", 0x60, 25) + CCU_GATE(CLK_BUS_OHCI0, "bus-ohci0", "ahb1", 0x60, 28) + CCU_GATE(CLK_BUS_OHCI1, "bus-ohci1", "ahb2", 0x60, 29) - CCU_GATE(A64_CLK_BUS_VE, "bus-ve", "ahb1", 0x64, 0) - CCU_GATE(A64_CLK_BUS_TCON0, "bus-tcon0", "ahb1", 0x64, 3) - CCU_GATE(A64_CLK_BUS_TCON1, "bus-tcon1", "ahb1", 0x64, 4) - CCU_GATE(A64_CLK_BUS_DEINTERLACE, "bus-deinterlace", "ahb1", 0x64, 5) - CCU_GATE(A64_CLK_BUS_CSI, "bus-csi", "ahb1", 0x64, 8) - CCU_GATE(A64_CLK_BUS_HDMI, "bus-hdmi", "ahb1", 0x64, 11) - CCU_GATE(A64_CLK_BUS_DE, "bus-de", "ahb1", 0x64, 12) - CCU_GATE(A64_CLK_BUS_GPU, "bus-gpu", "ahb1", 0x64, 20) - CCU_GATE(A64_CLK_BUS_MSGBOX, "bus-msgbox", "ahb1", 0x64, 21) - CCU_GATE(A64_CLK_BUS_SPINLOCK, "bus-spinlock", "ahb1", 0x64, 22) + CCU_GATE(CLK_BUS_VE, "bus-ve", "ahb1", 0x64, 0) + CCU_GATE(CLK_BUS_TCON0, "bus-tcon0", "ahb1", 0x64, 3) + CCU_GATE(CLK_BUS_TCON1, "bus-tcon1", "ahb1", 0x64, 4) + CCU_GATE(CLK_BUS_DEINTERLACE, "bus-deinterlace", "ahb1", 0x64, 5) + CCU_GATE(CLK_BUS_CSI, "bus-csi", "ahb1", 0x64, 8) + CCU_GATE(CLK_BUS_HDMI, "bus-hdmi", "ahb1", 0x64, 11) + CCU_GATE(CLK_BUS_DE, "bus-de", "ahb1", 0x64, 12) + CCU_GATE(CLK_BUS_GPU, "bus-gpu", "ahb1", 0x64, 20) + CCU_GATE(CLK_BUS_MSGBOX, "bus-msgbox", "ahb1", 0x64, 21) + CCU_GATE(CLK_BUS_SPINLOCK, "bus-spinlock", "ahb1", 0x64, 22) - CCU_GATE(A64_CLK_BUS_CODEC, "bus-codec", "apb1", 0x68, 0) - CCU_GATE(A64_CLK_BUS_SPDIF, "bus-spdif", "apb1", 0x68, 1) - CCU_GATE(A64_CLK_BUS_PIO, "bus-pio", "apb1", 0x68, 5) - CCU_GATE(A64_CLK_BUS_THS, "bus-ths", "apb1", 0x68, 8) - CCU_GATE(A64_CLK_BUS_I2S0, "bus-i2s0", "apb1", 0x68, 12) - CCU_GATE(A64_CLK_BUS_I2S1, "bus-i2s1", "apb1", 0x68, 13) - CCU_GATE(A64_CLK_BUS_I2S2, "bus-i2s2", "apb1", 0x68, 14) + CCU_GATE(CLK_BUS_CODEC, "bus-codec", "apb1", 0x68, 0) + CCU_GATE(CLK_BUS_SPDIF, "bus-spdif", "apb1", 0x68, 1) + CCU_GATE(CLK_BUS_PIO, "bus-pio", "apb1", 0x68, 5) + CCU_GATE(CLK_BUS_THS, "bus-ths", "apb1", 0x68, 8) + CCU_GATE(CLK_BUS_I2S0, "bus-i2s0", "apb1", 0x68, 12) + CCU_GATE(CLK_BUS_I2S1, "bus-i2s1", "apb1", 0x68, 13) + CCU_GATE(CLK_BUS_I2S2, "bus-i2s2", "apb1", 0x68, 14) - CCU_GATE(A64_CLK_BUS_I2C0, "bus-i2c0", "apb2", 0x6C, 0) - CCU_GATE(A64_CLK_BUS_I2C1, "bus-i2c1", "apb2", 0x6C, 1) - CCU_GATE(A64_CLK_BUS_I2C2, "bus-i2c2", "apb2", 0x6C, 2) - CCU_GATE(A64_CLK_BUS_SCR, "bus-src", "apb2", 0x6C, 5) - CCU_GATE(A64_CLK_BUS_UART0, "bus-uart0", "apb2", 0x6C, 16) - CCU_GATE(A64_CLK_BUS_UART1, "bus-uart1", "apb2", 0x6C, 17) - CCU_GATE(A64_CLK_BUS_UART2, "bus-uart2", "apb2", 0x6C, 18) - CCU_GATE(A64_CLK_BUS_UART3, "bus-uart3", "apb2", 0x6C, 19) - CCU_GATE(A64_CLK_BUS_UART4, "bus-uart4", "apb2", 0x6C, 20) + CCU_GATE(CLK_BUS_I2C0, "bus-i2c0", "apb2", 0x6C, 0) + CCU_GATE(CLK_BUS_I2C1, "bus-i2c1", "apb2", 0x6C, 1) + CCU_GATE(CLK_BUS_I2C2, "bus-i2c2", "apb2", 0x6C, 2) + CCU_GATE(CLK_BUS_SCR, "bus-src", "apb2", 0x6C, 5) + CCU_GATE(CLK_BUS_UART0, "bus-uart0", "apb2", 0x6C, 16) + CCU_GATE(CLK_BUS_UART1, "bus-uart1", "apb2", 0x6C, 17) + CCU_GATE(CLK_BUS_UART2, "bus-uart2", "apb2", 0x6C, 18) + CCU_GATE(CLK_BUS_UART3, "bus-uart3", "apb2", 0x6C, 19) + CCU_GATE(CLK_BUS_UART4, "bus-uart4", "apb2", 0x6C, 20) - CCU_GATE(A64_CLK_BUS_DBG, "bus-dbg", "ahb1", 0x70, 7) + CCU_GATE(CLK_BUS_DBG, "bus-dbg", "ahb1", 0x70, 7) - CCU_GATE(A64_CLK_USB_PHY0, "usb-phy0", "osc24M", 0xcc, 8) - CCU_GATE(A64_CLK_USB_PHY1, "usb-phy1", "osc24M", 0xcc, 9) - CCU_GATE(A64_CLK_USB_HSIC, "usb-hsic", "pll_hsic", 0xcc, 10) - CCU_GATE(A64_CLK_USB_HSIC_12M, "usb-hsic-12M", "osc12M", 0xcc, 11) - CCU_GATE(A64_CLK_USB_OHCI0, "usb-ohci0", "osc12M", 0xcc, 16) - CCU_GATE(A64_CLK_USB_OHCI1, "usb-ohci1", "usb-ohci0", 0xcc, 17) + CCU_GATE(CLK_USB_PHY0, "usb-phy0", "osc24M", 0xcc, 8) + CCU_GATE(CLK_USB_PHY1, "usb-phy1", "osc24M", 0xcc, 9) + CCU_GATE(CLK_USB_HSIC, "usb-hsic", "pll_hsic", 0xcc, 10) + CCU_GATE(CLK_USB_HSIC_12M, "usb-hsic-12M", "osc12M", 0xcc, 11) + CCU_GATE(CLK_USB_OHCI0, "usb-ohci0", "osc12M", 0xcc, 16) + CCU_GATE(CLK_USB_OHCI1, "usb-ohci1", "usb-ohci0", 0xcc, 17) - CCU_GATE(A64_CLK_DRAM_VE, "dram-ve", "dram", 0x100, 0) - CCU_GATE(A64_CLK_DRAM_CSI, "dram-csi", "dram", 0x100, 1) - CCU_GATE(A64_CLK_DRAM_DEINTERLACE, "dram-deinterlace", "dram", 0x100, 2) - CCU_GATE(A64_CLK_DRAM_TS, "dram-ts", "dram", 0x100, 3) + CCU_GATE(CLK_DRAM_VE, "dram-ve", "dram", 0x100, 0) + CCU_GATE(CLK_DRAM_CSI, "dram-csi", "dram", 0x100, 1) + CCU_GATE(CLK_DRAM_DEINTERLACE, "dram-deinterlace", "dram", 0x100, 2) + CCU_GATE(CLK_DRAM_TS, "dram-ts", "dram", 0x100, 3) - CCU_GATE(A64_CLK_CSI_MISC, "csi-misc", "osc24M", 0x130, 31) + CCU_GATE(CLK_CSI_MISC, "csi-misc", "osc24M", 0x130, 31) - CCU_GATE(A64_CLK_AC_DIG_4X, "ac-dig-4x", "pll_audio-4x", 0x140, 30) - CCU_GATE(A64_CLK_AC_DIG, "ac-dig", "pll_audio", 0x140, 31) + CCU_GATE(CLK_AC_DIG_4X, "ac-dig-4x", "pll_audio-4x", 0x140, 30) + CCU_GATE(CLK_AC_DIG, "ac-dig", "pll_audio", 0x140, 31) - CCU_GATE(A64_CLK_AVS, "avs", "osc24M", 0x144, 31) + CCU_GATE(CLK_AVS, "avs", "osc24M", 0x144, 31) - CCU_GATE(A64_CLK_HDMI_DDC, "hdmi-ddc", "osc24M", 0x154, 31) + CCU_GATE(CLK_HDMI_DDC, "hdmi-ddc", "osc24M", 0x154, 31) }; static const char *osc12m_parents[] = {"osc24M"}; FIXED_CLK(osc12m_clk, - A64_CLK_OSC_12M, /* id */ - "osc12M", /* name */ - osc12m_parents, /* parent */ + CLK_OSC_12M, /* id */ + "osc12M", /* name */ + osc12m_parents, /* parent */ 0, /* freq */ 1, /* mult */ 2, /* div */ @@ -187,7 +222,7 @@ FIXED_CLK(osc12m_clk, static const char *pll_cpux_parents[] = {"osc24M"}; NKMP_CLK(pll_cpux_clk, - A64_CLK_PLL_CPUX, /* id */ + CLK_PLL_CPUX, /* id */ "pll_cpux", pll_cpux_parents, /* name, parents */ 0x00, /* offset */ 8, 5, 0, 0, /* n factor */ @@ -200,7 +235,7 @@ NKMP_CLK(pll_cpux_clk, static const char *pll_audio_parents[] = {"osc24M"}; NKMP_CLK(pll_audio_clk, - A64_CLK_PLL_AUDIO, /* id */ + CLK_PLL_AUDIO, /* id */ "pll_audio", pll_audio_parents, /* name, parents */ 0x08, /* offset */ 8, 7, 0, 0, /* n factor */ @@ -213,7 +248,7 @@ NKMP_CLK(pll_audio_clk, static const char *pll_audio_mult_parents[] = {"pll_audio"}; FIXED_CLK(pll_audio_2x_clk, - A64_CLK_PLL_AUDIO_2X, /* id */ + CLK_PLL_AUDIO_2X, /* id */ "pll_audio-2x", /* name */ pll_audio_mult_parents, /* parent */ 0, /* freq */ @@ -221,7 +256,7 @@ FIXED_CLK(pll_audio_2x_clk, 1, /* div */ 0); /* flags */ FIXED_CLK(pll_audio_4x_clk, - A64_CLK_PLL_AUDIO_4X, /* id */ + CLK_PLL_AUDIO_4X, /* id */ "pll_audio-4x", /* name */ pll_audio_mult_parents, /* parent */ 0, /* freq */ @@ -229,7 +264,7 @@ FIXED_CLK(pll_audio_4x_clk, 1, /* div */ 0); /* flags */ FIXED_CLK(pll_audio_8x_clk, - A64_CLK_PLL_AUDIO_8X, /* id */ + CLK_PLL_AUDIO_8X, /* id */ "pll_audio-8x", /* name */ pll_audio_mult_parents, /* parent */ 0, /* freq */ @@ -239,7 +274,7 @@ FIXED_CLK(pll_audio_8x_clk, static const char *pll_video0_parents[] = {"osc24M"}; NM_CLK_WITH_FRAC(pll_video0_clk, - A64_CLK_PLL_VIDEO0, /* id */ + CLK_PLL_VIDEO0, /* id */ "pll_video0", pll_video0_parents, /* name, parents */ 0x10, /* offset */ 8, 7, 0, 0, /* n factor */ @@ -251,7 +286,7 @@ NM_CLK_WITH_FRAC(pll_video0_clk, static const char *pll_ve_parents[] = {"osc24M"}; NM_CLK_WITH_FRAC(pll_ve_clk, - A64_CLK_PLL_VE, /* id */ + CLK_PLL_VE, /* id */ "pll_ve", pll_ve_parents, /* name, parents */ 0x18, /* offset */ 8, 7, 0, 0, /* n factor */ @@ -263,7 +298,7 @@ NM_CLK_WITH_FRAC(pll_ve_clk, static const char *pll_ddr0_parents[] = {"osc24M"}; NKMP_CLK_WITH_UPDATE(pll_ddr0_clk, - A64_CLK_PLL_DDR0, /* id */ + CLK_PLL_DDR0, /* id */ "pll_ddr0", pll_ddr0_parents, /* name, parents */ 0x20, /* offset */ 8, 5, 0, 0, /* n factor */ @@ -278,7 +313,7 @@ NKMP_CLK_WITH_UPDATE(pll_ddr0_clk, static const char *pll_periph0_2x_parents[] = {"osc24M"}; static const char *pll_periph0_parents[] = {"pll_periph0_2x"}; NKMP_CLK(pll_periph0_2x_clk, - A64_CLK_PLL_PERIPH0_2X, /* id */ + CLK_PLL_PERIPH0_2X, /* id */ "pll_periph0_2x", pll_periph0_2x_parents, /* name, parents */ 0x28, /* offset */ 8, 5, 0, 0, /* n factor */ @@ -289,7 +324,7 @@ NKMP_CLK(pll_periph0_2x_clk, 28, 1000, /* lock */ AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ FIXED_CLK(pll_periph0_clk, - A64_CLK_PLL_PERIPH0, /* id */ + CLK_PLL_PERIPH0, /* id */ "pll_periph0", /* name */ pll_periph0_parents, /* parent */ 0, /* freq */ @@ -300,7 +335,7 @@ FIXED_CLK(pll_periph0_clk, static const char *pll_periph1_2x_parents[] = {"osc24M"}; static const char *pll_periph1_parents[] = {"pll_periph1_2x"}; NKMP_CLK(pll_periph1_2x_clk, - A64_CLK_PLL_PERIPH1_2X, /* id */ + CLK_PLL_PERIPH1_2X, /* id */ "pll_periph1_2x", pll_periph1_2x_parents, /* name, parents */ 0x2C, /* offset */ 8, 5, 0, 0, /* n factor */ @@ -311,7 +346,7 @@ NKMP_CLK(pll_periph1_2x_clk, 28, 1000, /* lock */ AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ FIXED_CLK(pll_periph1_clk, - A64_CLK_PLL_PERIPH1, /* id */ + CLK_PLL_PERIPH1, /* id */ "pll_periph1", /* name */ pll_periph1_parents, /* parent */ 0, /* freq */ @@ -321,7 +356,7 @@ FIXED_CLK(pll_periph1_clk, static const char *pll_video1_parents[] = {"osc24M"}; NM_CLK_WITH_FRAC(pll_video1_clk, - A64_CLK_PLL_VIDEO1, /* id */ + CLK_PLL_VIDEO1, /* id */ "pll_video1", pll_video1_parents, /* name, parents */ 0x30, /* offset */ 8, 7, 0, 0, /* n factor */ @@ -333,7 +368,7 @@ NM_CLK_WITH_FRAC(pll_video1_clk, static const char *pll_gpu_parents[] = {"osc24M"}; NM_CLK_WITH_FRAC(pll_gpu_clk, - A64_CLK_PLL_GPU, /* id */ + CLK_PLL_GPU, /* id */ "pll_gpu", pll_gpu_parents, /* name, parents */ 0x38, /* offset */ 8, 7, 0, 0, /* n factor */ @@ -347,7 +382,7 @@ NM_CLK_WITH_FRAC(pll_gpu_clk, static const char *pll_hsic_parents[] = {"osc24M"}; NM_CLK_WITH_FRAC(pll_hsic_clk, - A64_CLK_PLL_HSIC, /* id */ + CLK_PLL_HSIC, /* id */ "pll_hsic", pll_hsic_parents, /* name, parents */ 0x44, /* offset */ 8, 7, 0, 0, /* n factor */ @@ -359,7 +394,7 @@ NM_CLK_WITH_FRAC(pll_hsic_clk, static const char *pll_de_parents[] = {"osc24M"}; NM_CLK_WITH_FRAC(pll_de_clk, - A64_CLK_PLL_DE, /* id */ + CLK_PLL_DE, /* id */ "pll_de", pll_de_parents, /* name, parents */ 0x48, /* offset */ 8, 7, 0, 0, /* n factor */ @@ -371,7 +406,7 @@ NM_CLK_WITH_FRAC(pll_de_clk, static const char *pll_ddr1_parents[] = {"osc24M"}; NKMP_CLK_WITH_UPDATE(pll_ddr1_clk, - A64_CLK_PLL_DDR1, /* id */ + CLK_PLL_DDR1, /* id */ "pll_ddr1", pll_ddr1_parents, /* name, parents */ 0x4C, /* offset */ 8, 7, 0, 0, /* n factor */ @@ -385,13 +420,13 @@ NKMP_CLK_WITH_UPDATE(pll_ddr1_clk, static const char *cpux_parents[] = {"osc32k", "osc24M", "pll_cpux"}; MUX_CLK(cpux_clk, - A64_CLK_CPUX, /* id */ + CLK_CPUX, /* id */ "cpux", cpux_parents, /* name, parents */ 0x50, 16, 2); /* offset, shift, width */ static const char *axi_parents[] = {"cpux"}; DIV_CLK(axi_clk, - A64_CLK_AXI, /* id */ + CLK_AXI, /* id */ "axi", axi_parents, /* name, parents */ 0x50, /* offset */ 0, 2, /* shift, width */ @@ -399,14 +434,14 @@ DIV_CLK(axi_clk, static const char *apb_parents[] = {"cpux"}; DIV_CLK(apb_clk, - A64_CLK_APB, /* id */ + CLK_APB, /* id */ "apb", apb_parents, /* name, parents */ 0x50, /* offset */ 8, 2, /* shift, width */ 0, NULL); /* flags, div table */ static const char *ahb1_parents[] = {"osc32k", "osc24M", "axi", "pll_periph0"}; -PREDIV_CLK(ahb1_clk, A64_CLK_AHB1, /* id */ +PREDIV_CLK(ahb1_clk, CLK_AHB1, /* id */ "ahb1", ahb1_parents, /* name, parents */ 0x54, /* offset */ 12, 2, /* mux */ @@ -423,7 +458,7 @@ static struct clk_div_table apb1_div_table[] = { { }, }; DIV_CLK(apb1_clk, - A64_CLK_APB1, /* id */ + CLK_APB1, /* id */ "apb1", apb1_parents, /* name, parents */ 0x54, /* offset */ 8, 2, /* shift, width */ @@ -432,7 +467,7 @@ DIV_CLK(apb1_clk, static const char *apb2_parents[] = {"osc32k", "osc24M", "pll_periph0_2x", "pll_periph0_2x"}; NM_CLK(apb2_clk, - A64_CLK_APB2, /* id */ + CLK_APB2, /* id */ "apb2", apb2_parents, /* name, parents */ 0x58, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ @@ -442,7 +477,7 @@ NM_CLK(apb2_clk, AW_CLK_HAS_MUX); static const char *ahb2_parents[] = {"ahb1", "pll_periph0"}; -PREDIV_CLK(ahb2_clk, A64_CLK_AHB2, /* id */ +PREDIV_CLK(ahb2_clk, CLK_AHB2, /* id */ "ahb2", ahb2_parents, /* name, parents */ 0x5c, /* offset */ 0, 2, /* mux */ @@ -452,7 +487,7 @@ PREDIV_CLK(ahb2_clk, A64_CLK_AHB2, /* id */ static const char *mod_parents[] = {"osc24M", "pll_periph0_2x", "pll_periph1_2x"}; NM_CLK(nand_clk, - A64_CLK_NAND, "nand", mod_parents, /* id, name, parents */ + CLK_NAND, "nand", mod_parents, /* id, name, parents */ 0x80, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -461,7 +496,7 @@ NM_CLK(nand_clk, AW_CLK_HAS_GATE | AW_CLK_HAS_MUX); /* flags */ NM_CLK(mmc0_clk, - A64_CLK_MMC0, "mmc0", mod_parents, /* id, name, parents */ + CLK_MMC0, "mmc0", mod_parents, /* id, name, parents */ 0x88, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -471,7 +506,7 @@ NM_CLK(mmc0_clk, AW_CLK_REPARENT); /* flags */ NM_CLK(mmc1_clk, - A64_CLK_MMC1, "mmc1", mod_parents, /* id, name, parents */ + CLK_MMC1, "mmc1", mod_parents, /* id, name, parents */ 0x8c, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -481,7 +516,7 @@ NM_CLK(mmc1_clk, AW_CLK_REPARENT); /* flags */ NM_CLK(mmc2_clk, - A64_CLK_MMC2, "mmc2", mod_parents, /* id, name, parents */ + CLK_MMC2, "mmc2", mod_parents, /* id, name, parents */ 0x90, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -492,7 +527,7 @@ NM_CLK(mmc2_clk, static const char *ts_parents[] = {"osc24M", "pll_periph0"}; NM_CLK(ts_clk, - A64_CLK_TS, "ts", ts_parents, /* id, name, parents */ + CLK_TS, "ts", ts_parents, /* id, name, parents */ 0x98, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -501,7 +536,7 @@ NM_CLK(ts_clk, AW_CLK_HAS_GATE | AW_CLK_HAS_MUX); /* flags */ NM_CLK(ce_clk, - A64_CLK_CE, "ce", mod_parents, /* id, name, parents */ + CLK_CE, "ce", mod_parents, /* id, name, parents */ 0x9C, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -510,7 +545,7 @@ NM_CLK(ce_clk, AW_CLK_HAS_GATE | AW_CLK_HAS_MUX); /* flags */ NM_CLK(spi0_clk, - A64_CLK_SPI0, "spi0", mod_parents, /* id, name, parents */ + CLK_SPI0, "spi0", mod_parents, /* id, name, parents */ 0xA0, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -520,7 +555,7 @@ NM_CLK(spi0_clk, AW_CLK_REPARENT); /* flags */ NM_CLK(spi1_clk, - A64_CLK_SPI1, "spi1", mod_parents, /* id, name, parents */ + CLK_SPI1, "spi1", mod_parents, /* id, name, parents */ 0xA4, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -542,7 +577,7 @@ MUX_CLK(i2s2mux_clk, static const char *spdif_parents[] = {"pll_audio"}; NM_CLK(spdif_clk, - A64_CLK_SPDIF, "spdif", spdif_parents, /* id, name, parents */ + CLK_SPDIF, "spdif", spdif_parents, /* id, name, parents */ 0xC0, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake); */ 0, 4, 0, 0, /* m factor */ @@ -555,7 +590,7 @@ NM_CLK(spdif_clk, /* DRAM needs update bit */ static const char *dram_parents[] = {"pll_ddr0", "pll_ddr1"}; NM_CLK(dram_clk, - A64_CLK_DRAM, "dram", dram_parents, /* id, name, parents */ + CLK_DRAM, "dram", dram_parents, /* id, name, parents */ 0xF4, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 2, 0, 0, /* m factor */ @@ -565,7 +600,7 @@ NM_CLK(dram_clk, static const char *de_parents[] = {"pll_periph0_2x", "pll_de"}; NM_CLK(de_clk, - A64_CLK_DE, "de", de_parents, /* id, name, parents */ + CLK_DE, "de", de_parents, /* id, name, parents */ 0x104, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -577,7 +612,7 @@ NM_CLK(de_clk, static const char *deinterlace_parents[] = {"pll_periph0", "pll_periph1"}; NM_CLK(deinterlace_clk, - A64_CLK_DEINTERLACE, "deinterlace", deinterlace_parents, /* id, name, parents */ + CLK_DEINTERLACE, "deinterlace", deinterlace_parents, /* id, name, parents */ 0x124, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -587,7 +622,7 @@ NM_CLK(deinterlace_clk, static const char *csi_sclk_parents[] = {"pll_periph0", "pll_periph1"}; NM_CLK(csi_sclk_clk, - A64_CLK_CSI_SCLK, "csi-sclk", csi_sclk_parents, /* id, name, parents */ + CLK_CSI_SCLK, "csi-sclk", csi_sclk_parents, /* id, name, parents */ 0x134, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 16, 4, 0, 0, /* m factor */ @@ -597,7 +632,7 @@ NM_CLK(csi_sclk_clk, static const char *csi_mclk_parents[] = {"osc24M", "pll_video0", "pll_periph1"}; NM_CLK(csi_mclk_clk, - A64_CLK_CSI_MCLK, "csi-mclk", csi_mclk_parents, /* id, name, parents */ + CLK_CSI_MCLK, "csi-mclk", csi_mclk_parents, /* id, name, parents */ 0x134, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -607,7 +642,7 @@ NM_CLK(csi_mclk_clk, static const char *ve_parents[] = {"pll_ve"}; NM_CLK(ve_clk, - A64_CLK_VE, "ve", ve_parents, /* id, name, parents */ + CLK_VE, "ve", ve_parents, /* id, name, parents */ 0x13C, /* offset */ 16, 3, 0, 0, /* n factor */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* m factor (fake) */ @@ -617,7 +652,7 @@ NM_CLK(ve_clk, static const char *hdmi_parents[] = {"pll_video0"}; NM_CLK(hdmi_clk, - A64_CLK_HDMI, "hdmi", hdmi_parents, /* id, name, parents */ + CLK_HDMI, "hdmi", hdmi_parents, /* id, name, parents */ 0x150, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -627,7 +662,7 @@ NM_CLK(hdmi_clk, static const char *mbus_parents[] = {"osc24M", "pll_periph0_2x", "pll_ddr0"}; NM_CLK(mbus_clk, - A64_CLK_MBUS, "mbus", mbus_parents, /* id, name, parents */ + CLK_MBUS, "mbus", mbus_parents, /* id, name, parents */ 0x15C, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 3, 0, 0, /* m factor */ @@ -637,7 +672,7 @@ NM_CLK(mbus_clk, static const char *gpu_parents[] = {"pll_gpu"}; NM_CLK(gpu_clk, - A64_CLK_GPU, "gpu", gpu_parents, /* id, name, parents */ + CLK_GPU, "gpu", gpu_parents, /* id, name, parents */ 0x1A0, /* offset */ 0, 2, 0, 0, /* n factor */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* m factor (fake) */ Modified: head/sys/arm/allwinner/clkng/ccu_a64.h ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a64.h Mon Oct 2 15:56:45 2017 (r324209) +++ head/sys/arm/allwinner/clkng/ccu_a64.h Mon Oct 2 16:12:06 2017 (r324210) @@ -29,176 +29,6 @@ #ifndef __CCU_A64_H__ #define __CCU_A64_H__ -#define A64_RST_USB_PHY0 0 -#define A64_RST_USB_PHY1 1 -#define A64_RST_USB_HSIC 2 -#define A64_RST_DRAM 3 -#define A64_RST_MBUS 4 -#define A64_RST_BUS_MIPI_DSI 5 -#define A64_RST_BUS_CE 6 -#define A64_RST_BUS_DMA 7 -#define A64_RST_BUS_MMC0 8 -#define A64_RST_BUS_MMC1 9 -#define A64_RST_BUS_MMC2 10 -#define A64_RST_BUS_NAND 11 -#define A64_RST_BUS_DRAM 12 -#define A64_RST_BUS_EMAC 13 -#define A64_RST_BUS_TS 14 -#define A64_RST_BUS_HSTIMER 15 -#define A64_RST_BUS_SPI0 16 -#define A64_RST_BUS_SPI1 17 -#define A64_RST_BUS_OTG 18 -#define A64_RST_BUS_EHCI0 19 -#define A64_RST_BUS_EHCI1 20 -#define A64_RST_BUS_OHCI0 21 -#define A64_RST_BUS_OHCI1 22 -#define A64_RST_BUS_VE 23 -#define A64_RST_BUS_TCON0 24 -#define A64_RST_BUS_TCON1 25 -#define A64_RST_BUS_DEINTERLACE 26 -#define A64_RST_BUS_CSI 27 -#define A64_RST_BUS_HDMI0 28 -#define A64_RST_BUS_HDMI1 29 -#define A64_RST_BUS_DE 30 -#define A64_RST_BUS_GPU 31 -#define A64_RST_BUS_MSGBOX 32 -#define A64_RST_BUS_SPINLOCK 33 -#define A64_RST_BUS_DBG 34 -#define A64_RST_BUS_LVDS 35 -#define A64_RST_BUS_CODEC 36 -#define A64_RST_BUS_SPDIF 37 -#define A64_RST_BUS_THS 38 -#define A64_RST_BUS_I2S0 39 -#define A64_RST_BUS_I2S1 40 -#define A64_RST_BUS_I2S2 41 -#define A64_RST_BUS_I2C0 42 -#define A64_RST_BUS_I2C1 43 -#define A64_RST_BUS_I2C2 44 -#define A64_RST_BUS_SCR 45 -#define A64_RST_BUS_UART0 46 -#define A64_RST_BUS_UART1 47 -#define A64_RST_BUS_UART2 48 -#define A64_RST_BUS_UART3 49 -#define A64_RST_BUS_UART4 50 - -#define A64_CLK_OSC_12M 0 -#define A64_CLK_PLL_CPUX 1 -#define A64_CLK_PLL_AUDIO_BASE 2 -#define A64_CLK_PLL_AUDIO 3 -#define A64_CLK_PLL_AUDIO_2X 4 -#define A64_CLK_PLL_AUDIO_4X 5 -#define A64_CLK_PLL_AUDIO_8X 6 -#define A64_CLK_PLL_VIDEO0 7 -#define A64_CLK_PLL_VIDEO0_2X 8 -#define A64_CLK_PLL_VE 9 -#define A64_CLK_PLL_DDR0 10 -#define A64_CLK_PLL_PERIPH0 11 -#define A64_CLK_PLL_PERIPH0_2X 12 -#define A64_CLK_PLL_PERIPH1 13 -#define A64_CLK_PLL_PERIPH1_2X 14 -#define A64_CLK_PLL_VIDEO1 15 -#define A64_CLK_PLL_GPU 16 -#define A64_CLK_PLL_MIPI 17 -#define A64_CLK_PLL_HSIC 18 -#define A64_CLK_PLL_DE 19 -#define A64_CLK_PLL_DDR1 20 -#define A64_CLK_CPUX 21 -#define A64_CLK_AXI 22 -#define A64_CLK_APB 23 -#define A64_CLK_AHB1 24 -#define A64_CLK_APB1 25 -#define A64_CLK_APB2 26 -#define A64_CLK_AHB2 27 -#define A64_CLK_BUS_MIPI_DSI 28 -#define A64_CLK_BUS_CE 29 -#define A64_CLK_BUS_DMA 30 -#define A64_CLK_BUS_MMC0 31 -#define A64_CLK_BUS_MMC1 32 -#define A64_CLK_BUS_MMC2 33 -#define A64_CLK_BUS_NAND 34 -#define A64_CLK_BUS_DRAM 35 -#define A64_CLK_BUS_EMAC 36 -#define A64_CLK_BUS_TS 37 -#define A64_CLK_BUS_HSTIMER 38 -#define A64_CLK_BUS_SPI0 39 -#define A64_CLK_BUS_SPI1 40 -#define A64_CLK_BUS_OTG 41 -#define A64_CLK_BUS_EHCI0 42 -#define A64_CLK_BUS_EHCI1 43 -#define A64_CLK_BUS_OHCI0 44 -#define A64_CLK_BUS_OHCI1 45 -#define A64_CLK_BUS_VE 46 -#define A64_CLK_BUS_TCON0 47 -#define A64_CLK_BUS_TCON1 48 -#define A64_CLK_BUS_DEINTERLACE 49 -#define A64_CLK_BUS_CSI 50 -#define A64_CLK_BUS_HDMI 51 -#define A64_CLK_BUS_DE 52 -#define A64_CLK_BUS_GPU 53 -#define A64_CLK_BUS_MSGBOX 54 -#define A64_CLK_BUS_SPINLOCK 55 -#define A64_CLK_BUS_CODEC 56 -#define A64_CLK_BUS_SPDIF 57 -#define A64_CLK_BUS_PIO 58 -#define A64_CLK_BUS_THS 59 -#define A64_CLK_BUS_I2S0 60 -#define A64_CLK_BUS_I2S1 61 -#define A64_CLK_BUS_I2S2 62 -#define A64_CLK_BUS_I2C0 63 -#define A64_CLK_BUS_I2C1 64 -#define A64_CLK_BUS_I2C2 65 -#define A64_CLK_BUS_SCR 66 -#define A64_CLK_BUS_UART0 67 -#define A64_CLK_BUS_UART1 68 -#define A64_CLK_BUS_UART2 69 -#define A64_CLK_BUS_UART3 70 -#define A64_CLK_BUS_UART4 71 -#define A64_CLK_BUS_DBG 72 -#define A64_CLK_THS 73 -#define A64_CLK_NAND 74 -#define A64_CLK_MMC0 75 -#define A64_CLK_MMC1 76 -#define A64_CLK_MMC2 77 -#define A64_CLK_TS 78 -#define A64_CLK_CE 79 -#define A64_CLK_SPI0 80 -#define A64_CLK_SPI1 81 -#define A64_CLK_I2S0 82 -#define A64_CLK_I2S1 83 -#define A64_CLK_I2S2 84 -#define A64_CLK_SPDIF 85 -#define A64_CLK_USB_PHY0 86 -#define A64_CLK_USB_PHY1 87 -#define A64_CLK_USB_HSIC 88 -#define A64_CLK_USB_HSIC_12M 89 -#define A64_CLK_USB_OHCI0_12M 90 -#define A64_CLK_USB_OHCI0 91 -#define A64_CLK_USB_OHCI1_12M 92 -#define A64_CLK_USB_OHCI1 93 -#define A64_CLK_DRAM 94 -#define A64_CLK_DRAM_VE 95 -#define A64_CLK_DRAM_CSI 96 -#define A64_CLK_DRAM_DEINTERLACE 97 -#define A64_CLK_DRAM_TS 98 -#define A64_CLK_DE 99 -#define A64_CLK_TCON0 100 -#define A64_CLK_TCON1 101 -#define A64_CLK_DEINTERLACE 102 -#define A64_CLK_CSI_MISC 103 -#define A64_CLK_CSI_SCLK 104 -#define A64_CLK_CSI_MCLK 105 -#define A64_CLK_VE 106 -#define A64_CLK_AC_DIG 107 -#define A64_CLK_AC_DIG_4X 108 -#define A64_CLK_AVS 109 -#define A64_CLK_HDMI 110 -#define A64_CLK_HDMI_DDC 111 - -#define A64_CLK_MBUS 112 - -#define A64_CLK_DSI_DPHY 113 -#define A64_CLK_GPU 114 - void ccu_a64_register_clocks(struct aw_ccung_softc *sc); #endif /* __CCU_A64_H__ */ From owner-svn-src-head@freebsd.org Mon Oct 2 16:21:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F1E4E0DB6F; Mon, 2 Oct 2017 16:21:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59CF76DA84; Mon, 2 Oct 2017 16:21:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92GLKhs023084; Mon, 2 Oct 2017 16:21:20 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92GLKTX023082; Mon, 2 Oct 2017 16:21:20 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201710021621.v92GLKTX023082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 2 Oct 2017 16:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324211 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 324211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 16:21:21 -0000 Author: manu Date: Mon Oct 2 16:21:20 2017 New Revision: 324211 URL: https://svnweb.freebsd.org/changeset/base/324211 Log: Allwinner A31 ccu: Use clock/reset IDs from dt-bindings Do not redefines resets and clocks ID which are already in the dt-bindings include directory. Those files are under dual licenced under GPL2/MIT so use them directly. Modified: head/sys/arm/allwinner/clkng/ccu_a31.c head/sys/arm/allwinner/clkng/ccu_a31.h Modified: head/sys/arm/allwinner/clkng/ccu_a31.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a31.c Mon Oct 2 16:12:06 2017 (r324210) +++ head/sys/arm/allwinner/clkng/ccu_a31.c Mon Oct 2 16:21:20 2017 (r324211) @@ -43,169 +43,204 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include "ccu_a31.h" +/* Non-exported clocks */ +#define CLK_PLL_CPU 0 +#define CLK_PLL_AUDIO_BASE 1 +#define CLK_PLL_AUDIO 2 +#define CLK_PLL_AUDIO_2X 3 +#define CLK_PLL_AUDIO_4X 4 +#define CLK_PLL_AUDIO_8X 5 +#define CLK_PLL_VIDEO0 6 +#define CLK_PLL_VIDEO0_2X 7 +#define CLK_PLL_VE 8 +#define CLK_PLL_DDR 9 + +#define CLK_PLL_PERIPH_2X 11 +#define CLK_PLL_VIDEO1 12 +#define CLK_PLL_VIDEO1_2X 13 +#define CLK_PLL_GPU 14 +#define CLK_PLL_MIPI 15 +#define CLK_PLL9 16 +#define CLK_PLL10 17 + +#define CLK_AXI 19 +#define CLK_AHB1 20 +#define CLK_APB1 21 +#define CLK_APB2 22 + +#define CLK_MDFS 107 +#define CLK_SDRAM0 108 +#define CLK_SDRAM1 109 + +#define CLK_MBUS0 141 +#define CLK_MBUS1 142 + static struct aw_ccung_reset a31_ccu_resets[] = { - CCU_RESET(A31_RST_USB_PHY0, 0xcc, 0) - CCU_RESET(A31_RST_USB_PHY1, 0xcc, 1) - CCU_RESET(A31_RST_USB_PHY2, 0xcc, 2) + CCU_RESET(RST_USB_PHY0, 0xcc, 0) + CCU_RESET(RST_USB_PHY1, 0xcc, 1) + CCU_RESET(RST_USB_PHY2, 0xcc, 2) - CCU_RESET(A31_RST_AHB1_MIPI_DSI, 0x2c0, 1) - CCU_RESET(A31_RST_AHB1_SS, 0x2c0, 5) - CCU_RESET(A31_RST_AHB1_DMA, 0x2c0, 6) - CCU_RESET(A31_RST_AHB1_MMC0, 0x2c0, 8) - CCU_RESET(A31_RST_AHB1_MMC1, 0x2c0, 9) - CCU_RESET(A31_RST_AHB1_MMC2, 0x2c0, 10) - CCU_RESET(A31_RST_AHB1_MMC3, 0x2c0, 11) - CCU_RESET(A31_RST_AHB1_NAND1, 0x2c0, 12) - CCU_RESET(A31_RST_AHB1_NAND0, 0x2c0, 13) - CCU_RESET(A31_RST_AHB1_SDRAM, 0x2c0, 14) - CCU_RESET(A31_RST_AHB1_EMAC, 0x2c0, 17) - CCU_RESET(A31_RST_AHB1_TS, 0x2c0, 18) - CCU_RESET(A31_RST_AHB1_HSTIMER, 0x2c0, 19) - CCU_RESET(A31_RST_AHB1_SPI0, 0x2c0, 20) - CCU_RESET(A31_RST_AHB1_SPI1, 0x2c0, 21) - CCU_RESET(A31_RST_AHB1_SPI2, 0x2c0, 22) - CCU_RESET(A31_RST_AHB1_SPI3, 0x2c0, 23) - CCU_RESET(A31_RST_AHB1_OTG, 0x2c0, 24) - CCU_RESET(A31_RST_AHB1_EHCI0, 0x2c0, 26) - CCU_RESET(A31_RST_AHB1_EHCI1, 0x2c0, 27) - CCU_RESET(A31_RST_AHB1_OHCI0, 0x2c0, 29) - CCU_RESET(A31_RST_AHB1_OHCI1, 0x2c0, 30) - CCU_RESET(A31_RST_AHB1_OHCI2, 0x2c0, 31) + CCU_RESET(RST_AHB1_MIPI_DSI, 0x2c0, 1) + CCU_RESET(RST_AHB1_SS, 0x2c0, 5) + CCU_RESET(RST_AHB1_DMA, 0x2c0, 6) + CCU_RESET(RST_AHB1_MMC0, 0x2c0, 8) + CCU_RESET(RST_AHB1_MMC1, 0x2c0, 9) + CCU_RESET(RST_AHB1_MMC2, 0x2c0, 10) + CCU_RESET(RST_AHB1_MMC3, 0x2c0, 11) + CCU_RESET(RST_AHB1_NAND1, 0x2c0, 12) + CCU_RESET(RST_AHB1_NAND0, 0x2c0, 13) + CCU_RESET(RST_AHB1_SDRAM, 0x2c0, 14) + CCU_RESET(RST_AHB1_EMAC, 0x2c0, 17) + CCU_RESET(RST_AHB1_TS, 0x2c0, 18) + CCU_RESET(RST_AHB1_HSTIMER, 0x2c0, 19) + CCU_RESET(RST_AHB1_SPI0, 0x2c0, 20) + CCU_RESET(RST_AHB1_SPI1, 0x2c0, 21) + CCU_RESET(RST_AHB1_SPI2, 0x2c0, 22) + CCU_RESET(RST_AHB1_SPI3, 0x2c0, 23) + CCU_RESET(RST_AHB1_OTG, 0x2c0, 24) + CCU_RESET(RST_AHB1_EHCI0, 0x2c0, 26) + CCU_RESET(RST_AHB1_EHCI1, 0x2c0, 27) + CCU_RESET(RST_AHB1_OHCI0, 0x2c0, 29) + CCU_RESET(RST_AHB1_OHCI1, 0x2c0, 30) + CCU_RESET(RST_AHB1_OHCI2, 0x2c0, 31) - CCU_RESET(A31_RST_AHB1_VE, 0x2c4, 0) - CCU_RESET(A31_RST_AHB1_LCD0, 0x2c4, 4) - CCU_RESET(A31_RST_AHB1_LCD1, 0x2c4, 5) - CCU_RESET(A31_RST_AHB1_CSI, 0x2c4, 8) - CCU_RESET(A31_RST_AHB1_HDMI, 0x2c4, 11) - CCU_RESET(A31_RST_AHB1_BE0, 0x2c4, 12) - CCU_RESET(A31_RST_AHB1_BE1, 0x2c4, 13) - CCU_RESET(A31_RST_AHB1_FE0, 0x2c4, 14) - CCU_RESET(A31_RST_AHB1_FE1, 0x2c4, 15) - CCU_RESET(A31_RST_AHB1_MP, 0x2c4, 18) - CCU_RESET(A31_RST_AHB1_GPU, 0x2c4, 20) - CCU_RESET(A31_RST_AHB1_DEU0, 0x2c4, 23) - CCU_RESET(A31_RST_AHB1_DEU1, 0x2c4, 24) - CCU_RESET(A31_RST_AHB1_DRC0, 0x2c4, 25) - CCU_RESET(A31_RST_AHB1_DRC1, 0x2c4, 26) + CCU_RESET(RST_AHB1_VE, 0x2c4, 0) + CCU_RESET(RST_AHB1_LCD0, 0x2c4, 4) + CCU_RESET(RST_AHB1_LCD1, 0x2c4, 5) + CCU_RESET(RST_AHB1_CSI, 0x2c4, 8) + CCU_RESET(RST_AHB1_HDMI, 0x2c4, 11) + CCU_RESET(RST_AHB1_BE0, 0x2c4, 12) + CCU_RESET(RST_AHB1_BE1, 0x2c4, 13) + CCU_RESET(RST_AHB1_FE0, 0x2c4, 14) + CCU_RESET(RST_AHB1_FE1, 0x2c4, 15) + CCU_RESET(RST_AHB1_MP, 0x2c4, 18) + CCU_RESET(RST_AHB1_GPU, 0x2c4, 20) + CCU_RESET(RST_AHB1_DEU0, 0x2c4, 23) + CCU_RESET(RST_AHB1_DEU1, 0x2c4, 24) + CCU_RESET(RST_AHB1_DRC0, 0x2c4, 25) + CCU_RESET(RST_AHB1_DRC1, 0x2c4, 26) - CCU_RESET(A31_RST_AHB1_LVDS, 0x2c8, 0) + CCU_RESET(RST_AHB1_LVDS, 0x2c8, 0) - CCU_RESET(A31_RST_APB1_CODEC, 0x2d0, 0) - CCU_RESET(A31_RST_APB1_SPDIF, 0x2d0, 1) - CCU_RESET(A31_RST_APB1_DIGITAL_MIC, 0x2d0, 4) - CCU_RESET(A31_RST_APB1_DAUDIO0, 0x2d0, 12) - CCU_RESET(A31_RST_APB1_DAUDIO1, 0x2d0, 13) + CCU_RESET(RST_APB1_CODEC, 0x2d0, 0) + CCU_RESET(RST_APB1_SPDIF, 0x2d0, 1) + CCU_RESET(RST_APB1_DIGITAL_MIC, 0x2d0, 4) + CCU_RESET(RST_APB1_DAUDIO0, 0x2d0, 12) + CCU_RESET(RST_APB1_DAUDIO1, 0x2d0, 13) - CCU_RESET(A31_RST_APB2_I2C0, 0x2d8, 0) - CCU_RESET(A31_RST_APB2_I2C1, 0x2d8, 1) - CCU_RESET(A31_RST_APB2_I2C2, 0x2d8, 2) - CCU_RESET(A31_RST_APB2_I2C3, 0x2d8, 3) - CCU_RESET(A31_RST_APB2_UART0, 0x2d8, 16) - CCU_RESET(A31_RST_APB2_UART1, 0x2d8, 17) - CCU_RESET(A31_RST_APB2_UART2, 0x2d8, 18) - CCU_RESET(A31_RST_APB2_UART3, 0x2d8, 19) - CCU_RESET(A31_RST_APB2_UART4, 0x2d8, 20) - CCU_RESET(A31_RST_APB2_UART5, 0x2d8, 21) + CCU_RESET(RST_APB2_I2C0, 0x2d8, 0) + CCU_RESET(RST_APB2_I2C1, 0x2d8, 1) + CCU_RESET(RST_APB2_I2C2, 0x2d8, 2) + CCU_RESET(RST_APB2_I2C3, 0x2d8, 3) + CCU_RESET(RST_APB2_UART0, 0x2d8, 16) + CCU_RESET(RST_APB2_UART1, 0x2d8, 17) + CCU_RESET(RST_APB2_UART2, 0x2d8, 18) + CCU_RESET(RST_APB2_UART3, 0x2d8, 19) + CCU_RESET(RST_APB2_UART4, 0x2d8, 20) + CCU_RESET(RST_APB2_UART5, 0x2d8, 21) }; static struct aw_ccung_gate a31_ccu_gates[] = { - CCU_GATE(A31_CLK_AHB1_MIPIDSI, "ahb1-mipidsi", "ahb1", 0x60, 1) - CCU_GATE(A31_CLK_AHB1_SS, "ahb1-ss", "ahb1", 0x60, 5) - CCU_GATE(A31_CLK_AHB1_DMA, "ahb1-dma", "ahb1", 0x60, 6) - CCU_GATE(A31_CLK_AHB1_MMC0, "ahb1-mmc0", "ahb1", 0x60, 8) - CCU_GATE(A31_CLK_AHB1_MMC1, "ahb1-mmc1", "ahb1", 0x60, 9) - CCU_GATE(A31_CLK_AHB1_MMC2, "ahb1-mmc2", "ahb1", 0x60, 10) - CCU_GATE(A31_CLK_AHB1_MMC3, "ahb1-mmc3", "ahb1", 0x60, 11) - CCU_GATE(A31_CLK_AHB1_NAND1, "ahb1-nand1", "ahb1", 0x60, 12) - CCU_GATE(A31_CLK_AHB1_NAND0, "ahb1-nand0", "ahb1", 0x60, 13) - CCU_GATE(A31_CLK_AHB1_SDRAM, "ahb1-sdram", "ahb1", 0x60, 14) - CCU_GATE(A31_CLK_AHB1_EMAC, "ahb1-emac", "ahb1", 0x60, 17) - CCU_GATE(A31_CLK_AHB1_TS, "ahb1-ts", "ahb1", 0x60, 18) - CCU_GATE(A31_CLK_AHB1_HSTIMER, "ahb1-hstimer", "ahb1", 0x60, 19) - CCU_GATE(A31_CLK_AHB1_SPI0, "ahb1-spi0", "ahb1", 0x60, 20) - CCU_GATE(A31_CLK_AHB1_SPI1, "ahb1-spi1", "ahb1", 0x60, 21) - CCU_GATE(A31_CLK_AHB1_SPI2, "ahb1-spi2", "ahb1", 0x60, 22) - CCU_GATE(A31_CLK_AHB1_SPI3, "ahb1-spi3", "ahb1", 0x60, 23) - CCU_GATE(A31_CLK_AHB1_OTG, "ahb1-otg", "ahb1", 0x60, 24) - CCU_GATE(A31_CLK_AHB1_EHCI0, "ahb1-ehci0", "ahb1", 0x60, 26) - CCU_GATE(A31_CLK_AHB1_EHCI1, "ahb1-ehci1", "ahb1", 0x60, 27) - CCU_GATE(A31_CLK_AHB1_OHCI0, "ahb1-ohci0", "ahb1", 0x60, 29) - CCU_GATE(A31_CLK_AHB1_OHCI1, "ahb1-ohci1", "ahb1", 0x60, 30) - CCU_GATE(A31_CLK_AHB1_OHCI2, "ahb1-ohci2", "ahb1", 0x60, 31) - CCU_GATE(A31_CLK_AHB1_VE, "ahb1-ve", "ahb1", 0x64, 0) - CCU_GATE(A31_CLK_AHB1_LCD0, "ahb1-lcd0", "ahb1", 0x64, 4) - CCU_GATE(A31_CLK_AHB1_LCD1, "ahb1-lcd1", "ahb1", 0x64, 5) - CCU_GATE(A31_CLK_AHB1_CSI, "ahb1-csi", "ahb1", 0x64, 8) - CCU_GATE(A31_CLK_AHB1_HDMI, "ahb1-hdmi", "ahb1", 0x64, 11) - CCU_GATE(A31_CLK_AHB1_BE0, "ahb1-be0", "ahb1", 0x64, 12) - CCU_GATE(A31_CLK_AHB1_BE1, "ahb1-be1", "ahb1", 0x64, 13) - CCU_GATE(A31_CLK_AHB1_FE0, "ahb1-fe0", "ahb1", 0x64, 14) - CCU_GATE(A31_CLK_AHB1_FE1, "ahb1-fe1", "ahb1", 0x64, 15) - CCU_GATE(A31_CLK_AHB1_MP, "ahb1-mp", "ahb1", 0x64, 18) - CCU_GATE(A31_CLK_AHB1_GPU, "ahb1-gpu", "ahb1", 0x64, 20) - CCU_GATE(A31_CLK_AHB1_DEU0, "ahb1-deu0", "ahb1", 0x64, 23) - CCU_GATE(A31_CLK_AHB1_DEU1, "ahb1-deu1", "ahb1", 0x64, 24) - CCU_GATE(A31_CLK_AHB1_DRC0, "ahb1-drc0", "ahb1", 0x64, 25) - CCU_GATE(A31_CLK_AHB1_DRC1, "ahb1-drc1", "ahb1", 0x64, 26) + CCU_GATE(CLK_AHB1_MIPIDSI, "ahb1-mipidsi", "ahb1", 0x60, 1) + CCU_GATE(CLK_AHB1_SS, "ahb1-ss", "ahb1", 0x60, 5) + CCU_GATE(CLK_AHB1_DMA, "ahb1-dma", "ahb1", 0x60, 6) + CCU_GATE(CLK_AHB1_MMC0, "ahb1-mmc0", "ahb1", 0x60, 8) + CCU_GATE(CLK_AHB1_MMC1, "ahb1-mmc1", "ahb1", 0x60, 9) + CCU_GATE(CLK_AHB1_MMC2, "ahb1-mmc2", "ahb1", 0x60, 10) + CCU_GATE(CLK_AHB1_MMC3, "ahb1-mmc3", "ahb1", 0x60, 11) + CCU_GATE(CLK_AHB1_NAND1, "ahb1-nand1", "ahb1", 0x60, 12) + CCU_GATE(CLK_AHB1_NAND0, "ahb1-nand0", "ahb1", 0x60, 13) + CCU_GATE(CLK_AHB1_SDRAM, "ahb1-sdram", "ahb1", 0x60, 14) + CCU_GATE(CLK_AHB1_EMAC, "ahb1-emac", "ahb1", 0x60, 17) + CCU_GATE(CLK_AHB1_TS, "ahb1-ts", "ahb1", 0x60, 18) + CCU_GATE(CLK_AHB1_HSTIMER, "ahb1-hstimer", "ahb1", 0x60, 19) + CCU_GATE(CLK_AHB1_SPI0, "ahb1-spi0", "ahb1", 0x60, 20) + CCU_GATE(CLK_AHB1_SPI1, "ahb1-spi1", "ahb1", 0x60, 21) + CCU_GATE(CLK_AHB1_SPI2, "ahb1-spi2", "ahb1", 0x60, 22) + CCU_GATE(CLK_AHB1_SPI3, "ahb1-spi3", "ahb1", 0x60, 23) + CCU_GATE(CLK_AHB1_OTG, "ahb1-otg", "ahb1", 0x60, 24) + CCU_GATE(CLK_AHB1_EHCI0, "ahb1-ehci0", "ahb1", 0x60, 26) + CCU_GATE(CLK_AHB1_EHCI1, "ahb1-ehci1", "ahb1", 0x60, 27) + CCU_GATE(CLK_AHB1_OHCI0, "ahb1-ohci0", "ahb1", 0x60, 29) + CCU_GATE(CLK_AHB1_OHCI1, "ahb1-ohci1", "ahb1", 0x60, 30) + CCU_GATE(CLK_AHB1_OHCI2, "ahb1-ohci2", "ahb1", 0x60, 31) + CCU_GATE(CLK_AHB1_VE, "ahb1-ve", "ahb1", 0x64, 0) + CCU_GATE(CLK_AHB1_LCD0, "ahb1-lcd0", "ahb1", 0x64, 4) + CCU_GATE(CLK_AHB1_LCD1, "ahb1-lcd1", "ahb1", 0x64, 5) + CCU_GATE(CLK_AHB1_CSI, "ahb1-csi", "ahb1", 0x64, 8) + CCU_GATE(CLK_AHB1_HDMI, "ahb1-hdmi", "ahb1", 0x64, 11) + CCU_GATE(CLK_AHB1_BE0, "ahb1-be0", "ahb1", 0x64, 12) + CCU_GATE(CLK_AHB1_BE1, "ahb1-be1", "ahb1", 0x64, 13) + CCU_GATE(CLK_AHB1_FE0, "ahb1-fe0", "ahb1", 0x64, 14) + CCU_GATE(CLK_AHB1_FE1, "ahb1-fe1", "ahb1", 0x64, 15) + CCU_GATE(CLK_AHB1_MP, "ahb1-mp", "ahb1", 0x64, 18) + CCU_GATE(CLK_AHB1_GPU, "ahb1-gpu", "ahb1", 0x64, 20) + CCU_GATE(CLK_AHB1_DEU0, "ahb1-deu0", "ahb1", 0x64, 23) + CCU_GATE(CLK_AHB1_DEU1, "ahb1-deu1", "ahb1", 0x64, 24) + CCU_GATE(CLK_AHB1_DRC0, "ahb1-drc0", "ahb1", 0x64, 25) + CCU_GATE(CLK_AHB1_DRC1, "ahb1-drc1", "ahb1", 0x64, 26) - CCU_GATE(A31_CLK_APB1_CODEC, "apb1-codec", "apb1", 0x68, 0) - CCU_GATE(A31_CLK_APB1_SPDIF, "apb1-spdif", "apb1", 0x68, 1) - CCU_GATE(A31_CLK_APB1_DIGITAL_MIC, "apb1-digital-mic", "apb1", 0x68, 4) - CCU_GATE(A31_CLK_APB1_PIO, "apb1-pio", "apb1", 0x68, 5) - CCU_GATE(A31_CLK_APB1_DAUDIO0, "apb1-daudio0", "apb1", 0x68, 12) - CCU_GATE(A31_CLK_APB1_DAUDIO1, "apb1-daudio1", "apb1", 0x68, 13) + CCU_GATE(CLK_APB1_CODEC, "apb1-codec", "apb1", 0x68, 0) + CCU_GATE(CLK_APB1_SPDIF, "apb1-spdif", "apb1", 0x68, 1) + CCU_GATE(CLK_APB1_DIGITAL_MIC, "apb1-digital-mic", "apb1", 0x68, 4) + CCU_GATE(CLK_APB1_PIO, "apb1-pio", "apb1", 0x68, 5) + CCU_GATE(CLK_APB1_DAUDIO0, "apb1-daudio0", "apb1", 0x68, 12) + CCU_GATE(CLK_APB1_DAUDIO1, "apb1-daudio1", "apb1", 0x68, 13) - CCU_GATE(A31_CLK_APB2_I2C0, "apb2-i2c0", "apb2", 0x6c, 0) - CCU_GATE(A31_CLK_APB2_I2C1, "apb2-i2c1", "apb2", 0x6c, 1) - CCU_GATE(A31_CLK_APB2_I2C2, "apb2-i2c2", "apb2", 0x6c, 2) - CCU_GATE(A31_CLK_APB2_I2C3, "apb2-i2c3", "apb2", 0x6c, 3) - CCU_GATE(A31_CLK_APB2_UART0, "apb2-uart0", "apb2", 0x6c, 16) - CCU_GATE(A31_CLK_APB2_UART1, "apb2-uart1", "apb2", 0x6c, 17) - CCU_GATE(A31_CLK_APB2_UART2, "apb2-uart2", "apb2", 0x6c, 18) - CCU_GATE(A31_CLK_APB2_UART3, "apb2-uart3", "apb2", 0x6c, 19) - CCU_GATE(A31_CLK_APB2_UART4, "apb2-uart4", "apb2", 0x6c, 20) - CCU_GATE(A31_CLK_APB2_UART5, "apb2-uart5", "apb2", 0x6c, 21) + CCU_GATE(CLK_APB2_I2C0, "apb2-i2c0", "apb2", 0x6c, 0) + CCU_GATE(CLK_APB2_I2C1, "apb2-i2c1", "apb2", 0x6c, 1) + CCU_GATE(CLK_APB2_I2C2, "apb2-i2c2", "apb2", 0x6c, 2) + CCU_GATE(CLK_APB2_I2C3, "apb2-i2c3", "apb2", 0x6c, 3) + CCU_GATE(CLK_APB2_UART0, "apb2-uart0", "apb2", 0x6c, 16) + CCU_GATE(CLK_APB2_UART1, "apb2-uart1", "apb2", 0x6c, 17) + CCU_GATE(CLK_APB2_UART2, "apb2-uart2", "apb2", 0x6c, 18) + CCU_GATE(CLK_APB2_UART3, "apb2-uart3", "apb2", 0x6c, 19) + CCU_GATE(CLK_APB2_UART4, "apb2-uart4", "apb2", 0x6c, 20) + CCU_GATE(CLK_APB2_UART5, "apb2-uart5", "apb2", 0x6c, 21) - CCU_GATE(A31_CLK_DAUDIO0, "daudio0", "daudio0mux", 0xb0, 31) - CCU_GATE(A31_CLK_DAUDIO1, "daudio1", "daudio1mux", 0xb4, 31) + CCU_GATE(CLK_DAUDIO0, "daudio0", "daudio0mux", 0xb0, 31) + CCU_GATE(CLK_DAUDIO1, "daudio1", "daudio1mux", 0xb4, 31) - CCU_GATE(A31_CLK_USB_PHY0, "usb-phy0", "osc24M", 0xcc, 8) - CCU_GATE(A31_CLK_USB_PHY1, "usb-phy1", "osc24M", 0xcc, 9) - CCU_GATE(A31_CLK_USB_PHY2, "usb-phy2", "osc24M", 0xcc, 10) - CCU_GATE(A31_CLK_USB_OHCI0, "usb-ohci0", "osc24M", 0xcc, 16) - CCU_GATE(A31_CLK_USB_OHCI1, "usb-ohci1", "osc24M", 0xcc, 17) - CCU_GATE(A31_CLK_USB_OHCI2, "usb-ohci2", "osc24M", 0xcc, 18) + CCU_GATE(CLK_USB_PHY0, "usb-phy0", "osc24M", 0xcc, 8) + CCU_GATE(CLK_USB_PHY1, "usb-phy1", "osc24M", 0xcc, 9) + CCU_GATE(CLK_USB_PHY2, "usb-phy2", "osc24M", 0xcc, 10) + CCU_GATE(CLK_USB_OHCI0, "usb-ohci0", "osc24M", 0xcc, 16) + CCU_GATE(CLK_USB_OHCI1, "usb-ohci1", "osc24M", 0xcc, 17) + CCU_GATE(CLK_USB_OHCI2, "usb-ohci2", "osc24M", 0xcc, 18) - CCU_GATE(A31_CLK_DRAM_VE, "dram-ve", "mdfs", 0x100, 0) - CCU_GATE(A31_CLK_DRAM_CSI_ISP, "dram-csi_isp", "mdfs", 0x100, 1) - CCU_GATE(A31_CLK_DRAM_TS, "dram-ts", "mdfs", 0x100, 3) - CCU_GATE(A31_CLK_DRAM_DRC0, "dram-drc0", "mdfs", 0x100, 16) - CCU_GATE(A31_CLK_DRAM_DRC1, "dram-drc1", "mdfs", 0x100, 17) - CCU_GATE(A31_CLK_DRAM_DEU0, "dram-deu0", "mdfs", 0x100, 18) - CCU_GATE(A31_CLK_DRAM_DEU1, "dram-deu1", "mdfs", 0x100, 19) - CCU_GATE(A31_CLK_DRAM_FE0, "dram-fe0", "mdfs", 0x100, 24) - CCU_GATE(A31_CLK_DRAM_FE1, "dram-fe1", "mdfs", 0x100, 25) - CCU_GATE(A31_CLK_DRAM_BE0, "dram-be0", "mdfs", 0x100, 26) - CCU_GATE(A31_CLK_DRAM_BE1, "dram-be1", "mdfs", 0x100, 27) - CCU_GATE(A31_CLK_DRAM_MP, "dram-mp", "mdfs", 0x100, 28) + CCU_GATE(CLK_DRAM_VE, "dram-ve", "mdfs", 0x100, 0) + CCU_GATE(CLK_DRAM_CSI_ISP, "dram-csi_isp", "mdfs", 0x100, 1) + CCU_GATE(CLK_DRAM_TS, "dram-ts", "mdfs", 0x100, 3) + CCU_GATE(CLK_DRAM_DRC0, "dram-drc0", "mdfs", 0x100, 16) + CCU_GATE(CLK_DRAM_DRC1, "dram-drc1", "mdfs", 0x100, 17) + CCU_GATE(CLK_DRAM_DEU0, "dram-deu0", "mdfs", 0x100, 18) + CCU_GATE(CLK_DRAM_DEU1, "dram-deu1", "mdfs", 0x100, 19) + CCU_GATE(CLK_DRAM_FE0, "dram-fe0", "mdfs", 0x100, 24) + CCU_GATE(CLK_DRAM_FE1, "dram-fe1", "mdfs", 0x100, 25) + CCU_GATE(CLK_DRAM_BE0, "dram-be0", "mdfs", 0x100, 26) + CCU_GATE(CLK_DRAM_BE1, "dram-be1", "mdfs", 0x100, 27) + CCU_GATE(CLK_DRAM_MP, "dram-mp", "mdfs", 0x100, 28) - CCU_GATE(A31_CLK_CODEC, "codec", "pll_audio", 0x140, 31) + CCU_GATE(CLK_CODEC, "codec", "pll_audio", 0x140, 31) - CCU_GATE(A31_CLK_AVS, "avs", "pll_audio", 0x144, 31) + CCU_GATE(CLK_AVS, "avs", "pll_audio", 0x144, 31) - CCU_GATE(A31_CLK_DIGITAL_MIC, "digital-mic", "pll_audio", 0x148, 31) + CCU_GATE(CLK_DIGITAL_MIC, "digital-mic", "pll_audio", 0x148, 31) - CCU_GATE(A31_CLK_HDMI_DDC, "hdmi-ddc", "osc24M", 0x150, 30) + CCU_GATE(CLK_HDMI_DDC, "hdmi-ddc", "osc24M", 0x150, 30) - CCU_GATE(A31_CLK_PS, "ps", "lcd1_ch1", 0x154, 31) + CCU_GATE(CLK_PS, "ps", "lcd1_ch1", 0x154, 31) }; static const char *pll_parents[] = {"osc24M"}; NKMP_CLK(pll_cpu_clk, - A31_CLK_PLL_CPU, /* id */ + CLK_PLL_CPU, /* id */ "pll_cpu", pll_parents, /* name, parents */ 0x00, /* offset */ 8, 5, 0, 0, /* n factor */ @@ -217,7 +252,7 @@ NKMP_CLK(pll_cpu_clk, AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK | AW_CLK_SCALE_CHANGE); /* flags */ NKMP_CLK(pll_audio_clk, - A31_CLK_PLL_AUDIO, /* id */ + CLK_PLL_AUDIO, /* id */ "pll_audio", pll_parents, /* name, parents */ 0x08, /* offset */ 8, 7, 0, 0, /* n factor */ @@ -230,7 +265,7 @@ NKMP_CLK(pll_audio_clk, static const char *pll_audio_mult_parents[] = {"pll_audio"}; FIXED_CLK(pll_audio_2x_clk, - A31_CLK_PLL_AUDIO_2X, /* id */ + CLK_PLL_AUDIO_2X, /* id */ "pll_audio-2x", /* name */ pll_audio_mult_parents, /* parent */ 0, /* freq */ @@ -238,7 +273,7 @@ FIXED_CLK(pll_audio_2x_clk, 1, /* div */ 0); /* flags */ FIXED_CLK(pll_audio_4x_clk, - A31_CLK_PLL_AUDIO_4X, /* id */ + CLK_PLL_AUDIO_4X, /* id */ "pll_audio-4x", /* name */ pll_audio_mult_parents, /* parent */ 0, /* freq */ @@ -246,7 +281,7 @@ FIXED_CLK(pll_audio_4x_clk, 1, /* div */ 0); /* flags */ FIXED_CLK(pll_audio_8x_clk, - A31_CLK_PLL_AUDIO_8X, /* id */ + CLK_PLL_AUDIO_8X, /* id */ "pll_audio-8x", /* name */ pll_audio_mult_parents, /* parent */ 0, /* freq */ @@ -255,7 +290,7 @@ FIXED_CLK(pll_audio_8x_clk, 0); /* flags */ NM_CLK_WITH_FRAC(pll_video0_clk, - A31_CLK_PLL_VIDEO0, /* id */ + CLK_PLL_VIDEO0, /* id */ "pll_video0", pll_parents, /* name, parents */ 0x10, /* offset */ 8, 7, 0, 0, /* n factor */ @@ -267,7 +302,7 @@ NM_CLK_WITH_FRAC(pll_video0_clk, static const char *pll_video0_2x_parents[] = {"pll_video0"}; FIXED_CLK(pll_video0_2x_clk, - A31_CLK_PLL_VIDEO0_2X, /* id */ + CLK_PLL_VIDEO0_2X, /* id */ "pll_video0-2x", /* name */ pll_video0_2x_parents, /* parent */ 0, /* freq */ @@ -276,7 +311,7 @@ FIXED_CLK(pll_video0_2x_clk, 0); /* flags */ NM_CLK_WITH_FRAC(pll_ve_clk, - A31_CLK_PLL_VE, /* id */ + CLK_PLL_VE, /* id */ "pll_ve", pll_parents, /* name, parents */ 0x18, /* offset */ 8, 7, 0, 0, /* n factor */ @@ -287,7 +322,7 @@ NM_CLK_WITH_FRAC(pll_ve_clk, 24, 25); /* mode sel, freq sel */ NKMP_CLK_WITH_UPDATE(pll_ddr_clk, - A31_CLK_PLL_DDR, /* id */ + CLK_PLL_DDR, /* id */ "pll_ddr", pll_parents, /* name, parents */ 0x20, /* offset */ 8, 5, 0, 0, /* n factor */ @@ -300,7 +335,7 @@ NKMP_CLK_WITH_UPDATE(pll_ddr_clk, AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ NKMP_CLK(pll_periph_clk, - A31_CLK_PLL_PERIPH, /* id */ + CLK_PLL_PERIPH, /* id */ "pll_periph", pll_parents, /* name, parents */ 0x28, /* offset */ 8, 4, 0, 0, /* n factor */ @@ -313,7 +348,7 @@ NKMP_CLK(pll_periph_clk, static const char *pll_periph_2x_parents[] = {"pll_periph"}; FIXED_CLK(pll_periph_2x_clk, - A31_CLK_PLL_PERIPH_2X, /* id */ + CLK_PLL_PERIPH_2X, /* id */ "pll_periph-2x", /* name */ pll_periph_2x_parents, /* parent */ 0, /* freq */ @@ -322,7 +357,7 @@ FIXED_CLK(pll_periph_2x_clk, 0); /* flags */ NM_CLK_WITH_FRAC(pll_video1_clk, - A31_CLK_PLL_VIDEO1, /* id */ + CLK_PLL_VIDEO1, /* id */ "pll_video1", pll_parents, /* name, parents */ 0x30, /* offset */ 8, 7, 0, 0, /* n factor */ @@ -334,7 +369,7 @@ NM_CLK_WITH_FRAC(pll_video1_clk, static const char *pll_video1_2x_parents[] = {"pll_video1"}; FIXED_CLK(pll_video1_2x_clk, - A31_CLK_PLL_VIDEO1_2X, /* id */ + CLK_PLL_VIDEO1_2X, /* id */ "pll_video1-2x", /* name */ pll_video1_2x_parents, /* parent */ 0, /* freq */ @@ -343,7 +378,7 @@ FIXED_CLK(pll_video1_2x_clk, 0); /* flags */ NM_CLK_WITH_FRAC(pll_gpu_clk, - A31_CLK_PLL_GPU, /* id */ + CLK_PLL_GPU, /* id */ "pll_gpu", pll_parents, /* name, parents */ 0x38, /* offset */ 8, 7, 0, 0, /* n factor */ @@ -355,7 +390,7 @@ NM_CLK_WITH_FRAC(pll_gpu_clk, static const char *pll_mipi_parents[] = {"pll_video0", "pll_video1"}; NKMP_CLK(pll_mipi_clk, - A31_CLK_PLL_MIPI, /* id */ + CLK_PLL_MIPI, /* id */ "pll_mipi", pll_mipi_parents, /* name, parents */ 0x40, /* offset */ 8, 4, 0, 0, /* n factor */ @@ -367,7 +402,7 @@ NKMP_CLK(pll_mipi_clk, AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ NM_CLK_WITH_FRAC(pll9_clk, - A31_CLK_PLL9, /* id */ + CLK_PLL9, /* id */ "pll9", pll_parents, /* name, parents */ 0x44, /* offset */ 8, 7, 0, 0, /* n factor */ @@ -378,7 +413,7 @@ NM_CLK_WITH_FRAC(pll9_clk, 24, 25); /* mode sel, freq sel */ NM_CLK_WITH_FRAC(pll10_clk, - A31_CLK_PLL10, /* id */ + CLK_PLL10, /* id */ "pll10", pll_parents, /* name, parents */ 0x48, /* offset */ 8, 7, 0, 0, /* n factor */ @@ -401,7 +436,7 @@ static struct clk_div_table axi_div_table[] = { }; static const char *axi_parents[] = {"cpu"}; DIV_CLK(axi_clk, - A31_CLK_AXI, /* id */ + CLK_AXI, /* id */ "axi", axi_parents, /* name, parents */ 0x50, /* offset */ 0, 2, /* shift, mask */ @@ -409,13 +444,13 @@ DIV_CLK(axi_clk, static const char *cpu_parents[] = {"osc32k", "osc24M", "pll_cpu", "pll_cpu"}; MUX_CLK(cpu_clk, - A31_CLK_CPU, /* id */ + CLK_CPU, /* id */ "cpu", cpu_parents, /* name, parents */ 0x50, 16, 2); /* offset, shift, width */ static const char *ahb1_parents[] = {"osc32k", "osc24M", "axi", "pll_periph"}; PREDIV_CLK(ahb1_clk, - A31_CLK_AHB1, /* id */ + CLK_AHB1, /* id */ "ahb1", ahb1_parents, /* name, parents */ 0x54, /* offset */ 12, 2, /* mux */ @@ -432,7 +467,7 @@ static struct clk_div_table apb1_div_table[] = { { }, }; DIV_CLK(apb1_clk, - A31_CLK_APB1, /* id */ + CLK_APB1, /* id */ "apb1", apb1_parents, /* name, parents */ 0x54, /* offset */ 8, 2, /* shift, mask */ @@ -441,7 +476,7 @@ DIV_CLK(apb1_clk, static const char *apb2_parents[] = {"osc32k", "osc24M", "pll_periph", "pll_periph"}; NM_CLK(apb2_clk, - A31_CLK_APB2, /* id */ + CLK_APB2, /* id */ "apb2", apb2_parents, /* name, parents */ 0x58, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ @@ -452,7 +487,7 @@ NM_CLK(apb2_clk, static const char *mod_parents[] = {"osc24M", "pll_periph"}; NM_CLK(nand0_clk, - A31_CLK_NAND0, "nand0", mod_parents, /* id, name, parents */ + CLK_NAND0, "nand0", mod_parents, /* id, name, parents */ 0x80, /* offset */ 16, 3, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -461,7 +496,7 @@ NM_CLK(nand0_clk, AW_CLK_HAS_GATE | AW_CLK_HAS_MUX); /* flags */ NM_CLK(nand1_clk, - A31_CLK_NAND1, "nand1", mod_parents, /* id, name, parents */ + CLK_NAND1, "nand1", mod_parents, /* id, name, parents */ 0x80, /* offset */ 16, 3, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -470,7 +505,7 @@ NM_CLK(nand1_clk, AW_CLK_HAS_GATE | AW_CLK_HAS_MUX); /* flags */ NM_CLK(mmc0_clk, - A31_CLK_MMC0, "mmc0", mod_parents, /* id, name, parents */ + CLK_MMC0, "mmc0", mod_parents, /* id, name, parents */ 0x88, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -480,7 +515,7 @@ NM_CLK(mmc0_clk, AW_CLK_REPARENT); /* flags */ NM_CLK(mmc1_clk, - A31_CLK_MMC1, "mmc1", mod_parents, /* id, name, parents */ + CLK_MMC1, "mmc1", mod_parents, /* id, name, parents */ 0x8c, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -490,7 +525,7 @@ NM_CLK(mmc1_clk, AW_CLK_REPARENT); /* flags */ NM_CLK(mmc2_clk, - A31_CLK_MMC2, "mmc2", mod_parents, /* id, name, parents */ + CLK_MMC2, "mmc2", mod_parents, /* id, name, parents */ 0x90, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -500,7 +535,7 @@ NM_CLK(mmc2_clk, AW_CLK_REPARENT); /* flags */ NM_CLK(mmc3_clk, - A31_CLK_MMC2, "mmc3", mod_parents, /* id, name, parents */ + CLK_MMC2, "mmc3", mod_parents, /* id, name, parents */ 0x94, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -511,7 +546,7 @@ NM_CLK(mmc3_clk, static const char *ts_parents[] = {"osc24M", "pll_periph"}; NM_CLK(ts_clk, - A31_CLK_TS, "ts", ts_parents, /* id, name, parents */ + CLK_TS, "ts", ts_parents, /* id, name, parents */ 0x98, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -520,7 +555,7 @@ NM_CLK(ts_clk, AW_CLK_HAS_GATE | AW_CLK_HAS_MUX); /* flags */ NM_CLK(ss_clk, - A31_CLK_SS, "ss", mod_parents, /* id, name, parents */ + CLK_SS, "ss", mod_parents, /* id, name, parents */ 0x9C, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -529,7 +564,7 @@ NM_CLK(ss_clk, AW_CLK_HAS_GATE | AW_CLK_HAS_MUX); /* flags */ NM_CLK(spi0_clk, - A31_CLK_SPI0, "spi0", mod_parents, /* id, name, parents */ + CLK_SPI0, "spi0", mod_parents, /* id, name, parents */ 0xA0, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -538,7 +573,7 @@ NM_CLK(spi0_clk, AW_CLK_HAS_GATE | AW_CLK_HAS_MUX); /* flags */ NM_CLK(spi1_clk, - A31_CLK_SPI1, "spi1", mod_parents, /* id, name, parents */ + CLK_SPI1, "spi1", mod_parents, /* id, name, parents */ 0xA4, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -547,7 +582,7 @@ NM_CLK(spi1_clk, AW_CLK_HAS_GATE | AW_CLK_HAS_MUX); /* flags */ NM_CLK(spi2_clk, - A31_CLK_SPI2, "spi2", mod_parents, /* id, name, parents */ + CLK_SPI2, "spi2", mod_parents, /* id, name, parents */ 0xA8, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -556,7 +591,7 @@ NM_CLK(spi2_clk, AW_CLK_HAS_GATE | AW_CLK_HAS_MUX); /* flags */ NM_CLK(spi3_clk, - A31_CLK_SPI3, "spi3", mod_parents, /* id, name, parents */ + CLK_SPI3, "spi3", mod_parents, /* id, name, parents */ 0xAC, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -577,7 +612,7 @@ MUX_CLK(daudio1mux_clk, static const char *mdfs_parents[] = {"pll_ddr", "pll_periph"}; NM_CLK(mdfs_clk, - A31_CLK_MDFS, "mdfs", mdfs_parents, /* id, name, parents */ + CLK_MDFS, "mdfs", mdfs_parents, /* id, name, parents */ 0xF0, /* offset */ 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -587,7 +622,7 @@ NM_CLK(mdfs_clk, static const char *dram_parents[] = {"pll_ddr", "pll_periph"}; NM_CLK(sdram0_clk, - A31_CLK_SDRAM0, "sdram0", dram_parents, /* id, name, parents */ + CLK_SDRAM0, "sdram0", dram_parents, /* id, name, parents */ 0xF4, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -595,7 +630,7 @@ NM_CLK(sdram0_clk, 0, /* gate */ AW_CLK_HAS_MUX); /* flags */ NM_CLK(sdram1_clk, - A31_CLK_SDRAM1, "sdram1", dram_parents, /* id, name, parents */ + CLK_SDRAM1, "sdram1", dram_parents, /* id, name, parents */ 0xF4, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 8, 4, 0, 0, /* m factor */ @@ -605,7 +640,7 @@ NM_CLK(sdram1_clk, static const char *befe_parents[] = {"pll_video0", "pll_video1", "pll_periph-2x", "pll_gpu", "pll9", "pll10"}; NM_CLK(be0_clk, - A31_CLK_BE0, "be0", befe_parents, /* id, name, parents */ + CLK_BE0, "be0", befe_parents, /* id, name, parents */ 0x104, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -614,7 +649,7 @@ NM_CLK(be0_clk, AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ NM_CLK(be1_clk, - A31_CLK_BE1, "be1", befe_parents, /* id, name, parents */ + CLK_BE1, "be1", befe_parents, /* id, name, parents */ 0x108, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -623,7 +658,7 @@ NM_CLK(be1_clk, AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ NM_CLK(fe0_clk, - A31_CLK_FE0, "fe0", befe_parents, /* id, name, parents */ + CLK_FE0, "fe0", befe_parents, /* id, name, parents */ 0x104, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -631,7 +666,7 @@ NM_CLK(fe0_clk, 31, /* gate */ AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ NM_CLK(fe1_clk, - A31_CLK_FE1, "fe1", befe_parents, /* id, name, parents */ + CLK_FE1, "fe1", befe_parents, /* id, name, parents */ 0x108, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -641,7 +676,7 @@ NM_CLK(fe1_clk, static const char *mp_parents[] = {"pll_video0", "pll_video1", "pll9", "pll10"}; NM_CLK(mp_clk, - A31_CLK_MP, "mp", mp_parents, /* id, name, parents */ + CLK_MP, "mp", mp_parents, /* id, name, parents */ 0x108, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -651,7 +686,7 @@ NM_CLK(mp_clk, static const char *lcd_ch0_parents[] = {"pll_video0", "pll_video1", "pll_video0-2x", "pll_video1-2x", "pll_mipi"}; NM_CLK(lcd0_ch0_clk, - A31_CLK_LCD0_CH0, "lcd0_ch0", lcd_ch0_parents, /* id, name, parents */ + CLK_LCD0_CH0, "lcd0_ch0", lcd_ch0_parents, /* id, name, parents */ 0x118, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* m factor (fake )*/ @@ -660,7 +695,7 @@ NM_CLK(lcd0_ch0_clk, AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ NM_CLK(lcd1_ch0_clk, - A31_CLK_LCD1_CH0, "lcd1_ch0", lcd_ch0_parents, /* id, name, parents */ + CLK_LCD1_CH0, "lcd1_ch0", lcd_ch0_parents, /* id, name, parents */ 0x11C, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* m factor (fake )*/ @@ -670,7 +705,7 @@ NM_CLK(lcd1_ch0_clk, static const char *lcd_ch1_parents[] = {"pll_video0", "pll_video1", "pll_video0-2x", "pll_video1-2x"}; NM_CLK(lcd0_ch1_clk, - A31_CLK_LCD0_CH1, "lcd0_ch1", lcd_ch1_parents, /* id, name, parents */ + CLK_LCD0_CH1, "lcd0_ch1", lcd_ch1_parents, /* id, name, parents */ 0x12C, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -679,7 +714,7 @@ NM_CLK(lcd0_ch1_clk, AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ NM_CLK(lcd1_ch1_clk, - A31_CLK_LCD1_CH1, "lcd1_ch1", lcd_ch1_parents, /* id, name, parents */ + CLK_LCD1_CH1, "lcd1_ch1", lcd_ch1_parents, /* id, name, parents */ 0x130, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -692,7 +727,7 @@ NM_CLK(lcd1_ch1_clk, static const char *ve_parents[] = {"pll_ve"}; NM_CLK(ve_clk, - A31_CLK_VE, "ve", ve_parents, /* id, name, parents */ + CLK_VE, "ve", ve_parents, /* id, name, parents */ 0x13C, /* offset */ 16, 3, 0, 0, /* n factor */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* m factor (fake) */ @@ -701,7 +736,7 @@ NM_CLK(ve_clk, AW_CLK_HAS_GATE); /* flags */ NM_CLK(hdmi_clk, - A31_CLK_HDMI, "hdmi", lcd_ch1_parents, /* id, name, parents */ + CLK_HDMI, "hdmi", lcd_ch1_parents, /* id, name, parents */ 0x150, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -711,7 +746,7 @@ NM_CLK(hdmi_clk, static const char *mbus_parents[] = {"osc24M", "pll_periph", "pll_ddr"}; NM_CLK(mbus0_clk, - A31_CLK_MBUS0, "mbus0", mbus_parents, /* id, name, parents */ + CLK_MBUS0, "mbus0", mbus_parents, /* id, name, parents */ 0x15C, /* offset */ 16, 2, 0, 0, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -720,7 +755,7 @@ NM_CLK(mbus0_clk, AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ NM_CLK(mbus1_clk, - A31_CLK_MBUS1, "mbus1", mbus_parents, /* id, name, parents */ + CLK_MBUS1, "mbus1", mbus_parents, /* id, name, parents */ 0x160, /* offset */ 16, 2, 0, 0, /* n factor */ 0, 4, 0, 0, /* m factor */ @@ -730,7 +765,7 @@ NM_CLK(mbus1_clk, static const char *mipi_parents[] = {"pll_video0", "pll_video1", "pll_video0-2x", "pll_video1-2x"}; NM_CLK(mipi_dsi_clk, - A31_CLK_MIPI_DSI, "mipi_dsi", mipi_parents, /* id, name, parents */ + CLK_MIPI_DSI, "mipi_dsi", mipi_parents, /* id, name, parents */ 0x168, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 16, 4, 0, 0, /* m factor */ @@ -739,7 +774,7 @@ NM_CLK(mipi_dsi_clk, AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ NM_CLK(mipi_dsi_dphy_clk, - A31_CLK_MIPI_DSI_DPHY, "mipi_dsi_dphy", mipi_parents, /* id, name, parents */ + CLK_MIPI_DSI_DPHY, "mipi_dsi_dphy", mipi_parents, /* id, name, parents */ 0x168, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -748,7 +783,7 @@ NM_CLK(mipi_dsi_dphy_clk, AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ NM_CLK(mipi_csi_dphy_clk, - A31_CLK_MIPI_CSI_DPHY, "mipi_csi_dphy", mipi_parents, /* id, name, parents */ + CLK_MIPI_CSI_DPHY, "mipi_csi_dphy", mipi_parents, /* id, name, parents */ 0x16C, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -759,7 +794,7 @@ NM_CLK(mipi_csi_dphy_clk, static const char *iep_parents[] = {"pll_video0", "pll_video1", "pll_periph-2x", "pll_gpu", "pll9", "pll10"}; NM_CLK(iep_drc0_clk, - A31_CLK_IEP_DRC0, "iep_drc0", iep_parents, /* id, name, parents */ + CLK_IEP_DRC0, "iep_drc0", iep_parents, /* id, name, parents */ 0x180, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -768,7 +803,7 @@ NM_CLK(iep_drc0_clk, AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ NM_CLK(iep_drc1_clk, - A31_CLK_IEP_DRC1, "iep_drc1", iep_parents, /* id, name, parents */ + CLK_IEP_DRC1, "iep_drc1", iep_parents, /* id, name, parents */ 0x184, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -777,7 +812,7 @@ NM_CLK(iep_drc1_clk, AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ NM_CLK(iep_deu0_clk, - A31_CLK_IEP_DEU0, "iep_deu0", iep_parents, /* id, name, parents */ + CLK_IEP_DEU0, "iep_deu0", iep_parents, /* id, name, parents */ 0x188, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -786,7 +821,7 @@ NM_CLK(iep_deu0_clk, AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ NM_CLK(iep_deu1_clk, - A31_CLK_IEP_DEU1, "iep_deu1", iep_parents, /* id, name, parents */ + CLK_IEP_DEU1, "iep_deu1", iep_parents, /* id, name, parents */ 0x18C, /* offset */ 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ @@ -796,7 +831,7 @@ NM_CLK(iep_deu1_clk, static const char *gpu_parents[] = {"pll_gpu", "pll_periph-2x", "pll_video0", "pll_video1", "pll9", "pll10"}; PREDIV_CLK(gpu_core_clk, - A31_CLK_GPU_CORE, /* id */ + CLK_GPU_CORE, /* id */ "gpu_core", gpu_parents, /* name, parents */ 0x1A0, /* offset */ 24, 3, /* mux */ @@ -805,7 +840,7 @@ PREDIV_CLK(gpu_core_clk, 24, 2, 1); /* prediv condition */ PREDIV_CLK(gpu_memory_clk, - A31_CLK_GPU_MEMORY, /* id */ + CLK_GPU_MEMORY, /* id */ "gpu_memory", gpu_parents, /* name, parents */ 0x1A4, /* offset */ 24, 3, /* mux */ @@ -814,7 +849,7 @@ PREDIV_CLK(gpu_memory_clk, 24, 2, 1); /* prediv condition */ PREDIV_CLK(gpu_hyd_clk, - A31_CLK_GPU_HYD, /* id */ + CLK_GPU_HYD, /* id */ "gpu_hyd", gpu_parents, /* name, parents */ 0x1A8, /* offset */ 24, 3, /* mux */ Modified: head/sys/arm/allwinner/clkng/ccu_a31.h ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a31.h Mon Oct 2 16:12:06 2017 (r324210) +++ head/sys/arm/allwinner/clkng/ccu_a31.h Mon Oct 2 16:21:20 2017 (r324211) @@ -29,222 +29,6 @@ #ifndef __CCU_A31_H__ #define __CCU_A31_H__ -#define A31_RST_USB_PHY0 0 -#define A31_RST_USB_PHY1 1 -#define A31_RST_USB_PHY2 2 -#define A31_RST_AHB1_MIPI_DSI 3 -#define A31_RST_AHB1_SS 4 -#define A31_RST_AHB1_DMA 5 -#define A31_RST_AHB1_MMC0 6 -#define A31_RST_AHB1_MMC1 7 -#define A31_RST_AHB1_MMC2 8 -#define A31_RST_AHB1_MMC3 9 -#define A31_RST_AHB1_NAND1 10 -#define A31_RST_AHB1_NAND0 11 -#define A31_RST_AHB1_SDRAM 12 -#define A31_RST_AHB1_EMAC 13 -#define A31_RST_AHB1_TS 14 -#define A31_RST_AHB1_HSTIMER 15 -#define A31_RST_AHB1_SPI0 16 -#define A31_RST_AHB1_SPI1 17 -#define A31_RST_AHB1_SPI2 18 -#define A31_RST_AHB1_SPI3 19 -#define A31_RST_AHB1_OTG 20 -#define A31_RST_AHB1_EHCI0 21 -#define A31_RST_AHB1_EHCI1 22 -#define A31_RST_AHB1_OHCI0 23 -#define A31_RST_AHB1_OHCI1 24 -#define A31_RST_AHB1_OHCI2 25 -#define A31_RST_AHB1_VE 26 -#define A31_RST_AHB1_LCD0 27 -#define A31_RST_AHB1_LCD1 28 -#define A31_RST_AHB1_CSI 29 -#define A31_RST_AHB1_HDMI 30 -#define A31_RST_AHB1_BE0 31 -#define A31_RST_AHB1_BE1 32 -#define A31_RST_AHB1_FE0 33 -#define A31_RST_AHB1_FE1 34 -#define A31_RST_AHB1_MP 35 -#define A31_RST_AHB1_GPU 36 -#define A31_RST_AHB1_DEU0 37 -#define A31_RST_AHB1_DEU1 38 -#define A31_RST_AHB1_DRC0 39 -#define A31_RST_AHB1_DRC1 40 -#define A31_RST_AHB1_LVDS 41 -#define A31_RST_APB1_CODEC 42 -#define A31_RST_APB1_SPDIF 43 -#define A31_RST_APB1_DIGITAL_MIC 44 -#define A31_RST_APB1_DAUDIO0 45 -#define A31_RST_APB1_DAUDIO1 46 -#define A31_RST_APB2_I2C0 47 -#define A31_RST_APB2_I2C1 48 -#define A31_RST_APB2_I2C2 49 -#define A31_RST_APB2_I2C3 50 -#define A31_RST_APB2_UART0 51 -#define A31_RST_APB2_UART1 52 -#define A31_RST_APB2_UART2 53 -#define A31_RST_APB2_UART3 54 -#define A31_RST_APB2_UART4 55 -#define A31_RST_APB2_UART5 56 - -#define A31_CLK_PLL_CPU 0 -#define A31_CLK_PLL_AUDIO_BASE 1 -#define A31_CLK_PLL_AUDIO 2 -#define A31_CLK_PLL_AUDIO_2X 3 -#define A31_CLK_PLL_AUDIO_4X 4 -#define A31_CLK_PLL_AUDIO_8X 5 -#define A31_CLK_PLL_VIDEO0 6 -#define A31_CLK_PLL_VIDEO0_2X 7 -#define A31_CLK_PLL_VE 8 -#define A31_CLK_PLL_DDR 9 -#define A31_CLK_PLL_PERIPH 10 -#define A31_CLK_PLL_PERIPH_2X 11 -#define A31_CLK_PLL_VIDEO1 12 -#define A31_CLK_PLL_VIDEO1_2X 13 -#define A31_CLK_PLL_GPU 14 -#define A31_CLK_PLL_MIPI 15 -#define A31_CLK_PLL9 16 -#define A31_CLK_PLL10 17 -#define A31_CLK_CPU 18 -#define A31_CLK_AXI 19 -#define A31_CLK_AHB1 20 -#define A31_CLK_APB1 21 -#define A31_CLK_APB2 22 -#define A31_CLK_AHB1_MIPIDSI 23 -#define A31_CLK_AHB1_SS 24 -#define A31_CLK_AHB1_DMA 25 -#define A31_CLK_AHB1_MMC0 26 -#define A31_CLK_AHB1_MMC1 27 -#define A31_CLK_AHB1_MMC2 28 -#define A31_CLK_AHB1_MMC3 29 -#define A31_CLK_AHB1_NAND1 30 -#define A31_CLK_AHB1_NAND0 31 -#define A31_CLK_AHB1_SDRAM 32 -#define A31_CLK_AHB1_EMAC 33 -#define A31_CLK_AHB1_TS 34 -#define A31_CLK_AHB1_HSTIMER 35 -#define A31_CLK_AHB1_SPI0 36 -#define A31_CLK_AHB1_SPI1 37 -#define A31_CLK_AHB1_SPI2 38 -#define A31_CLK_AHB1_SPI3 39 -#define A31_CLK_AHB1_OTG 40 -#define A31_CLK_AHB1_EHCI0 41 -#define A31_CLK_AHB1_EHCI1 42 -#define A31_CLK_AHB1_OHCI0 43 -#define A31_CLK_AHB1_OHCI1 44 -#define A31_CLK_AHB1_OHCI2 45 -#define A31_CLK_AHB1_VE 46 -#define A31_CLK_AHB1_LCD0 47 -#define A31_CLK_AHB1_LCD1 48 -#define A31_CLK_AHB1_CSI 49 -#define A31_CLK_AHB1_HDMI 50 -#define A31_CLK_AHB1_BE0 51 -#define A31_CLK_AHB1_BE1 52 -#define A31_CLK_AHB1_FE0 53 -#define A31_CLK_AHB1_FE1 54 -#define A31_CLK_AHB1_MP 55 -#define A31_CLK_AHB1_GPU 56 -#define A31_CLK_AHB1_DEU0 57 -#define A31_CLK_AHB1_DEU1 58 -#define A31_CLK_AHB1_DRC0 59 -#define A31_CLK_AHB1_DRC1 60 -#define A31_CLK_APB1_CODEC 61 -#define A31_CLK_APB1_SPDIF 62 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Oct 2 16:33:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E911EE0E092; Mon, 2 Oct 2017 16:33:05 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAA176E3FD; Mon, 2 Oct 2017 16:33:05 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92GX4Ph029523; Mon, 2 Oct 2017 16:33:04 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92GX4h3029521; Mon, 2 Oct 2017 16:33:04 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201710021633.v92GX4h3029521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 2 Oct 2017 16:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324212 - head/usr.bin/rsh X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/usr.bin/rsh X-SVN-Commit-Revision: 324212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 16:33:06 -0000 Author: eugen (ports committer) Date: Mon Oct 2 16:33:04 2017 New Revision: 324212 URL: https://svnweb.freebsd.org/changeset/base/324212 Log: rsh: introduce new option -N disabling shutdown of socket sending path. This prevents premature disconnection of rsh session with protocol implementation confused by "end-of-file" condition for standard input stream. For example, modern Cisco IOS (15.x) versions can be managed with "rsh -N" cron jobs having /dev/null as stdin. PR: 205144 Approved by: avg (mentor) MFC after: 1 week Modified: head/usr.bin/rsh/rsh.1 head/usr.bin/rsh/rsh.c Modified: head/usr.bin/rsh/rsh.1 ============================================================================== --- head/usr.bin/rsh/rsh.1 Mon Oct 2 16:21:20 2017 (r324211) +++ head/usr.bin/rsh/rsh.1 Mon Oct 2 16:33:04 2017 (r324212) @@ -36,7 +36,7 @@ .Nd remote shell .Sh SYNOPSIS .Nm -.Op Fl 46dn +.Op Fl 46dnN .Op Fl l Ar username .Op Fl t Ar timeout .Ar host @@ -87,12 +87,22 @@ By default, the remote username is the same as the loc Authorization is determined as in .Xr rlogin 1 . +.It Fl N +Opposite to +.Fl n +option: do not send the "end of file" (EOF) indication for input stream +to the remote host. This option makes the +.Nm +utility compatible with protocol implementations confused by receiving +EOF, like some Cisco IOS versions. Disables +.Fl n . .It Fl n Redirect input from the special device .Pa /dev/null (see the .Sx BUGS -section of this manual page). +section of this manual page). Disables +.Fl N . .It Fl t Ar timeout Allow a .Ar timeout Modified: head/usr.bin/rsh/rsh.c ============================================================================== --- head/usr.bin/rsh/rsh.c Mon Oct 2 16:21:20 2017 (r324211) +++ head/usr.bin/rsh/rsh.c Mon Oct 2 16:33:04 2017 (r324212) @@ -85,7 +85,7 @@ static char rlogin[] = "rlogin"; void connect_timeout(int); char *copyargs(char * const *); void sendsig(int); -void talk(int, long, pid_t, int, int); +void talk(int, int, long, pid_t, int, int); void usage(void); int @@ -94,13 +94,13 @@ main(int argc, char *argv[]) struct passwd const *pw; struct servent const *sp; long omask; - int argoff, asrsh, ch, dflag, nflag, one, rem; + int argoff, asrsh, ch, dflag, nflag, Nflag, one, rem; pid_t pid = 0; uid_t uid; char *args, *host, *p, *user; int timeout = 0; - argoff = asrsh = dflag = nflag = 0; + argoff = asrsh = dflag = nflag = Nflag = 0; one = 1; host = user = NULL; @@ -120,7 +120,7 @@ main(int argc, char *argv[]) argoff = 1; } -#define OPTIONS "468Lde:l:nt:w" +#define OPTIONS "468LNde:l:nt:w" while ((ch = getopt(argc - argoff, argv + argoff, OPTIONS)) != -1) switch(ch) { case '4': @@ -131,6 +131,10 @@ main(int argc, char *argv[]) family = PF_INET6; break; + case 'N': + Nflag = 1; + nflag = 0; + break; case 'L': /* -8Lew are ignored to allow rlogin aliases */ case 'e': case 'w': @@ -144,6 +148,7 @@ main(int argc, char *argv[]) break; case 'n': nflag = 1; + Nflag = 0; break; case 't': timeout = atoi(optarg); @@ -227,7 +232,7 @@ main(int argc, char *argv[]) (void)ioctl(rfd2, FIONBIO, &one); (void)ioctl(rem, FIONBIO, &one); - talk(nflag, omask, pid, rem, timeout); + talk(nflag, Nflag, omask, pid, rem, timeout); if (!nflag) (void)kill(pid, SIGKILL); @@ -235,7 +240,7 @@ main(int argc, char *argv[]) } void -talk(int nflag, long omask, pid_t pid, int rem, int timeout) +talk(int nflag, int Nflag, long omask, pid_t pid, int rem, int timeout) { int cc, wc; fd_set readfrom, ready, rembits; @@ -276,8 +281,8 @@ rewrite: if (cc == 0) goto reread; goto rewrite; -done: - (void)shutdown(rem, SHUT_WR); +done: if (!Nflag) + (void)shutdown(rem, SHUT_WR); exit(0); } @@ -371,6 +376,6 @@ usage(void) { (void)fprintf(stderr, - "usage: rsh [-46dn] [-l username] [-t timeout] host [command]\n"); + "usage: rsh [-46Ndn] [-l username] [-t timeout] host [command]\n"); exit(1); } From owner-svn-src-head@freebsd.org Mon Oct 2 16:39:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E0A0E0E251; Mon, 2 Oct 2017 16:39:13 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 554B46E6A0; Mon, 2 Oct 2017 16:39:13 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92GdCqk029779; Mon, 2 Oct 2017 16:39:12 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92GdCd0029778; Mon, 2 Oct 2017 16:39:12 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201710021639.v92GdCd0029778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 2 Oct 2017 16:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324213 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 324213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 16:39:13 -0000 Author: manu Date: Mon Oct 2 16:39:12 2017 New Revision: 324213 URL: https://svnweb.freebsd.org/changeset/base/324213 Log: Allwinner: Remove a10_gpio.h a10_gpio.h isn't used since a long time, remove it from the tree. Deleted: head/sys/arm/allwinner/a10_gpio.h From owner-svn-src-head@freebsd.org Mon Oct 2 17:20:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F4B1E0F277; Mon, 2 Oct 2017 17:20:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BF8C6FAFF; Mon, 2 Oct 2017 17:20:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92HK7mp046516; Mon, 2 Oct 2017 17:20:07 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92HK7oX046515; Mon, 2 Oct 2017 17:20:07 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201710021720.v92HK7oX046515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 2 Oct 2017 17:20:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324214 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 324214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 17:20:08 -0000 Author: manu Date: Mon Oct 2 17:20:07 2017 New Revision: 324214 URL: https://svnweb.freebsd.org/changeset/base/324214 Log: Allwinner GPIO: Fail if we cannot enable a clock If we cannot enable a clock (which is required to have the device working), do not attach the device as it will not work. Modified: head/sys/arm/allwinner/a10_gpio.c Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Mon Oct 2 16:39:12 2017 (r324213) +++ head/sys/arm/allwinner/a10_gpio.c Mon Oct 2 17:20:07 2017 (r324214) @@ -775,7 +775,7 @@ a10_gpio_attach(device_t dev) struct clk_list *clkp, *clkp_tmp; clk_t clk; hwreset_t rst = NULL; - int off, err; + int off, err, clkret; sc = device_get_softc(dev); sc->sc_dev = dev; @@ -815,12 +815,15 @@ a10_gpio_attach(device_t dev) error = hwreset_deassert(rst); if (error != 0) { device_printf(dev, "cannot de-assert reset\n"); - return (error); + goto fail; } } TAILQ_INIT(&sc->clk_list); - for (off = 0; clk_get_by_ofw_index(dev, 0, off, &clk) == 0; off++) { + for (off = 0, clkret = 0; clkret == 0; off++) { + clkret = clk_get_by_ofw_index(dev, 0, off, &clk); + if (clkret != 0) + break; err = clk_enable(clk); if (err != 0) { device_printf(dev, "Could not enable clock %s\n", @@ -830,6 +833,11 @@ a10_gpio_attach(device_t dev) clkp = malloc(sizeof(*clkp), M_DEVBUF, M_WAITOK | M_ZERO); clkp->clk = clk; TAILQ_INSERT_TAIL(&sc->clk_list, clkp, next); + } + if (clkret != 0 && clkret != ENOENT) { + device_printf(dev, "Could not find clock at offset %d (%d)\n", + off, clkret); + goto fail; } sc->sc_busdev = gpiobus_attach_bus(dev); From owner-svn-src-head@freebsd.org Mon Oct 2 18:25:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE98FE23DFD; Mon, 2 Oct 2017 18:25:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D62972454; Mon, 2 Oct 2017 18:25:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92IPUp5076017; Mon, 2 Oct 2017 18:25:30 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92IPUpu076015; Mon, 2 Oct 2017 18:25:30 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201710021825.v92IPUpu076015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 2 Oct 2017 18:25:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324216 - in head: sbin/ipfw sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head: sbin/ipfw sys/netpfil/ipfw X-SVN-Commit-Revision: 324216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 18:25:31 -0000 Author: tuexen Date: Mon Oct 2 18:25:30 2017 New Revision: 324216 URL: https://svnweb.freebsd.org/changeset/base/324216 Log: Fix a bug which avoided that rules for matching port numbers for SCTP packets where actually matched. While there, make clean in the man-page that SCTP port numbers are supported in rules. MFC after: 1 month Modified: head/sbin/ipfw/ipfw.8 head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Mon Oct 2 18:03:55 2017 (r324215) +++ head/sbin/ipfw/ipfw.8 Mon Oct 2 18:25:30 2017 (r324216) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 3, 2017 +.Dd October 2, 2017 .Dt IPFW 8 .Os .Sh NAME @@ -537,7 +537,7 @@ for filtering packets, among the following: .It Layer-2 header fields When available .It IPv4 and IPv6 Protocol -TCP, UDP, ICMP, etc. +SCTP, TCP, UDP, ICMP, etc. .It Source and dest. addresses and ports .It Direction See Section @@ -1396,7 +1396,7 @@ error-prone. No support for sets of IPv6 addresses is provided because IPv6 addresses are typically random past the initial prefix. .It Ar ports : Bro Ar port | port Ns \&- Ns Ar port Ns Brc Ns Op , Ns Ar ports -For protocols which support port numbers (such as TCP and UDP), optional +For protocols which support port numbers (such as SCTP, TCP and UDP), optional .Cm ports may be specified as one or more ports or port ranges, separated by commas but no spaces, and an optional Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Mon Oct 2 18:03:55 2017 (r324215) +++ head/sys/netpfil/ipfw/ip_fw2.c Mon Oct 2 18:25:30 2017 (r324216) @@ -1663,8 +1663,8 @@ do { \ * to guarantee that we have a * packet with port info. */ - if ((proto==IPPROTO_UDP || proto==IPPROTO_TCP) - && offset == 0) { + if ((proto==IPPROTO_UDP || proto==IPPROTO_TCP || + proto==IPPROTO_SCTP) && offset == 0) { u_int16_t x = (cmd->opcode == O_IP_SRCPORT) ? src_port : dst_port ; From owner-svn-src-head@freebsd.org Mon Oct 2 19:17:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02B85E253CF; Mon, 2 Oct 2017 19:17:11 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B927674427; Mon, 2 Oct 2017 19:17:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92JH95g096960; Mon, 2 Oct 2017 19:17:09 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92JH9TY096959; Mon, 2 Oct 2017 19:17:09 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201710021917.v92JH9TY096959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 2 Oct 2017 19:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324217 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 324217 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 19:17:11 -0000 Author: manu Date: Mon Oct 2 19:17:09 2017 New Revision: 324217 URL: https://svnweb.freebsd.org/changeset/base/324217 Log: Allwinner H3 CCU: Fix build on ARM64 ccu_h3.c is also used on ARM64 as it provides clocks for the H5 SoC. Since ARM64 doesn't have sys/gun/dts/include in it's include path, use the full name for the sun8i-h3-ccu.h include. Reported by: andreast Modified: head/sys/arm/allwinner/clkng/ccu_h3.c Modified: head/sys/arm/allwinner/clkng/ccu_h3.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_h3.c Mon Oct 2 18:25:30 2017 (r324216) +++ head/sys/arm/allwinner/clkng/ccu_h3.c Mon Oct 2 19:17:09 2017 (r324217) @@ -43,8 +43,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include #include "ccu_h3.h" From owner-svn-src-head@freebsd.org Mon Oct 2 20:02:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21C86E26739; Mon, 2 Oct 2017 20:02:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E384A75DBB; Mon, 2 Oct 2017 20:02:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92K2QN0017533; Mon, 2 Oct 2017 20:02:26 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92K2Q0o017532; Mon, 2 Oct 2017 20:02:26 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201710022002.v92K2Q0o017532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 2 Oct 2017 20:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324218 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 324218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 20:02:27 -0000 Author: tuexen Date: Mon Oct 2 20:02:25 2017 New Revision: 324218 URL: https://svnweb.freebsd.org/changeset/base/324218 Log: Whitespace changes: Remove leading spaces followed by a tab. Modified: head/sbin/ipfw/ipfw2.h Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Mon Oct 2 19:17:09 2017 (r324217) +++ head/sbin/ipfw/ipfw2.h Mon Oct 2 20:02:25 2017 (r324218) @@ -205,14 +205,14 @@ enum tokens { TOK_IP, TOK_IF, - TOK_ALOG, - TOK_DENY_INC, - TOK_SAME_PORTS, - TOK_UNREG_ONLY, + TOK_ALOG, + TOK_DENY_INC, + TOK_SAME_PORTS, + TOK_UNREG_ONLY, TOK_SKIP_GLOBAL, - TOK_RESET_ADDR, - TOK_ALIAS_REV, - TOK_PROXY_ONLY, + TOK_RESET_ADDR, + TOK_ALIAS_REV, + TOK_PROXY_ONLY, TOK_REDIR_ADDR, TOK_REDIR_PORT, TOK_REDIR_PROTO, From owner-svn-src-head@freebsd.org Mon Oct 2 20:33:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 973B6E27525; Mon, 2 Oct 2017 20:33:17 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62D1076FD4; Mon, 2 Oct 2017 20:33:17 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92KXGgQ030132; Mon, 2 Oct 2017 20:33:16 GMT (envelope-from mizhka@FreeBSD.org) Received: (from mizhka@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92KXGsm030130; Mon, 2 Oct 2017 20:33:16 GMT (envelope-from mizhka@FreeBSD.org) Message-Id: <201710022033.v92KXGsm030130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mizhka set sender to mizhka@FreeBSD.org using -f From: Michael Zhilin Date: Mon, 2 Oct 2017 20:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324219 - head/lib/libthr/thread X-SVN-Group: head X-SVN-Commit-Author: mizhka X-SVN-Commit-Paths: head/lib/libthr/thread X-SVN-Commit-Revision: 324219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 20:33:17 -0000 Author: mizhka Date: Mon Oct 2 20:33:16 2017 New Revision: 324219 URL: https://svnweb.freebsd.org/changeset/base/324219 Log: [libthr] revert change of visibility of _thread_keytable to unbreak debugger Fix regression by r318539. The sysutils/pstack uses library libthread_db to read information about threads state. The function pt_ta_new makes lookup of several key symbols including _thread_keytable. But r318539 mades this field static. It causes silent ignore of libthr library by pstack and as result sysutils/pstack doesn't output any thread information. This fix changes this field back to non-static. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D11738 Modified: head/lib/libthr/thread/thr_private.h head/lib/libthr/thread/thr_spec.c Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Mon Oct 2 20:02:25 2017 (r324218) +++ head/lib/libthr/thread/thr_private.h Mon Oct 2 20:33:16 2017 (r324219) @@ -719,6 +719,8 @@ extern char *_usrstack __hidden; extern int _libthr_debug; extern int _thread_event_mask; extern struct pthread *_thread_last_event; +/* Used in symbol lookup of libthread_db */ +extern struct pthread_key _thread_keytable[]; /* List of all threads: */ extern pthreadlist _thread_list; Modified: head/lib/libthr/thread/thr_spec.c ============================================================================== --- head/lib/libthr/thread/thr_spec.c Mon Oct 2 20:02:25 2017 (r324218) +++ head/lib/libthr/thread/thr_spec.c Mon Oct 2 20:33:16 2017 (r324219) @@ -42,7 +42,8 @@ __FBSDID("$FreeBSD$"); #include "thr_private.h" -static struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX]; +/* Used in symbol lookup of libthread_db */ +struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX]; __weak_reference(_pthread_key_create, pthread_key_create); __weak_reference(_pthread_key_delete, pthread_key_delete); From owner-svn-src-head@freebsd.org Mon Oct 2 22:02:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06DC8E2896F; Mon, 2 Oct 2017 22:02:06 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D59417D240; Mon, 2 Oct 2017 22:02:05 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92M24eg065287; Mon, 2 Oct 2017 22:02:04 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92M24q6065282; Mon, 2 Oct 2017 22:02:04 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201710022202.v92M24q6065282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 2 Oct 2017 22:02:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324220 - in head/cddl/contrib/opensolaris: cmd/zdb cmd/ztest lib/libzpool/common lib/libzpool/common/sys X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head/cddl/contrib/opensolaris: cmd/zdb cmd/ztest lib/libzpool/common lib/libzpool/common/sys X-SVN-Commit-Revision: 324220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 22:02:06 -0000 Author: asomers Date: Mon Oct 2 22:02:04 2017 New Revision: 324220 URL: https://svnweb.freebsd.org/changeset/base/324220 Log: MFC r316858 7280 Allow changing global libzpool variables in zdb 7280 Allow changing global libzpool variables in zdb and ztest through command line illumos/illumos-gate@0e60744c982adecd0a1f146f5637475d07ab1069 https://github.com/illumos/illumos-gate/commit/0e60744c982adecd0a1f146f5637475d07ab1069 https://www.illumos.org/issues/7280 zdb is very handy for diagnosing problems with a pool in a safe and quick way. When a pool is in a bad shape, we often want to disable some fail-safes, or adjust some tunables in order to open them. In the kernel, this is done by changing public variables in mdb. The goal of this feature is to add the same capability to zdb and ztest, so that they can change libzpool tuneables from the command line. Reviewed by: Matthew Ahrens Reviewed by: Dan Kimmel Approved by: Robert Mustacchi Author: Pavel Zakharov MFC after: 3 weeks Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h head/cddl/contrib/opensolaris/lib/libzpool/common/util.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/zdb/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Mon Oct 2 20:33:16 2017 (r324219) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Mon Oct 2 22:02:04 2017 (r324220) @@ -33,6 +33,7 @@ .Op Fl U Ar cache .Op Fl I Ar inflight I/Os .Op Fl x Ar dumpdir +.Op Fl o Ar var=value .Ar poolname .Op Ar object ... .Nm @@ -252,6 +253,10 @@ Limit the number of outstanding checksum I/Os to the s The default value is 200. This option affects the performance of the .Fl c option. +.It Fl o Ar var=value +Set the given global libzpool variable to the provided value. The value must be +an unsigned 32-bit integer. Currently only little-endian systems are supported +to avoid accidentally setting the high 32 bits of 64-bit variables. .It Fl P Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather than 1M. Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Oct 2 20:33:16 2017 (r324219) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Oct 2 22:02:04 2017 (r324220) @@ -121,7 +121,8 @@ usage(void) { (void) fprintf(stderr, "Usage: %s [-CumMdibcsDvhLXFPAG] [-t txg] [-e [-p path...]] " - "[-U config] [-I inflight I/Os] [-x dumpdir] poolname [object...]\n" + "[-U config] [-I inflight I/Os] [-x dumpdir] [-o var=value] " + "poolname [object...]\n" " %s [-divPA] [-e -p path...] [-U config] dataset " "[object...]\n" " %s -mM [-LXFPA] [-t txg] [-e [-p path...]] [-U config] " @@ -183,6 +184,8 @@ usage(void) "checksumming I/Os [default is 200]\n"); (void) fprintf(stderr, " -G dump zfs_dbgmsg buffer before " "exiting\n"); + (void) fprintf(stderr, " -o = set global " + "variable to an unsigned 32-bit integer value\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " "to make only that option verbose\n"); (void) fprintf(stderr, "Default is to dump everything non-verbosely\n"); @@ -3614,7 +3617,7 @@ main(int argc, char **argv) spa_config_path = spa_config_path_env; while ((c = getopt(argc, argv, - "bcdhilmMI:suCDRSAFLXx:evp:t:U:PG")) != -1) { + "bcdhilmMI:suCDRSAFLXx:evp:t:U:PGo:")) != -1) { switch (c) { case 'b': case 'c': @@ -3682,6 +3685,11 @@ main(int argc, char **argv) break; case 'x': vn_dumpdir = optarg; + break; + case 'o': + error = set_global_var(optarg); + if (error != 0) + usage(); break; default: usage(); Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Oct 2 20:33:16 2017 (r324219) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Oct 2 22:02:04 2017 (r324220) @@ -583,6 +583,8 @@ usage(boolean_t requested) "\t[-F freezeloops (default: %llu)] max loops in spa_freeze()\n" "\t[-P passtime (default: %llu sec)] time per pass\n" "\t[-B alt_ztest (default: )] alternate ztest path\n" + "\t[-o variable=value] ... set global variable to an unsigned\n" + "\t 32-bit integer value\n" "\t[-h] (print help)\n" "", zo->zo_pool, @@ -618,7 +620,7 @@ process_options(int argc, char **argv) bcopy(&ztest_opts_defaults, zo, sizeof (*zo)); while ((opt = getopt(argc, argv, - "v:s:a:m:r:R:d:t:g:i:k:p:f:VET:P:hF:B:")) != EOF) { + "v:s:a:m:r:R:d:t:g:i:k:p:f:VET:P:hF:B:o:")) != EOF) { value = 0; switch (opt) { case 'v': @@ -704,6 +706,10 @@ process_options(int argc, char **argv) break; case 'B': (void) strlcpy(altdir, optarg, sizeof (altdir)); + break; + case 'o': + if (set_global_var(optarg) != 0) + usage(B_FALSE); break; case 'h': usage(B_TRUE); Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Mon Oct 2 20:33:16 2017 (r324219) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Mon Oct 2 22:02:04 2017 (r324220) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2015 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ /* @@ -583,6 +583,7 @@ extern void kernel_fini(void); struct spa; extern void nicenum(uint64_t num, char *buf); extern void show_pool_stats(struct spa *); +extern int set_global_var(char *arg); typedef struct callb_cpr { kmutex_t *cc_lockp; Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/util.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/util.c Mon Oct 2 20:33:16 2017 (r324219) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/util.c Mon Oct 2 22:02:04 2017 (r324220) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016 by Delphix. All rights reserved. */ #include @@ -31,6 +32,7 @@ #include #include #include +#include /* * Routines needed by more than one client of libzpool. @@ -152,4 +154,59 @@ show_pool_stats(spa_t *spa) show_vdev_stats(NULL, ZPOOL_CONFIG_SPARES, nvroot, 0); nvlist_free(config); +} + +/* + * Sets given global variable in libzpool to given unsigned 32-bit value. + * arg: "=" + */ +int +set_global_var(char *arg) +{ + void *zpoolhdl; + char *varname = arg, *varval; + u_longlong_t val; + +#ifndef _LITTLE_ENDIAN + /* + * On big endian systems changing a 64-bit variable would set the high + * 32 bits instead of the low 32 bits, which could cause unexpected + * results. + */ + fprintf(stderr, "Setting global variables is only supported on " + "little-endian systems\n", varname); + return (ENOTSUP); +#endif + if ((varval = strchr(arg, '=')) != NULL) { + *varval = '\0'; + varval++; + val = strtoull(varval, NULL, 0); + if (val > UINT32_MAX) { + fprintf(stderr, "Value for global variable '%s' must " + "be a 32-bit unsigned integer\n", varname); + return (EOVERFLOW); + } + } else { + return (EINVAL); + } + + zpoolhdl = dlopen("libzpool.so", RTLD_LAZY); + if (zpoolhdl != NULL) { + uint32_t *var; + var = dlsym(zpoolhdl, varname); + if (var == NULL) { + fprintf(stderr, "Global variable '%s' does not exist " + "in libzpool.so\n", varname); + return (EINVAL); + } + *var = (uint32_t)val; + + dlclose(zpoolhdl); + } else { + fprintf(stderr, "Failed to open libzpool.so to set global " + "variable\n"); + return (EIO); + } + + return (0); } From owner-svn-src-head@freebsd.org Mon Oct 2 22:13:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA918E28CAC; Mon, 2 Oct 2017 22:13:21 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BBBD7D68D; Mon, 2 Oct 2017 22:13:21 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92MDKIw071004; Mon, 2 Oct 2017 22:13:20 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92MDK63071002; Mon, 2 Oct 2017 22:13:20 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201710022213.v92MDK63071002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 2 Oct 2017 22:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324221 - head/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zdb X-SVN-Commit-Revision: 324221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 22:13:21 -0000 Author: asomers Date: Mon Oct 2 22:13:20 2017 New Revision: 324221 URL: https://svnweb.freebsd.org/changeset/base/324221 Log: MFV r316861: 6866 zdb -l should return non-zero if it fails to find any label illumos/illumos-gate@64723e361134b2a2c45341334174f9d34002f8d0 https://github.com/illumos/illumos-gate/commit/64723e361134b2a2c45341334174f9d34002f8d0 https://www.illumos.org/issues/6866 Need this for #6865. To be generally more scripting-friendly, overload this issue with adding '-q' option which should skip printing any label information. Reviewed by: Matthew Ahrens Reviewed by: John Kennedy Approved by: Robert Mustacchi Author: Yuri Pankov MFC after: 3 weeks Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Mon Oct 2 22:02:04 2017 (r324220) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Mon Oct 2 22:13:20 2017 (r324221) @@ -15,11 +15,12 @@ .\" Copyright 2012, Richard Lowe. .\" Copyright (c) 2012, Marcelo Araujo . .\" Copyright (c) 2012, 2014 by Delphix. All rights reserved. +.\" Copyright 2016 Nexenta Systems, Inc. .\" All Rights Reserved. .\" .\" $FreeBSD$ .\" -.Dd July 26, 2014 +.Dd October 1, 2017 .Dt ZDB 8 .Os .Sh NAME @@ -27,7 +28,7 @@ .Nd Display zpool debugging and consistency information .Sh SYNOPSIS .Nm -.Op Fl CumdibcsDvhLMXFPA +.Op Fl CmdibcsDvhLMXFPA .Op Fl e Op Fl p Ar path... .Op Fl t Ar txg .Op Fl U Ar cache @@ -64,7 +65,7 @@ .Ar poolname .Nm .Fl l -.Op Fl uA +.Op Fl Aqu .Ar device .Nm .Fl C @@ -156,9 +157,14 @@ dataset. If specified multiple times, display counts of each intent log transaction type. .It Fl l Ar device -Display the vdev labels from the specified device. +Read the vdev labels from the specified device. +Return 0 if a valid label was found, 1 if an error occurred, and 2 if no valid +labels were found. If the .Fl u +option is also specified, also display the uberblocks on this device. +If the +.Fl q option is also specified, also display the uberblocks on this device. .It Fl L Disable leak tracing and the loading of space maps. Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Oct 2 22:02:04 2017 (r324220) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Oct 2 22:13:20 2017 (r324221) @@ -23,6 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright 2016 Nexenta Systems, Inc. */ #include @@ -120,7 +121,7 @@ static void usage(void) { (void) fprintf(stderr, - "Usage: %s [-CumMdibcsDvhLXFPAG] [-t txg] [-e [-p path...]] " + "Usage: %s [-CmMdibcsDvhLXFPAG] [-t txg] [-e [-p path...]] " "[-U config] [-I inflight I/Os] [-x dumpdir] [-o var=value] " "poolname [object...]\n" " %s [-divPA] [-e -p path...] [-U config] dataset " @@ -130,7 +131,7 @@ usage(void) " %s -R [-A] [-e [-p path...]] poolname " "vdev:offset:size[:flags]\n" " %s -S [-PA] [-e [-p path...]] [-U config] poolname\n" - " %s -l [-uA] device\n" + " %s -l [-Aqu] device\n" " %s -C [-A] [-U config]\n\n", cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); @@ -141,7 +142,6 @@ usage(void) (void) fprintf(stderr, " If object numbers are specified, only " "those objects are dumped\n\n"); (void) fprintf(stderr, " Options to control amount of output:\n"); - (void) fprintf(stderr, " -u uberblock\n"); (void) fprintf(stderr, " -d dataset(s)\n"); (void) fprintf(stderr, " -i intent logs\n"); (void) fprintf(stderr, " -C config (or cachefile if alone)\n"); @@ -155,7 +155,7 @@ usage(void) (void) fprintf(stderr, " -D dedup statistics\n"); (void) fprintf(stderr, " -S simulate dedup to measure effect\n"); (void) fprintf(stderr, " -v verbose (applies to all others)\n"); - (void) fprintf(stderr, " -l dump label contents\n"); + (void) fprintf(stderr, " -l read label contents\n"); (void) fprintf(stderr, " -L disable leak tracking (do not " "load spacemaps)\n"); (void) fprintf(stderr, " -R read and display block from a " @@ -186,6 +186,8 @@ usage(void) "exiting\n"); (void) fprintf(stderr, " -o = set global " "variable to an unsigned 32-bit integer value\n"); + (void) fprintf(stderr, " -q don't print label contents\n"); + (void) fprintf(stderr, " -u uberblock\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " "to make only that option verbose\n"); (void) fprintf(stderr, "Default is to dump everything non-verbosely\n"); @@ -2159,84 +2161,94 @@ dump_label_uberblocks(vdev_label_t *lbl, uint64_t ashi } } -static void +static int dump_label(const char *dev) { int fd; vdev_label_t label; - char *path, *buf = label.vl_vdev_phys.vp_nvlist; + char path[MAXPATHLEN]; + char *buf = label.vl_vdev_phys.vp_nvlist; size_t buflen = sizeof (label.vl_vdev_phys.vp_nvlist); struct stat64 statbuf; uint64_t psize, ashift; - int len = strlen(dev) + 1; + boolean_t label_found = B_FALSE; - if (strncmp(dev, ZFS_DISK_ROOTD, strlen(ZFS_DISK_ROOTD)) == 0) { - len++; - path = malloc(len); - (void) snprintf(path, len, "%s%s", ZFS_RDISK_ROOTD, - dev + strlen(ZFS_DISK_ROOTD)); - } else { - path = strdup(dev); - } + (void) strlcpy(path, dev, sizeof (path)); + if (dev[0] == '/') { + if (strncmp(dev, ZFS_DISK_ROOTD, + strlen(ZFS_DISK_ROOTD)) == 0) { + (void) snprintf(path, sizeof (path), "%s%s", + ZFS_RDISK_ROOTD, dev + strlen(ZFS_DISK_ROOTD)); + } + } else if (stat64(path, &statbuf) != 0) { + char *s; - if ((fd = open64(path, O_RDONLY)) < 0) { - (void) printf("cannot open '%s': %s\n", path, strerror(errno)); - free(path); - exit(1); + (void) snprintf(path, sizeof (path), "%s%s", ZFS_RDISK_ROOTD, + dev); + if ((s = strrchr(dev, 's')) == NULL || !isdigit(*(s + 1))) + (void) strlcat(path, "s0", sizeof (path)); } - if (fstat64(fd, &statbuf) != 0) { + if (stat64(path, &statbuf) != 0) { (void) printf("failed to stat '%s': %s\n", path, strerror(errno)); - free(path); - (void) close(fd); exit(1); } if (S_ISBLK(statbuf.st_mode)) { (void) printf("cannot use '%s': character device required\n", path); - free(path); - (void) close(fd); exit(1); } + if ((fd = open64(path, O_RDONLY)) < 0) { + (void) printf("cannot open '%s': %s\n", path, strerror(errno)); + exit(1); + } + psize = statbuf.st_size; psize = P2ALIGN(psize, (uint64_t)sizeof (vdev_label_t)); for (int l = 0; l < VDEV_LABELS; l++) { nvlist_t *config = NULL; - (void) printf("--------------------------------------------\n"); - (void) printf("LABEL %d\n", l); - (void) printf("--------------------------------------------\n"); + if (!dump_opt['q']) { + (void) printf("------------------------------------\n"); + (void) printf("LABEL %d\n", l); + (void) printf("------------------------------------\n"); + } if (pread64(fd, &label, sizeof (label), vdev_label_offset(psize, l, 0)) != sizeof (label)) { - (void) printf("failed to read label %d\n", l); + if (!dump_opt['q']) + (void) printf("failed to read label %d\n", l); continue; } if (nvlist_unpack(buf, buflen, &config, 0) != 0) { - (void) printf("failed to unpack label %d\n", l); + if (!dump_opt['q']) + (void) printf("failed to unpack label %d\n", l); ashift = SPA_MINBLOCKSHIFT; } else { nvlist_t *vdev_tree = NULL; - dump_nvlist(config, 4); + if (!dump_opt['q']) + dump_nvlist(config, 4); if ((nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, &vdev_tree) != 0) || (nvlist_lookup_uint64(vdev_tree, ZPOOL_CONFIG_ASHIFT, &ashift) != 0)) ashift = SPA_MINBLOCKSHIFT; nvlist_free(config); + label_found = B_TRUE; } if (dump_opt['u']) dump_label_uberblocks(&label, ashift); } - free(path); (void) close(fd); + + return (label_found ? 0 : 2); } static uint64_t dataset_feature_count[SPA_FEATURES]; @@ -3617,7 +3629,7 @@ main(int argc, char **argv) spa_config_path = spa_config_path_env; while ((c = getopt(argc, argv, - "bcdhilmMI:suCDRSAFLXx:evp:t:U:PGo:")) != -1) { + "bcdhilmMI:suCDRSAFLXx:evp:t:U:PGo:q")) != -1) { switch (c) { case 'b': case 'c': @@ -3643,6 +3655,7 @@ main(int argc, char **argv) case 'X': case 'e': case 'P': + case 'q': dump_opt[c]++; break; case 'I': @@ -3751,10 +3764,8 @@ main(int argc, char **argv) usage(); } - if (dump_opt['l']) { - dump_label(argv[0]); - return (0); - } + if (dump_opt['l']) + return (dump_label(argv[0])); if (dump_opt['X'] || dump_opt['F']) rewind = ZPOOL_DO_REWIND | From owner-svn-src-head@freebsd.org Mon Oct 2 22:14:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA253E28D1C for ; Mon, 2 Oct 2017 22:14:07 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x241.google.com (mail-lf0-x241.google.com [IPv6:2a00:1450:4010:c07::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F3197D7D6 for ; Mon, 2 Oct 2017 22:14:07 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x241.google.com with SMTP id l196so2781283lfl.3 for ; Mon, 02 Oct 2017 15:14:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:cc; bh=tPTnHTqjyzZKQkhW9f/lCGmIL5GYZz3c0xhEQa+4PTE=; b=dIWwhsfizwBtpax/kK/kx58R5FZVusiNRHDiq4l3ImrTY5xxfQfrT7SvbbA3ECpC7i pw8xZSkPVuWrVVlur1S4sjKFuABnjc/pKcnDj7vCdEzTJ9sMKEwP1jZBpdE4TRN7nAll FrZZqD1F5fq8+JjZcFP/hgGWtwo0I09810ivCNH/WNrB8ah2Se4X6t2lg9T2UVPcO7gV GzivPlGBpKSIqj83vdbaeRGrZOPnHpwhj6jGACnL/oKRXSOQzqmzaIGwSNpSK2tb03/J ZbWLDoC4tuvH7Fdw6tRR4455sQrepiRHML+heK2ecJPRj82IjL2w0ReF3tIbY4greByi wniA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:cc; bh=tPTnHTqjyzZKQkhW9f/lCGmIL5GYZz3c0xhEQa+4PTE=; b=NFNrgIn76oJyT9ozUPkqt0lnEC97i/M6kDZn5GCd6E0iyjDILt1vdvlUfBFyvE2dPV QYDOac25nySNrnxd/Jkkup/IXVdtGlTD664BJlOQPyaK57ZQYtToNsxdx9kn1PZkq6E2 ATGmCNWtsiMdUFKE5WDUnLDtXU9WrSZ116Cj3wKiPGyCtCCNfSqLcxBYA4lAUonc6DG2 EIJsA5Q5m61uR7LTORDIpaxKjtfyZh/wynPxQMCAnBKKSutPLkALCqVY5IUryLvunkZI YQgTY2bzz5YqGgNM2rHXyt3BCSSp5fQ/0tuh+dYCHf10k80Wpg7bMGiyxiwHMBWGx+y4 qu7g== X-Gm-Message-State: AHPjjUiAeQkDXKNVlT12opTgN2ppFMSRL2Opp7IT5xQbxrNlDkk5UBKh a+PRomlg0BrLpXQV3LG/yZiIdPRp2LdoBsJcnOg= X-Received: by 10.46.41.22 with SMTP id u22mt8653035lje.130.1506982445671; Mon, 02 Oct 2017 15:14:05 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.7.153 with HTTP; Mon, 2 Oct 2017 15:14:04 -0700 (PDT) In-Reply-To: <201710022202.v92M24q6065282@repo.freebsd.org> References: <201710022202.v92M24q6065282@repo.freebsd.org> From: Alan Somers Date: Mon, 2 Oct 2017 16:14:04 -0600 X-Google-Sender-Auth: vi6PfCWsOfSbo-dQsem1hq5JaXs Message-ID: Subject: Re: svn commit: r324220 - in head/cddl/contrib/opensolaris: cmd/zdb cmd/ztest lib/libzpool/common lib/libzpool/common/sys Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 22:14:08 -0000 On Mon, Oct 2, 2017 at 4:02 PM, Alan Somers wrote: > Author: asomers > Date: Mon Oct 2 22:02:04 2017 > New Revision: 324220 > URL: https://svnweb.freebsd.org/changeset/base/324220 > > Log: > MFC r316858 7280 Allow changing global libzpool variables in zdb > > 7280 Allow changing global libzpool variables in zdb and ztest through command line > > illumos/illumos-gate@0e60744c982adecd0a1f146f5637475d07ab1069 > https://github.com/illumos/illumos-gate/commit/0e60744c982adecd0a1f146f5637475d07ab1069 > > https://www.illumos.org/issues/7280 > zdb is very handy for diagnosing problems with a pool in a safe and > quick way. When a pool is in a bad shape, we often want to disable some > fail-safes, or adjust some tunables in order to open them. In the > kernel, this is done by changing public variables in mdb. The goal of > this feature is to add the same capability to zdb and ztest, so that > they can change libzpool tuneables from the command line. > > Reviewed by: Matthew Ahrens > Reviewed by: Dan Kimmel > Approved by: Robert Mustacchi > Author: Pavel Zakharov > > MFC after: 3 weeks s/MFC/MFV/ From owner-svn-src-head@freebsd.org Mon Oct 2 22:35:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE7A8E291EF; Mon, 2 Oct 2017 22:35:36 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB30F7DFF0; Mon, 2 Oct 2017 22:35:36 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92MZZel079176; Mon, 2 Oct 2017 22:35:35 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92MZZ8a079175; Mon, 2 Oct 2017 22:35:35 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201710022235.v92MZZ8a079175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 2 Oct 2017 22:35:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324222 - head/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zdb X-SVN-Commit-Revision: 324222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 22:35:37 -0000 Author: asomers Date: Mon Oct 2 22:35:35 2017 New Revision: 324222 URL: https://svnweb.freebsd.org/changeset/base/324222 Log: MFV r316863: 3871 fix issues introduced by 3604 illumos/illumos-gate@de05b58863498b10283637eb9ac85e92fe85150e https://github.com/illumos/illumos-gate/commit/de05b58863498b10283637eb9ac85e92fe85150e https://www.illumos.org/issues/3871 GCC 4.5.3 on Gentoo Linux did not like a few of the changes made in the issue 3604 patch. It printed an error and a couple of warnings: ../../cmd/zdb/zdb.c: In function 'dump_bpobj': ../../cmd/zdb/zdb.c:1257:3: error: 'for' loop initial declarations are only allowed in C99 mode ../../cmd/zdb/zdb.c:1257:3: note: use option -std=c99 or -std=gnu99 to compile your code ../../cmd/zdb/zdb.c: In function 'dump_deadlist': ../../cmd/zdb/zdb.c:1323:8: warning: too many arguments for format ../../cmd/zdb/zdb.c:1323:8: warning: too many arguments for format Reviewed by: Paul Dagnelie Reviewed by: Matthew Ahrens Reviewed by: Serapheim Dimitropoulos Approved by: Dan McDonald Author: Richard Yao MFC after: 3 weeks Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/zdb/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Oct 2 22:13:20 2017 (r324221) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Oct 2 22:35:35 2017 (r324222) @@ -1587,8 +1587,9 @@ dump_deadlist(dsl_deadlist_t *dl) dle = AVL_NEXT(&dl->dl_tree, dle)) { if (dump_opt['d'] >= 5) { char buf[128]; - (void) snprintf(buf, sizeof (buf), "mintxg %llu -> " - "obj %llu", (longlong_t)dle->dle_mintxg, + (void) snprintf(buf, sizeof (buf), + "mintxg %llu -> obj %llu", + (longlong_t)dle->dle_mintxg, (longlong_t)dle->dle_bpobj.bpo_object); dump_full_bpobj(&dle->dle_bpobj, buf, 0); } else { From owner-svn-src-head@freebsd.org Mon Oct 2 22:39:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74A37E292B2; Mon, 2 Oct 2017 22:39:13 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BFF17E174; Mon, 2 Oct 2017 22:39:13 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92MdCUA079341; Mon, 2 Oct 2017 22:39:12 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92MdCCN079340; Mon, 2 Oct 2017 22:39:12 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201710022239.v92MdCCN079340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 2 Oct 2017 22:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324223 - head/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zdb X-SVN-Commit-Revision: 324223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 22:39:13 -0000 Author: asomers Date: Mon Oct 2 22:39:12 2017 New Revision: 324223 URL: https://svnweb.freebsd.org/changeset/base/324223 Log: MFV r319743: 8108 zdb -l fails to read labels 2 and 3 illumos/illumos-gate@22c8b9583d07895c16549075a53668d7bc988cf3 https://github.com/illumos/illumos-gate/commit/22c8b9583d07895c16549075a53668d7bc988cf3 https://www.illumos.org/issues/8108 Reviewed by: Matthew Ahrens Reviewed by: Toomas Soome Reviewed by: Igor Kozhukhov Reviewed by: Andrew Stormont Approved by: Robert Mustacchi Author: Yuri Pankov MFC after: 3 weeks Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/zdb/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Oct 2 22:35:35 2017 (r324222) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Oct 2 22:39:12 2017 (r324223) @@ -2186,24 +2186,29 @@ dump_label(const char *dev) (void) snprintf(path, sizeof (path), "%s%s", ZFS_RDISK_ROOTD, dev); - if ((s = strrchr(dev, 's')) == NULL || !isdigit(*(s + 1))) + if (((s = strrchr(dev, 's')) == NULL && + (s = strchr(dev, 'p')) == NULL) || + !isdigit(*(s + 1))) (void) strlcat(path, "s0", sizeof (path)); } - if (stat64(path, &statbuf) != 0) { - (void) printf("failed to stat '%s': %s\n", path, + if ((fd = open64(path, O_RDONLY)) < 0) { + (void) fprintf(stderr, "cannot open '%s': %s\n", path, strerror(errno)); exit(1); } - if (S_ISBLK(statbuf.st_mode)) { - (void) printf("cannot use '%s': character device required\n", - path); + if (fstat64(fd, &statbuf) != 0) { + (void) fprintf(stderr, "failed to stat '%s': %s\n", path, + strerror(errno)); + (void) close(fd); exit(1); } - if ((fd = open64(path, O_RDONLY)) < 0) { - (void) printf("cannot open '%s': %s\n", path, strerror(errno)); + if (S_ISBLK(statbuf.st_mode)) { + (void) fprintf(stderr, + "cannot use '%s': character device required\n", path); + (void) close(fd); exit(1); } From owner-svn-src-head@freebsd.org Mon Oct 2 23:12:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A89F9E299A1; Mon, 2 Oct 2017 23:12:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 707B67EE80; Mon, 2 Oct 2017 23:12:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92NC224092424; Mon, 2 Oct 2017 23:12:02 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92NC2vX092423; Mon, 2 Oct 2017 23:12:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201710022312.v92NC2vX092423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 2 Oct 2017 23:12:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324224 - head/sys/fs/cd9660 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/fs/cd9660 X-SVN-Commit-Revision: 324224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 23:12:03 -0000 Author: jhb Date: Mon Oct 2 23:12:02 2017 New Revision: 324224 URL: https://svnweb.freebsd.org/changeset/base/324224 Log: Handle _PC_FILESIZEBITS and _PC_SYMLINK_MAX pathconf() requests in cd9660. cd9660 only supports symlinks with Rock Ridge extensions, so _PC_SYMLINK_MAX is conditional on Rock Ridge. Sponsored by: Chelsio Communications Modified: head/sys/fs/cd9660/cd9660_vnops.c Modified: head/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vnops.c Mon Oct 2 22:39:12 2017 (r324223) +++ head/sys/fs/cd9660/cd9660_vnops.c Mon Oct 2 23:12:02 2017 (r324224) @@ -783,6 +783,9 @@ cd9660_pathconf(ap) { switch (ap->a_name) { + case _PC_FILESIZEBITS: + *ap->a_retval = 32; + return (0); case _PC_LINK_MAX: *ap->a_retval = 1; return (0); @@ -792,6 +795,12 @@ cd9660_pathconf(ap) else *ap->a_retval = 37; return (0); + case _PC_SYMLINK_MAX: + if (VTOI(ap->a_vp)->i_mnt->iso_ftype == ISO_FTYPE_RRIP) { + *ap->a_retval = MAXPATHLEN; + return (0); + } + return (EINVAL); case _PC_NO_TRUNC: *ap->a_retval = 1; return (0); From owner-svn-src-head@freebsd.org Mon Oct 2 23:14:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 046DEE29B6B; Mon, 2 Oct 2017 23:14:31 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C08807F150; Mon, 2 Oct 2017 23:14:30 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92NEUqG095754; Mon, 2 Oct 2017 23:14:30 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92NET7B095753; Mon, 2 Oct 2017 23:14:29 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201710022314.v92NET7B095753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 2 Oct 2017 23:14:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324225 - head/usr.sbin/ppp X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/ppp X-SVN-Commit-Revision: 324225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 23:14:31 -0000 Author: cem Date: Mon Oct 2 23:14:29 2017 New Revision: 324225 URL: https://svnweb.freebsd.org/changeset/base/324225 Log: ppp(8): Fix various bugs in NOPAM section of auth_CheckPasswd * pw is not initialized before use * success is returned if crypt(3) errors These bugs were introduced in r231994, which attempted to adopt DragonflyBSD f4a9869feb646aafe72de6e5d61051a023a02676. The original author of the Dragonfly change also noticed these mistakes and filed the PR. PR: 222620 Submitted by: Lubos Boucek Obtained from: DragonflyBSD f4a9869feb646aafe72de6e5d61051a023a02676 Modified: head/usr.sbin/ppp/auth.c Modified: head/usr.sbin/ppp/auth.c ============================================================================== --- head/usr.sbin/ppp/auth.c Mon Oct 2 23:12:02 2017 (r324224) +++ head/usr.sbin/ppp/auth.c Mon Oct 2 23:14:29 2017 (r324225) @@ -125,13 +125,19 @@ auth_CheckPasswd(const char *name, const char *data, c #ifdef NOPAM /* Then look up the real password database */ struct passwd *pw; - int result; + int result = 0; char *cryptpw; + + pw = getpwnam(name); - cryptpw = crypt(key, pw->pw_passwd); - result = (pw = getpwnam(name)) && - (cryptpw == NULL || !strcmp(cryptpw, pw->pw_passwd)); + if (pw) { + cryptpw = crypt(key, pw->pw_passwd); + + result = (cryptpw != NULL) && !strcmp(cryptpw, pw->pw_passwd); + } + endpwent(); + return result; #else /* !NOPAM */ /* Then consult with PAM. */ From owner-svn-src-head@freebsd.org Mon Oct 2 23:23:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19E08E29D99; Mon, 2 Oct 2017 23:23:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D62107F5A1; Mon, 2 Oct 2017 23:23:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92NNCLb099800; Mon, 2 Oct 2017 23:23:12 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92NNCfp099799; Mon, 2 Oct 2017 23:23:12 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201710022323.v92NNCfp099799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 2 Oct 2017 23:23:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324226 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 324226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 23:23:14 -0000 Author: jhb Date: Mon Oct 2 23:23:12 2017 New Revision: 324226 URL: https://svnweb.freebsd.org/changeset/base/324226 Log: Return 64 for pathconf(_PC_FILESIZEBITS) on tmpfs. Sponsored by: Chelsio Communications Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Mon Oct 2 23:14:29 2017 (r324225) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Mon Oct 2 23:23:12 2017 (r324226) @@ -1353,7 +1353,7 @@ tmpfs_pathconf(struct vop_pathconf_args *v) break; case _PC_FILESIZEBITS: - *retval = 0; /* XXX Don't know which value should I return. */ + *retval = 64; break; default: From owner-svn-src-head@freebsd.org Mon Oct 2 23:29:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE8B6E29E6B; Mon, 2 Oct 2017 23:29:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A601B7F746; Mon, 2 Oct 2017 23:29:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92NTvNK000180; Mon, 2 Oct 2017 23:29:57 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92NTuLF000167; Mon, 2 Oct 2017 23:29:56 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201710022329.v92NTuLF000167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 2 Oct 2017 23:29:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324227 - in head: lib/libprocstat sys/kern sys/netinet6 sys/sys usr.bin/bluetooth/btsockstat usr.bin/netstat usr.bin/sockstat usr.bin/systat X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head: lib/libprocstat sys/kern sys/netinet6 sys/sys usr.bin/bluetooth/btsockstat usr.bin/netstat usr.bin/sockstat usr.bin/systat X-SVN-Commit-Revision: 324227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 23:29:59 -0000 Author: glebius Date: Mon Oct 2 23:29:56 2017 New Revision: 324227 URL: https://svnweb.freebsd.org/changeset/base/324227 Log: Hide struct socket and struct unpcb from the userland. Violators may define _WANT_SOCKET and _WANT_UNPCB respectively and are not guaranteed for stability of the structures. The violators list is the the usual one: libprocstat(3) and netstat(1) internally and lsof in ports. In struct xunpcb remove the inclusion of kernel structure and add a bunch of spare fields. The xsocket already has socket not included, but add there spares as well. Embed xsockbuf into xsocket. Sort declarations in sys/socketvar.h to separate kernel only from userland available ones. PR: 221820 (exp-run) Deleted: head/sys/sys/sockstate.h Modified: head/lib/libprocstat/libprocstat.c head/sys/kern/uipc_usrreq.c head/sys/netinet6/send.c head/sys/sys/param.h head/sys/sys/sockbuf.h head/sys/sys/socketvar.h head/sys/sys/unpcb.h head/usr.bin/bluetooth/btsockstat/btsockstat.c head/usr.bin/netstat/inet.c head/usr.bin/netstat/netgraph.c head/usr.bin/netstat/unix.c head/usr.bin/sockstat/sockstat.c head/usr.bin/systat/netstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Mon Oct 2 23:23:12 2017 (r324226) +++ head/lib/libprocstat/libprocstat.c Mon Oct 2 23:29:56 2017 (r324227) @@ -48,10 +48,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _WANT_SOCKET #include #include #include #include +#define _WANT_UNPCB #include #include #include Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Mon Oct 2 23:23:12 2017 (r324226) +++ head/sys/kern/uipc_usrreq.c Mon Oct 2 23:29:56 2017 (r324227) @@ -1646,12 +1646,20 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) if (unp->unp_addr != NULL) bcopy(unp->unp_addr, &xu->xu_addr, unp->unp_addr->sun_len); + else + bzero(&xu->xu_addr, sizeof(xu->xu_addr)); if (unp->unp_conn != NULL && unp->unp_conn->unp_addr != NULL) bcopy(unp->unp_conn->unp_addr, &xu->xu_caddr, unp->unp_conn->unp_addr->sun_len); - bcopy(unp, &xu->xu_unp, sizeof *unp); + else + bzero(&xu->xu_caddr, sizeof(xu->xu_caddr)); + xu->unp_vnode = unp->unp_vnode; + xu->unp_conn = unp->unp_conn; + xu->xu_firstref = LIST_FIRST(&unp->unp_refs); + xu->xu_nextref = LIST_NEXT(unp, unp_reflink); + xu->unp_gencnt = unp->unp_gencnt; sotoxsocket(unp->unp_socket, &xu->xu_socket); UNP_PCB_UNLOCK(unp); error = SYSCTL_OUT(req, xu, sizeof *xu); Modified: head/sys/netinet6/send.c ============================================================================== --- head/sys/netinet6/send.c Mon Oct 2 23:23:12 2017 (r324226) +++ head/sys/netinet6/send.c Mon Oct 2 23:29:56 2017 (r324227) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Oct 2 23:23:12 2017 (r324226) +++ head/sys/sys/param.h Mon Oct 2 23:29:56 2017 (r324227) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200047 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200048 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Mon Oct 2 23:23:12 2017 (r324226) +++ head/sys/sys/sockbuf.h Mon Oct 2 23:29:56 2017 (r324227) @@ -65,18 +65,6 @@ struct socket; struct thread; struct selinfo; -struct xsockbuf { - u_int sb_cc; - u_int sb_hiwat; - u_int sb_mbcnt; - u_int sb_mcnt; - u_int sb_ccnt; - u_int sb_mbmax; - int sb_lowat; - int sb_timeo; - short sb_flags; -}; - /* * Variables for socket buffering. * @@ -174,7 +162,6 @@ struct mbuf * sbsndptr(struct sockbuf *sb, u_int off, u_int len, u_int *moff); struct mbuf * sbsndmbuf(struct sockbuf *sb, u_int off, u_int *moff); -void sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb); int sbwait(struct sockbuf *sb); int sblock(struct sockbuf *sb, int flags); void sbunlock(struct sockbuf *sb); Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Mon Oct 2 23:23:12 2017 (r324226) +++ head/sys/sys/socketvar.h Mon Oct 2 23:29:56 2017 (r324227) @@ -34,6 +34,12 @@ #ifndef _SYS_SOCKETVAR_H_ #define _SYS_SOCKETVAR_H_ +/* + * Socket generation count type. Also used in xinpcb, xtcpcb, xunpcb. + */ +typedef uint64_t so_gen_t; + +#if defined(_KERNEL) || defined(_WANT_SOCKET) #include /* for TAILQ macros */ #include /* for struct selinfo */ #include @@ -41,7 +47,6 @@ #include #include #include -#include #ifdef _KERNEL #include #include @@ -55,7 +60,6 @@ struct vnet; * handle on protocol and pointer to protocol * private data and error information. */ -typedef uint64_t so_gen_t; typedef int so_upcall_t(struct socket *, void *, int); struct socket; @@ -167,7 +171,40 @@ struct socket { }; }; }; +#endif /* defined(_KERNEL) || defined(_WANT_SOCKET) */ +/* + * Socket state bits. + * + * Historically, this bits were all kept in the so_state field. For + * locking reasons, they are now in multiple fields, as they are + * locked differently. so_state maintains basic socket state protected + * by the socket lock. so_qstate holds information about the socket + * accept queues. Each socket buffer also has a state field holding + * information relevant to that socket buffer (can't send, rcv). Many + * fields will be read without locks to improve performance and avoid + * lock order issues. However, this approach must be used with caution. + */ +#define SS_NOFDREF 0x0001 /* no file table ref any more */ +#define SS_ISCONNECTED 0x0002 /* socket connected to a peer */ +#define SS_ISCONNECTING 0x0004 /* in process of connecting to peer */ +#define SS_ISDISCONNECTING 0x0008 /* in process of disconnecting */ +#define SS_NBIO 0x0100 /* non-blocking ops */ +#define SS_ASYNC 0x0200 /* async i/o notify */ +#define SS_ISCONFIRMING 0x0400 /* deciding to accept connection req */ +#define SS_ISDISCONNECTED 0x2000 /* socket disconnected from peer */ + +/* + * Protocols can mark a socket as SS_PROTOREF to indicate that, following + * pru_detach, they still want the socket to persist, and will free it + * themselves when they are done. Protocols should only ever call sofree() + * following setting this flag in pru_detach(), and never otherwise, as + * sofree() bypasses socket reference counting. + */ +#define SS_PROTOREF 0x4000 /* strong protocol reference */ + +#ifdef _KERNEL + #define SOCK_MTX(so) &(so)->so_lock #define SOCK_LOCK(so) mtx_lock(&(so)->so_lock) #define SOCK_OWNED(so) mtx_owned(&(so)->so_lock) @@ -194,32 +231,6 @@ struct socket { } while (0) /* - * Externalized form of struct socket used by the sysctl(3) interface. - */ -struct xsocket { - size_t xso_len; /* length of this structure */ - struct socket *xso_so; /* makes a convenient handle sometimes */ - short so_type; - short so_options; - short so_linger; - short so_state; - caddr_t so_pcb; /* another convenient handle */ - int xso_protocol; - int xso_family; - u_int so_qlen; - u_int so_incqlen; - u_int so_qlimit; - short so_timeo; - u_short so_error; - pid_t so_pgid; - u_long so_oobmark; - struct xsockbuf so_rcv, so_snd; - uid_t so_uid; /* XXX */ -}; - -#ifdef _KERNEL - -/* * Macros for sockets and socket buffering. */ @@ -422,7 +433,6 @@ int sosend_generic(struct socket *so, struct sockaddr struct uio *uio, struct mbuf *top, struct mbuf *control, int flags, struct thread *td); int soshutdown(struct socket *so, int how); -void sotoxsocket(struct socket *so, struct xsocket *xso); void soupcall_clear(struct socket *, int); void soupcall_set(struct socket *, int, so_upcall_t, void *); void solisten_upcall_set(struct socket *, so_upcall_t, void *); @@ -431,6 +441,14 @@ void sowakeup_aio(struct socket *so, struct sockbuf *s void solisten_wakeup(struct socket *); int selsocket(struct socket *so, int events, struct timeval *tv, struct thread *td); +void soisconnected(struct socket *so); +void soisconnecting(struct socket *so); +void soisdisconnected(struct socket *so); +void soisdisconnecting(struct socket *so); +void socantrcvmore(struct socket *so); +void socantrcvmore_locked(struct socket *so); +void socantsendmore(struct socket *so); +void socantsendmore_locked(struct socket *so); /* * Accept filter functions (duh). @@ -446,5 +464,59 @@ int accept_filt_generic_mod_event(module_t mod, int ev #endif #endif /* _KERNEL */ + +/* + * Structure to export socket from kernel to utilities, via sysctl(3). + */ +struct xsocket { + size_t xso_len; /* length of this structure */ + union { + void *xso_so; /* kernel address of struct socket */ + int64_t ph_so; + }; + union { + void *so_pcb; /* kernel address of struct inpcb */ + int64_t ph_pcb; + }; + uint64_t so_oobmark; + int64_t so_spare64[8]; + int32_t xso_protocol; + int32_t xso_family; + uint32_t so_qlen; + uint32_t so_incqlen; + uint32_t so_qlimit; + pid_t so_pgid; + uid_t so_uid; + int32_t so_spare32[8]; + int16_t so_type; + int16_t so_options; + int16_t so_linger; + int16_t so_state; + int16_t so_timeo; + uint16_t so_error; + struct xsockbuf { + uint32_t sb_cc; + uint32_t sb_hiwat; + uint32_t sb_mbcnt; + uint32_t sb_mcnt; + uint32_t sb_ccnt; + uint32_t sb_mbmax; + int32_t sb_lowat; + int32_t sb_timeo; + int16_t sb_flags; + } so_rcv, so_snd; +}; + +#ifdef _KERNEL +void sotoxsocket(struct socket *so, struct xsocket *xso); +void sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb); +#endif + +/* + * Socket buffer state bits. Exported via libprocstat(3). + */ +#define SBS_CANTSENDMORE 0x0010 /* can't send more data to peer */ +#define SBS_CANTRCVMORE 0x0020 /* can't receive more data from peer */ +#define SBS_RCVATMARK 0x0040 /* at mark on input */ #endif /* !_SYS_SOCKETVAR_H_ */ Modified: head/sys/sys/unpcb.h ============================================================================== --- head/sys/sys/unpcb.h Mon Oct 2 23:23:12 2017 (r324226) +++ head/sys/sys/unpcb.h Mon Oct 2 23:29:56 2017 (r324227) @@ -33,6 +33,9 @@ #ifndef _SYS_UNPCB_H_ #define _SYS_UNPCB_H_ +typedef uint64_t unp_gen_t; + +#if defined(_KERNEL) || defined(_WANT_UNPCB) #include #include @@ -61,7 +64,6 @@ * so that changes in the sockbuf may be computed to modify * back pressure on the sender accordingly. */ -typedef u_quad_t unp_gen_t; LIST_HEAD(unp_head, unpcb); struct unpcb { @@ -74,8 +76,6 @@ struct unpcb { struct unp_head unp_refs; /* referencing socket linked list */ LIST_ENTRY(unpcb) unp_reflink; /* link in unp_refs list */ struct sockaddr_un *unp_addr; /* bound address of socket */ - int reserved1; - int reserved2; unp_gen_t unp_gencnt; /* generation count of this instance */ short unp_flags; /* flags */ short unp_gcflag; /* Garbage collector flags. */ @@ -116,32 +116,50 @@ struct unpcb { #define sotounpcb(so) ((struct unpcb *)((so)->so_pcb)) -/* Hack alert -- this structure depends on . */ +#endif /* _KERNEL || _WANT_UNPCB */ + +/* + * UNPCB structure exported to user-land via sysctl(3). + * + * Fields prefixed with "xu_" are unique to the export structure, and fields + * with "unp_" or other prefixes match corresponding fields of 'struct unpcb'. + * + * Legend: + * (s) - used by userland utilities in src + * (p) - used by utilities in ports + * (3) - is known to be used by third party software not in ports + * (n) - no known usage + * + * Evil hack: declare only if sys/socketvar.h have been included. + */ #ifdef _SYS_SOCKETVAR_H_ struct xunpcb { - size_t xu_len; /* length of this structure */ - struct unpcb *xu_unpp; /* to help netstat, fstat */ - struct unpcb xu_unp; /* our information */ + size_t xu_len; /* length of this structure */ + void *xu_unpp; /* to help netstat, fstat */ + void *unp_vnode; /* (s) */ + void *unp_conn; /* (s) */ + void *xu_firstref; /* (s) */ + void *xu_nextref; /* (s) */ + unp_gen_t unp_gencnt; /* (s) */ + int64_t xu_spare64[8]; + int32_t xu_spare32[8]; union { - struct sockaddr_un xuu_addr; /* our bound address */ + struct sockaddr_un xu_addr; /* our bound address */ char xu_dummy1[256]; - } xu_au; -#define xu_addr xu_au.xuu_addr + }; union { - struct sockaddr_un xuu_caddr; /* their bound address */ + struct sockaddr_un xu_caddr; /* their bound address */ char xu_dummy2[256]; - } xu_cau; -#define xu_caddr xu_cau.xuu_caddr - struct xsocket xu_socket; - u_quad_t xu_alignment_hack; -}; + }; + struct xsocket xu_socket; +} __aligned(8); struct xunpgen { size_t xug_len; u_int xug_count; unp_gen_t xug_gen; so_gen_t xug_sogen; -}; +} __aligned(8);; #endif /* _SYS_SOCKETVAR_H_ */ #endif /* _SYS_UNPCB_H_ */ Modified: head/usr.bin/bluetooth/btsockstat/btsockstat.c ============================================================================== --- head/usr.bin/bluetooth/btsockstat/btsockstat.c Mon Oct 2 23:23:12 2017 (r324226) +++ head/usr.bin/bluetooth/btsockstat/btsockstat.c Mon Oct 2 23:29:56 2017 (r324227) @@ -35,6 +35,7 @@ #include #include #include +#define _WANT_SOCKET #include #include Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Mon Oct 2 23:23:12 2017 (r324226) +++ head/usr.bin/netstat/inet.c Mon Oct 2 23:29:56 2017 (r324227) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _WANT_SOCKET #include #include @@ -172,7 +173,7 @@ sotoxsocket(struct socket *so, struct xsocket *xso) xso->xso_family = domain.dom_family; xso->so_timeo = so->so_timeo; xso->so_error = so->so_error; - if (SOLISTENING(so)) { + if ((so->so_options & SO_ACCEPTCONN) != 0) { xso->so_qlen = so->sol_qlen; xso->so_incqlen = so->sol_incqlen; xso->so_qlimit = so->sol_qlimit; Modified: head/usr.bin/netstat/netgraph.c ============================================================================== --- head/usr.bin/netstat/netgraph.c Mon Oct 2 23:23:12 2017 (r324226) +++ head/usr.bin/netstat/netgraph.c Mon Oct 2 23:29:56 2017 (r324227) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _WANT_SOCKET #include #include #include Modified: head/usr.bin/netstat/unix.c ============================================================================== --- head/usr.bin/netstat/unix.c Mon Oct 2 23:23:12 2017 (r324226) +++ head/usr.bin/netstat/unix.c Mon Oct 2 23:29:56 2017 (r324227) @@ -43,10 +43,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _WANT_SOCKET #include #include #include #include +#define _WANT_UNPCB #include #include @@ -100,7 +102,7 @@ static int pcblist_kvm(u_long count_off, u_long gencnt_off, u_long head_off, char **bufp) { struct unp_head head; - struct unpcb *unp, unp_conn; + struct unpcb *unp, unp0, unp_conn; u_char sun_len; struct socket so; struct xunpgen xug; @@ -150,8 +152,8 @@ pcblist_kvm(u_long count_off, u_long gencnt_off, u_lon KREAD(head_off, &head, sizeof(head)); LIST_FOREACH(unp, &head, unp_link) { xu.xu_unpp = unp; - KREAD(unp, &xu.xu_unp, sizeof (*unp)); - unp = &xu.xu_unp; + KREAD(unp, &unp0, sizeof (*unp)); + unp = &unp0; if (unp->unp_gencnt > unp_gencnt) continue; @@ -236,7 +238,7 @@ unixpr(u_long count_off, u_long gencnt_off, u_long dhe so = &xunp->xu_socket; /* Ignore PCBs which were freed during copyout. */ - if (xunp->xu_unp.unp_gencnt > oxug->xug_gen) + if (xunp->unp_gencnt > oxug->xug_gen) continue; if (*first) { xo_open_list("socket"); @@ -268,7 +270,6 @@ unixpr(u_long count_off, u_long gencnt_off, u_long dhe static void unixdomainpr(struct xunpcb *xunp, struct xsocket *so) { - struct unpcb *unp; struct sockaddr_un *sa; static int first = 1; char buf1[33]; @@ -292,11 +293,7 @@ unixdomainpr(struct xunpcb *xunp, struct xsocket *so) }; int fmt = (sizeof(void *) == 8) ? 1 : 0; - unp = &xunp->xu_unp; - if (unp->unp_addr) - sa = &xunp->xu_addr; - else - sa = (struct sockaddr_un *)0; + sa = (xunp->xu_addr.sun_family == AF_UNIX) ? &xunp->xu_addr : NULL; if (first && !Lflag) { xo_emit("{T:Active UNIX domain sockets}\n"); @@ -318,10 +315,9 @@ unixdomainpr(struct xunpcb *xunp, struct xsocket *so) } else { xo_emit(format[fmt], (long)so->so_pcb, socktype[so->so_type], so->so_rcv.sb_cc, - so->so_snd.sb_cc, (long)unp->unp_vnode, - (long)unp->unp_conn, - (long)LIST_FIRST(&unp->unp_refs), - (long)LIST_NEXT(unp, unp_reflink)); + so->so_snd.sb_cc, (long)xunp->unp_vnode, + (long)xunp->unp_conn, (long)xunp->xu_firstref, + (long)xunp->xu_nextref); } if (sa) xo_emit(" {:path/%.*s}", Modified: head/usr.bin/sockstat/sockstat.c ============================================================================== --- head/usr.bin/sockstat/sockstat.c Mon Oct 2 23:23:12 2017 (r324226) +++ head/usr.bin/sockstat/sockstat.c Mon Oct 2 23:29:56 2017 (r324227) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#define _WANT_UNPCB #include #include @@ -784,8 +785,8 @@ gather_unix(int proto) warnx("struct xunpcb size mismatch"); goto out; } - if ((xup->xu_unp.unp_conn == NULL && !opt_l) || - (xup->xu_unp.unp_conn != NULL && !opt_c)) + if ((xup->unp_conn == NULL && !opt_l) || + (xup->unp_conn != NULL && !opt_c)) continue; if ((sock = calloc(1, sizeof(*sock))) == NULL) err(1, "malloc()"); @@ -798,11 +799,11 @@ gather_unix(int proto) sock->proto = proto; sock->family = AF_UNIX; sock->protoname = protoname; - if (xup->xu_unp.unp_addr != NULL) + if (xup->xu_addr.sun_family == AF_UNIX) laddr->address = *(struct sockaddr_storage *)(void *)&xup->xu_addr; - else if (xup->xu_unp.unp_conn != NULL) - *(void **)&(faddr->address) = xup->xu_unp.unp_conn; + else if (xup->unp_conn != NULL) + *(void **)&(faddr->address) = xup->unp_conn; laddr->next = NULL; faddr->next = NULL; sock->laddr = laddr; Modified: head/usr.bin/systat/netstat.c ============================================================================== --- head/usr.bin/systat/netstat.c Mon Oct 2 23:23:12 2017 (r324226) +++ head/usr.bin/systat/netstat.c Mon Oct 2 23:29:56 2017 (r324227) @@ -41,6 +41,7 @@ static const char sccsid[] = "@(#)netstat.c 8.1 (Berke #include #include #include +#define _WANT_SOCKET #include #include From owner-svn-src-head@freebsd.org Mon Oct 2 23:31:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46F9FE29F25; Mon, 2 Oct 2017 23:31:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13FEE7FA4B; Mon, 2 Oct 2017 23:31:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v92NVCif000320; Mon, 2 Oct 2017 23:31:12 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v92NVC3I000319; Mon, 2 Oct 2017 23:31:12 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201710022331.v92NVC3I000319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 2 Oct 2017 23:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324228 - head/sys/fs/udf X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/fs/udf X-SVN-Commit-Revision: 324228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 23:31:13 -0000 Author: jhb Date: Mon Oct 2 23:31:11 2017 New Revision: 324228 URL: https://svnweb.freebsd.org/changeset/base/324228 Log: Flesh out pathconf() on UDF. - Return 64 bits for _PC_FILESIZEBITS. - Handle _PC_SYMLINK_MAX. - Defer _PC_PATH_MAX to vop_stdpathconf(). Sponsored by: Chelsio Communications Modified: head/sys/fs/udf/udf_vnops.c Modified: head/sys/fs/udf/udf_vnops.c ============================================================================== --- head/sys/fs/udf/udf_vnops.c Mon Oct 2 23:29:56 2017 (r324227) +++ head/sys/fs/udf/udf_vnops.c Mon Oct 2 23:31:11 2017 (r324228) @@ -383,20 +383,23 @@ udf_pathconf(struct vop_pathconf_args *a) { switch (a->a_name) { + case _PC_FILESIZEBITS: + *a->a_retval = 64; + return (0); case _PC_LINK_MAX: *a->a_retval = 65535; return (0); case _PC_NAME_MAX: *a->a_retval = NAME_MAX; return (0); - case _PC_PATH_MAX: - *a->a_retval = PATH_MAX; + case _PC_SYMLINK_MAX: + *a->a_retval = MAXPATHLEN; return (0); case _PC_NO_TRUNC: *a->a_retval = 1; return (0); default: - return (EINVAL); + return (vop_stdpathconf(a)); } } From owner-svn-src-head@freebsd.org Tue Oct 3 00:53:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED61AE2BA69; Tue, 3 Oct 2017 00:53:12 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9F3581AB9; Tue, 3 Oct 2017 00:53:12 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v930rBmu036670; Tue, 3 Oct 2017 00:53:11 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v930rBq6036668; Tue, 3 Oct 2017 00:53:11 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201710030053.v930rBq6036668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 3 Oct 2017 00:53:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324229 - in head: sbin/init usr.bin/lock X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: sbin/init usr.bin/lock X-SVN-Commit-Revision: 324229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Oct 2017 00:53:13 -0000 Author: cem Date: Tue Oct 3 00:53:11 2017 New Revision: 324229 URL: https://svnweb.freebsd.org/changeset/base/324229 Log: Correct sense of crypt(3) NULL checks in init(8) and lock(1) In r231994, an attempt was made to fix crypt(3) failure returns (NULL). However, instead of treating crypt(3) failure as authentication failure, some of the changes treated crypt(3) failure as authentication success. This is wrong. r324225 fixed this for ppp, which also inspired this review. The other changes in the 231994 revision were audited for correctness and look ok. Reviewed by: jhb Security: yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12571 Modified: head/sbin/init/init.c head/usr.bin/lock/lock.c Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Mon Oct 2 23:31:11 2017 (r324228) +++ head/sbin/init/init.c Tue Oct 3 00:53:11 2017 (r324229) @@ -919,7 +919,7 @@ single_user(void) _exit(0); password = crypt(clear, pp->pw_passwd); bzero(clear, _PASSWORD_LEN); - if (password == NULL || + if (password != NULL && strcmp(password, pp->pw_passwd) == 0) break; warning("single-user login failed\n"); Modified: head/usr.bin/lock/lock.c ============================================================================== --- head/usr.bin/lock/lock.c Mon Oct 2 23:31:11 2017 (r324228) +++ head/usr.bin/lock/lock.c Tue Oct 3 00:53:11 2017 (r324229) @@ -223,7 +223,7 @@ main(int argc, char **argv) if (usemine) { s[strlen(s) - 1] = '\0'; cryptpw = crypt(s, mypw); - if (cryptpw == NULL || !strcmp(mypw, cryptpw)) + if (cryptpw != NULL && !strcmp(mypw, cryptpw)) break; } else if (!strcmp(s, s1)) From owner-svn-src-head@freebsd.org Tue Oct 3 02:10:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40118E2D567 for ; Tue, 3 Oct 2017 02:10:39 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-28.reflexion.net [208.70.210.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA0AF83FDB for ; Tue, 3 Oct 2017 02:10:38 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 15568 invoked from network); 3 Oct 2017 02:10:36 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 3 Oct 2017 02:10:36 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.3) with SMTP; Mon, 02 Oct 2017 22:10:36 -0400 (EDT) Received: (qmail 2206 invoked from network); 3 Oct 2017 02:10:36 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 3 Oct 2017 02:10:36 -0000 Received: from [192.168.1.26] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 03010EC9411; Mon, 2 Oct 2017 19:10:35 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r324207 - head/sys/arm64/arm64 Message-Id: Date: Mon, 2 Oct 2017 19:10:35 -0700 To: andrew@freebsd.org, svn-src-head@freebsd.org, freebsd-arm X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Oct 2017 02:10:39 -0000 > Author: andrew > Date: Mon Oct 2 14:22:35 2017 > New Revision: 324207 > URL:=20 > https://svnweb.freebsd.org/changeset/base/324207 >=20 >=20 > Log: > Add a memory barrier to ensure the atomic write is visible to the = other > CPUs before waking them up. > =20 > Sponsored by: DARPA, AFRL >=20 > Modified: > head/sys/arm64/arm64/mp_machdep.c >=20 > Modified: head/sys/arm64/arm64/mp_machdep.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/arm64/arm64/mp_machdep.c Mon Oct 2 14:19:31 2017 = (r324206) > +++ head/sys/arm64/arm64/mp_machdep.c Mon Oct 2 14:22:35 2017 = (r324207) > @@ -236,7 +236,10 @@ release_aps(void *dummy __unused) > =20 > atomic_store_rel_int(&aps_ready, 1); > /* Wake up the other CPUs */ > - __asm __volatile("sev"); > + __asm __volatile( > + "dsb ishst \n" > + "sev \n" > + ::: "memory"); > =20 > printf("Release APs\n"); There is another sev instruction without a prior memory barrier: Index: /usr/src/sys/arm64/arm64/identcpu.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 --- /usr/src/sys/arm64/arm64/identcpu.c (revision 323676) +++ /usr/src/sys/arm64/arm64/identcpu.c (working copy) @@ -1109,6 +1109,9 @@ =20 /* Wake up the other CPUs */ atomic_store_rel_int(&ident_lock, 0); - __asm __volatile("sev" ::: "memory"); + __asm __volatile( + "dsb ish \n" + "sev \n" + ::: "memory"); } } (No claim that the dsb form is optimal. Arm documentation says that they recommend every sev be preceded by a dsb and I picked ish to experiment with.) See comments and extra attachment in bugzilla 222234 (which you have fixed with your change). [Specifically your change should make non-debug kernels boot Pine64+ 2GB's again. (I had used just "dsb ish" get get such to boot.)] =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Tue Oct 3 11:13:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8257E38D7C; Tue, 3 Oct 2017 11:13:26 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 881246F6F0; Tue, 3 Oct 2017 11:13:26 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v93BDPgj092180; Tue, 3 Oct 2017 11:13:25 GMT (envelope-from ru@FreeBSD.org) Received: (from ru@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v93BDPcG092179; Tue, 3 Oct 2017 11:13:25 GMT (envelope-from ru@FreeBSD.org) Message-Id: <201710031113.v93BDPcG092179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ru set sender to ru@FreeBSD.org using -f From: Ruslan Ermilov Date: Tue, 3 Oct 2017 11:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324236 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: ru X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 324236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Oct 2017 11:13:26 -0000 Author: ru Date: Tue Oct 3 11:13:25 2017 New Revision: 324236 URL: https://svnweb.freebsd.org/changeset/base/324236 Log: Fixed description of msg_name/msg_namelen in recvmsg(). Modified: head/lib/libc/sys/recv.2 Modified: head/lib/libc/sys/recv.2 ============================================================================== --- head/lib/libc/sys/recv.2 Tue Oct 3 11:00:34 2017 (r324235) +++ head/lib/libc/sys/recv.2 Tue Oct 3 11:13:25 2017 (r324236) @@ -28,7 +28,7 @@ .\" @(#)recv.2 8.3 (Berkeley) 2/21/94 .\" $FreeBSD$ .\" -.Dd February 3, 2017 +.Dd October 3, 2017 .Dt RECV 2 .Os .Sh NAME @@ -230,7 +230,7 @@ Here .Fa msg_name and .Fa msg_namelen -specify the destination address if the socket is unconnected; +specify the source address if the socket is unconnected; .Fa msg_name may be given as a null pointer if no names are desired or required. The From owner-svn-src-head@freebsd.org Tue Oct 3 11:45:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9764E39C0B; Tue, 3 Oct 2017 11:45:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2CE6709F6; Tue, 3 Oct 2017 11:45:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v93BjOVI005340; Tue, 3 Oct 2017 11:45:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v93BjOqh005336; Tue, 3 Oct 2017 11:45:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201710031145.v93BjOqh005336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 3 Oct 2017 11:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324237 - in head: lib/libprocstat usr.bin/procstat X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: lib/libprocstat usr.bin/procstat X-SVN-Commit-Revision: 324237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Oct 2017 11:45:26 -0000 Author: trasz Date: Tue Oct 3 11:45:24 2017 New Revision: 324237 URL: https://svnweb.freebsd.org/changeset/base/324237 Log: Make procstat(1) recognize process descriptors, so that it shows "P" instead of "?" in "procstat -af" output. Note that there are still a few more DTYPE_* kinds we don't decode yet. Reported by: rwatson MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12426 Modified: head/lib/libprocstat/libprocstat.c head/lib/libprocstat/libprocstat.h head/usr.bin/procstat/procstat.1 head/usr.bin/procstat/procstat_files.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Tue Oct 3 11:13:25 2017 (r324236) +++ head/lib/libprocstat/libprocstat.c Tue Oct 3 11:45:24 2017 (r324237) @@ -582,6 +582,10 @@ procstat_getfiles_kvm(struct procstat *procstat, struc type = PS_FST_TYPE_SHM; data = file.f_data; break; + case DTYPE_PROCDESC: + type = PS_FST_TYPE_PROCDESC; + data = file.f_data; + break; default: continue; } @@ -665,6 +669,7 @@ kinfo_type2fst(int kftype) int kf_type; int fst_type; } kftypes2fst[] = { + { KF_TYPE_PROCDESC, PS_FST_TYPE_PROCDESC }, { KF_TYPE_CRYPTO, PS_FST_TYPE_CRYPTO }, { KF_TYPE_FIFO, PS_FST_TYPE_FIFO }, { KF_TYPE_KQUEUE, PS_FST_TYPE_KQUEUE }, Modified: head/lib/libprocstat/libprocstat.h ============================================================================== --- head/lib/libprocstat/libprocstat.h Tue Oct 3 11:13:25 2017 (r324236) +++ head/lib/libprocstat/libprocstat.h Tue Oct 3 11:45:24 2017 (r324237) @@ -68,6 +68,7 @@ #define PS_FST_TYPE_SEM 10 #define PS_FST_TYPE_UNKNOWN 11 #define PS_FST_TYPE_NONE 12 +#define PS_FST_TYPE_PROCDESC 13 /* * Special descriptor numbers. Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Tue Oct 3 11:13:25 2017 (r324236) +++ head/usr.bin/procstat/procstat.1 Tue Oct 3 11:45:24 2017 (r324237) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 26, 2017 +.Dd October 3, 2017 .Dt PROCSTAT 1 .Os .Sh NAME @@ -212,6 +212,8 @@ shared memory kqueue .It m message queue +.It P +process descriptor .It p pipe .It s Modified: head/usr.bin/procstat/procstat_files.c ============================================================================== --- head/usr.bin/procstat/procstat_files.c Tue Oct 3 11:13:25 2017 (r324236) +++ head/usr.bin/procstat/procstat_files.c Tue Oct 3 11:45:24 2017 (r324237) @@ -400,6 +400,11 @@ procstat_files(struct procstat *procstat, struct kinfo xo_emit("{eq:fd_type/sem}"); break; + case PS_FST_TYPE_PROCDESC: + str = "P"; + xo_emit("{eq:fd_type/procdesc}"); + break; + case PS_FST_TYPE_NONE: str = "?"; xo_emit("{eq:fd_type/none}"); From owner-svn-src-head@freebsd.org Tue Oct 3 13:31:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A04B3E3D0B3; Tue, 3 Oct 2017 13:31:23 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77033743D7; Tue, 3 Oct 2017 13:31:23 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v93DVMS0046667; Tue, 3 Oct 2017 13:31:22 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v93DVMph046666; Tue, 3 Oct 2017 13:31:22 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201710031331.v93DVMph046666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Tue, 3 Oct 2017 13:31:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324239 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: maxim X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 324239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Oct 2017 13:31:23 -0000 Author: maxim Date: Tue Oct 3 13:31:22 2017 New Revision: 324239 URL: https://svnweb.freebsd.org/changeset/base/324239 Log: FreeBSD 10.4 release added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Tue Oct 3 13:20:17 2017 (r324238) +++ head/share/misc/bsd-family-tree Tue Oct 3 13:31:22 2017 (r324239) @@ -344,19 +344,21 @@ FreeBSD 5.2 | | | | | | | | DragonFly 4.4.1 | FreeBSD | | OpenBSD 5.9 | | 10.3 | | | | - | | NetBSD 7.0.1 | | - | | | | DragonFly 4.6.0 - | | | | | - | | | | | - *--FreeBSD macOS | OpenBSD 6.0 | - | 11.0 10.12 | | | - | | | NetBSD 7.1 | | - | | | | | DragonFly 4.8.0 - | | | | OpenBSD 6.1 | + | | | NetBSD 7.0.1 | | + | `------. | | | DragonFly 4.6.0 + | | | | | | + | | | | | | + *--FreeBSD | macOS | OpenBSD 6.0 | + | 11.0 | 10.12 | | | + | | | | NetBSD 7.1 | | + | | | | | | DragonFly 4.8.0 + | | | | | OpenBSD 6.1 | + | | FreeBSD | | | | + | | 10.4 | | | | | FreeBSD | | | | | 11.1 | | | | | | | | | -FreeBSD 12 -current | NetBSD -current OpenBSD -current DragonFly -current +FreeBSD 13 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | v v v v v @@ -715,6 +717,7 @@ NetBSD 7.1 2017-03-11 [NBD] DragonFly 4.8.0 2017-03-27 [DFB] OpenBSD 6.1 2017-04-11 [OBD] FreeBSD 11.1 2017-07-26 [FBD] +FreeBSD 10.4 2017-10-03 [FBD] Bibliography ------------------------ From owner-svn-src-head@freebsd.org Tue Oct 3 14:23:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44AADE3E56B; Tue, 3 Oct 2017 14:23:50 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14161762F3; Tue, 3 Oct 2017 14:23:50 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v93ENnW6071752; Tue, 3 Oct 2017 14:23:49 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v93ENnrr071751; Tue, 3 Oct 2017 14:23:49 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201710031423.v93ENnrr071751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Tue, 3 Oct 2017 14:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324240 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: maxim X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 324240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Oct 2017 14:23:50 -0000 Author: maxim Date: Tue Oct 3 14:23:49 2017 New Revision: 324240 URL: https://svnweb.freebsd.org/changeset/base/324240 Log: o FreeBSD 10.4 happened after 11.1, adjust the branches accordingly. o The current FreeBSD branch is 12 not 13. Suggested by: lidl Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Tue Oct 3 13:31:22 2017 (r324239) +++ head/share/misc/bsd-family-tree Tue Oct 3 14:23:49 2017 (r324240) @@ -353,12 +353,12 @@ FreeBSD 5.2 | | | | | | | NetBSD 7.1 | | | | | | | | DragonFly 4.8.0 | | | | | OpenBSD 6.1 | - | | FreeBSD | | | | + | FreeBSD | | | | | + | 11.1 FreeBSD | | | | | | 10.4 | | | | - | FreeBSD | | | | - | 11.1 | | | | + | v | | | | | | | | | -FreeBSD 13 -current | NetBSD -current OpenBSD -current DragonFly -current +FreeBSD 12 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | v v v v v From owner-svn-src-head@freebsd.org Tue Oct 3 14:25:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B063E3E6D2; Tue, 3 Oct 2017 14:25:59 +0000 (UTC) (envelope-from mad@madpilot.net) Received: from mail.madpilot.net (grunt.madpilot.net [78.47.145.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A8FE765CA; Tue, 3 Oct 2017 14:25:58 +0000 (UTC) (envelope-from mad@madpilot.net) Received: from mail (mail [192.168.254.3]) by mail.madpilot.net (Postfix) with ESMTP id 3y61Xt20v2zZr7; Tue, 3 Oct 2017 16:25:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=madpilot.net; h= content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:subject:subject:received :received; s=mail; t=1507040744; x=1508855145; bh=1kq01TfrGJe8oV tpxW/KMXEd9CJBYARM8RyO1PLV9r4=; b=nUoaaYzLTA//mGUTyp0ehGEdselO5s /CHGjm8VVo5ibD/42yT6hiVzlStdOa7UiKG/3Z1kbZpGxsSS9TCeJwhUl4/G4/F4 P9q4+d6ZX/esK5dHzcspAfiIH9A5LGJ3qREV3tSljWp0kqcIAkbSuMDNEYRNHTJg 9nNiJ+4zT3MWI= Received: from mail.madpilot.net ([192.168.254.3]) by mail (mail.madpilot.net [192.168.254.3]) (amavisd-new, port 10024) with ESMTP id 0IsUpMs2ljMP; Tue, 3 Oct 2017 16:25:44 +0200 (CEST) Received: from marvin.madpilot.net (micro.madpilot.net [88.149.173.206]) by mail.madpilot.net (Postfix) with ESMTPSA; Tue, 3 Oct 2017 16:25:44 +0200 (CEST) Subject: Re: svn commit: r324239 - head/share/misc To: Maxim Konovalov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710031331.v93DVMph046666@repo.freebsd.org> From: Guido Falsi Message-ID: Date: Tue, 3 Oct 2017 16:25:43 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <201710031331.v93DVMph046666@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Oct 2017 14:25:59 -0000 On 10/03/2017 15:31, Maxim Konovalov wrote: > Author: maxim > Date: Tue Oct 3 13:31:22 2017 > New Revision: 324239 > URL: https://svnweb.freebsd.org/changeset/base/324239 > > Log: > FreeBSD 10.4 release added. > > Modified: > head/share/misc/bsd-family-tree > > Modified: head/share/misc/bsd-family-tree > ============================================================================== > --- head/share/misc/bsd-family-tree Tue Oct 3 13:20:17 2017 (r324238) > +++ head/share/misc/bsd-family-tree Tue Oct 3 13:31:22 2017 (r324239) > @@ -344,19 +344,21 @@ FreeBSD 5.2 | | | [...] > + | | | | | OpenBSD 6.1 | > + | | FreeBSD | | | | > + | | 10.4 | | | | > | FreeBSD | | | | > | 11.1 | | | | > | | | | | > -FreeBSD 12 -current | NetBSD -current OpenBSD -current DragonFly -current > +FreeBSD 13 -current | NetBSD -current OpenBSD -current DragonFly -current > | | | | | > v v v v v > Why did this become FreeBSD 13? Shouldn't it stay at FreeBSD 12? -- Guido Falsi From owner-svn-src-head@freebsd.org Tue Oct 3 14:28:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 053E7E3E86B; Tue, 3 Oct 2017 14:28:59 +0000 (UTC) (envelope-from mad@madpilot.net) Received: from mail.madpilot.net (grunt.madpilot.net [78.47.145.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B92A3767A5; Tue, 3 Oct 2017 14:28:57 +0000 (UTC) (envelope-from mad@madpilot.net) Received: from mail (mail [192.168.254.3]) by mail.madpilot.net (Postfix) with ESMTP id 3y61cR1SZ6zZr5; Tue, 3 Oct 2017 16:28:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=madpilot.net; h= content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:references:from:from:subject:subject:received :received; s=mail; t=1507040930; x=1508855331; bh=TZRXxmQ0aVDIFu F0LzNkjhf5/sOyY7/kqmARnrIV65I=; b=HthHFoKY7qR9MJgG210xeRfUUJFode O+qaEjYvGgDb9rNSEV7nvJ4MW6Sz2L50q7Boz6tSyvHOWK4OIS14Lbo1mmP+hQ50 j/PpGOFWHQ5cH/dlQbE2Uh+1lMYlxfyOPdl5RzXqPQExmwretfpH8HxkUf7xdKBL Vvro6rH1Le51g= Received: from mail.madpilot.net ([192.168.254.3]) by mail (mail.madpilot.net [192.168.254.3]) (amavisd-new, port 10024) with ESMTP id FygTzGNxc0Sz; Tue, 3 Oct 2017 16:28:50 +0200 (CEST) Received: from marvin.madpilot.net (micro.madpilot.net [88.149.173.206]) by mail.madpilot.net (Postfix) with ESMTPSA; Tue, 3 Oct 2017 16:28:49 +0200 (CEST) Subject: Re: svn commit: r324239 - head/share/misc From: Guido Falsi To: Maxim Konovalov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710031331.v93DVMph046666@repo.freebsd.org> Message-ID: <72f045c0-3a72-e4bc-8c1c-353308ffcc62@madpilot.net> Date: Tue, 3 Oct 2017 16:28:49 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: it-IT Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Oct 2017 14:28:59 -0000 On 10/03/2017 16:25, Guido Falsi wrote: > On 10/03/2017 15:31, Maxim Konovalov wrote: >> Author: maxim >> Date: Tue Oct 3 13:31:22 2017 >> New Revision: 324239 >> URL: https://svnweb.freebsd.org/changeset/base/324239 >> >> Log: >> FreeBSD 10.4 release added. >> >> Modified: >> head/share/misc/bsd-family-tree >> >> Modified: head/share/misc/bsd-family-tree >> ============================================================================== >> --- head/share/misc/bsd-family-tree Tue Oct 3 13:20:17 2017 (r324238) >> +++ head/share/misc/bsd-family-tree Tue Oct 3 13:31:22 2017 (r324239) >> @@ -344,19 +344,21 @@ FreeBSD 5.2 | | | > [...] >> + | | | | | OpenBSD 6.1 | >> + | | FreeBSD | | | | >> + | | 10.4 | | | | >> | FreeBSD | | | | >> | 11.1 | | | | >> | | | | | >> -FreeBSD 12 -current | NetBSD -current OpenBSD -current DragonFly -current >> +FreeBSD 13 -current | NetBSD -current OpenBSD -current DragonFly -current >> | | | | | >> v v v v v >> > > Why did this become FreeBSD 13? Shouldn't it stay at FreeBSD 12? > I was two minutes late :) -- Guido Falsi From owner-svn-src-head@freebsd.org Tue Oct 3 17:00:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17107E427B9; Tue, 3 Oct 2017 17:00:03 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6D1581358; Tue, 3 Oct 2017 17:00:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v93H01Rw036243; Tue, 3 Oct 2017 17:00:01 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v93H01aj036242; Tue, 3 Oct 2017 17:00:01 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201710031700.v93H01aj036242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 3 Oct 2017 17:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324241 - head/usr.sbin/diskinfo X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/usr.sbin/diskinfo X-SVN-Commit-Revision: 324241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Oct 2017 17:00:03 -0000 Author: asomers Date: Tue Oct 3 17:00:01 2017 New Revision: 324241 URL: https://svnweb.freebsd.org/changeset/base/324241 Log: Fix copy/paste error in diskinfo.8 from r320555 MFC after: 1 week Sponsored by: Spectra Logic Corp Modified: head/usr.sbin/diskinfo/diskinfo.8 Modified: head/usr.sbin/diskinfo/diskinfo.8 ============================================================================== --- head/usr.sbin/diskinfo/diskinfo.8 Tue Oct 3 14:23:49 2017 (r324240) +++ head/usr.sbin/diskinfo/diskinfo.8 Tue Oct 3 17:00:01 2017 (r324241) @@ -64,7 +64,7 @@ Return the physical path of the disk. This is a string that identifies the physical path to the disk in the storage enclosure. .It Fl s -Return the disk serial number +Return the disk ident, usually the serial number. .It Fl S Perform synchronous random write test (ZFS SLOG test), measuring time required to write data blocks of different size and @@ -82,13 +82,6 @@ with the following fields: device name, sectorsize, me media size in sectors, stripe size, stripe offset, firmware cylinders, firmware heads, and firmware sectors. The last three fields are only present if the information is available. -.It Fl i -Return the disk ident, usually the serial number. -.It Fl p -Return the physical path of the disk. -This is a string that identifies the physical path to the disk in the -storage enclosure. -.El .Sh HISTORY The .Nm From owner-svn-src-head@freebsd.org Tue Oct 3 22:57:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52DADE278DE; Tue, 3 Oct 2017 22:57:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20C99680F2; Tue, 3 Oct 2017 22:57:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v93MvJrH085831; Tue, 3 Oct 2017 22:57:19 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v93MvJTI085830; Tue, 3 Oct 2017 22:57:19 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201710032257.v93MvJTI085830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 3 Oct 2017 22:57:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324243 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 324243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Oct 2017 22:57:20 -0000 Author: brooks Date: Tue Oct 3 22:57:19 2017 New Revision: 324243 URL: https://svnweb.freebsd.org/changeset/base/324243 Log: Remove an unneeded and incorrect memset(). On Variant I TLS architectures (aarch64, arm, mips, powerpc, and riscv) the __libc_allocate_tls function allocates thread local storage memory with calloc(). It then copies initialization data over the portions with non-zero initial values. Before this change it would then pointlessly zero the already zeroed remainder of the storage. Unfortunately the calculation was wrong and it would zero TLS_TCB_SIZE (2*sizeof(void *)) additional bytes. In practice, this overflow only matters if the TLS segment is sized such that calloc() allocates a less than TLS_TCB_SIZE extra memory. Even then, the likely result will be zeroing part of the next bucket. This coupled with the impact being confined to Tier II platforms means there will be no security advisory for this issue. Reviewed by: kib, dfr Discussed with: security-officer (delphij) MFC after: 1 week Found by: CHERI Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12547 Modified: head/lib/libc/gen/tls.c Modified: head/lib/libc/gen/tls.c ============================================================================== --- head/lib/libc/gen/tls.c Tue Oct 3 19:08:16 2017 (r324242) +++ head/lib/libc/gen/tls.c Tue Oct 3 22:57:19 2017 (r324243) @@ -160,9 +160,6 @@ __libc_allocate_tls(void *oldtcb, size_t tcbsize, size if (tls_init_size > 0) memcpy((void*)dtv[2], tls_init, tls_init_size); - if (tls_static_space > tls_init_size) - memset((void*)(dtv[2] + tls_init_size), 0, - tls_static_space - tls_init_size); } return(tcb); From owner-svn-src-head@freebsd.org Wed Oct 4 01:12:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0F63E2A02B; Wed, 4 Oct 2017 01:12:27 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EACE6BC02; Wed, 4 Oct 2017 01:12:27 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v941CQ2H042710; Wed, 4 Oct 2017 01:12:26 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v941CQxp042709; Wed, 4 Oct 2017 01:12:26 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201710040112.v941CQxp042709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 4 Oct 2017 01:12:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324244 - head/usr.bin/chpass X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.bin/chpass X-SVN-Commit-Revision: 324244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 01:12:27 -0000 Author: cem Date: Wed Oct 4 01:12:26 2017 New Revision: 324244 URL: https://svnweb.freebsd.org/changeset/base/324244 Log: chpass(1): Check crypt(3) return and handle error appropriately This change is spiritually similar to the earlier r231994. PR: 222756 Submitted by: Lubos Boucek Obtained from: DragonflyBSD 2020c8fec4168a5020f984a093224fade3074b25 Modified: head/usr.bin/chpass/chpass.c Modified: head/usr.bin/chpass/chpass.c ============================================================================== --- head/usr.bin/chpass/chpass.c Tue Oct 3 22:57:19 2017 (r324243) +++ head/usr.bin/chpass/chpass.c Wed Oct 4 01:12:26 2017 (r324244) @@ -82,7 +82,7 @@ main(int argc, char *argv[]) struct passwd lpw, *old_pw, *pw; int ch, pfd, tfd; const char *password; - char *arg = NULL; + char *arg = NULL, *cryptpw; uid_t uid; #ifdef YP struct ypclnt *ypclnt; @@ -228,8 +228,8 @@ main(int argc, char *argv[]) if (old_pw && !master_mode) { password = getpass("Password: "); - if (strcmp(crypt(password, old_pw->pw_passwd), - old_pw->pw_passwd) != 0) + cryptpw = crypt(password, old_pw->pw_passwd); + if (cryptpw == NULL || strcmp(cryptpw, old_pw->pw_passwd) != 0) baduser(); } else { password = ""; From owner-svn-src-head@freebsd.org Wed Oct 4 03:24:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BB55E2C41D; Wed, 4 Oct 2017 03:24:18 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E7616EF30; Wed, 4 Oct 2017 03:24:18 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v943OHoE096787; Wed, 4 Oct 2017 03:24:17 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v943OGU2096785; Wed, 4 Oct 2017 03:24:16 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201710040324.v943OGU2096785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 4 Oct 2017 03:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324246 - head X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 324246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 03:24:18 -0000 Author: cy Date: Wed Oct 4 03:24:16 2017 New Revision: 324246 URL: https://svnweb.freebsd.org/changeset/base/324246 Log: When building multiple kernels using KERNCONF, non-existent KERNCONF files will produce an error and buildkernel will fail. Previously missing KERNCONF files silently failed giving no indication as to why, only to subsequently discover during installkernel that the desired kernel was never built in the first place. This is a rework of r302865. Reviewed by: ngie (previous version, r302865) MFC after: 2 months Differential Revision: D7167 Modified: head/Makefile.inc1 head/UPDATING Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Oct 4 01:14:54 2017 (r324245) +++ head/Makefile.inc1 Wed Oct 4 03:24:16 2017 (r324246) @@ -1914,18 +1914,6 @@ _dtc= usr.bin/dtc _dtc= gnu/usr.bin/dtc .endif -.if ${MK_KERBEROS} != "no" -_kerberos5_bootstrap_tools= \ - kerberos5/tools/make-roken \ - kerberos5/lib/libroken \ - kerberos5/lib/libvers \ - kerberos5/tools/asn1_compile \ - kerberos5/tools/slc \ - usr.bin/compile_et - -.ORDER: ${_kerberos5_bootstrap_tools:C/^/${_bt}-/g} -.endif - # r283777 makewhatis(1) replaced with mandoc version which builds a database. _libopenbsd?= lib/libopenbsd _makewhatis= usr.bin/mandoc @@ -1938,7 +1926,6 @@ bootstrap-tools: .PHONY # FreeBSD versions that need the tool built at this stage of the build. .for _tool in \ ${_clang_tblgen} \ - ${_kerberos5_bootstrap_tools} \ ${_strfile} \ ${_gperf} \ ${_dtc} \ Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Oct 4 01:14:54 2017 (r324245) +++ head/UPDATING Wed Oct 4 03:24:16 2017 (r324246) @@ -51,6 +51,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** ++20160714: + When building multiple kernels using KERNCONF, non-existent KERNCONF + files will produce an error and buildkernel will fail. Previously + missing KERNCONF files silently failed giving no indication as to + why, only to subsequently discover during installkernel that the + desired kernel was never built in the first place. + 20170912: The default serial number format for CTL LUNs has changed. This will affect users who use /dev/diskid/* device nodes, or whose FibreChannel From owner-svn-src-head@freebsd.org Wed Oct 4 03:35:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47A76E2C853; Wed, 4 Oct 2017 03:35:25 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEF776F401; Wed, 4 Oct 2017 03:35:24 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v943ZOBw000914; Wed, 4 Oct 2017 03:35:24 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v943ZOiK000912; Wed, 4 Oct 2017 03:35:24 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201710040335.v943ZOiK000912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 4 Oct 2017 03:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324247 - head X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 324247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 03:35:25 -0000 Author: cy Date: Wed Oct 4 03:35:23 2017 New Revision: 324247 URL: https://svnweb.freebsd.org/changeset/base/324247 Log: Revert r324246. This is not exactly what was intended. Modified: head/Makefile.inc1 head/UPDATING Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Oct 4 03:24:16 2017 (r324246) +++ head/Makefile.inc1 Wed Oct 4 03:35:23 2017 (r324247) @@ -1914,6 +1914,18 @@ _dtc= usr.bin/dtc _dtc= gnu/usr.bin/dtc .endif +.if ${MK_KERBEROS} != "no" +_kerberos5_bootstrap_tools= \ + kerberos5/tools/make-roken \ + kerberos5/lib/libroken \ + kerberos5/lib/libvers \ + kerberos5/tools/asn1_compile \ + kerberos5/tools/slc \ + usr.bin/compile_et + +.ORDER: ${_kerberos5_bootstrap_tools:C/^/${_bt}-/g} +.endif + # r283777 makewhatis(1) replaced with mandoc version which builds a database. _libopenbsd?= lib/libopenbsd _makewhatis= usr.bin/mandoc @@ -1926,6 +1938,7 @@ bootstrap-tools: .PHONY # FreeBSD versions that need the tool built at this stage of the build. .for _tool in \ ${_clang_tblgen} \ + ${_kerberos5_bootstrap_tools} \ ${_strfile} \ ${_gperf} \ ${_dtc} \ Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Oct 4 03:24:16 2017 (r324246) +++ head/UPDATING Wed Oct 4 03:35:23 2017 (r324247) @@ -51,13 +51,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** -+20160714: - When building multiple kernels using KERNCONF, non-existent KERNCONF - files will produce an error and buildkernel will fail. Previously - missing KERNCONF files silently failed giving no indication as to - why, only to subsequently discover during installkernel that the - desired kernel was never built in the first place. - 20170912: The default serial number format for CTL LUNs has changed. This will affect users who use /dev/diskid/* device nodes, or whose FibreChannel From owner-svn-src-head@freebsd.org Wed Oct 4 03:39:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D662AE2C953; Wed, 4 Oct 2017 03:39:55 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A68D96F5CC; Wed, 4 Oct 2017 03:39:55 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v943ds6l001111; Wed, 4 Oct 2017 03:39:54 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v943dskR001109; Wed, 4 Oct 2017 03:39:54 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201710040339.v943dskR001109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 4 Oct 2017 03:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324248 - head X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 324248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 03:39:56 -0000 Author: cy Date: Wed Oct 4 03:39:54 2017 New Revision: 324248 URL: https://svnweb.freebsd.org/changeset/base/324248 Log: When building multiple kernels using KERNCONF, non-existent KERNCONF files will produce an error and buildkernel will fail. Previously missing KERNCONF files silently failed giving no indication as to why, only to subsequently discover during installkernel that the desired kernel was never built in the first place. This is a rework of r302865. This is the correct patch. Reviewed by: ngie (previous version, r302865) MFC after: 2 months Differential Revision: D7167 Modified: head/Makefile.inc1 head/UPDATING Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Oct 4 03:35:23 2017 (r324247) +++ head/Makefile.inc1 Wed Oct 4 03:39:54 2017 (r324248) @@ -1359,6 +1359,10 @@ BUILDKERNELS+= ${_kernel} .if empty(INSTALLKERNEL) && !defined(NO_INSTALLKERNEL) INSTALLKERNEL= ${_kernel} .endif +.else +.if make(buildkernel) +.error Missing KERNCONF ${KERNCONFDIR}/${_kernel} +.endif .endif .endfor Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Oct 4 03:35:23 2017 (r324247) +++ head/UPDATING Wed Oct 4 03:39:54 2017 (r324248) @@ -51,6 +51,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** ++20160714: + When building multiple kernels using KERNCONF, non-existent KERNCONF + files will produce an error and buildkernel will fail. Previously + missing KERNCONF files silently failed giving no indication as to + why, only to subsequently discover during installkernel that the + desired kernel was never built in the first place. + 20170912: The default serial number format for CTL LUNs has changed. This will affect users who use /dev/diskid/* device nodes, or whose FibreChannel From owner-svn-src-head@freebsd.org Wed Oct 4 03:46:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FFAAE2CB94; Wed, 4 Oct 2017 03:46:12 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 257946FA1E; Wed, 4 Oct 2017 03:46:11 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id zadLd6JP3DJTWzadMd2tF8; Tue, 03 Oct 2017 21:46:10 -0600 X-Authority-Analysis: v=2.2 cv=B4DJ6KlM c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=02M-m0pO-4AA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=S-cxxyXkFpmfPYfbDscA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 5CA74B8E; Tue, 3 Oct 2017 20:46:07 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v943k7Sk008227; Tue, 3 Oct 2017 20:46:07 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201710040346.v943k7Sk008227@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324246 - head In-Reply-To: Message from Cy Schubert of "Wed, 04 Oct 2017 03:24:16 -0000." <201710040324.v943OGU2096785@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 03 Oct 2017 20:46:07 -0700 X-CMAE-Envelope: MS4wfOB4v6dKCDpa//UQZC0ZkNYVFNjhqOu8bvVlSGRxZ1dD7vxlQfaVKWkO3TMdYTCP/hg9BT3KR5b68ZrYU0XqW1IxhKxbE5GFaX3BliFtKexld5kJ7OIt rbSVPxVXMV0QqYdciIMV67hou6C9q8CYVyMBImkPHyHfENbgAuABMPmdBvdXkKjwcR1jxRy8QmtINLfGDdMQr7YZJzrS/SrQqch0LIWLbH0HLZgitCsgFm0y xxquGvi1R7Sn2dA51B62zADEZHPqX9k4C4xrCjF1Y7/uylG27MY3XGO5kjqKZmdY X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 03:46:12 -0000 In message <201710040324.v943OGU2096785@repo.freebsd.org>, Cy Schubert writes: > Author: cy > Date: Wed Oct 4 03:24:16 2017 > New Revision: 324246 > URL: https://svnweb.freebsd.org/changeset/base/324246 > > Log: > When building multiple kernels using KERNCONF, non-existent KERNCONF > files will produce an error and buildkernel will fail. Previously missing > KERNCONF files silently failed giving no indication as to why, only to > subsequently discover during installkernel that the desired kernel was > never built in the first place. > > This is a rework of r302865. > > Reviewed by: ngie (previous version, r302865) > MFC after: 2 months > Differential Revision: D7167 > > Modified: > head/Makefile.inc1 > head/UPDATING > > Modified: head/Makefile.inc1 > ============================================================================= > = > --- head/Makefile.inc1 Wed Oct 4 01:14:54 2017 (r324245) > +++ head/Makefile.inc1 Wed Oct 4 03:24:16 2017 (r324246) > @@ -1914,18 +1914,6 @@ _dtc= usr.bin/dtc > _dtc= gnu/usr.bin/dtc > .endif > > -.if ${MK_KERBEROS} != "no" > -_kerberos5_bootstrap_tools= \ > - kerberos5/tools/make-roken \ > - kerberos5/lib/libroken \ > - kerberos5/lib/libvers \ > - kerberos5/tools/asn1_compile \ > - kerberos5/tools/slc \ > - usr.bin/compile_et > - > -.ORDER: ${_kerberos5_bootstrap_tools:C/^/${_bt}-/g} > -.endif > - > # r283777 makewhatis(1) replaced with mandoc version which builds a database > . > _libopenbsd?= lib/libopenbsd > _makewhatis= usr.bin/mandoc > @@ -1938,7 +1926,6 @@ bootstrap-tools: .PHONY > # FreeBSD versions that need the tool built at this stage of the build. > .for _tool in \ > ${_clang_tblgen} \ > - ${_kerberos5_bootstrap_tools} \ > ${_strfile} \ > ${_gperf} \ > ${_dtc} \ Oops. Wrong tree. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Oct 4 06:06:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 802ADE2F57F; Wed, 4 Oct 2017 06:06:23 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FBCA73058; Wed, 4 Oct 2017 06:06:23 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9466MHB061919; Wed, 4 Oct 2017 06:06:22 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9466MFk061918; Wed, 4 Oct 2017 06:06:22 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201710040606.v9466MFk061918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 4 Oct 2017 06:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324249 - head/lib/libc/net X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/lib/libc/net X-SVN-Commit-Revision: 324249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 06:06:23 -0000 Author: cy Date: Wed Oct 4 06:06:22 2017 New Revision: 324249 URL: https://svnweb.freebsd.org/changeset/base/324249 Log: Clarify the wording describing the stayopen flag. MFC after: 1 week Modified: head/lib/libc/net/gethostbyname.3 Modified: head/lib/libc/net/gethostbyname.3 ============================================================================== --- head/lib/libc/net/gethostbyname.3 Wed Oct 4 03:39:54 2017 (r324248) +++ head/lib/libc/net/gethostbyname.3 Wed Oct 4 06:06:22 2017 (r324249) @@ -28,7 +28,7 @@ .\" From: @(#)gethostbyname.3 8.4 (Berkeley) 5/25/95 .\" $FreeBSD$ .\" -.Dd May 12, 2006 +.Dd October 4, 2017 .Dt GETHOSTBYNAME 3 .Os .Sh NAME @@ -189,19 +189,18 @@ function may be used to request the use of a connected .Tn TCP socket for queries. -If the +Queries will by defaulat use +.Tn UDP +datagrams. If the .Fa stayopen -flag is non-zero, -this sets the option to send all queries to the name server using +flag is non-zero, a .Tn TCP -and to retain the connection after each call to +connection to the name server will be used. It will remain open after calls to .Fn gethostbyname , .Fn gethostbyname2 or -.Fn gethostbyaddr . -Otherwise, queries are performed using -.Tn UDP -datagrams. +.Fn gethostbyaddr +have completed. .Pp The .Fn endhostent From owner-svn-src-head@freebsd.org Wed Oct 4 08:43:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1027E32D64; Wed, 4 Oct 2017 08:43:57 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C07AB77CEC; Wed, 4 Oct 2017 08:43:57 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v948hu2X028835; Wed, 4 Oct 2017 08:43:56 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v948huhc028834; Wed, 4 Oct 2017 08:43:56 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201710040843.v948huhc028834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 4 Oct 2017 08:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324257 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 324257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 08:43:58 -0000 Author: manu Date: Wed Oct 4 08:43:56 2017 New Revision: 324257 URL: https://svnweb.freebsd.org/changeset/base/324257 Log: mountd: Convert exportlist to SLIST Use SLIST from sys/queue.h instead of homebrew linked list for the exportlist. Reviewed by: bapt, rmacklem MFC after: 1 week Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D12502 Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Wed Oct 4 07:43:23 2017 (r324256) +++ head/usr.sbin/mountd/mountd.c Wed Oct 4 08:43:56 2017 (r324257) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -108,7 +109,6 @@ struct dirlist { #define DP_HOSTSET 0x2 struct exportlist { - struct exportlist *ex_next; struct dirlist *ex_dirl; struct dirlist *ex_defdir; int ex_flag; @@ -119,6 +119,8 @@ struct exportlist { int ex_secflavors[MAXSECFLAVORS]; int ex_defnumsecflavors; int ex_defsecflavors[MAXSECFLAVORS]; + + SLIST_ENTRY(exportlist) entries; }; /* ex_flag bits */ #define EX_LINKED 0x1 @@ -222,7 +224,7 @@ static int xdr_fhs(XDR *, caddr_t); static int xdr_mlist(XDR *, caddr_t); static void terminate(int); -static struct exportlist *exphead; +static SLIST_HEAD(, exportlist) exphead = SLIST_HEAD_INITIALIZER(exphead); static struct mountlist *mlhead; static struct grouplist *grphead; static char *exnames_default[2] = { _PATH_EXPORTS, NULL }; @@ -445,7 +447,6 @@ main(int argc, char **argv) argc -= optind; argv += optind; grphead = (struct grouplist *)NULL; - exphead = (struct exportlist *)NULL; mlhead = (struct mountlist *)NULL; if (argc > 0) exnames = argv; @@ -1284,8 +1285,8 @@ xdr_explist_common(XDR *xdrsp, caddr_t cp __unused, in sigemptyset(&sighup_mask); sigaddset(&sighup_mask, SIGHUP); sigprocmask(SIG_BLOCK, &sighup_mask, NULL); - ep = exphead; - while (ep) { + + SLIST_FOREACH(ep, &exphead, entries) { putdef = 0; if (put_exlist(ep->ex_dirl, xdrsp, ep->ex_defdir, &putdef, brief)) @@ -1294,7 +1295,6 @@ xdr_explist_common(XDR *xdrsp, caddr_t cp __unused, in put_exlist(ep->ex_defdir, xdrsp, (struct dirlist *)NULL, &putdef, brief)) goto errout; - ep = ep->ex_next; } sigprocmask(SIG_UNBLOCK, &sighup_mask, NULL); if (!xdr_bool(xdrsp, &false)) @@ -1397,9 +1397,8 @@ static FILE *exp_file; static void get_exportlist_one(void) { - struct exportlist *ep, *ep2; + struct exportlist *ep; struct grouplist *grp, *tgrp; - struct exportlist **epp; struct dirlist *dirhead; struct statfs fsb; struct xucred anon; @@ -1676,19 +1675,8 @@ get_exportlist_one(void) } dirhead = (struct dirlist *)NULL; if ((ep->ex_flag & EX_LINKED) == 0) { - ep2 = exphead; - epp = &exphead; + SLIST_INSERT_HEAD(&exphead, ep, entries); - /* - * Insert in the list in alphabetical order. - */ - while (ep2 && strcmp(ep2->ex_fsdir, ep->ex_fsdir) < 0) { - epp = &ep2->ex_next; - ep2 = ep2->ex_next; - } - if (ep2) - ep->ex_next = ep2; - *epp = ep; ep->ex_flag |= EX_LINKED; } nextline: @@ -1730,13 +1718,10 @@ get_exportlist(void) /* * First, get rid of the old list */ - ep = exphead; - while (ep) { - ep2 = ep; - ep = ep->ex_next; - free_exp(ep2); + SLIST_FOREACH_SAFE(ep, &exphead, entries, ep2) { + SLIST_REMOVE(&exphead, ep, exportlist, entries); + free_exp(ep); } - exphead = (struct exportlist *)NULL; grp = grphead; while (grp) { @@ -1918,13 +1903,12 @@ ex_search(fsid_t *fsid) { struct exportlist *ep; - ep = exphead; - while (ep) { + SLIST_FOREACH(ep, &exphead, entries) { if (ep->ex_fs.val[0] == fsid->val[0] && ep->ex_fs.val[1] == fsid->val[1]) return (ep); - ep = ep->ex_next; } + return (ep); } From owner-svn-src-head@freebsd.org Wed Oct 4 08:48:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 395C3E32E84; Wed, 4 Oct 2017 08:48:07 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 136767C140; Wed, 4 Oct 2017 08:48:07 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v948m6Om029128; Wed, 4 Oct 2017 08:48:06 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v948m6jn029127; Wed, 4 Oct 2017 08:48:06 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201710040848.v948m6jn029127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 4 Oct 2017 08:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324258 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 324258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 08:48:07 -0000 Author: manu Date: Wed Oct 4 08:48:05 2017 New Revision: 324258 URL: https://svnweb.freebsd.org/changeset/base/324258 Log: mountd: Convert mountlist to SLIST Use SLIST from sys/queue.h instead of homebrew linked list for mountlist. Reviewed by: bapt, rmacklem MFC after: 1 week Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D12504 Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Wed Oct 4 08:43:56 2017 (r324257) +++ head/usr.sbin/mountd/mountd.c Wed Oct 4 08:48:05 2017 (r324258) @@ -92,9 +92,10 @@ __FBSDID("$FreeBSD$"); * Structures for keeping the mount list and export list */ struct mountlist { - struct mountlist *ml_next; char ml_host[MNTNAMLEN+1]; char ml_dirp[MNTPATHLEN+1]; + + SLIST_ENTRY(mountlist) next; }; struct dirlist { @@ -225,7 +226,7 @@ static int xdr_mlist(XDR *, caddr_t); static void terminate(int); static SLIST_HEAD(, exportlist) exphead = SLIST_HEAD_INITIALIZER(exphead); -static struct mountlist *mlhead; +static SLIST_HEAD(, mountlist) mlhead = SLIST_HEAD_INITIALIZER(mlhead); static struct grouplist *grphead; static char *exnames_default[2] = { _PATH_EXPORTS, NULL }; static char **exnames; @@ -447,7 +448,6 @@ main(int argc, char **argv) argc -= optind; argv += optind; grphead = (struct grouplist *)NULL; - mlhead = (struct mountlist *)NULL; if (argc > 0) exnames = argv; else @@ -1254,8 +1254,7 @@ xdr_mlist(XDR *xdrsp, caddr_t cp __unused) int false = 0; char *strp; - mlp = mlhead; - while (mlp) { + SLIST_FOREACH(mlp, &mlhead, next) { if (!xdr_bool(xdrsp, &true)) return (0); strp = &mlp->ml_host[0]; @@ -1264,7 +1263,6 @@ xdr_mlist(XDR *xdrsp, caddr_t cp __unused) strp = &mlp->ml_dirp[0]; if (!xdr_string(xdrsp, &strp, MNTPATHLEN)) return (0); - mlp = mlp->ml_next; } if (!xdr_bool(xdrsp, &false)) return (0); @@ -2946,7 +2944,7 @@ parsecred(char *namelist, struct xucred *cr) static void get_mountlist(void) { - struct mountlist *mlp, **mlpp; + struct mountlist *mlp; char *host, *dirp, *cp; char str[STRSIZ]; FILE *mlfile; @@ -2959,7 +2957,6 @@ get_mountlist(void) return; } } - mlpp = &mlhead; while (fgets(str, STRSIZ, mlfile) != NULL) { cp = str; host = strsep(&cp, " \t\n"); @@ -2973,9 +2970,8 @@ get_mountlist(void) mlp->ml_host[MNTNAMLEN] = '\0'; strncpy(mlp->ml_dirp, dirp, MNTPATHLEN); mlp->ml_dirp[MNTPATHLEN] = '\0'; - mlp->ml_next = (struct mountlist *)NULL; - *mlpp = mlp; - mlpp = &mlp->ml_next; + + SLIST_INSERT_HEAD(&mlhead, mlp, next); } fclose(mlfile); } @@ -2983,23 +2979,16 @@ get_mountlist(void) static void del_mlist(char *hostp, char *dirp) { - struct mountlist *mlp, **mlpp; - struct mountlist *mlp2; + struct mountlist *mlp, *mlp2; FILE *mlfile; int fnd = 0; - mlpp = &mlhead; - mlp = mlhead; - while (mlp) { + SLIST_FOREACH_SAFE(mlp, &mlhead, next, mlp2) { if (!strcmp(mlp->ml_host, hostp) && (!dirp || !strcmp(mlp->ml_dirp, dirp))) { fnd = 1; - mlp2 = mlp; - *mlpp = mlp = mlp->ml_next; - free((caddr_t)mlp2); - } else { - mlpp = &mlp->ml_next; - mlp = mlp->ml_next; + SLIST_REMOVE(&mlhead, mlp, mountlist, next); + free((caddr_t)mlp); } } if (fnd) { @@ -3007,10 +2996,8 @@ del_mlist(char *hostp, char *dirp) syslog(LOG_ERR,"can't update %s", _PATH_RMOUNTLIST); return; } - mlp = mlhead; - while (mlp) { + SLIST_FOREACH(mlp, &mlhead, next) { fprintf(mlfile, "%s %s\n", mlp->ml_host, mlp->ml_dirp); - mlp = mlp->ml_next; } fclose(mlfile); } @@ -3019,17 +3006,14 @@ del_mlist(char *hostp, char *dirp) static void add_mlist(char *hostp, char *dirp) { - struct mountlist *mlp, **mlpp; + struct mountlist *mlp; FILE *mlfile; - mlpp = &mlhead; - mlp = mlhead; - while (mlp) { + SLIST_FOREACH(mlp, &mlhead, next) { if (!strcmp(mlp->ml_host, hostp) && !strcmp(mlp->ml_dirp, dirp)) return; - mlpp = &mlp->ml_next; - mlp = mlp->ml_next; } + mlp = (struct mountlist *)malloc(sizeof (*mlp)); if (mlp == (struct mountlist *)NULL) out_of_mem(); @@ -3037,8 +3021,7 @@ add_mlist(char *hostp, char *dirp) mlp->ml_host[MNTNAMLEN] = '\0'; strncpy(mlp->ml_dirp, dirp, MNTPATHLEN); mlp->ml_dirp[MNTPATHLEN] = '\0'; - mlp->ml_next = (struct mountlist *)NULL; - *mlpp = mlp; + SLIST_INSERT_HEAD(&mlhead, mlp, next); if ((mlfile = fopen(_PATH_RMOUNTLIST, "a")) == NULL) { syslog(LOG_ERR, "can't update %s", _PATH_RMOUNTLIST); return; From owner-svn-src-head@freebsd.org Wed Oct 4 09:54:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31B50E34675; Wed, 4 Oct 2017 09:54:57 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAF4E7E495; Wed, 4 Oct 2017 09:54:56 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v949su6f058100; Wed, 4 Oct 2017 09:54:56 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v949suOj058099; Wed, 4 Oct 2017 09:54:56 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201710040954.v949suOj058099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 4 Oct 2017 09:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324259 - head X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 324259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 09:54:57 -0000 Author: cy Date: Wed Oct 4 09:54:55 2017 New Revision: 324259 URL: https://svnweb.freebsd.org/changeset/base/324259 Log: Fix typo. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Oct 4 08:48:05 2017 (r324258) +++ head/UPDATING Wed Oct 4 09:54:55 2017 (r324259) @@ -51,7 +51,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** -+20160714: +20171003: When building multiple kernels using KERNCONF, non-existent KERNCONF files will produce an error and buildkernel will fail. Previously missing KERNCONF files silently failed giving no indication as to From owner-svn-src-head@freebsd.org Wed Oct 4 09:55:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66957E34684; Wed, 4 Oct 2017 09:55:00 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 367587E498; Wed, 4 Oct 2017 09:55:00 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v949sxLu058146; Wed, 4 Oct 2017 09:54:59 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v949sxkx058145; Wed, 4 Oct 2017 09:54:59 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201710040954.v949sxkx058145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 4 Oct 2017 09:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324260 - head/lib/libc/net X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/lib/libc/net X-SVN-Commit-Revision: 324260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 09:55:00 -0000 Author: cy Date: Wed Oct 4 09:54:59 2017 New Revision: 324260 URL: https://svnweb.freebsd.org/changeset/base/324260 Log: Fix typo. Reported by: se Modified: head/lib/libc/net/gethostbyname.3 Modified: head/lib/libc/net/gethostbyname.3 ============================================================================== --- head/lib/libc/net/gethostbyname.3 Wed Oct 4 09:54:55 2017 (r324259) +++ head/lib/libc/net/gethostbyname.3 Wed Oct 4 09:54:59 2017 (r324260) @@ -189,7 +189,7 @@ function may be used to request the use of a connected .Tn TCP socket for queries. -Queries will by defaulat use +Queries will by default use .Tn UDP datagrams. If the .Fa stayopen From owner-svn-src-head@freebsd.org Wed Oct 4 11:35:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80B2DE36ADB; Wed, 4 Oct 2017 11:35:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B303823C1; Wed, 4 Oct 2017 11:35:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v94BZ4Ao003532; Wed, 4 Oct 2017 11:35:04 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v94BZ4jW003531; Wed, 4 Oct 2017 11:35:04 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201710041135.v94BZ4jW003531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 4 Oct 2017 11:35:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324261 - head/sys/cam/ctl X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/cam/ctl X-SVN-Commit-Revision: 324261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 11:35:05 -0000 Author: trasz Date: Wed Oct 4 11:35:04 2017 New Revision: 324261 URL: https://svnweb.freebsd.org/changeset/base/324261 Log: Fix iSCSI target panics on concurrent session teardown and display (eg removing a target and doing "ctladm islist -v" at the same time). Reviewed by: manu Tested by: manu MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Oct 4 09:54:59 2017 (r324260) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Oct 4 11:35:04 2017 (r324261) @@ -1308,18 +1308,17 @@ cfiscsi_session_delete(struct cfiscsi_session *cs) KASSERT(TAILQ_EMPTY(&cs->cs_waiting_for_data_out), ("destroying session with non-empty queue")); + mtx_lock(&softc->lock); + TAILQ_REMOVE(&softc->sessions, cs, cs_next); + mtx_unlock(&softc->lock); + cfiscsi_session_unregister_initiator(cs); if (cs->cs_target != NULL) cfiscsi_target_release(cs->cs_target); icl_conn_close(cs->cs_conn); icl_conn_free(cs->cs_conn); - - mtx_lock(&softc->lock); - TAILQ_REMOVE(&softc->sessions, cs, cs_next); - cv_signal(&softc->sessions_cv); - mtx_unlock(&softc->lock); - free(cs, M_CFISCSI); + cv_signal(&softc->sessions_cv); } static int From owner-svn-src-head@freebsd.org Wed Oct 4 12:23:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9176AE38A95; Wed, 4 Oct 2017 12:23:35 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EF65A54; Wed, 4 Oct 2017 12:23:35 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v94CNYQl024924; Wed, 4 Oct 2017 12:23:34 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v94CNYpS024923; Wed, 4 Oct 2017 12:23:34 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201710041223.v94CNYpS024923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 4 Oct 2017 12:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324275 - head/sys/dev/md X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/md X-SVN-Commit-Revision: 324275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 12:23:35 -0000 Author: trasz Date: Wed Oct 4 12:23:34 2017 New Revision: 324275 URL: https://svnweb.freebsd.org/changeset/base/324275 Log: Make md(4) support GEOM::ident for vnode-backed disks. It's based on backing file device and inode numbers. This is useful for gmountver(8) regression tests. MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12230 Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Wed Oct 4 12:06:24 2017 (r324274) +++ head/sys/dev/md/md.c Wed Oct 4 12:23:34 2017 (r324275) @@ -207,6 +207,7 @@ struct md_s { unsigned opencount; unsigned fwheads; unsigned fwsectors; + char ident[32]; unsigned flags; char name[20]; struct proc *procp; @@ -1181,6 +1182,9 @@ md_kthread(void *arg) sc->fwheads))) || g_handleattr_int(bp, "GEOM::candelete", 1)) error = -1; + else if (sc->ident[0] != '\0' && + g_handleattr_str(bp, "GEOM::ident", sc->ident)) + error = -1; else if (g_handleattr_int(bp, "MNT::verified", isv)) error = -1; else @@ -1414,6 +1418,8 @@ mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio, sc->fwsectors = mdio->md_fwsectors; if (mdio->md_fwheads != 0) sc->fwheads = mdio->md_fwheads; + snprintf(sc->ident, sizeof(sc->ident), "MD-DEV%ju-INO%ju", + (uintmax_t)vattr.va_fsid, (uintmax_t)vattr.va_fileid); sc->flags = mdio->md_options & (MD_FORCE | MD_ASYNC | MD_VERIFY); if (!(flags & FWRITE)) sc->flags |= MD_READONLY; @@ -1898,6 +1904,11 @@ g_md_dumpconf(struct sbuf *sb, const char *indent, str indent, (uintmax_t) mp->fwheads); sbuf_printf(sb, "%s%ju\n", indent, (uintmax_t) mp->fwsectors); + if (mp->ident[0] != '\0') { + sbuf_printf(sb, "%s", indent); + g_conf_printf_escaped(sb, "%s", mp->ident); + sbuf_printf(sb, "\n"); + } sbuf_printf(sb, "%s%ju\n", indent, (uintmax_t) mp->mediasize); sbuf_printf(sb, "%s%s\n", indent, From owner-svn-src-head@freebsd.org Wed Oct 4 12:25:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14F81E38B17; Wed, 4 Oct 2017 12:25:41 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3323BE5; Wed, 4 Oct 2017 12:25:40 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v94CPd3X025034; Wed, 4 Oct 2017 12:25:39 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v94CPdgx025032; Wed, 4 Oct 2017 12:25:39 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201710041225.v94CPdgx025032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 4 Oct 2017 12:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324276 - head/sys/geom/mountver X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/geom/mountver X-SVN-Commit-Revision: 324276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 12:25:41 -0000 Author: trasz Date: Wed Oct 4 12:25:39 2017 New Revision: 324276 URL: https://svnweb.freebsd.org/changeset/base/324276 Log: Don't destroy gmountver(8) devices on shutdown, unless they are orphaned. Otherwise we would fail to sync the filesystem on reboot. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/geom/mountver/g_mountver.c head/sys/geom/mountver/g_mountver.h Modified: head/sys/geom/mountver/g_mountver.c ============================================================================== --- head/sys/geom/mountver/g_mountver.c Wed Oct 4 12:23:34 2017 (r324275) +++ head/sys/geom/mountver/g_mountver.c Wed Oct 4 12:25:39 2017 (r324276) @@ -190,6 +190,11 @@ g_mountver_start(struct bio *bp) * requests in order to maintain ordering. */ if (sc->sc_orphaned || !TAILQ_EMPTY(&sc->sc_queue)) { + if (sc->sc_shutting_down) { + G_MOUNTVER_LOGREQ(bp, "Discarding request due to shutdown."); + g_io_deliver(bp, ENXIO); + return; + } G_MOUNTVER_LOGREQ(bp, "Queueing request."); g_mountver_queue(bp); if (!sc->sc_orphaned) @@ -607,13 +612,20 @@ g_mountver_dumpconf(struct sbuf *sb, const char *inden static void g_mountver_shutdown_pre_sync(void *arg, int howto) { + struct g_mountver_softc *sc; struct g_class *mp; struct g_geom *gp, *gp2; mp = arg; g_topology_lock(); - LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) - g_mountver_destroy(gp, 1); + LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { + if (gp->softc == NULL) + continue; + sc = gp->softc; + sc->sc_shutting_down = 1; + if (sc->sc_orphaned) + g_mountver_destroy(gp, 1); + } g_topology_unlock(); } Modified: head/sys/geom/mountver/g_mountver.h ============================================================================== --- head/sys/geom/mountver/g_mountver.h Wed Oct 4 12:23:34 2017 (r324275) +++ head/sys/geom/mountver/g_mountver.h Wed Oct 4 12:25:39 2017 (r324276) @@ -62,6 +62,7 @@ struct g_mountver_softc { char *sc_provider_name; char sc_ident[DISK_IDENT_SIZE]; int sc_orphaned; + int sc_shutting_down; int sc_access_r; int sc_access_w; int sc_access_e; From owner-svn-src-head@freebsd.org Wed Oct 4 12:58:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4937CE3959C; Wed, 4 Oct 2017 12:58:31 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15A6B1F06; Wed, 4 Oct 2017 12:58:31 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v94CwUlY037495; Wed, 4 Oct 2017 12:58:30 GMT (envelope-from bjk@FreeBSD.org) Received: (from bjk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v94CwUXW037494; Wed, 4 Oct 2017 12:58:30 GMT (envelope-from bjk@FreeBSD.org) Message-Id: <201710041258.v94CwUXW037494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bjk set sender to bjk@FreeBSD.org using -f From: Benjamin Kaduk Date: Wed, 4 Oct 2017 12:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324277 - head/lib/libc/net X-SVN-Group: head X-SVN-Commit-Author: bjk X-SVN-Commit-Paths: head/lib/libc/net X-SVN-Commit-Revision: 324277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 12:58:31 -0000 Author: bjk (doc committer) Date: Wed Oct 4 12:58:30 2017 New Revision: 324277 URL: https://svnweb.freebsd.org/changeset/base/324277 Log: mdoc style: start new sentence on new line Modified: head/lib/libc/net/gethostbyname.3 Modified: head/lib/libc/net/gethostbyname.3 ============================================================================== --- head/lib/libc/net/gethostbyname.3 Wed Oct 4 12:25:39 2017 (r324276) +++ head/lib/libc/net/gethostbyname.3 Wed Oct 4 12:58:30 2017 (r324277) @@ -191,11 +191,13 @@ may be used to request the use of a connected socket for queries. Queries will by default use .Tn UDP -datagrams. If the +datagrams. +If the .Fa stayopen flag is non-zero, a .Tn TCP -connection to the name server will be used. It will remain open after calls to +connection to the name server will be used. +It will remain open after calls to .Fn gethostbyname , .Fn gethostbyname2 or From owner-svn-src-head@freebsd.org Wed Oct 4 13:13:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1795CE39955; Wed, 4 Oct 2017 13:13:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E75092A79; Wed, 4 Oct 2017 13:13:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v94DDdrC045761; Wed, 4 Oct 2017 13:13:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v94DDcNC045759; Wed, 4 Oct 2017 13:13:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710041313.v94DDcNC045759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 4 Oct 2017 13:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324278 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 324278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 13:13:40 -0000 Author: hselasky Date: Wed Oct 4 13:13:38 2017 New Revision: 324278 URL: https://svnweb.freebsd.org/changeset/base/324278 Log: Make sure the timer belonging to the delayed work in the LinuxKPI gets drained before invoking the work function. Else the timer mutex may still be in use which can lead to use-after-free situations, because the work function might free the work structure before returning. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h head/sys/compat/linuxkpi/common/src/linux_work.c Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/workqueue.h Wed Oct 4 12:58:30 2017 (r324277) +++ head/sys/compat/linuxkpi/common/include/linux/workqueue.h Wed Oct 4 13:13:38 2017 (r324278) @@ -215,6 +215,7 @@ extern struct workqueue_struct *system_power_efficient extern void linux_init_delayed_work(struct delayed_work *, work_func_t); extern void linux_work_fn(void *, int); +extern void linux_delayed_work_fn(void *, int); extern struct workqueue_struct *linux_create_workqueue_common(const char *, int); extern void linux_destroy_workqueue(struct workqueue_struct *); extern bool linux_queue_work_on(int cpu, struct workqueue_struct *, struct work_struct *); Modified: head/sys/compat/linuxkpi/common/src/linux_work.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_work.c Wed Oct 4 12:58:30 2017 (r324277) +++ head/sys/compat/linuxkpi/common/src/linux_work.c Wed Oct 4 13:13:38 2017 (r324278) @@ -260,6 +260,23 @@ done: WQ_EXEC_UNLOCK(wq); } +void +linux_delayed_work_fn(void *context, int pending) +{ + struct delayed_work *dwork = context; + + /* + * Make sure the timer belonging to the delayed work gets + * drained before invoking the work function. Else the timer + * mutex may still be in use which can lead to use-after-free + * situations, because the work function might free the work + * structure before returning. + */ + callout_drain(&dwork->timer.callout); + + linux_work_fn(&dwork->work, pending); +} + static void linux_delayed_work_timer_fn(void *arg) { @@ -550,7 +567,8 @@ void linux_init_delayed_work(struct delayed_work *dwork, work_func_t func) { memset(dwork, 0, sizeof(*dwork)); - INIT_WORK(&dwork->work, func); + dwork->work.func = func; + TASK_INIT(&dwork->work.work_task, 0, linux_delayed_work_fn, dwork); mtx_init(&dwork->timer.mtx, spin_lock_name("lkpi-dwork"), NULL, MTX_DEF | MTX_NOWITNESS); callout_init_mtx(&dwork->timer.callout, &dwork->timer.mtx, 0); From owner-svn-src-head@freebsd.org Wed Oct 4 14:39:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 623E6E3ADA7; Wed, 4 Oct 2017 14:39:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 315C96465D; Wed, 4 Oct 2017 14:39:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v94EdtwP079057; Wed, 4 Oct 2017 14:39:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v94EdtTY079056; Wed, 4 Oct 2017 14:39:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710041439.v94EdtTY079056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 4 Oct 2017 14:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324279 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 324279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 14:39:56 -0000 Author: emaste Date: Wed Oct 4 14:39:55 2017 New Revision: 324279 URL: https://svnweb.freebsd.org/changeset/base/324279 Log: arch.7: correct statement about time_t size After r320347 it is 64-bit on every architecture except i386. Sponsored by: The FreeBSD Foundation Modified: head/share/man/man7/arch.7 Modified: head/share/man/man7/arch.7 ============================================================================== --- head/share/man/man7/arch.7 Wed Oct 4 13:13:38 2017 (r324278) +++ head/share/man/man7/arch.7 Wed Oct 4 14:39:55 2017 (r324279) @@ -212,8 +212,7 @@ Machine-dependent type sizes: .El .Pp .Sy time_t -is 8 bytes on all supported architectures except i386 and 32-bit -variants of powerpc. +is 8 bytes on all supported architectures except i386. .Ss Endianness and Char Signedness .Bl -column -offset indent "Sy Architecture" "Sy Endianness" "Sy char Signedness" .It Sy Architecture Ta Sy Endianness Ta Sy char Signedness From owner-svn-src-head@freebsd.org Wed Oct 4 14:41:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91B84E3B09E; Wed, 4 Oct 2017 14:41:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49CF464A0A; Wed, 4 Oct 2017 14:41:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v94EfjT4080596; Wed, 4 Oct 2017 14:41:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v94Efjan080595; Wed, 4 Oct 2017 14:41:45 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710041441.v94Efjan080595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 4 Oct 2017 14:41:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324280 - head/sys/dev/ofw X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/ofw X-SVN-Commit-Revision: 324280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 14:41:46 -0000 Author: imp Date: Wed Oct 4 14:41:45 2017 New Revision: 324280 URL: https://svnweb.freebsd.org/changeset/base/324280 Log: 'private' isn't a PNP string field, so instead used the reserved '#' name for this field (it might even be possible to just drop it entirely, since it will be ignored either way). Sponsored by: Netflix Modified: head/sys/dev/ofw/ofw_bus_subr.h Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Wed Oct 4 14:39:55 2017 (r324279) +++ head/sys/dev/ofw/ofw_bus_subr.h Wed Oct 4 14:41:45 2017 (r324280) @@ -63,7 +63,7 @@ struct intr_map_data_fdt { }; #endif -#define SIMPLEBUS_PNP_DESCR "Z:compat;P:private;" +#define SIMPLEBUS_PNP_DESCR "Z:compat;P:#;" #define SIMPLEBUS_PNP_INFO(t) \ MODULE_PNP_INFO(SIMPLEBUS_PNP_DESCR, simplebus, t, t, sizeof(t[0]), sizeof(t) / sizeof(t[0])); From owner-svn-src-head@freebsd.org Wed Oct 4 15:07:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FE75E3B9D8; Wed, 4 Oct 2017 15:07:37 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x232.google.com (mail-pg0-x232.google.com [IPv6:2607:f8b0:400e: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 0D23A659A5; Wed, 4 Oct 2017 15:07:37 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x232.google.com with SMTP id b11so6626132pgn.12; Wed, 04 Oct 2017 08:07:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=CXPSdP5pbw7jF42Vu0d/t7vai6oI2A1BY2XOg2c3XRc=; b=uHhgRryS5uF001W7f1u4cZAB0+wHpB+1ic9r1Sjn6xaxHdrpxFbG9+oPmLTfamiBAZ Qa8hSaz1GJfazlugwyxmFTlUb70NyqWWqJ82LOqOiC1FGnQi9N64p4J3pB25i3LEQlz2 qGmf6HIIyerVRjqwj0xwuN591xiN+Xpe+/AEFXkr8knsmz1MMa0nywTALTo0j2LTK/0f lh8DKUHQPVHxW96OX5SOjX9ym6EpbyxV9VjjMbpR4wLXmKMkFqtfOMTtVmdTJHOaSE5K Ui/xZ+/QX7u4o55DOCaKLRO1qSSa1MbXuNuhq+Y8zB1Tp62MB8RfVJ46ABBa7BK2xCi4 RGqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=CXPSdP5pbw7jF42Vu0d/t7vai6oI2A1BY2XOg2c3XRc=; b=DMZm68vIAJxrVJfxDLEuDYo2F/Lq3StwmSmWFc9cw7daPur8DmURBcJzblcXyWEHdH fRuTr3W+Iw3OVKmpazblFSsEfx+jDzAZ9Fxadx5YKSp60BPMNwEudBDxdaBo0YSsNrI3 cuYZl8rDIOG94aJ4JJu8nVbTZa73IFREHmGbJ52aWuCiizP8mrBE9zDZBlpLY7vBnitG oeOk2gnG5mTrDwkLxjlC6c9JLGsaMutF9802jfckQ3NIvgad77RqYrrqcuw1rDqbaKDA EsP4d/T+Gg+UXrCtiRtpZm+4wmttG9O0RixNnNIYMGFk4V8htbWTgcHD6o2P8SRPVqpR AhXA== X-Gm-Message-State: AMCzsaU7CcVbnfUnL8uVyUlbz6En3bNYTJiSYI0DqmrN2XbsVur0X5eS mPbjS58qR8S7S4rcWaP/blV+RK71 X-Google-Smtp-Source: AOwi7QCqslFYwQRyN90kepYAhF3se5e0p4ygir5vAOqrVi7HbAedr34PF3vLux4e1sJqOzgCHUjMcw== X-Received: by 10.98.4.67 with SMTP id 64mr8251217pfe.103.1507129656169; Wed, 04 Oct 2017 08:07:36 -0700 (PDT) Received: from [192.168.20.13] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id 5sm6998802pfe.128.2017.10.04.08.07.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Oct 2017 08:07:35 -0700 (PDT) Content-Type: text/plain; charset=cp932 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r324257 - head/usr.sbin/mountd From: Ngie Cooper X-Mailer: iPhone Mail (15A402) In-Reply-To: <201710040843.v948huhc028834@repo.freebsd.org> Date: Wed, 4 Oct 2017 08:07:29 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201710040843.v948huhc028834@repo.freebsd.org> To: Emmanuel Vadot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 15:07:37 -0000 > On Oct 4, 2017, at 01:43, Emmanuel Vadot wrote: >=20 > Author: manu > Date: Wed Oct 4 08:43:56 2017 > New Revision: 324257 > URL: https://svnweb.freebsd.org/changeset/base/324257 >=20 > Log: > mountd: Convert exportlist to SLIST >=20 > Use SLIST from sys/queue.h instead of homebrew linked list for the export= list. >=20 > Reviewed by: bapt, rmacklem > MFC after: 1 week > Sponsored by: Gandi.net > Differential Revision: https://reviews.freebsd.org/D12502 >=20 > Modified: > head/usr.sbin/mountd/mountd.c ... > - ep2 =3D exphead; > - epp =3D &exphead; > + SLIST_INSERT_HEAD(&exphead, ep, entries); >=20 > - /* > - * Insert in the list in alphabetical order. > - */ > - while (ep2 && strcmp(ep2->ex_fsdir, ep->ex_fsdir) < 0) { > - epp =3D &ep2->ex_next; > - ep2 =3D ep2->ex_next; > - } > - if (ep2) > - ep->ex_next =3D ep2; > - *epp =3D ep; > ep->ex_flag |=3D EX_LINKED; The new code isn=81ft functionally equivalent to the old code: the mount= list is no longer sorted on insert. Is that intentional? Thanks, -Ngie= From owner-svn-src-head@freebsd.org Wed Oct 4 15:09:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECFBEE3BACD; Wed, 4 Oct 2017 15:09:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8A2265B55; Wed, 4 Oct 2017 15:09:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v94F9nLF091588; Wed, 4 Oct 2017 15:09:49 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v94F9nY7091583; Wed, 4 Oct 2017 15:09:49 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201710041509.v94F9nY7091583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 4 Oct 2017 15:09:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324281 - in head: sys/geom sys/sys usr.sbin/diskinfo X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: sys/geom sys/sys usr.sbin/diskinfo X-SVN-Commit-Revision: 324281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 15:09:51 -0000 Author: asomers Date: Wed Oct 4 15:09:49 2017 New Revision: 324281 URL: https://svnweb.freebsd.org/changeset/base/324281 Log: Display rotation rate and TRIM/UNMAP support in diskinfo(8) Bump __FreeBSD_version due to the expansion of struct diocgattr_arg. Reviewed by: mav, allanjude, imp MFC after: 3 weeks Relnotes: yes Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D12578 Modified: head/sys/geom/geom_disk.h head/sys/sys/disk.h head/sys/sys/param.h head/usr.sbin/diskinfo/diskinfo.c Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Wed Oct 4 14:41:45 2017 (r324280) +++ head/sys/geom/geom_disk.h Wed Oct 4 15:09:49 2017 (r324281) @@ -37,6 +37,11 @@ #ifndef _GEOM_GEOM_DISK_H_ #define _GEOM_GEOM_DISK_H_ +#define DISK_RR_UNKNOWN 0 +#define DISK_RR_NON_ROTATING 1 +#define DISK_RR_MIN 0x0401 +#define DISK_RR_MAX 0xfffe + #ifdef _KERNEL #include @@ -126,11 +131,6 @@ struct disk { #define DISKFLAG_UNMAPPED_BIO 0x10 #define DISKFLAG_DIRECT_COMPLETION 0x20 #define DISKFLAG_CANZONE 0x80 - -#define DISK_RR_UNKNOWN 0 -#define DISK_RR_NON_ROTATING 1 -#define DISK_RR_MIN 0x0401 -#define DISK_RR_MAX 0xfffe struct disk *disk_alloc(void); void disk_create(struct disk *disk, int version); Modified: head/sys/sys/disk.h ============================================================================== --- head/sys/sys/disk.h Wed Oct 4 14:41:45 2017 (r324280) +++ head/sys/sys/disk.h Wed Oct 4 15:09:49 2017 (r324281) @@ -134,6 +134,7 @@ struct diocgattr_arg { char str[DISK_IDENT_SIZE]; off_t off; int i; + uint16_t u16; } value; }; #define DIOCGATTR _IOWR('d', 142, struct diocgattr_arg) Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Oct 4 14:41:45 2017 (r324280) +++ head/sys/sys/param.h Wed Oct 4 15:09:49 2017 (r324281) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200048 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200049 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- head/usr.sbin/diskinfo/diskinfo.c Wed Oct 4 14:41:45 2017 (r324280) +++ head/usr.sbin/diskinfo/diskinfo.c Wed Oct 4 15:09:49 2017 (r324281) @@ -31,6 +31,7 @@ * $FreeBSD$ */ +#include #include #include #include @@ -42,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -62,9 +64,11 @@ usage(void) static int opt_c, opt_i, opt_p, opt_s, opt_S, opt_t, opt_v, opt_w; +static bool candelete(int fd); static void speeddisk(int fd, off_t mediasize, u_int sectorsize); static void commandtime(int fd, off_t mediasize, u_int sectorsize); static void iopsbench(int fd, off_t mediasize, u_int sectorsize); +static void rotationrate(int fd, char *buf, size_t buflen); static void slogbench(int fd, int isreg, off_t mediasize, u_int sectorsize); static int zonecheck(int fd, uint32_t *zone_mode, char *zone_str, size_t zone_str_len); @@ -78,6 +82,7 @@ main(int argc, char **argv) int i, ch, fd, error, exitval = 0; char tstr[BUFSIZ], ident[DISK_IDENT_SIZE], physpath[MAXPATHLEN]; char zone_desc[64]; + char rrate[64]; struct diocgattr_arg arg; off_t mediasize, stripesize, stripeoffset; u_int sectorsize, fwsectors, fwheads, zoned = 0, isreg; @@ -246,6 +251,10 @@ main(int argc, char **argv) printf("\t%-12s\t# Disk ident.\n", ident); if (ioctl(fd, DIOCGPHYSPATH, physpath) == 0) printf("\t%-12s\t# Physical path\n", physpath); + printf("\t%-12s\t# TRIM/UNMAP support\n", + candelete(fd) ? "Yes" : "No"); + rotationrate(fd, rrate, sizeof(rrate)); + printf("\t%-12s\t# Rotation rate in RPM\n", rrate); if (zoned != 0) printf("\t%-12s\t# Zone Mode\n", zone_desc); } @@ -263,6 +272,39 @@ out: } free(buf); exit (exitval); +} + +static bool +candelete(int fd) +{ + struct diocgattr_arg arg; + + strlcpy(arg.name, "GEOM::candelete", sizeof(arg.name)); + arg.len = sizeof(arg.value.i); + if (ioctl(fd, DIOCGATTR, &arg) == 0) + return (arg.value.i != 0); + else + return (false); +} + +static void +rotationrate(int fd, char *rate, size_t buflen) +{ + struct diocgattr_arg arg; + int ret; + + strlcpy(arg.name, "GEOM::rotation_rate", sizeof(arg.name)); + arg.len = sizeof(arg.value.u16); + + ret = ioctl(fd, DIOCGATTR, &arg); + if (ret < 0 || arg.value.u16 == DISK_RR_UNKNOWN) + snprintf(rate, buflen, "Unknown"); + else if (arg.value.u16 == DISK_RR_NON_ROTATING) + snprintf(rate, buflen, "%d", 0); + else if (arg.value.u16 >= DISK_RR_MIN && arg.value.u16 <= DISK_RR_MAX) + snprintf(rate, buflen, "%d", arg.value.u16); + else + snprintf(rate, buflen, "Invalid"); } static void From owner-svn-src-head@freebsd.org Wed Oct 4 15:10:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9DFBE3BB38; Wed, 4 Oct 2017 15:10:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22a.google.com (mail-pf0-x22a.google.com [IPv6:2607:f8b0:400e:c00::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 871FC65CB2; Wed, 4 Oct 2017 15:10:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22a.google.com with SMTP id l188so6392590pfc.6; Wed, 04 Oct 2017 08:10:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Q1grjKxfkHQLqd3Va8jE3CqdtUMHxkM7jiryTU317Sg=; b=eobH4ORK8j/YEkbWmToYtWiMCgq+a4UM5DipfQlV6HY8ARpFAGji4fPFR+q35dud6z w3iHYjFUgR8eJJ72TqoVMvWPsNgH774Mk5OZSMGgkTOmKe6zGcUQ3n2GpVvS2B+8fv3I 4ZtUyAZRix//n+Zl4BLH/S2PIb9IElWaBvsaWxjgNbgZ/YuhhKkNxJn8pFjII6h5VYaY lxYqGUfqSyYRUF0Md0DfQzAx0VFWoQ5lDRz7SX2bA88sBDGwuDOdPiTugVOZyGaBc+Xb Vuen8mgp8FFI62NIDZtPHdXbbr6qIMqxUlYzs15Bm78jXF1yJg6ubULY1FtsLU5Z6zOl MuVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Q1grjKxfkHQLqd3Va8jE3CqdtUMHxkM7jiryTU317Sg=; b=HpE6kEbwqFiHKte8iO9IElTRjaiYCIqWgA5K21O6KYN5JWv+1oIHy1WznPZ7FRcrhp IGgMSddN1ovv1QKlqvtbE041gu+KXZKrNrGTySZtwwXTXCPa1BD59UNniCQjKz7Q2pF/ 1NZd1YNDHFNnX2yQnAh2kmVlmw500C/pzik1ZecYJGOZW4cLFub+xk2ZI8I4fjjlVFwv Zy6thWUU3gdUzhOCZHNgaq37kZ1L35TLUaDQOCAAeJzQMczID919SYjwmdaV/cueOeRZ q9bLTYbKOHwF+ONwjc0IENF+eGYw7jtryoeOcZqXLcnzAYieS6UvjlMkQ5AYNgFzC2I2 v0jQ== X-Gm-Message-State: AHPjjUgmjJbBvv8vPW8vhcG0lN+oNQqQWk/nNR4tToyttKiX3qVZTfqv NY/rNwyr44gpLwBaS0Dx7ICYoodM X-Google-Smtp-Source: AOwi7QBlPxljZfAgSqaMhS4RZMV8WrA7rUIec7/5qmXpaaiXYX3CLGvgLPYkX5f4/h7C/USCN/8Uvw== X-Received: by 10.99.36.7 with SMTP id k7mr18625962pgk.91.1507129819625; Wed, 04 Oct 2017 08:10:19 -0700 (PDT) Received: from [192.168.20.13] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id v41sm21101811pgn.44.2017.10.04.08.10.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Oct 2017 08:10:19 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r324249 - head/lib/libc/net From: Ngie Cooper X-Mailer: iPhone Mail (15A402) In-Reply-To: <201710040606.v9466MFk061918@repo.freebsd.org> Date: Wed, 4 Oct 2017 08:10:15 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <3CE21D1E-4400-44EE-B7BE-62B4A9DB59A7@gmail.com> References: <201710040606.v9466MFk061918@repo.freebsd.org> To: Cy Schubert X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 15:10:20 -0000 > On Oct 3, 2017, at 23:06, Cy Schubert wrote: >=20 > Author: cy > Date: Wed Oct 4 06:06:22 2017 > New Revision: 324249 > URL: https://svnweb.freebsd.org/changeset/base/324249 >=20 > Log: > Clarify the wording describing the stayopen flag. >=20 > MFC after: 1 week >=20 > Modified: > head/lib/libc/net/gethostbyname.3 >=20 > Modified: head/lib/libc/net/gethostbyname.3 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=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/lib/libc/net/gethostbyname.3 Wed Oct 4 03:39:54 2017 (r324= 248) > +++ head/lib/libc/net/gethostbyname.3 Wed Oct 4 06:06:22 2017 (r324= 249) > @@ -28,7 +28,7 @@ > .\" From: @(#)gethostbyname.3 8.4 (Berkeley) 5/25/95 > .\" $FreeBSD$ > .\" > -.Dd May 12, 2006 > +.Dd October 4, 2017 > .Dt GETHOSTBYNAME 3 > .Os > .Sh NAME > @@ -189,19 +189,18 @@ function > may be used to request the use of a connected > .Tn TCP > socket for queries. > -If the > +Queries will by defaulat use > +.Tn UDP > +datagrams. If the manlint: new sentences must start on new lines. Cheers, -Ngie= From owner-svn-src-head@freebsd.org Wed Oct 4 15:11:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90A71E3BCD9; Wed, 4 Oct 2017 15:11:50 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-oi0-x231.google.com (mail-oi0-x231.google.com [IPv6:2607:f8b0:4003:c06::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 51EAC65EFD; Wed, 4 Oct 2017 15:11:50 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-oi0-x231.google.com with SMTP id p187so20050527oif.4; Wed, 04 Oct 2017 08:11:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=HIezO8WOKKj8kSNRzxdX0774aYb09J5jBbnybFfcXrs=; b=Ylx9GqlUhRNwOgi+jsr3OkAktUqcOueuHqmrhxLBiZdb2iF31O4b08F7NgJd4iA86b yK8bRljxNO54RCvl+e9pF1GJDLsduu7FTIw+GarSsJxRBjGJT7xX8azzcI0/VNmeZqBM uVoMQ9RT2MSRsBDbO83YNzlRou1QuDJdiAuV+MTaQNlY+lZ4NMlnjV1uy3sxUI9xwPVI SfCAuy+s0IGRTqHH93hHYTq7fNqL6eLymYZRGPOfGx5KmwbommXS5l37OcN8zEw/ly5W bcZUxb1yu9nTxqm4TT7VhtLw7ASdek3ATMN8hP/KJI05F/sBlOhJUgXv3uY8ogZyUu8p T3YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=HIezO8WOKKj8kSNRzxdX0774aYb09J5jBbnybFfcXrs=; b=G3DKAyITfTTD3yA1m43iaM+hR/xqbYJLlDtPJzjtGMrZsxSozPR0khrcq5vfSN8NC0 XeEwdGZznQTZ/13i0pm9N4uaHAOl/Zg5djSduh7FAp0zGGGlOrOKGa6Oz5uQVQ7uHqpz daDBJHfoe26OpD67aMSTIrwLnlvAW1NISNBFA2m5on7GpgJMve/Gt8f8TDF0qW+XpYc1 jZq8ZWs6mGHvvtzBXugRUqMbfvjvcHdeK5O0sNx/eyeybG3KdJgRQXGbW1KD7KgG3Bqk ed1Ks6VjiT1cj0A7v9PPhoLcRHNhtES1xHGM1yPK4Y1KbaO/X16KSqEBGItA3dwZTIsV GFtg== X-Gm-Message-State: AMCzsaXeF3DOqzfdpC0gNJQKaDJ4R9E8bfSoX0YcedCVA/vKa7lG44OM zRstiFFG2EVX2e6lNC8E/9MmOKmgf602wBsxDVkNCw== X-Google-Smtp-Source: AOwi7QBVDDK4m/POhmLAi8iD4WPA0WXAJm3xKgF0/kQbRSlmuiivncJ6z2mSLnts0qAl/lag2FX3sP8fjvBFv19bDYs= X-Received: by 10.157.34.2 with SMTP id o2mr11446450ota.193.1507129909508; Wed, 04 Oct 2017 08:11:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.41.6 with HTTP; Wed, 4 Oct 2017 08:11:48 -0700 (PDT) In-Reply-To: <3CE21D1E-4400-44EE-B7BE-62B4A9DB59A7@gmail.com> References: <201710040606.v9466MFk061918@repo.freebsd.org> <3CE21D1E-4400-44EE-B7BE-62B4A9DB59A7@gmail.com> From: Benjamin Kaduk Date: Wed, 4 Oct 2017 10:11:48 -0500 Message-ID: Subject: Re: svn commit: r324249 - head/lib/libc/net To: Ngie Cooper Cc: Cy Schubert , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 15:11:50 -0000 On Wed, Oct 4, 2017 at 10:10 AM, Ngie Cooper wrote: > > > On Oct 3, 2017, at 23:06, Cy Schubert wrote: > > > > @@ -189,19 +189,18 @@ function > > may be used to request the use of a connected > > .Tn TCP > > socket for queries. > > -If the > > +Queries will by defaulat use > > +.Tn UDP > > +datagrams. If the > > manlint: new sentences must start on new lines. > See r324277. -Ben From owner-svn-src-head@freebsd.org Wed Oct 4 15:31:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E7FBE3C27F; Wed, 4 Oct 2017 15:31:40 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBC06684D; Wed, 4 Oct 2017 15:31:38 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 87348681; Wed, 4 Oct 2017 17:31:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=kPWKO/uhIsUZjt1tqu7gG9rApZA=; b=nT3vexrsiH5Xlz2G2stVcNBM3bM2 a5b5yIHb9e/gk1l6dDur1dnTjBrZB4QjQkX0S/jPK6jChMKFkJxuDyzXxe3T0RXu VKvpsHHg2v8QOedghGvtgjibmS43YvGtIh9/V8mQERQw6Cz+6q6tGWfbBrTswvwF Z/OCArv9bHLILlE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=to8/1TLaUVSS5F0mSKp7DyfDahWBJSAn8Zf8mkG8zBDMe+l/34i0gTOu 2dhd1KebHUeR8Y8qLd0+yds7lMRU4WOWIoR/szeYmjpQ2yZnda4VbvpF7Xrn3EQK rpSKcCEkV1Ntc3aXw5uyZrgMr0CVMyLdM4MhZ/FVdEFhe7jzLQQ= Received: from arcadia (evadot.gandi.net [217.70.181.36]) by mail.blih.net (OpenSMTPD) with ESMTPSA id da385128 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Wed, 4 Oct 2017 17:31:28 +0200 (CEST) Date: Wed, 4 Oct 2017 17:31:27 +0200 From: Emmanuel Vadot To: Ngie Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324257 - head/usr.sbin/mountd Message-Id: <20171004173127.a0748a48e208b1dd0712d755@bidouilliste.com> In-Reply-To: References: <201710040843.v948huhc028834@repo.freebsd.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 15:31:40 -0000 On Wed, 4 Oct 2017 08:07:29 -0700 Ngie Cooper wrote: >=20 > > On Oct 4, 2017, at 01:43, Emmanuel Vadot wrote: > >=20 > > Author: manu > > Date: Wed Oct 4 08:43:56 2017 > > New Revision: 324257 > > URL: https://svnweb.freebsd.org/changeset/base/324257 > >=20 > > Log: > > mountd: Convert exportlist to SLIST > >=20 > > Use SLIST from sys/queue.h instead of homebrew linked list for the exp= ortlist. > >=20 > > Reviewed by: bapt, rmacklem > > MFC after: 1 week > > Sponsored by: Gandi.net > > Differential Revision: https://reviews.freebsd.org/D12502 > >=20 > > Modified: > > head/usr.sbin/mountd/mountd.c >=20 > ... >=20 > > - ep2 =3D exphead; > > - epp =3D &exphead; > > + SLIST_INSERT_HEAD(&exphead, ep, entries); > >=20 > > - /* > > - * Insert in the list in alphabetical order. > > - */ > > - while (ep2 && strcmp(ep2->ex_fsdir, ep->ex_fsdir) < 0) { > > - epp =3D &ep2->ex_next; > > - ep2 =3D ep2->ex_next; > > - } > > - if (ep2) > > - ep->ex_next =3D ep2; > > - *epp =3D ep; > > ep->ex_flag |=3D EX_LINKED; >=20 > The new code isn?t functionally equivalent to the old code: the mount= list is no longer sorted on insert. Is that intentional? > Thanks, > -Ngie Yes, this give no value to do it. Rick noted that showmount might loose alphabetical order but even before showmount doesn't get the list alphabetically sorted. Cheers, --=20 Emmanuel Vadot From owner-svn-src-head@freebsd.org Wed Oct 4 16:15:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3A88E3CF0A; Wed, 4 Oct 2017 16:15:08 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A04A68014; Wed, 4 Oct 2017 16:15:08 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id zmK3d9MTODJTWzmK4d4Hf5; Wed, 04 Oct 2017 10:15:01 -0600 X-Authority-Analysis: v=2.2 cv=B4DJ6KlM c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=02M-m0pO-4AA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=pGLkceISAAAA:8 a=U3BLAdOpvsTvyTwSKuwA:9 a=QEXdDO2ut3YA:10 a=HfBBEWFXgfF8T2VhJ6UA:9 a=PPOMHdMzo8FrX3Iy:21 a=_W_S_7VecoQA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from [25.172.12.81] (S0106d4ca6d8943b0.gv.shawcable.net [24.68.134.59]) by spqr.komquats.com (Postfix) with ESMTPSA id 3C2501C8; Wed, 4 Oct 2017 09:14:58 -0700 (PDT) MIME-Version: 1.0 From: Cy Schubert Subject: RE: svn commit: r324249 - head/lib/libc/net Date: Wed, 4 Oct 2017 09:15:00 -0700 To: Benjamin Kaduk , Ngie Cooper CC: Cy Schubert , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Message-Id: <20171004161458.3C2501C8@spqr.komquats.com> X-CMAE-Envelope: MS4wfMgH2vdqRAbr7LxXQU6R4qpL+9odx8yxsoDB88zsfH5pxee5n9QzPmOCxOQVfQ+tfsCSqh1xkBepoK+BKroRLv5tqY+rGgHgPlZSFt4ZfBdc63rrErEv mZb+EGeIu6w/AXD8Zhbq/qrFWNGbWJ+If4JgqQEgPVpLUxvd9mS4kR1xENDB74dBghU6YHZMaL7ZID9YBNGWgxDWGqkpPt90AAv4ihfWJOchnvVqrXr5ixdf M+7Y+dfobRIGE313IACxpHkWQv37MFIAmtIqGFT+BlpemCYe8bae/dU1Nhsl1uzR6Qn7snR6l/eFL9Y5/+ul7F5a8Fx/vBGa4YdEIOq2JuQ= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 16:15:09 -0000 Thank you. I will remember for next time. --- Sent using a tiny phone keyboard. Apologies for any typos and autocorrect. Cy Schubert or -----Original Message----- From: Benjamin Kaduk Sent: 04/10/2017 08:13 To: Ngie Cooper Cc: Cy Schubert; svn-src-head@freebsd.org; svn-src-all@freebsd.org; src-com= mitters@freebsd.org Subject: Re: svn commit: r324249 - head/lib/libc/net On Wed, Oct 4, 2017 at 10:10 AM, Ngie Cooper wrote: > On Oct 3, 2017, at 23:06, Cy Schubert wrote: > > @@ -189,19 +189,18 @@ function > may be used to request the use of a connected > .Tn TCP > socket for queries. > -If the > +Queries will by defaulat use > +.Tn UDP > +datagrams. If the =20 manlint: new sentences must start on new lines. See r324277. -Ben = From owner-svn-src-head@freebsd.org Wed Oct 4 17:29:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB492E3E94D; Wed, 4 Oct 2017 17:29:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7A106ADD0; Wed, 4 Oct 2017 17:29:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v94HT8KK049996; Wed, 4 Oct 2017 17:29:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v94HT80Y049995; Wed, 4 Oct 2017 17:29:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201710041729.v94HT80Y049995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 4 Oct 2017 17:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324285 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 324285 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 17:29:10 -0000 Author: markj Date: Wed Oct 4 17:29:08 2017 New Revision: 324285 URL: https://svnweb.freebsd.org/changeset/base/324285 Log: Add get_random_{int,long} to the LinuxKPI. Fix some whitespace bugs while here. Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D12588 Modified: head/sys/compat/linuxkpi/common/include/linux/random.h Modified: head/sys/compat/linuxkpi/common/include/linux/random.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/random.h Wed Oct 4 16:35:58 2017 (r324284) +++ head/sys/compat/linuxkpi/common/include/linux/random.h Wed Oct 4 17:29:08 2017 (r324285) @@ -28,7 +28,8 @@ * * $FreeBSD$ */ -#ifndef _LINUX_RANDOM_H_ + +#ifndef _LINUX_RANDOM_H_ #define _LINUX_RANDOM_H_ #include @@ -37,8 +38,27 @@ static inline void get_random_bytes(void *buf, int nbytes) { + if (read_random(buf, nbytes) == 0) arc4rand(buf, nbytes, 0); } -#endif /* _LINUX_RANDOM_H_ */ +static inline u_int +get_random_int(void) +{ + u_int val; + + get_random_bytes(&val, sizeof(val)); + return (val); +} + +static inline u_long +get_random_long(void) +{ + u_long val; + + get_random_bytes(&val, sizeof(val)); + return (val); +} + +#endif /* _LINUX_RANDOM_H_ */ From owner-svn-src-head@freebsd.org Wed Oct 4 18:11:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E96FE3F45F; Wed, 4 Oct 2017 18:11:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0CFA6BFB4; Wed, 4 Oct 2017 18:11:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v94IB1lj067392; Wed, 4 Oct 2017 18:11:01 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v94IB1qn067391; Wed, 4 Oct 2017 18:11:01 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201710041811.v94IB1qn067391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 4 Oct 2017 18:11:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324286 - head/usr.bin/hexdump/tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/hexdump/tests X-SVN-Commit-Revision: 324286 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 18:11:02 -0000 Author: kevans Date: Wed Oct 4 18:11:00 2017 New Revision: 324286 URL: https://svnweb.freebsd.org/changeset/base/324286 Log: hexdump: Remove expected test failures for now succeeding tests r323990 fixed the -s flag breakage reported by PR 219173. Mark the corresponding hexdump tests accordingly, since they should now both succeed. PR: 222781 Reported by: ngie Reviewed by: emaste, ngie Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D12590 Modified: head/usr.bin/hexdump/tests/hexdump_test.sh Modified: head/usr.bin/hexdump/tests/hexdump_test.sh ============================================================================== --- head/usr.bin/hexdump/tests/hexdump_test.sh Wed Oct 4 17:29:08 2017 (r324285) +++ head/usr.bin/hexdump/tests/hexdump_test.sh Wed Oct 4 18:11:00 2017 (r324286) @@ -134,7 +134,6 @@ s_flag_head() } s_flag_body() { - atf_expect_fail "-s option is currently broken due to capsicum (PR 219173)" atf_check -o file:"$(atf_get_srcdir)/d_hexdump_sflag_a.out" \ hexdump -bs 4 "$(atf_get_srcdir)/d_hexdump_a.in" @@ -148,7 +147,6 @@ v_flag_head() } v_flag_body() { - atf_expect_fail "-s option is currently broken due to capsicum (PR 219173)" for i in $(seq 0 7); do atf_check -o match:"^\*$" \ hexdump -s ${i} "$(atf_get_srcdir)/d_hexdump_c.in" From owner-svn-src-head@freebsd.org Wed Oct 4 20:08:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0FF6E41515; Wed, 4 Oct 2017 20:08:47 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::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 828806F64C; Wed, 4 Oct 2017 20:08:47 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x229.google.com with SMTP id c195so17203136itb.1; Wed, 04 Oct 2017 13:08:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=zfD8BgTMJTQS6xtgOtEAxg1uBQqp8E2NBHCxGk/oBzY=; b=QfjTOQwM8u+Ze2GRyuqbLe2hg4trMplJAi57qhZflLjbn5ifauKNoBZtfi6hBU1ouY 8FIny4e2Zi1rtslrPKIpqX04QkzoYX5HMXPVrFQpLBtaCEXqkFgZqganjuVXngzVGcqX syRJyb2FUWmFWfmRPvHjDrpdQNqaBTJxcITtObyh/F+mhDmhMksXDGp6d97Gb71RkgpO jKJf+AZCmbCZ6jm0w6zg2tVh1keK8UCcC0hiORHFJVFJHQWAGk6aShoFAzZ4nFBnj4ev o1XZ3/gL26Q+zbeQbEarHOJoVddTgupWmgBzv41p4rWc3dsJChNR41A9u08aiAVwYOe9 2nng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=zfD8BgTMJTQS6xtgOtEAxg1uBQqp8E2NBHCxGk/oBzY=; b=C8kgavg8p3wDHX2oy4L0uIzco1yx0lOGrmlPhP2ksdMDiPDdgdcoLLZVUCcih1Z08b wfIlOX8gSbTlq1fWOfah+PTMOcW00U5NB/O3zZZaENnPkfGFplr1I81V92k4GPaLJ1QZ OoMesfM3CtM/nGf1XrrHUzPivANT2GBTXbKFlzIXqS1YBCm5+okOL7pem0ErTgOR10rk ETWM2gEVJx7QN+KzgCOgDiTj7+QEdhztYcKGWz6tVo4YDr7BIqKWS6l445pTkgccHtbH rAxKnpl2CFtQrThJl7GJrywE4sIqsjCFIXgF1TTWrKkUtRhPAepXpUGLVutiAaf5/mx4 Bmkw== X-Gm-Message-State: AMCzsaVqk/QDGhbZ9vVb4BUfx63koXqgvvfgqFYhhk2xIms+kXdnWGsr qa89ycnNTJS7PrGg901y5diF6xb96vgfpPQtpxnqwAS2 X-Google-Smtp-Source: AOwi7QBPkiWBxc6ygYUa/u30qe/xSR6Blucwbl3uR0ELu6VBFoyTTRKl5DqkelDIf77kWS91P3h1GIbwb/cnyEU6I8k= X-Received: by 10.36.90.205 with SMTP id v196mr28748490ita.70.1507147726525; Wed, 04 Oct 2017 13:08:46 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.4.80 with HTTP; Wed, 4 Oct 2017 13:08:26 -0700 (PDT) In-Reply-To: <201710012012.v91KCUvU024559@repo.freebsd.org> References: <201710012012.v91KCUvU024559@repo.freebsd.org> From: Ed Maste Date: Wed, 4 Oct 2017 22:08:26 +0200 X-Google-Sender-Auth: hpowhzOZ11maIySHeTwePAeluAc Message-ID: Subject: Re: svn commit: r324178 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua To: Andriy Gapon Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 20:08:47 -0000 On 1 October 2017 at 22:12, Andriy Gapon wrote: > > Author: avg > Date: Sun Oct 1 20:12:30 2017 > New Revision: 324178 > URL: https://svnweb.freebsd.org/changeset/base/324178 > > Log: > unbreak kernel builds on sparc64 and powerpc after r324163, ZFS Channel Programs Seems this is still broken on sparc64: https://ci.freebsd.org/job/FreeBSD-head-powerpc64-build/1443/console From owner-svn-src-head@freebsd.org Wed Oct 4 20:36:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AD52E4217F; Wed, 4 Oct 2017 20:36:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id EAA3170A87; Wed, 4 Oct 2017 20:36:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA16521; Wed, 04 Oct 2017 23:30:20 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1dzqJA-000LZN-0t; Wed, 04 Oct 2017 23:30:20 +0300 Subject: Re: svn commit: r324178 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua To: Ed Maste Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201710012012.v91KCUvU024559@repo.freebsd.org> From: Andriy Gapon Message-ID: <73fc56c3-2a00-44a4-9d3c-5ff77053ddf6@FreeBSD.org> Date: Wed, 4 Oct 2017 23:29:19 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 20:36:38 -0000 On 04/10/2017 23:08, Ed Maste wrote: > On 1 October 2017 at 22:12, Andriy Gapon wrote: >> >> Author: avg >> Date: Sun Oct 1 20:12:30 2017 >> New Revision: 324178 >> URL: https://svnweb.freebsd.org/changeset/base/324178 >> >> Log: >> unbreak kernel builds on sparc64 and powerpc after r324163, ZFS Channel Programs > > Seems this is still broken on sparc64: > https://ci.freebsd.org/job/FreeBSD-head-powerpc64-build/1443/console That's really puzzling because I specifically tested the fix on sparc64 before committing and it worked. Oh, I see, you meant powerpc64... -- Andriy Gapon From owner-svn-src-head@freebsd.org Wed Oct 4 21:05:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5D89E42B85; Wed, 4 Oct 2017 21:05:45 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 773797217A; Wed, 4 Oct 2017 21:05:45 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v94L5ibe045627; Wed, 4 Oct 2017 21:05:44 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v94L5iHX045623; Wed, 4 Oct 2017 21:05:44 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201710042105.v94L5iHX045623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 4 Oct 2017 21:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324287 - in head: contrib/tcpdump usr.sbin/tcpdump/tcpdump X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head: contrib/tcpdump usr.sbin/tcpdump/tcpdump X-SVN-Commit-Revision: 324287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 21:05:45 -0000 Author: oshogbo Date: Wed Oct 4 21:05:44 2017 New Revision: 324287 URL: https://svnweb.freebsd.org/changeset/base/324287 Log: Partially revert r323866. Using HAVE_* is a internal tcpdump style standard. We want to be consistent with the standard to upstream those changes in the future. Requested by: glebius@ Modified: head/contrib/tcpdump/addrtoname.c head/contrib/tcpdump/tcpdump.c head/usr.sbin/tcpdump/tcpdump/Makefile head/usr.sbin/tcpdump/tcpdump/config.h Modified: head/contrib/tcpdump/addrtoname.c ============================================================================== --- head/contrib/tcpdump/addrtoname.c Wed Oct 4 18:11:00 2017 (r324286) +++ head/contrib/tcpdump/addrtoname.c Wed Oct 4 21:05:44 2017 (r324287) @@ -26,10 +26,10 @@ #include "config.h" #endif -#ifdef WITH_CASPER +#ifdef HAVE_CASPER #include #include -#endif /* WITH_CASPER */ +#endif /* HAVE_CASPER */ #include @@ -202,7 +202,7 @@ intoa(uint32_t addr) static uint32_t f_netmask; static uint32_t f_localnet; -#ifdef WITH_CASPER +#ifdef HAVE_CASPER extern cap_channel_t *capdns; #endif @@ -250,7 +250,7 @@ getname(netdissect_options *ndo, const u_char *ap) */ if (!ndo->ndo_nflag && (addr & f_netmask) == f_localnet) { -#ifdef WITH_CASPER +#ifdef HAVE_CASPER if (capdns != NULL) { hp = cap_gethostbyaddr(capdns, (char *)&addr, 4, AF_INET); @@ -311,7 +311,7 @@ getname6(netdissect_options *ndo, const u_char *ap) * Do not print names if -n was given. */ if (!ndo->ndo_nflag) { -#ifdef WITH_CASPER +#ifdef HAVE_CASPER if (capdns != NULL) { hp = cap_gethostbyaddr(capdns, (char *)&addr, sizeof(addr), AF_INET6); Modified: head/contrib/tcpdump/tcpdump.c ============================================================================== --- head/contrib/tcpdump/tcpdump.c Wed Oct 4 18:11:00 2017 (r324286) +++ head/contrib/tcpdump/tcpdump.c Wed Oct 4 21:05:44 2017 (r324287) @@ -82,10 +82,10 @@ The Regents of the University of California. All righ #include #include #include -#ifdef WITH_CASPER +#ifdef HAVE_CASPER #include #include -#endif /* WITH_CASPER */ +#endif /* HAVE_CASPER */ #endif /* HAVE_CAPSICUM */ #include #include @@ -176,7 +176,7 @@ static int infoprint; char *program_name; -#ifdef WITH_CASPER +#ifdef HAVE_CASPER cap_channel_t *capdns; #endif @@ -730,7 +730,7 @@ get_next_file(FILE *VFile, char *ptr) return ret; } -#ifdef WITH_CASPER +#ifdef HAVE_CASPER static cap_channel_t * capdns_setup(void) { @@ -757,7 +757,7 @@ capdns_setup(void) return (capdnsloc); } -#endif /* WITH_CASPER */ +#endif /* HAVE_CASPER */ #ifdef HAVE_PCAP_SET_TSTAMP_PRECISION static int @@ -1839,10 +1839,10 @@ main(int argc, char **argv) exit_tcpdump(0); } -#ifdef WITH_CASPER +#ifdef HAVE_CASPER if (!ndo->ndo_nflag) capdns = capdns_setup(); -#endif /* WITH_CASPER */ +#endif /* HAVE_CASPER */ init_print(ndo, localnet, netmask, timezone_offset); @@ -2066,11 +2066,11 @@ main(int argc, char **argv) #ifdef HAVE_CAPSICUM cansandbox = (VFileName == NULL && zflag == NULL); -#ifdef WITH_CASPER +#ifdef HAVE_CASPER cansandbox = (cansandbox && (ndo->ndo_nflag || capdns != NULL)); #else cansandbox = (cansandbox && ndo->ndo_nflag); -#endif /* WITH_CASPER */ +#endif /* HAVE_CASPER */ if (cansandbox && cap_enter() < 0 && errno != ENOSYS) error("unable to enter the capability mode"); #endif /* HAVE_CAPSICUM */ Modified: head/usr.sbin/tcpdump/tcpdump/Makefile ============================================================================== --- head/usr.sbin/tcpdump/tcpdump/Makefile Wed Oct 4 18:11:00 2017 (r324286) +++ head/usr.sbin/tcpdump/tcpdump/Makefile Wed Oct 4 21:05:44 2017 (r324287) @@ -190,7 +190,7 @@ LIBADD= l pcap .if ${MK_CASPER} != "no" LIBADD+= casper LIBADD+= cap_dns -CFLAGS+=-DWITH_CASPER +CFLAGS+=-DHAVE_CASPER .endif .if ${MK_OPENSSL} != "no" LIBADD+= crypto Modified: head/usr.sbin/tcpdump/tcpdump/config.h ============================================================================== --- head/usr.sbin/tcpdump/tcpdump/config.h Wed Oct 4 18:11:00 2017 (r324286) +++ head/usr.sbin/tcpdump/tcpdump/config.h Wed Oct 4 21:05:44 2017 (r324287) @@ -18,7 +18,7 @@ /* Casper library support available */ /* See Makefile */ -/* #undef WITH_CASPER */ +/* #undef HAVE_CASPER */ /* Define to 1 if you have the `cap_enter' function. */ #define HAVE_CAP_ENTER 1 From owner-svn-src-head@freebsd.org Wed Oct 4 21:06:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF668E42C25; Wed, 4 Oct 2017 21:06:28 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-lf0-x232.google.com (mail-lf0-x232.google.com [IPv6:2a00:1450:4010:c07::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 4F81D722E2; Wed, 4 Oct 2017 21:06:28 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-lf0-x232.google.com with SMTP id d10so12514546lfg.11; Wed, 04 Oct 2017 14:06:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=fWgNk+d1Ynpa2Zkv+UcusqyqIf366QLTcsEunPgraDk=; b=Mvq0deY82qDtvzsGeYVMwTLL3MzCEmuDzp7lIoyk2MnT6sfvuRcpe5Mq+qKuqbxf23 KDqI0F4ycqvlSoxnmgK0YvdPSXu6Vkkp04DcL4JeIRk5vaRMrOn9AZNv9AarBsysVhPT xPJGskksIXTeeUiLUw3IV7B9Yib40JXbFx5/mpmVp6L0owMyR52p7EPcFwihj5czhifG oMMW2fro24gQgq2X4NfOksFr3W3YbX9kkjy84moM/BYIVwT+sqVIF/0vLcUKZ4cgPgUp 0PEBcJ09QJEfV29koaJxkS78i6z/dIquObhdi0iCu+lLVpQAV0DGMQl2t8kIZDGXFe+E Wy5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=fWgNk+d1Ynpa2Zkv+UcusqyqIf366QLTcsEunPgraDk=; b=V+QMOY3r4+qG+72DJnCWMOnD1BtrxU/UE/tsOpEa7ytmp0evUAj0zhDJCz/klOficY SoEEoN5F7hKepdEtOoQZ4fED9xAN6FwGdMlyH35LGiyMffI5dlEgN+Ecu5o3rHJO/wHE vzkKFITKKPfkR1uU1+tXV2s/uc+tiiw6nJI0LjI3qFc6uxk7W3Odmoj7LXD/Y6zqsx5c ct5GRB/7h/vLBFZy9BXo+NnELCX1u34VW3z0H/2C32ccPvm2IyUNnsxL4Fn3ZZP3wnf4 kOGokkFGJ1YUXfzcWFnCaYjku3vMf1zwJ7gK0huPmMyi3unIiaE0YjmYLGCTZw5rRXcd 7mnw== X-Gm-Message-State: AMCzsaU8X6lQgyuFDTFxGUh/8IjqmwzKU3EDIq489xZo6ydnOIw2ETgl h4m/GTJRJ4ylhCZDz6F5nbcbiboj X-Google-Smtp-Source: AOwi7QDD6slQ5Kv/ZuQa3mbKeeDpQMFReRMHjRKacfKoCbW2JBovROoTsBnsYqwmrWOA0JSo3Ivlvg== X-Received: by 10.25.35.1 with SMTP id j1mr4529047lfj.178.1507151186219; Wed, 04 Oct 2017 14:06:26 -0700 (PDT) Received: from x-wing (87-206-70-245.dynamic.chello.pl. [87.206.70.245]) by smtp.gmail.com with ESMTPSA id d21sm2591491lfj.16.2017.10.04.14.06.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Oct 2017 14:06:25 -0700 (PDT) Sender: Mariusz Zaborski Date: Wed, 4 Oct 2017 23:07:51 +0200 From: Mariusz Zaborski To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323866 - in head: contrib/tcpdump contrib/traceroute sbin/ping usr.bin/kdump usr.sbin/tcpdump/tcpdump usr.sbin/traceroute Message-ID: <20171004210751.GA70157@x-wing> References: <201709211441.v8LEfg1w082237@repo.freebsd.org> <20170925202555.GV1055@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20170925202555.GV1055@FreeBSD.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 21:06:28 -0000 On Mon, Sep 25, 2017 at 01:25:55PM -0700, Gleb Smirnoff wrote: > Mariusz, >=20 > On Thu, Sep 21, 2017 at 02:41:42PM +0000, Mariusz Zaborski wrote: > M> Author: oshogbo > M> Date: Thu Sep 21 14:41:41 2017 > M> New Revision: 323866 > M> URL: https://svnweb.freebsd.org/changeset/base/323866 > M>=20 > M> Log: > M> We use a few different ifdef's names to check if we are using Casper= or not, > M> let's standardize this. Now we are always use WITH_CASPER name. >=20 > Before this change we had some change to upstream the tcpdump patch, > now we don't, since the define violates internal tcpdump style. >=20 > As person who did previous tcpdump import and spent some time upstreaming > patches, I would ask to backout the tcpdump part of this commit. >=20 Done. r324287. Sorry for keep you waiting. --=20 Mariusz Zaborski oshogbo//vx | http://oshogbo.vexillium.org FreeBSD commiter | https://freebsd.org Software developer | http://wheelsystems.com If it's not broken, let's fix it till it is!!1 From owner-svn-src-head@freebsd.org Wed Oct 4 21:15:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B40FE42EDC; Wed, 4 Oct 2017 21:15:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18DA7727EE; Wed, 4 Oct 2017 21:15:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v94LFjdp050068; Wed, 4 Oct 2017 21:15:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v94LFjp4050067; Wed, 4 Oct 2017 21:15:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201710042115.v94LFjp4050067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 4 Oct 2017 21:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324288 - head/sys/crypto/aesni X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/crypto/aesni X-SVN-Commit-Revision: 324288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 21:15:46 -0000 Author: cem Date: Wed Oct 4 21:15:45 2017 New Revision: 324288 URL: https://svnweb.freebsd.org/changeset/base/324288 Log: aesni(4): CRYPTO_AES_NIST_GCM_16 mandates MAC Remove some dead conditionals and add an assertion around behavior already present in aesni_process(). Silence a few Coverity false positives. CIDs: 1381571, 1381557 Sponsored by: Dell EMC Isilon Modified: head/sys/crypto/aesni/aesni.c Modified: head/sys/crypto/aesni/aesni.c ============================================================================== --- head/sys/crypto/aesni/aesni.c Wed Oct 4 21:05:44 2017 (r324287) +++ head/sys/crypto/aesni/aesni.c Wed Oct 4 21:15:45 2017 (r324288) @@ -773,12 +773,15 @@ aesni_cipher_crypt(struct aesni_session *ses, struct c int error, ivlen; bool encflag, allocated, authallocated; + KASSERT(ses->algo != CRYPTO_AES_NIST_GCM_16 || authcrd != NULL, + ("AES_NIST_GCM_16 must include MAC descriptor")); + buf = aesni_cipher_alloc(enccrd, crp, &allocated); if (buf == NULL) return (ENOMEM); authallocated = false; - if (ses->algo == CRYPTO_AES_NIST_GCM_16 && authcrd != NULL) { + if (ses->algo == CRYPTO_AES_NIST_GCM_16) { authbuf = aesni_cipher_alloc(authcrd, crp, &authallocated); if (authbuf == NULL) { error = ENOMEM; @@ -851,7 +854,7 @@ aesni_cipher_crypt(struct aesni_session *ses, struct c iv); break; case CRYPTO_AES_NIST_GCM_16: - if (authcrd != NULL && !encflag) + if (!encflag) crypto_copydata(crp->crp_flags, crp->crp_buf, authcrd->crd_inject, GMAC_DIGEST_LEN, tag); else From owner-svn-src-head@freebsd.org Wed Oct 4 22:55:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C46A2E0DE63; Wed, 4 Oct 2017 22:55:31 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9239575680; Wed, 4 Oct 2017 22:55:31 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v94MtUGL093659; Wed, 4 Oct 2017 22:55:30 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v94MtUM7093658; Wed, 4 Oct 2017 22:55:30 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201710042255.v94MtUM7093658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 4 Oct 2017 22:55:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324289 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 324289 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 22:55:31 -0000 Author: rmacklem Date: Wed Oct 4 22:55:30 2017 New Revision: 324289 URL: https://svnweb.freebsd.org/changeset/base/324289 Log: Add a few definitions for the Flex File Layout. This patch adds a few definitions for the Flex File Layout. Until a future commit adds Flex File layout support, these new fields are not used. This patch should not affect the "pnfs" option for File Layout. Modified: head/sys/fs/nfs/nfsproto.h Modified: head/sys/fs/nfs/nfsproto.h ============================================================================== --- head/sys/fs/nfs/nfsproto.h Wed Oct 4 21:15:45 2017 (r324288) +++ head/sys/fs/nfs/nfsproto.h Wed Oct 4 22:55:30 2017 (r324289) @@ -637,6 +637,7 @@ #define NFSLAYOUT_NFSV4_1_FILES 0x1 #define NFSLAYOUT_OSD2_OBJECTS 0x2 #define NFSLAYOUT_BLOCK_VOLUME 0x3 +#define NFSLAYOUT_FLEXFILE 0x4 #define NFSLAYOUTIOMODE_READ 1 #define NFSLAYOUTIOMODE_RW 2 @@ -649,6 +650,12 @@ /* Flags for File Layout. */ #define NFSFLAYUTIL_DENSE 0x1 #define NFSFLAYUTIL_COMMIT_THRU_MDS 0x2 + +/* Flags for Flex File Layout. */ +#define NFSFLEXFLAG_NO_LAYOUTCOMMIT 0x00000001 +#define NFSFLEXFLAG_NOIO_MDS 0x00000002 +#define NFSFLEXFLAG_NO_READIO 0x00000004 +#define NFSFLEXFLAG_WRITE_ONEMIRROR 0x00000008 /* Conversion macros */ #define vtonfsv2_mode(t,m) \ From owner-svn-src-head@freebsd.org Wed Oct 4 23:03:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC491E231AC; Wed, 4 Oct 2017 23:03:10 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9C3675C9B; Wed, 4 Oct 2017 23:03:10 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v94N39P9098069; Wed, 4 Oct 2017 23:03:09 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v94N39rY098067; Wed, 4 Oct 2017 23:03:09 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201710042303.v94N39rY098067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 4 Oct 2017 23:03:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324290 - head/sys/dev/qlxgbe X-SVN-Group: head X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: head/sys/dev/qlxgbe X-SVN-Commit-Revision: 324290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 23:03:11 -0000 Author: davidcs Date: Wed Oct 4 23:03:09 2017 New Revision: 324290 URL: https://svnweb.freebsd.org/changeset/base/324290 Log: Add sanity checks in ql_hw_send() qla_send() to ensure that empty slots in Tx Ring map to empty slot in Tx_buf array before Transmits. If the checks fail further Transmission on that Tx Ring is prevented. Modified: head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- head/sys/dev/qlxgbe/ql_hw.c Wed Oct 4 22:55:30 2017 (r324289) +++ head/sys/dev/qlxgbe/ql_hw.c Wed Oct 4 23:03:09 2017 (r324290) @@ -2374,6 +2374,16 @@ ql_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, in } } + for (i = 0; i < num_tx_cmds; i++) { + if (NULL != ha->tx_ring[txr_idx].tx_buf[(tx_idx+i)].m_head) { + QL_ASSERT(ha, 0, \ + ("%s: txr_idx = %d tx_idx = %d mbuf = %p\n",\ + __func__, txr_idx, (tx_idx+i),\ + ha->tx_ring[txr_idx].tx_buf[(tx_idx+i)].m_head)); + return (EINVAL); + } + } + tx_cmd = &hw->tx_cntxt[txr_idx].tx_ring_base[tx_idx]; if (!(mp->m_pkthdr.csum_flags & CSUM_TSO)) { Modified: head/sys/dev/qlxgbe/ql_os.c ============================================================================== --- head/sys/dev/qlxgbe/ql_os.c Wed Oct 4 22:55:30 2017 (r324289) +++ head/sys/dev/qlxgbe/ql_os.c Wed Oct 4 23:03:09 2017 (r324290) @@ -1232,6 +1232,17 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32 QL_DPRINT8(ha, (ha->pci_dev, "%s: enter\n", __func__)); tx_idx = ha->hw.tx_cntxt[txr_idx].txr_next; + + if (NULL != ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head) { + QL_ASSERT(ha, 0, ("%s: txr_idx = %d tx_idx = %d mbuf = %p\n",\ + __func__, txr_idx, tx_idx,\ + ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head)); + if (m_head) + m_freem(m_head); + *m_headp = NULL; + return (ret); + } + map = ha->tx_ring[txr_idx].tx_buf[tx_idx].map; ret = bus_dmamap_load_mbuf_sg(ha->tx_tag, map, m_head, segs, &nsegs, From owner-svn-src-head@freebsd.org Wed Oct 4 23:35:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65444E23A77; Wed, 4 Oct 2017 23:35:11 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F58C76A0D; Wed, 4 Oct 2017 23:35:11 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v94NZAYT011888; Wed, 4 Oct 2017 23:35:10 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v94NZAgt011886; Wed, 4 Oct 2017 23:35:10 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201710042335.v94NZAgt011886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 4 Oct 2017 23:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324291 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 324291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Oct 2017 23:35:11 -0000 Author: cem Date: Wed Oct 4 23:35:10 2017 New Revision: 324291 URL: https://svnweb.freebsd.org/changeset/base/324291 Log: hwpmc(4): Add support for extended AMD events Sponsored by: Dell EMC Isilon Modified: head/sys/dev/hwpmc/hwpmc_amd.c head/sys/dev/hwpmc/hwpmc_amd.h Modified: head/sys/dev/hwpmc/hwpmc_amd.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_amd.c Wed Oct 4 23:03:09 2017 (r324290) +++ head/sys/dev/hwpmc/hwpmc_amd.c Wed Oct 4 23:35:10 2017 (r324291) @@ -108,7 +108,7 @@ static struct amd_descr amd_pmcdesc[AMD_NPMCS] = struct amd_event_code_map { enum pmc_event pe_ev; /* enum value */ - uint8_t pe_code; /* encoded event mask */ + uint16_t pe_code; /* encoded event mask */ uint8_t pe_mask; /* bits allowed in unit mask */ }; Modified: head/sys/dev/hwpmc/hwpmc_amd.h ============================================================================== --- head/sys/dev/hwpmc/hwpmc_amd.h Wed Oct 4 23:03:09 2017 (r324290) +++ head/sys/dev/hwpmc/hwpmc_amd.h Wed Oct 4 23:35:10 2017 (r324291) @@ -64,10 +64,10 @@ #define AMD_PMC_UNITMASK_MOESI 0x1F #define AMD_PMC_UNITMASK 0xFF00 -#define AMD_PMC_EVENTMASK 0x00FF +#define AMD_PMC_EVENTMASK 0xF000000FF #define AMD_PMC_TO_UNITMASK(x) (((x) << 8) & AMD_PMC_UNITMASK) -#define AMD_PMC_TO_EVENTMASK(x) ((x) & 0xFF) +#define AMD_PMC_TO_EVENTMASK(x) (((x) & 0xFF) | (((x) & 0xF00) << 24)) #define AMD_VALID_BITS (AMD_PMC_COUNTERMASK | AMD_PMC_INVERT | \ AMD_PMC_ENABLE | AMD_PMC_INT | AMD_PMC_PC | AMD_PMC_EDGE | \ AMD_PMC_OS | AMD_PMC_USR | AMD_PMC_UNITMASK | AMD_PMC_EVENTMASK) From owner-svn-src-head@freebsd.org Thu Oct 5 06:30:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2004E2E0A0; Thu, 5 Oct 2017 06:30:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 4389623E8; Thu, 5 Oct 2017 06:30:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA17538; Thu, 05 Oct 2017 09:30:24 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1dzzfs-000LyI-04; Thu, 05 Oct 2017 09:30:24 +0300 Subject: Re: svn commit: r324178 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua From: Andriy Gapon To: Ed Maste Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201710012012.v91KCUvU024559@repo.freebsd.org> <73fc56c3-2a00-44a4-9d3c-5ff77053ddf6@FreeBSD.org> Message-ID: <1daf8629-7c80-5b43-3d8e-31a925b44538@FreeBSD.org> Date: Thu, 5 Oct 2017 09:29:27 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <73fc56c3-2a00-44a4-9d3c-5ff77053ddf6@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 06:30:27 -0000 On 04/10/2017 23:29, Andriy Gapon wrote: > On 04/10/2017 23:08, Ed Maste wrote: >> On 1 October 2017 at 22:12, Andriy Gapon wrote: >>> >>> Author: avg >>> Date: Sun Oct 1 20:12:30 2017 >>> New Revision: 324178 >>> URL: https://svnweb.freebsd.org/changeset/base/324178 >>> >>> Log: >>> unbreak kernel builds on sparc64 and powerpc after r324163, ZFS Channel Programs >> >> Seems this is still broken on sparc64: >> https://ci.freebsd.org/job/FreeBSD-head-powerpc64-build/1443/console > > That's really puzzling because I specifically tested the fix on sparc64 before > committing and it worked. > > Oh, I see, you meant powerpc64... Now I see where I tripped. The code built fine on sparc64 and powerpc does not build ZFS at all and powerpc64 (with char unsigned) kept failing. I am going to commit a platform independent fix soon. -- Andriy Gapon From owner-svn-src-head@freebsd.org Thu Oct 5 06:39:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB43EE2E3FC; Thu, 5 Oct 2017 06:39:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F0AF2A88; Thu, 5 Oct 2017 06:39:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v956dve3091548; Thu, 5 Oct 2017 06:39:57 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v956dvvK091547; Thu, 5 Oct 2017 06:39:57 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710050639.v956dvvK091547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 5 Oct 2017 06:39:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324292 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua X-SVN-Commit-Revision: 324292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 06:39:58 -0000 Author: avg Date: Thu Oct 5 06:39:57 2017 New Revision: 324292 URL: https://svnweb.freebsd.org/changeset/base/324292 Log: really unbreak kernel builds on sparc64 and powerpc64 after r324163, ZFS Channel Programs This commit also reverts r324178 that did not fix the problem on powerpc64 where char is usigned. MFC after: 4 weeks X-MFC with: r324163 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c Wed Oct 4 23:35:10 2017 (r324291) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c Thu Oct 5 06:39:57 2017 (r324292) @@ -35,10 +35,11 @@ #ifdef illumos #define tolower(C) (((C) >= 'A' && (C) <= 'Z') ? (C) - 'A' + 'a' : (C)) #define toupper(C) (((C) >= 'a' && (C) <= 'z') ? (C) - 'a' + 'A': (C)) +#define iscntrl(C) ((((C) >= 0) && ((C) <= 0x1f)) || ((C) == 0x7f)) #else #define isalnum(C) (isalpha(C) || isdigit(C)) +#define iscntrl(C) (uchar(C) <= 0x1f || uchar(C) == 0x7f) #endif -#define iscntrl(C) ((((C) >= 0) && ((C) <= 0x1f)) || ((C) == 0x7f)) #define isgraph(C) ((C) >= 0x21 && (C) <= 0x7E) #define ispunct(C) (((C) >= 0x21 && (C) <= 0x2F) || \ ((C) >= 0x3A && (C) <= 0x40) || \ @@ -867,7 +868,7 @@ static void addquoted (lua_State *L, luaL_Buffer *b, i luaL_addchar(b, '\\'); luaL_addchar(b, *s); } - else if (*s == '\0' || iscntrl(*s)) { + else if (*s == '\0' || iscntrl(uchar(*s))) { char buff[10]; if (!isdigit(uchar(*(s+1)))) sprintf(buff, "\\%d", (int)uchar(*s)); From owner-svn-src-head@freebsd.org Thu Oct 5 07:18:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85032E2F113; Thu, 5 Oct 2017 07:18:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5ECCF632B9; Thu, 5 Oct 2017 07:18:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v957IHDN008264; Thu, 5 Oct 2017 07:18:17 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v957IH0x008260; Thu, 5 Oct 2017 07:18:17 GMT (envelope-from np@FreeBSD.org) Message-Id: <201710050718.v957IH0x008260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 5 Oct 2017 07:18:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324296 - in head: share/man/man4 sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/cxgbe X-SVN-Commit-Revision: 324296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 07:18:18 -0000 Author: np Date: Thu Oct 5 07:18:16 2017 New Revision: 324296 URL: https://svnweb.freebsd.org/changeset/base/324296 Log: cxgbe(4): Provide knobs to set the holdoff parameters of TOE rx queues separately from NIC rx queues instead of using the same parameters for both types of queues. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/share/man/man4/cxgbe.4 head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c Modified: head/share/man/man4/cxgbe.4 ============================================================================== --- head/share/man/man4/cxgbe.4 Thu Oct 5 07:16:31 2017 (r324295) +++ head/share/man/man4/cxgbe.4 Thu Oct 5 07:18:16 2017 (r324296) @@ -215,23 +215,27 @@ for rx and tx as well an additional pair of queues for The default is 1. .It Va hw.cxgbe.holdoff_timer_idx_10G .It Va hw.cxgbe.holdoff_timer_idx_1G +.It Va hw.cxgbe.holdoff_timer_idx_ofld Timer index value used to delay interrupts. The holdoff timer list has the values 1, 5, 10, 50, 100, and 200 by default (all values are in microseconds) and the index selects a value from this list. +holdoff_timer_idx_ofld applies to queues used for TOE rx. The default value is 1 which means the timer value is 5us. Different interfaces can be assigned different values at any time via the -dev..X.holdoff_tmr_idx sysctl. +dev..X.holdoff_tmr_idx and dev..X.holdoff_tmr_idx_ofld sysctls. .It Va hw.cxgbe.holdoff_pktc_idx_10G .It Va hw.cxgbe.holdoff_pktc_idx_1G +.It Va hw.cxgbe.holdoff_pktc_idx_ofld Packet-count index value used to delay interrupts. The packet-count list has the values 1, 8, 16, and 32 by default, and the index selects a value from this list. +holdoff_pktc_idx_ofld applies to queues used for TOE rx. The default value is -1 which means packet counting is disabled and interrupts are generated based solely on the holdoff timer value. Different interfaces can be assigned different values via the -dev..X.holdoff_pktc_idx sysctl. -This sysctl works only when the interface has never been marked up (as done by +dev..X.holdoff_pktc_idx and dev..X.holdoff_pktc_idx_ofld sysctls. +These sysctls work only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_txq Number of entries in a transmit queue's descriptor ring. Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Oct 5 07:16:31 2017 (r324295) +++ head/sys/dev/cxgbe/adapter.h Thu Oct 5 07:18:16 2017 (r324296) @@ -219,7 +219,9 @@ struct vi_info { int nnmrxq; int first_nm_rxq; int tmr_idx; + int ofld_tmr_idx; int pktc_idx; + int ofld_pktc_idx; int qsize_rxq; int qsize_txq; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Oct 5 07:16:31 2017 (r324295) +++ head/sys/dev/cxgbe/t4_main.c Thu Oct 5 07:18:16 2017 (r324296) @@ -295,6 +295,14 @@ TUNABLE_INT("hw.cxgbe.nofldtxq_vi", &t4_nofldtxq_vi); static int t4_nofldrxq_vi = -NOFLDRXQ_VI; TUNABLE_INT("hw.cxgbe.nofldrxq_vi", &t4_nofldrxq_vi); +#define TMR_IDX_OFLD 1 +int t4_tmr_idx_ofld = TMR_IDX_OFLD; +TUNABLE_INT("hw.cxgbe.holdoff_timer_idx_ofld", &t4_tmr_idx_ofld); + +#define PKTC_IDX_OFLD (-1) +int t4_pktc_idx_ofld = PKTC_IDX_OFLD; +TUNABLE_INT("hw.cxgbe.holdoff_pktc_idx_ofld", &t4_pktc_idx_ofld); + /* 0 means chip/fw default, non-zero number is value in microseconds */ static u_long t4_toe_keepalive_idle = 0; TUNABLE_ULONG("hw.cxgbe.toe.keepalive_idle", &t4_toe_keepalive_idle); @@ -600,6 +608,8 @@ static int sysctl_tp_dack_timer(SYSCTL_HANDLER_ARGS); static int sysctl_tp_timer(SYSCTL_HANDLER_ARGS); static int sysctl_tp_shift_cnt(SYSCTL_HANDLER_ARGS); static int sysctl_tp_backoff(SYSCTL_HANDLER_ARGS); +static int sysctl_holdoff_tmr_idx_ofld(SYSCTL_HANDLER_ARGS); +static int sysctl_holdoff_pktc_idx_ofld(SYSCTL_HANDLER_ARGS); #endif static uint32_t fconf_iconf_to_mode(uint32_t, uint32_t); static uint32_t mode_to_fconf(uint32_t); @@ -1182,6 +1192,8 @@ t4_attach(device_t dev) vi->rsrv_noflowq = 0; #ifdef TCP_OFFLOAD + vi->ofld_tmr_idx = t4_tmr_idx_ofld; + vi->ofld_pktc_idx = t4_pktc_idx_ofld; vi->first_ofld_rxq = ofld_rqidx; vi->first_ofld_txq = ofld_tqidx; if (port_top_speed(pi) >= 10) { @@ -5579,6 +5591,14 @@ vi_sysctls(struct vi_info *vi) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_ofld_txq", CTLFLAG_RD, &vi->first_ofld_txq, 0, "index of first TOE tx queue"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_tmr_idx_ofld", + CTLTYPE_INT | CTLFLAG_RW, vi, 0, + sysctl_holdoff_tmr_idx_ofld, "I", + "holdoff timer index for TOE queues"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_pktc_idx_ofld", + CTLTYPE_INT | CTLFLAG_RW, vi, 0, + sysctl_holdoff_pktc_idx_ofld, "I", + "holdoff packet counter index for TOE queues"); } #endif #ifdef DEV_NETMAP @@ -5929,9 +5949,6 @@ sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS) struct adapter *sc = vi->pi->adapter; int idx, rc, i; struct sge_rxq *rxq; -#ifdef TCP_OFFLOAD - struct sge_ofld_rxq *ofld_rxq; -#endif uint8_t v; idx = vi->tmr_idx; @@ -5956,15 +5973,6 @@ sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS) rxq->iq.intr_params = v; #endif } -#ifdef TCP_OFFLOAD - for_each_ofld_rxq(vi, i, ofld_rxq) { -#ifdef atomic_store_rel_8 - atomic_store_rel_8(&ofld_rxq->iq.intr_params, v); -#else - ofld_rxq->iq.intr_params = v; -#endif - } -#endif vi->tmr_idx = idx; end_synchronized_op(sc, LOCK_HELD); @@ -8380,8 +8388,75 @@ sysctl_tp_backoff(SYSCTL_HANDLER_ARGS) return (sysctl_handle_int(oidp, &v, 0, req)); } + +static int +sysctl_holdoff_tmr_idx_ofld(SYSCTL_HANDLER_ARGS) +{ + struct vi_info *vi = arg1; + struct adapter *sc = vi->pi->adapter; + int idx, rc, i; + struct sge_ofld_rxq *ofld_rxq; + uint8_t v; + + idx = vi->ofld_tmr_idx; + + rc = sysctl_handle_int(oidp, &idx, 0, req); + if (rc != 0 || req->newptr == NULL) + return (rc); + + if (idx < 0 || idx >= SGE_NTIMERS) + return (EINVAL); + + rc = begin_synchronized_op(sc, vi, HOLD_LOCK | SLEEP_OK | INTR_OK, + "t4otmr"); + if (rc) + return (rc); + + v = V_QINTR_TIMER_IDX(idx) | V_QINTR_CNT_EN(vi->ofld_pktc_idx != -1); + for_each_ofld_rxq(vi, i, ofld_rxq) { +#ifdef atomic_store_rel_8 + atomic_store_rel_8(&ofld_rxq->iq.intr_params, v); +#else + ofld_rxq->iq.intr_params = v; #endif + } + vi->ofld_tmr_idx = idx; + end_synchronized_op(sc, LOCK_HELD); + return (0); +} + +static int +sysctl_holdoff_pktc_idx_ofld(SYSCTL_HANDLER_ARGS) +{ + struct vi_info *vi = arg1; + struct adapter *sc = vi->pi->adapter; + int idx, rc; + + idx = vi->ofld_pktc_idx; + + rc = sysctl_handle_int(oidp, &idx, 0, req); + if (rc != 0 || req->newptr == NULL) + return (rc); + + if (idx < -1 || idx >= SGE_NCOUNTERS) + return (EINVAL); + + rc = begin_synchronized_op(sc, vi, HOLD_LOCK | SLEEP_OK | INTR_OK, + "t4opktc"); + if (rc) + return (rc); + + if (vi->flags & VI_INIT_DONE) + rc = EBUSY; /* cannot be changed once the queues are created */ + else + vi->ofld_pktc_idx = idx; + + end_synchronized_op(sc, LOCK_HELD); + return (rc); +} +#endif + static uint32_t fconf_iconf_to_mode(uint32_t fconf, uint32_t iconf) { @@ -9908,6 +9983,12 @@ tweak_tunables(void) FW_CAPS_CONFIG_ISCSI_TARGET_PDU | FW_CAPS_CONFIG_ISCSI_T10DIF; } + + if (t4_tmr_idx_ofld < 0 || t4_tmr_idx_ofld >= SGE_NTIMERS) + t4_tmr_idx_ofld = TMR_IDX_OFLD; + + if (t4_pktc_idx_ofld < -1 || t4_pktc_idx_ofld >= SGE_NCOUNTERS) + t4_pktc_idx_ofld = PKTC_IDX_OFLD; #else if (t4_toecaps_allowed == -1) t4_toecaps_allowed = 0; Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Oct 5 07:16:31 2017 (r324295) +++ head/sys/dev/cxgbe/t4_sge.c Thu Oct 5 07:18:16 2017 (r324296) @@ -1138,7 +1138,7 @@ t4_setup_vi_queues(struct vi_info *vi) } for_each_ofld_rxq(vi, i, ofld_rxq) { - init_iq(&ofld_rxq->iq, sc, vi->tmr_idx, vi->pktc_idx, + init_iq(&ofld_rxq->iq, sc, vi->ofld_tmr_idx, vi->ofld_pktc_idx, vi->qsize_rxq); snprintf(name, sizeof(name), "%s ofld_rxq%d-fl", From owner-svn-src-head@freebsd.org Thu Oct 5 11:34:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FDACE35937; Thu, 5 Oct 2017 11:34:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6560A6C8BB; Thu, 5 Oct 2017 11:34:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95BYpcg018346; Thu, 5 Oct 2017 11:34:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95BYp6Y018345; Thu, 5 Oct 2017 11:34:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710051134.v95BYp6Y018345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Oct 2017 11:34:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324301 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 324301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 11:34:52 -0000 Author: kib Date: Thu Oct 5 11:34:51 2017 New Revision: 324301 URL: https://svnweb.freebsd.org/changeset/base/324301 Log: Update comment to note that we skip LDT reload for kthreads as well. Noted by: bde Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/amd64/amd64/cpu_switch.S Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Thu Oct 5 11:01:19 2017 (r324300) +++ head/sys/amd64/amd64/cpu_switch.S Thu Oct 5 11:34:51 2017 (r324301) @@ -172,7 +172,7 @@ sw1: * to load up the rest of the next context. */ - /* Skip loading user fsbase/gsbase for kthreads */ + /* Skip loading LDT and user fsbase/gsbase for kthreads */ testl $TDP_KTHREAD,TD_PFLAGS(%r12) jnz do_kthread From owner-svn-src-head@freebsd.org Thu Oct 5 11:36:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44753E359E3; Thu, 5 Oct 2017 11:36:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 125996CAA0; Thu, 5 Oct 2017 11:36:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95BatSB018482; Thu, 5 Oct 2017 11:36:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95Bat8Z018481; Thu, 5 Oct 2017 11:36:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710051136.v95Bat8Z018481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Oct 2017 11:36:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324302 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 324302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 11:36:56 -0000 Author: kib Date: Thu Oct 5 11:36:55 2017 New Revision: 324302 URL: https://svnweb.freebsd.org/changeset/base/324302 Log: Reduce default max_ldt_segment value to 512. This makes the LDT to use only one page with default settings, avoiding the need to find contigous 2 pages in KVA. It seems that most users are fine even with 512 segments. Discussed with: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Thu Oct 5 11:34:51 2017 (r324301) +++ head/sys/amd64/amd64/sys_machdep.c Thu Oct 5 11:36:55 2017 (r324302) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); #define MAX_LD 8192 -int max_ldt_segment = 1024; +int max_ldt_segment = 512; SYSCTL_INT(_machdep, OID_AUTO, max_ldt_segment, CTLFLAG_RDTUN, &max_ldt_segment, 0, "Maximum number of allowed LDT segments in the single address space"); From owner-svn-src-head@freebsd.org Thu Oct 5 11:50:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79867E35FAF; Thu, 5 Oct 2017 11:50:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43B216D3B5; Thu, 5 Oct 2017 11:50:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95Bo191023272; Thu, 5 Oct 2017 11:50:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95Bo1Hu023270; Thu, 5 Oct 2017 11:50:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710051150.v95Bo1Hu023270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Oct 2017 11:50:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324303 - in head/sys/amd64: amd64 include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/amd64: amd64 include X-SVN-Commit-Revision: 324303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 11:50:02 -0000 Author: kib Date: Thu Oct 5 11:50:01 2017 New Revision: 324303 URL: https://svnweb.freebsd.org/changeset/base/324303 Log: On amd64, mark the set_user_ldt() function as static. On i386, the function is used from the context switch code and needs to be accessible externally. Amd64 MD context switch does not lock an LDT spinlock and inlines switching in assembly. Discussed with: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/sys_machdep.c head/sys/amd64/include/proc.h Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Thu Oct 5 11:36:55 2017 (r324302) +++ head/sys/amd64/amd64/sys_machdep.c Thu Oct 5 11:50:01 2017 (r324303) @@ -426,7 +426,7 @@ done: * Update the GDT entry pointing to the LDT to point to the LDT of the * current process. */ -void +static void set_user_ldt(struct mdproc *mdp) { Modified: head/sys/amd64/include/proc.h ============================================================================== --- head/sys/amd64/include/proc.h Thu Oct 5 11:36:55 2017 (r324302) +++ head/sys/amd64/include/proc.h Thu Oct 5 11:50:01 2017 (r324303) @@ -88,7 +88,6 @@ struct syscall_args { (char *)&td; \ } while (0) -void set_user_ldt(struct mdproc *); struct proc_ldt *user_ldt_alloc(struct proc *, int); void user_ldt_free(struct thread *); void user_ldt_deref(struct proc_ldt *); From owner-svn-src-head@freebsd.org Thu Oct 5 11:56:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73B1AE36201; Thu, 5 Oct 2017 11:56:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 418126D8EF; Thu, 5 Oct 2017 11:56:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95Bu4K0027341; Thu, 5 Oct 2017 11:56:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95Bu4PE027340; Thu, 5 Oct 2017 11:56:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710051156.v95Bu4PE027340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Oct 2017 11:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324304 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 324304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 11:56:05 -0000 Author: kib Date: Thu Oct 5 11:56:04 2017 New Revision: 324304 URL: https://svnweb.freebsd.org/changeset/base/324304 Log: Remove useless comments. Requested by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Thu Oct 5 11:50:01 2017 (r324303) +++ head/sys/amd64/amd64/sys_machdep.c Thu Oct 5 11:56:04 2017 (r324304) @@ -655,12 +655,7 @@ amd64_set_ldt(struct thread *td, struct i386_ldt_args case SDT_SYSNULL4: case SDT_SYSIGT: case SDT_SYSTGT: - /* I can't think of any reason to allow a user proc - * to create a segment of these types. They are - * for OS use only. - */ return (EACCES); - /*NOTREACHED*/ /* memory segment types */ case SDT_MEMEC: /* memory execute only conforming */ @@ -686,7 +681,6 @@ amd64_set_ldt(struct thread *td, struct i386_ldt_args break; default: return(EINVAL); - /*NOTREACHED*/ } /* Only user (ring-3) descriptors may be present. */ From owner-svn-src-head@freebsd.org Thu Oct 5 12:01:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19ADDE36A8E; Thu, 5 Oct 2017 12:01:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D80EE6DFFB; Thu, 5 Oct 2017 12:01:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95C1dPI029792; Thu, 5 Oct 2017 12:01:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95C1dFG029791; Thu, 5 Oct 2017 12:01:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710051201.v95C1dFG029791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Oct 2017 12:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324305 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 324305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 12:01:41 -0000 Author: kib Date: Thu Oct 5 12:01:39 2017 New Revision: 324305 URL: https://svnweb.freebsd.org/changeset/base/324305 Log: Correct format specifiers in the debug code. Requested by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Thu Oct 5 11:56:04 2017 (r324304) +++ head/sys/amd64/amd64/sys_machdep.c Thu Oct 5 12:01:39 2017 (r324305) @@ -558,7 +558,7 @@ amd64_get_ldt(td, uap) struct user_segment_descriptor *lp; #ifdef DEBUG - printf("amd64_get_ldt: start=%d num=%d descs=%p\n", + printf("amd64_get_ldt: start=%u num=%u descs=%p\n", uap->start, uap->num, (void *)uap->descs); #endif @@ -594,7 +594,7 @@ amd64_set_ldt(struct thread *td, struct i386_ldt_args unsigned int largest_ld, i; #ifdef DEBUG - printf("amd64_set_ldt: start=%d num=%d descs=%p\n", + printf("amd64_set_ldt: start=%u num=%u descs=%p\n", uap->start, uap->num, (void *)uap->descs); #endif mdp = &td->td_proc->p_md; From owner-svn-src-head@freebsd.org Thu Oct 5 12:07:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C92A9E36DF6; Thu, 5 Oct 2017 12:07:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 974986E334; Thu, 5 Oct 2017 12:07:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95C7ct0031481; Thu, 5 Oct 2017 12:07:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95C7cQY031480; Thu, 5 Oct 2017 12:07:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710051207.v95C7cQY031480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Oct 2017 12:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324306 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 324306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 12:07:39 -0000 Author: kib Date: Thu Oct 5 12:07:38 2017 New Revision: 324306 URL: https://svnweb.freebsd.org/changeset/base/324306 Log: Use ANSI C declaration for amd64_get_ldt(). Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Thu Oct 5 12:01:39 2017 (r324305) +++ head/sys/amd64/amd64/sys_machdep.c Thu Oct 5 12:07:38 2017 (r324306) @@ -548,9 +548,7 @@ user_ldt_deref(struct proc_ldt *pldt) * the OS-specific one. */ int -amd64_get_ldt(td, uap) - struct thread *td; - struct i386_ldt_args *uap; +amd64_get_ldt(struct thread *td, struct i386_ldt_args *uap) { int error = 0; struct proc_ldt *pldt; From owner-svn-src-head@freebsd.org Thu Oct 5 12:16:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0FD5E370E2; Thu, 5 Oct 2017 12:16:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E97F6E86D; Thu, 5 Oct 2017 12:16:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95CGjB9035746; Thu, 5 Oct 2017 12:16:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95CGjoe035745; Thu, 5 Oct 2017 12:16:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710051216.v95CGjoe035745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Oct 2017 12:16:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324307 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 324307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 12:16:46 -0000 Author: kib Date: Thu Oct 5 12:16:45 2017 New Revision: 324307 URL: https://svnweb.freebsd.org/changeset/base/324307 Log: Complete r323772 on amd64. Compilers are allowed to combine plain reads into group operations, e.g. 64bit element copies of one array into another can be legitimately optimized back to a memcpy() call, which r323772 tried to prevent. Qualify accesses to LDT descriptors with volatile dereference to ensure that each write indeed occurs. After that, our usual claim of native-size aligned writes being atomic applies. This is equivalent to atomic_store(memory_order_relaxed) C11 accesses, but our machine/atomic.h does not provide corresponding primitive. Noted and reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Thu Oct 5 12:07:38 2017 (r324306) +++ head/sys/amd64/amd64/sys_machdep.c Thu Oct 5 12:16:45 2017 (r324307) @@ -616,7 +616,7 @@ amd64_set_ldt(struct thread *td, struct i386_ldt_args return (EINVAL); mtx_lock(&dt_lock); for (i = uap->start; i < largest_ld; i++) - ((uint64_t *)(pldt->ldt_base))[i] = 0; + ((volatile uint64_t *)(pldt->ldt_base))[i] = 0; mtx_unlock(&dt_lock); return (0); } @@ -734,15 +734,15 @@ amd64_set_ldt_data(struct thread *td, int start, int n { struct mdproc *mdp; struct proc_ldt *pldt; - uint64_t *dst, *src; + volatile uint64_t *dst, *src; int i; mtx_assert(&dt_lock, MA_OWNED); mdp = &td->td_proc->p_md; pldt = mdp->md_ldt; - dst = (uint64_t *)(pldt->ldt_base); - src = (uint64_t *)descs; + dst = (volatile uint64_t *)(pldt->ldt_base); + src = (volatile uint64_t *)descs; for (i = 0; i < num; i++) dst[start + i] = src[i]; return (0); From owner-svn-src-head@freebsd.org Thu Oct 5 12:19:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EC89E3721E; Thu, 5 Oct 2017 12:19:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D23CD6EAE7; Thu, 5 Oct 2017 12:19:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95CJtQY035934; Thu, 5 Oct 2017 12:19:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95CJtBm035933; Thu, 5 Oct 2017 12:19:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710051219.v95CJtBm035933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Oct 2017 12:19:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324308 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 324308 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 12:19:57 -0000 Author: kib Date: Thu Oct 5 12:19:55 2017 New Revision: 324308 URL: https://svnweb.freebsd.org/changeset/base/324308 Log: Minor style fix. Requested by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Thu Oct 5 12:16:45 2017 (r324307) +++ head/sys/amd64/amd64/sys_machdep.c Thu Oct 5 12:19:55 2017 (r324308) @@ -588,8 +588,8 @@ amd64_set_ldt(struct thread *td, struct i386_ldt_args struct proc_ldt *pldt; struct user_segment_descriptor *dp; struct proc *p; + u_int largest_ld, i; int error; - unsigned int largest_ld, i; #ifdef DEBUG printf("amd64_set_ldt: start=%u num=%u descs=%p\n", From owner-svn-src-head@freebsd.org Thu Oct 5 12:25:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE620E37472; Thu, 5 Oct 2017 12:25:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D6DB6EF0D; Thu, 5 Oct 2017 12:25:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95CPI9x040071; Thu, 5 Oct 2017 12:25:18 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95CPIdM040070; Thu, 5 Oct 2017 12:25:18 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710051225.v95CPIdM040070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 5 Oct 2017 12:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324309 - head/sys/cddl/compat/opensolaris/kern X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/compat/opensolaris/kern X-SVN-Commit-Revision: 324309 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 12:25:19 -0000 Author: avg Date: Thu Oct 5 12:25:18 2017 New Revision: 324309 URL: https://svnweb.freebsd.org/changeset/base/324309 Log: remove heuristic error detection from ddi_strto*() Zero, _MIN and _MAX values can result from valid conversions. They don't necessarily imply any error. Since we do not have any reliable error signaling from libkern's strto*(), it's better to always assume success rather than to report an error when there is none. Reviewed by: tsoome MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12565 Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_sunddi.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_sunddi.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_sunddi.c Thu Oct 5 12:19:55 2017 (r324308) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_sunddi.c Thu Oct 5 12:25:18 2017 (r324309) @@ -41,10 +41,6 @@ ddi_strtol(const char *str, char **nptr, int base, lon { *result = strtol(str, nptr, base); - if (*result == 0) - return (EINVAL); - else if (*result == LONG_MIN || *result == LONG_MAX) - return (ERANGE); return (0); } @@ -58,10 +54,6 @@ ddi_strtoul(const char *str, char **nptr, int base, un } *result = strtoul(str, nptr, base); - if (*result == 0) - return (EINVAL); - else if (*result == ULONG_MAX) - return (ERANGE); return (0); } @@ -70,10 +62,6 @@ ddi_strtoull(const char *str, char **nptr, int base, u { *result = (unsigned long long)strtouq(str, nptr, base); - if (*result == 0) - return (EINVAL); - else if (*result == ULLONG_MAX) - return (ERANGE); return (0); } From owner-svn-src-head@freebsd.org Thu Oct 5 12:29:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A406E37611; Thu, 5 Oct 2017 12:29:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 199216F30B; Thu, 5 Oct 2017 12:29:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95CTZnT040463; Thu, 5 Oct 2017 12:29:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95CTZ03040462; Thu, 5 Oct 2017 12:29:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710051229.v95CTZ03040462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Oct 2017 12:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324310 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 324310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 12:29:36 -0000 Author: kib Date: Thu Oct 5 12:29:34 2017 New Revision: 324310 URL: https://svnweb.freebsd.org/changeset/base/324310 Log: Improve amd64_get_ldt(). Provide consistent snapshot of the requested descriptors by preventing other threads from modifying LDT while we fetch the data, lock dt_lock around the read. Copy the data into intermediate buffer, which is copied out after the lock is dropped. Use guaranteed atomic (aligned volatile) reads of the descriptors to use same-size atomic as CPU update to set A bit in the descriptor type field. Improve overflow checking for the descriptors range calculations and remove unneeded casts. Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Thu Oct 5 12:25:18 2017 (r324309) +++ head/sys/amd64/amd64/sys_machdep.c Thu Oct 5 12:29:34 2017 (r324310) @@ -550,34 +550,36 @@ user_ldt_deref(struct proc_ldt *pldt) int amd64_get_ldt(struct thread *td, struct i386_ldt_args *uap) { - int error = 0; struct proc_ldt *pldt; - int num; struct user_segment_descriptor *lp; + uint64_t *data; + u_int i, num; + int error; #ifdef DEBUG printf("amd64_get_ldt: start=%u num=%u descs=%p\n", uap->start, uap->num, (void *)uap->descs); #endif - if ((pldt = td->td_proc->p_md.md_ldt) != NULL) { - lp = &((struct user_segment_descriptor *)(pldt->ldt_base)) - [uap->start]; - num = min(uap->num, max_ldt_segment); - } else + if (uap->start >= max_ldt_segment) return (EINVAL); - - if ((uap->start > (unsigned int)max_ldt_segment) || - ((unsigned int)num > (unsigned int)max_ldt_segment) || - ((unsigned int)(uap->start + num) > (unsigned int)max_ldt_segment)) - return(EINVAL); - - error = copyout(lp, uap->descs, num * + num = min(uap->num, max_ldt_segment - uap->start); + pldt = td->td_proc->p_md.md_ldt; + if (pldt == NULL) + return (EINVAL); + lp = &((struct user_segment_descriptor *)(pldt->ldt_base))[uap->start]; + data = malloc(num * sizeof(struct user_segment_descriptor), M_TEMP, + M_WAITOK); + mtx_lock(&dt_lock); + for (i = 0; i < num; i++) + data[i] = ((volatile uint64_t *)lp)[i]; + mtx_unlock(&dt_lock); + error = copyout(data, uap->descs, num * sizeof(struct user_segment_descriptor)); - if (!error) + free(data, M_TEMP); + if (error == 0) td->td_retval[0] = num; - - return(error); + return (error); } int From owner-svn-src-head@freebsd.org Thu Oct 5 12:32:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34FE1E377CC; Thu, 5 Oct 2017 12:32:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB57B6F6AE; Thu, 5 Oct 2017 12:32:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95CWFEG043456; Thu, 5 Oct 2017 12:32:15 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95CWEng043453; Thu, 5 Oct 2017 12:32:14 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710051232.v95CWEng043453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 5 Oct 2017 12:32:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324311 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 324311 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 12:32:16 -0000 Author: avg Date: Thu Oct 5 12:32:14 2017 New Revision: 324311 URL: https://svnweb.freebsd.org/changeset/base/324311 Log: sysctl-s in a module should be accessible only when the module is initialized A sysctl can have a custom handler that may access data that is initialized via SYSINIT(9) or via a module event handler (also invoked via SYSINIT). Thus, it is not safe to allow access to the module's sysctl-s until the initialization is performed. Likewise, we should not allow access to teh sysctl-s after the module is uninitialized. The latter is easy to achieve by properly ordering linker_file_unregister_sysctls and linker_file_sysuninit. The former is not as easy for two reasons: - the initialization may depend on tunables which get set when sysctl-s are registered, so we need to set the tunables before running sysinit-s - the initialization may try to dynamically add more sysctl-s under statically defined sysctl nodes So, this change splits the sysctl setup into two phases. In the first phase the sysctl-s are registered as before but they are disabled and hidden from consumers. In the second phase, done after sysinit-s, normal access to the sysctl-s is enabled. The change should affect only dynamic module loading and unloading after the system boot-up. Nothing changes for sysctl-s compiled into the kernel and sysctl-s in preloaded modules. Discussed with: hselasky, ian, jhb Reviewed by: julian, kib MFC after: 2 weeks Sponsored by: Panzura Differential Revision: https://reviews.freebsd.org/D12545 Modified: head/sys/kern/kern_linker.c head/sys/kern/kern_sysctl.c head/sys/sys/sysctl.h Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Thu Oct 5 12:29:34 2017 (r324310) +++ head/sys/kern/kern_linker.c Thu Oct 5 12:32:14 2017 (r324311) @@ -288,7 +288,7 @@ linker_file_sysuninit(linker_file_t lf) } static void -linker_file_register_sysctls(linker_file_t lf) +linker_file_register_sysctls(linker_file_t lf, bool enable) { struct sysctl_oid **start, **stop, **oidp; @@ -303,8 +303,34 @@ linker_file_register_sysctls(linker_file_t lf) sx_xunlock(&kld_sx); sysctl_wlock(); + for (oidp = start; oidp < stop; oidp++) { + if (enable) + sysctl_register_oid(*oidp); + else + sysctl_register_disabled_oid(*oidp); + } + sysctl_wunlock(); + sx_xlock(&kld_sx); +} + +static void +linker_file_enable_sysctls(linker_file_t lf) +{ + struct sysctl_oid **start, **stop, **oidp; + + KLD_DPF(FILE, + ("linker_file_enable_sysctls: enable SYSCTLs for %s\n", + lf->filename)); + + sx_assert(&kld_sx, SA_XLOCKED); + + if (linker_file_lookup_set(lf, "sysctl_set", &start, &stop, NULL) != 0) + return; + + sx_xunlock(&kld_sx); + sysctl_wlock(); for (oidp = start; oidp < stop; oidp++) - sysctl_register_oid(*oidp); + sysctl_enable_oid(*oidp); sysctl_wunlock(); sx_xlock(&kld_sx); } @@ -430,7 +456,7 @@ linker_load_file(const char *filename, linker_file_t * return (error); } modules = !TAILQ_EMPTY(&lf->modules); - linker_file_register_sysctls(lf); + linker_file_register_sysctls(lf, false); linker_file_sysinit(lf); lf->flags |= LINKER_FILE_LINKED; @@ -443,6 +469,7 @@ linker_load_file(const char *filename, linker_file_t * linker_file_unload(lf, LINKER_UNLOAD_FORCE); return (ENOEXEC); } + linker_file_enable_sysctls(lf); EVENTHANDLER_INVOKE(kld_load, lf); *result = lf; return (0); @@ -692,8 +719,8 @@ linker_file_unload(linker_file_t file, int flags) */ if (file->flags & LINKER_FILE_LINKED) { file->flags &= ~LINKER_FILE_LINKED; - linker_file_sysuninit(file); linker_file_unregister_sysctls(file); + linker_file_sysuninit(file); } TAILQ_REMOVE(&linker_files, file, link); @@ -1642,7 +1669,7 @@ restart: if (linker_file_lookup_set(lf, "sysinit_set", &si_start, &si_stop, NULL) == 0) sysinit_add(si_start, si_stop); - linker_file_register_sysctls(lf); + linker_file_register_sysctls(lf, true); lf->flags |= LINKER_FILE_LINKED; continue; fail: Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Thu Oct 5 12:29:34 2017 (r324310) +++ head/sys/kern/kern_sysctl.c Thu Oct 5 12:32:14 2017 (r324311) @@ -510,6 +510,37 @@ retry: } void +sysctl_register_disabled_oid(struct sysctl_oid *oidp) +{ + + /* + * Mark the leaf as dormant if it's not to be immediately enabled. + * We do not disable nodes as they can be shared between modules + * and it is always safe to access a node. + */ + KASSERT((oidp->oid_kind & CTLFLAG_DORMANT) == 0, + ("internal flag is set in oid_kind")); + if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE) + oidp->oid_kind |= CTLFLAG_DORMANT; + sysctl_register_oid(oidp); +} + +void +sysctl_enable_oid(struct sysctl_oid *oidp) +{ + + SYSCTL_ASSERT_WLOCKED(); + if ((oidp->oid_kind & CTLTYPE) == CTLTYPE_NODE) { + KASSERT((oidp->oid_kind & CTLFLAG_DORMANT) == 0, + ("sysctl node is marked as dormant")); + return; + } + KASSERT((oidp->oid_kind & CTLFLAG_DORMANT) != 0, + ("enabling already enabled sysctl oid")); + oidp->oid_kind &= ~CTLFLAG_DORMANT; +} + +void sysctl_unregister_oid(struct sysctl_oid *oidp) { struct sysctl_oid *p; @@ -1057,7 +1088,7 @@ sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int *next = oidp->oid_number; *oidpp = oidp; - if (oidp->oid_kind & CTLFLAG_SKIP) + if ((oidp->oid_kind & (CTLFLAG_SKIP | CTLFLAG_DORMANT)) != 0) continue; if (!namelen) { @@ -1878,6 +1909,8 @@ sysctl_find_oid(int *name, u_int namelen, struct sysct } lsp = SYSCTL_CHILDREN(oid); } else if (indx == namelen) { + if ((oid->oid_kind & CTLFLAG_DORMANT) != 0) + return (ENOENT); *noid = oid; if (nindx != NULL) *nindx = indx; Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Thu Oct 5 12:29:34 2017 (r324310) +++ head/sys/sys/sysctl.h Thu Oct 5 12:32:14 2017 (r324311) @@ -83,6 +83,7 @@ struct ctlname { #define CTLFLAG_RD 0x80000000 /* Allow reads of variable */ #define CTLFLAG_WR 0x40000000 /* Allow writes to the variable */ #define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR) +#define CTLFLAG_DORMANT 0x20000000 /* This sysctl is not active yet */ #define CTLFLAG_ANYBODY 0x10000000 /* All users can set this var */ #define CTLFLAG_SECURE 0x08000000 /* Permit set only if securelevel<=0 */ #define CTLFLAG_PRISON 0x04000000 /* Prisoned roots can fiddle */ @@ -219,6 +220,8 @@ int sysctl_dpcpu_quad(SYSCTL_HANDLER_ARGS); * These functions are used to add/remove an oid from the mib. */ void sysctl_register_oid(struct sysctl_oid *oidp); +void sysctl_register_disabled_oid(struct sysctl_oid *oidp); +void sysctl_enable_oid(struct sysctl_oid *oidp); void sysctl_unregister_oid(struct sysctl_oid *oidp); /* Declare a static oid to allow child oids to be added to it. */ From owner-svn-src-head@freebsd.org Thu Oct 5 12:38:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DFC0E37B4E; Thu, 5 Oct 2017 12:38:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37A516FA68; Thu, 5 Oct 2017 12:38:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95CcQW3044606; Thu, 5 Oct 2017 12:38:26 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95CcQBd044605; Thu, 5 Oct 2017 12:38:26 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710051238.v95CcQBd044605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 5 Oct 2017 12:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324312 - head/etc/devd X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/etc/devd X-SVN-Commit-Revision: 324312 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 12:38:27 -0000 Author: avg Date: Thu Oct 5 12:38:26 2017 New Revision: 324312 URL: https://svnweb.freebsd.org/changeset/base/324312 Log: fix the misleading log facility used in devd/zfs.conf In general, the "kern" facility is reserved for the kernel use only. If a program specifies that facility, then it is silently converted to "user" facility. So, using logger -p kern.xxx was both misleading and non-specific. Thus, change the facility to local7, so that users can create more adequate syslogd configurations. While local0..local7 are documented as being for local use we already have several examples in the tree where they are used because none of the named facilities really fits. Approved by: asomers MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12420 Modified: head/etc/devd/zfs.conf Modified: head/etc/devd/zfs.conf ============================================================================== --- head/etc/devd/zfs.conf Thu Oct 5 12:32:14 2017 (r324311) +++ head/etc/devd/zfs.conf Thu Oct 5 12:38:26 2017 (r324312) @@ -5,73 +5,73 @@ notify 10 { match "system" "ZFS"; match "type" "fs.zfs.checksum"; - action "logger -p kern.warn -t ZFS 'checksum mismatch, zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size'"; + action "logger -p local7.warn -t ZFS 'checksum mismatch, zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size'"; }; notify 10 { match "system" "ZFS"; match "type" "fs.zfs.io"; - action "logger -p kern.warn -t ZFS 'vdev I/O failure, zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size error=$zio_err'"; + action "logger -p local7.warn -t ZFS 'vdev I/O failure, zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size error=$zio_err'"; }; notify 10 { match "system" "ZFS"; match "type" "fs.zfs.data"; - action "logger -p kern.warn -t ZFS 'pool I/O failure, zpool=$pool error=$zio_err'"; + action "logger -p local7.warn -t ZFS 'pool I/O failure, zpool=$pool error=$zio_err'"; }; notify 10 { match "system" "ZFS"; match "type" "fs.zfs.zpool"; - action "logger -p kern.err -t ZFS 'failed to load zpool $pool'"; + action "logger -p local7.err -t ZFS 'failed to load zpool $pool'"; }; notify 10 { match "system" "ZFS"; match "type" "fs.zfs.vdev\..*"; - action "logger -p kern.err -t ZFS 'vdev problem, zpool=$pool path=$vdev_path type=$type'"; + action "logger -p local7.err -t ZFS 'vdev problem, zpool=$pool path=$vdev_path type=$type'"; }; notify 10 { match "system" "ZFS"; match "type" "fs.zfs.io_failure"; - action "logger -p kern.alert -t ZFS 'catastrophic pool I/O failure, zpool=$pool'"; + action "logger -p local7.alert -t ZFS 'catastrophic pool I/O failure, zpool=$pool'"; }; notify 10 { match "system" "ZFS"; match "type" "fs.zfs.probe_failure"; - action "logger -p kern.err -t ZFS 'vdev probe failure, zpool=$pool path=$vdev_path'"; + action "logger -p local7.err -t ZFS 'vdev probe failure, zpool=$pool path=$vdev_path'"; }; notify 10 { match "system" "ZFS"; match "type" "fs.zfs.log_replay"; - action "logger -p kern.err -t ZFS 'pool log replay failure, zpool=$pool'"; + action "logger -p local7.err -t ZFS 'pool log replay failure, zpool=$pool'"; }; notify 10 { match "system" "ZFS"; match "type" "fs.zfs.config_cache_write"; - action "logger -p kern.warn -t ZFS 'failed to write zpool.cache, zpool=$pool'"; + action "logger -p local7.warn -t ZFS 'failed to write zpool.cache, zpool=$pool'"; }; notify 10 { match "system" "ZFS"; match "type" "resource.fs.zfs.removed"; - action "logger -p kern.notice -t ZFS 'vdev is removed, pool_guid=$pool_guid vdev_guid=$vdev_guid'"; + action "logger -p local7.notice -t ZFS 'vdev is removed, pool_guid=$pool_guid vdev_guid=$vdev_guid'"; }; notify 10 { match "system" "ZFS"; match "type" "resource.fs.zfs.autoreplace"; - action "logger -p kern.info -t ZFS 'autoreplace is configured for vdev, pool_guid=$pool_guid vdev_guid=$vdev_guid'"; + action "logger -p local7.info -t ZFS 'autoreplace is configured for vdev, pool_guid=$pool_guid vdev_guid=$vdev_guid'"; }; notify 10 { match "system" "ZFS"; match "type" "resource.fs.zfs.statechange"; - action "logger -p kern.notice -t ZFS 'vdev state changed, pool_guid=$pool_guid vdev_guid=$vdev_guid'"; + action "logger -p local7.notice -t ZFS 'vdev state changed, pool_guid=$pool_guid vdev_guid=$vdev_guid'"; }; From owner-svn-src-head@freebsd.org Thu Oct 5 12:50:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88CFEE37F96; Thu, 5 Oct 2017 12:50:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BEBF701CE; Thu, 5 Oct 2017 12:50:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95Co35a048932; Thu, 5 Oct 2017 12:50:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95Co31e048931; Thu, 5 Oct 2017 12:50:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710051250.v95Co31e048931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Oct 2017 12:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324313 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 324313 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 12:50:04 -0000 Author: kib Date: Thu Oct 5 12:50:03 2017 New Revision: 324313 URL: https://svnweb.freebsd.org/changeset/base/324313 Log: Avoid a race betweem freeing LDT and context switches. cpu_switch.S uses curproc->p_md.md_ldt value as the flag indicating presence of the process LDT. The flag is checked and then ldt segment descriptor is copied into the CPU' GDT slot. Disallow context switches around clearing of the curproc LDT state by performing the cleanup in critical section. Ensure that the md_ldt flag is cleared before md_ldt_sd descriptor content is destroyed by inserting fence between the operations. We depend on the x86 memory model strong ordering guarantees, in particular, that cpu_switch.S observes the writes to md_ldt and md_ldt_sd in the expected order. Discussed with: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Thu Oct 5 12:38:26 2017 (r324312) +++ head/sys/amd64/amd64/sys_machdep.c Thu Oct 5 12:50:03 2017 (r324313) @@ -514,10 +514,13 @@ user_ldt_free(struct thread *td) return; } + critical_enter(); mdp->md_ldt = NULL; + atomic_thread_fence_rel(); bzero(&mdp->md_ldt_sd, sizeof(mdp->md_ldt_sd)); if (td == curthread) lldt(GSEL(GNULL_SEL, SEL_KPL)); + critical_exit(); user_ldt_deref(pldt); } From owner-svn-src-head@freebsd.org Thu Oct 5 13:01:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B10F7E382F5; Thu, 5 Oct 2017 13:01:19 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DCBC708C5; Thu, 5 Oct 2017 13:01:19 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95D1Ixs056297; Thu, 5 Oct 2017 13:01:18 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95D1Iki056295; Thu, 5 Oct 2017 13:01:18 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710051301.v95D1Iki056295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 5 Oct 2017 13:01:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324314 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 13:01:19 -0000 Author: mjg Date: Thu Oct 5 13:01:18 2017 New Revision: 324314 URL: https://svnweb.freebsd.org/changeset/base/324314 Log: locks: partially tidy up waiting on readers spin first instant of instantly re-readoing and don't re-read after spinning is finished - the state is already known. Note the code is subject to significant changes later. MFC after: 1 week Modified: head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Thu Oct 5 12:50:03 2017 (r324313) +++ head/sys/kern/kern_rwlock.c Thu Oct 5 13:01:18 2017 (r324314) @@ -489,12 +489,11 @@ __rw_rlock_hard(volatile uintptr_t *c, struct thread * "spinning", "lockname:\"%s\"", rw->lock_object.lo_name); for (i = 0; i < rowner_loops; i++) { + cpu_spinwait(); v = RW_READ_VALUE(rw); if ((v & RW_LOCK_READ) == 0 || RW_CAN_READ(td, v)) break; - cpu_spinwait(); } - v = RW_READ_VALUE(rw); #ifdef KDTRACE_HOOKS lda.spin_cnt += rowner_loops - i; #endif @@ -930,13 +929,13 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v, ui "spinning", "lockname:\"%s\"", rw->lock_object.lo_name); for (i = 0; i < rowner_loops; i++) { - if ((rw->rw_lock & RW_LOCK_WRITE_SPINNER) == 0) - break; cpu_spinwait(); + v = RW_READ_VALUE(rw); + if ((v & RW_LOCK_WRITE_SPINNER) == 0) + break; } KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); - v = RW_READ_VALUE(rw); #ifdef KDTRACE_HOOKS lda.spin_cnt += rowner_loops - i; #endif Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Thu Oct 5 12:50:03 2017 (r324313) +++ head/sys/kern/kern_sx.c Thu Oct 5 13:01:18 2017 (r324314) @@ -605,18 +605,17 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t t CTR4(KTR_LOCK, "%s: shared spinning on %p with %u and %u", __func__, sx, spintries, i); - x = sx->sx_lock; + cpu_spinwait(); + x = SX_READ_VALUE(sx); if ((x & SX_LOCK_SHARED) == 0 || SX_SHARERS(x) == 0) break; - cpu_spinwait(); + } #ifdef KDTRACE_HOOKS - lda.spin_cnt++; + lda.spin_cnt += i; #endif - } KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); - x = SX_READ_VALUE(sx); if (i != asx_loops) continue; } From owner-svn-src-head@freebsd.org Thu Oct 5 13:13:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 243E3E387D2; Thu, 5 Oct 2017 13:13:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F230A7107E; Thu, 5 Oct 2017 13:13:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95DCxqi061350; Thu, 5 Oct 2017 13:12:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95DCxVm061349; Thu, 5 Oct 2017 13:12:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710051312.v95DCxVm061349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Oct 2017 13:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324315 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 324315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 13:13:01 -0000 Author: kib Date: Thu Oct 5 13:12:59 2017 New Revision: 324315 URL: https://svnweb.freebsd.org/changeset/base/324315 Log: Ensure that after sucessfull i386_set_ldt() call, other threads can use LDT segments immediately. If the i386_set_ldt() call created a first LDT descriptor (and consequently created the LDT) for our address space, LDTR is currently loaded only on the CPU executing the syscall. Other CPUs executing threads sharing the address space, would only load LDTR after context switch. Uncomment set_user_ldt_rv() and call it on all CPUs. Remove critical section inside set_user_ldt(), it is not needed in the context of call from smp_rendezvous(). Set md_ldt after md_ldt_sd is initialized using the same code sequence as in user_ldt_free(). Do the whole initialization in a critical section, to not race with the context switching while we set LDT. Discussed with: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Thu Oct 5 13:01:18 2017 (r324314) +++ head/sys/amd64/amd64/sys_machdep.c Thu Oct 5 13:12:59 2017 (r324315) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -80,11 +81,6 @@ max_ldt_segment_init(void *arg __unused) } SYSINIT(maxldt, SI_SUB_VM_CONF, SI_ORDER_ANY, max_ldt_segment_init, NULL); -#ifdef notyet -#ifdef SMP -static void set_user_ldt_rv(struct vmspace *vmsp); -#endif -#endif static void user_ldt_derefl(struct proc_ldt *pldt); #ifndef _SYS_SYSPROTO_H_ @@ -430,14 +426,10 @@ static void set_user_ldt(struct mdproc *mdp) { - critical_enter(); *PCPU_GET(ldt) = mdp->md_ldt_sd; lldt(GSEL(GUSERLDT_SEL, SEL_KPL)); - critical_exit(); } -#ifdef notyet -#ifdef SMP static void set_user_ldt_rv(struct vmspace *vmsp) { @@ -449,8 +441,6 @@ set_user_ldt_rv(struct vmspace *vmsp) set_user_ldt(&td->td_proc->p_md); } -#endif -#endif struct proc_ldt * user_ldt_alloc(struct proc *p, int force) @@ -492,11 +482,13 @@ user_ldt_alloc(struct proc *p, int force) sizeof(struct user_segment_descriptor)); user_ldt_derefl(pldt); } + critical_enter(); ssdtosyssd(&sldt, &p->p_md.md_ldt_sd); - atomic_store_rel_ptr((volatile uintptr_t *)&mdp->md_ldt, - (uintptr_t)new_ldt); - if (p == curproc) - set_user_ldt(mdp); + atomic_thread_fence_rel(); + mdp->md_ldt = new_ldt; + critical_exit(); + smp_rendezvous(NULL, (void (*)(void *))set_user_ldt_rv, NULL, + p->p_vmspace); return (mdp->md_ldt); } From owner-svn-src-head@freebsd.org Thu Oct 5 13:22:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4602E38A94; Thu, 5 Oct 2017 13:22:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1F84714F3; Thu, 5 Oct 2017 13:22:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95DMETM065555; Thu, 5 Oct 2017 13:22:14 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95DMELI065554; Thu, 5 Oct 2017 13:22:14 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710051322.v95DMELI065554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 5 Oct 2017 13:22:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324316 - head/sys/dev/hyperv/netvsc X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 13:22:16 -0000 Author: sephe Date: Thu Oct 5 13:22:14 2017 New Revision: 324316 URL: https://svnweb.freebsd.org/changeset/base/324316 Log: hyperv/hn: Fix options RSS building Reported by: np MFC after: 1 week Sponsored by: Microsoft Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Thu Oct 5 13:12:59 2017 (r324315) +++ head/sys/dev/hyperv/netvsc/if_hn.c Thu Oct 5 13:22:14 2017 (r324316) @@ -387,9 +387,7 @@ static void hn_destroy_rx_data(struct hn_softc *); static int hn_check_iplen(const struct mbuf *, int); static int hn_set_rxfilter(struct hn_softc *, uint32_t); static int hn_rxfilter_config(struct hn_softc *); -#ifndef RSS static int hn_rss_reconfig(struct hn_softc *); -#endif static void hn_rss_ind_fixup(struct hn_softc *); static void hn_rss_mbuf_hash(struct hn_softc *, uint32_t); static int hn_rxpkt(struct hn_rx_ring *, const void *, @@ -1025,7 +1023,6 @@ hn_get_txswq_depth(const struct hn_tx_ring *txr) return hn_tx_swq_depth; } -#ifndef RSS static int hn_rss_reconfig(struct hn_softc *sc) { @@ -1064,7 +1061,6 @@ hn_rss_reconfig(struct hn_softc *sc) } return (0); } -#endif /* !RSS */ static void hn_rss_ind_fixup(struct hn_softc *sc) From owner-svn-src-head@freebsd.org Thu Oct 5 13:29:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A01A9E38D3A; Thu, 5 Oct 2017 13:29:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CFFF7192E; Thu, 5 Oct 2017 13:29:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95DTsdo065873; Thu, 5 Oct 2017 13:29:54 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95DTs7Q065872; Thu, 5 Oct 2017 13:29:54 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201710051329.v95DTs7Q065872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 5 Oct 2017 13:29:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324317 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 324317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 13:29:55 -0000 Author: tuexen Date: Thu Oct 5 13:29:54 2017 New Revision: 324317 URL: https://svnweb.freebsd.org/changeset/base/324317 Log: Ensure that the accept ABORT chunks with the T-bit set only the a non-zero matching peer tag is provided. MFC after: 1 week Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Thu Oct 5 13:22:14 2017 (r324316) +++ head/sys/netinet/sctp_input.c Thu Oct 5 13:29:54 2017 (r324317) @@ -4673,6 +4673,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * if ((((ch->chunk_flags & SCTP_HAD_NO_TCB) == 0) && (vtag_in == asoc->my_vtag)) || (((ch->chunk_flags & SCTP_HAD_NO_TCB) == SCTP_HAD_NO_TCB) && + (asoc->peer_vtag != htonl(0)) && (vtag_in == asoc->peer_vtag))) { /* this is valid */ } else { From owner-svn-src-head@freebsd.org Thu Oct 5 14:17:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 385EAE39B27; Thu, 5 Oct 2017 14:17:51 +0000 (UTC) (envelope-from guyyur@gmail.com) Received: from mail-wr0-x22c.google.com (mail-wr0-x22c.google.com [IPv6:2a00:1450:400c:c0c::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 C204373362; Thu, 5 Oct 2017 14:17:50 +0000 (UTC) (envelope-from guyyur@gmail.com) Received: by mail-wr0-x22c.google.com with SMTP id p10so9157704wrc.6; Thu, 05 Oct 2017 07:17:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=rUqj7hVh0xnymw6LOKQMjjIQ8xIss1NCvRyzFoj56h8=; b=NgkNFClnWXLqej8c7F46lrCpTBaCd/igDbvWvnzu9lEK9tBWFhn/XzB9ZrzbcssG7v H9zT4dBB0EIOT01dmohNyEHfw25Q8O9AJ6j8tK1Eg81llCO7Ezf2D3FelFEKPjpPCl8t xGuq8BNUMvMv72vIy8sVQOkrHQkSm13UcnjMo8AkjQAx6KKiUCEApVXhkazZmIBFAmVf tt6kGpOKdIT/5eKM1JEY+VzinwoxTZqydIZ7cxYpGhcCOA8TVigIE0MAOt/S8GB1hIr+ 1AplQnVCGpwWzODsrlAKqXTja+zGEVuplTXM7uYF0oG8KkmZ63853OfQpjv7b728ZMUx SsxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=rUqj7hVh0xnymw6LOKQMjjIQ8xIss1NCvRyzFoj56h8=; b=n8xRcrpciblDRMlqwoWhjMIa6jTYVh1f5JLuL7Jw/hsFX5zi0aBhcWmO+f/ThJO0D1 ZqAG8qAFNL/P5G0xwCo+5ESmRRnZOFTnM6pz7WgQGsC3/xwVBdAqRZSY9hxOP/bw2q86 zT6B8C7d//Gd8LUd7u6T11h3Fksb5ykU05prxDoaM6A9Mrli3oNeU0VR8f/HJCJIcHJx DxDzzAeI0vamxYXxBQ0cPDxYGWOlGmgHVVeNqTkV9GNsZ/ixXoksl+Dd0FQP7GSwhVNZ 6kISwQIrR/pk1PLE9TALKGw4Nf4h7nn9UIM2pXCQThdQiBR0CnfJWQZuynJ3fLgPNaPR /eAA== X-Gm-Message-State: AMCzsaUX1xPpHJwcphqY37qabPL7uzbZTqXysW4SnDbTtzI0T4Dk4/LA S4AxbCMN4J4Ed67DZ70yyQpCRXoxU7tvP7aXB7fkfQ== X-Google-Smtp-Source: AOwi7QC6hK55GpWO7dre3kUoAXaASqBG6Eh+62cJ26RCMVaSsF6hfvtDwfZ65x0/nvjzfIQfAQ2d2D95yU6yW1OAvMM= X-Received: by 10.223.172.11 with SMTP id v11mr10438040wrc.95.1507213069004; Thu, 05 Oct 2017 07:17:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.197.141 with HTTP; Thu, 5 Oct 2017 07:17:48 -0700 (PDT) In-Reply-To: <201709270939.v8R9dGhR063228@repo.freebsd.org> References: <201709270939.v8R9dGhR063228@repo.freebsd.org> From: Guy Yur Date: Thu, 5 Oct 2017 17:17:48 +0300 Message-ID: Subject: Re: svn commit: r324054 - head/sys/kern To: Emmanuel Vadot Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 14:17:51 -0000 On 27 September 2017 at 12:39, Emmanuel Vadot wrote: > Author: manu > Date: Wed Sep 27 09:39:16 2017 > New Revision: 324054 > URL: https://svnweb.freebsd.org/changeset/base/324054 > > Log: > vfs_export: Simplify vfs_export_lookup > > If the filesystem is not exported directly return NULL. > If no address is given and filesystem is exported using some default > one return it directly, if it doesn't have a default one directly > return NULL. > > Reviewed by: kib, bapt > MFC after: 1 week > Sponsored by: Gandi.net > Differential Revision: https://reviews.freebsd.org/D12505 > > Modified: > head/sys/kern/vfs_export.c > > ... > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" Hi, After this commit I can't mount from a host with the following exports: # cat /etc/exports /export -ro /export/obj -maproot=root V4: /export # cat /etc/fstab ... /usr/obj /export/obj nullfs rw 0 0 # mount -t nfs -oro,nfsv4 vm4:/obj /mnt mount_nfs: nmount: /mnt: Permission denied Adding debug prints: nam = 0xfffff80002c10700 saddr->sa_family = 28 rnh = 0 Before the commit, rnh == NULL would continue to MNT_DEFEXPORTED check. Thanks, Guy From owner-svn-src-head@freebsd.org Thu Oct 5 14:43:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7916E3A5E7; Thu, 5 Oct 2017 14:43:31 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2FF17425C; Thu, 5 Oct 2017 14:43:31 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95EhUaE000921; Thu, 5 Oct 2017 14:43:30 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95EhUGJ000914; Thu, 5 Oct 2017 14:43:30 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201710051443.v95EhUGJ000914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Thu, 5 Oct 2017 14:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324318 - in head/sys: dev/bnxt dev/e1000 kern net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: in head/sys: dev/bnxt dev/e1000 kern net X-SVN-Commit-Revision: 324318 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 14:43:31 -0000 Author: shurd Date: Thu Oct 5 14:43:30 2017 New Revision: 324318 URL: https://svnweb.freebsd.org/changeset/base/324318 Log: Fix "taskqgroup_attach: setaffinity failed: 3" with iflib drivers Improved logging added in r323879 exposed an error during attach. We need the irq, not the rid to work correctly. em uses shared irqs, so it will use the same irq for TX as RX. bnxt does not use shared irqs, or TX irqs at all, so there's no need to set the TX irq affinity. Reviewed by: sbruno Approved by: sbruno (mentor) Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D12496 Modified: head/sys/dev/bnxt/if_bnxt.c head/sys/dev/e1000/if_em.c head/sys/kern/subr_gtaskqueue.c head/sys/net/iflib.c head/sys/net/iflib.h Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Thu Oct 5 13:29:54 2017 (r324317) +++ head/sys/dev/bnxt/if_bnxt.c Thu Oct 5 14:43:30 2017 (r324318) @@ -1649,8 +1649,7 @@ bnxt_msix_intr_assign(if_ctx_t ctx, int msix) } for (i=0; iscctx->isc_ntxqsets; i++) - iflib_softirq_alloc_generic(ctx, i + 1, IFLIB_INTR_TX, NULL, i, - "tx_cp"); + iflib_softirq_alloc_generic(ctx, NULL, IFLIB_INTR_TX, NULL, i, "tx_cp"); return rc; Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Oct 5 13:29:54 2017 (r324317) +++ head/sys/dev/e1000/if_em.c Thu Oct 5 14:43:30 2017 (r324318) @@ -1954,7 +1954,9 @@ em_if_msix_intr_assign(if_ctx_t ctx, int msix) rid = vector + 1; snprintf(buf, sizeof(buf), "txq%d", i); tx_que = &adapter->tx_queues[i]; - iflib_softirq_alloc_generic(ctx, rid, IFLIB_INTR_TX, tx_que, tx_que->me, buf); + iflib_softirq_alloc_generic(ctx, + &adapter->rx_queues[i % adapter->rx_num_queues].que_irq, + IFLIB_INTR_TX, tx_que, tx_que->me, buf); tx_que->msix = (vector % adapter->tx_num_queues); Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Thu Oct 5 13:29:54 2017 (r324317) +++ head/sys/kern/subr_gtaskqueue.c Thu Oct 5 14:43:30 2017 (r324318) @@ -681,7 +681,7 @@ taskqgroup_attach(struct taskqgroup *qgroup, struct gr mtx_unlock(&qgroup->tqg_lock); error = intr_setaffinity(irq, CPU_WHICH_IRQ, &mask); if (error) - printf("%s: setaffinity failed: %d\n", __func__, error); + printf("%s: setaffinity failed for %s: %d\n", __func__, gtask->gt_name, error); } else mtx_unlock(&qgroup->tqg_lock); } Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Oct 5 13:29:54 2017 (r324317) +++ head/sys/net/iflib.c Thu Oct 5 14:43:30 2017 (r324318) @@ -5003,21 +5003,22 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, in if (tqrid != -1) { cpuid = find_nth(ctx, &cpus, qid); - taskqgroup_attach_cpu(tqg, gtask, q, cpuid, irq->ii_rid, name); + taskqgroup_attach_cpu(tqg, gtask, q, cpuid, rman_get_start(irq->ii_res), name); } else { - taskqgroup_attach(tqg, gtask, q, tqrid, name); + taskqgroup_attach(tqg, gtask, q, rman_get_start(irq->ii_res), name); } return (0); } void -iflib_softirq_alloc_generic(if_ctx_t ctx, int rid, iflib_intr_type_t type, void *arg, int qid, char *name) +iflib_softirq_alloc_generic(if_ctx_t ctx, if_irq_t irq, iflib_intr_type_t type, void *arg, int qid, char *name) { struct grouptask *gtask; struct taskqgroup *tqg; gtask_fn_t *fn; void *q; + int irq_num = -1; switch (type) { case IFLIB_INTR_TX: @@ -5025,25 +5026,28 @@ iflib_softirq_alloc_generic(if_ctx_t ctx, int rid, ifl gtask = &ctx->ifc_txqs[qid].ift_task; tqg = qgroup_if_io_tqg; fn = _task_fn_tx; + if (irq != NULL) + irq_num = rman_get_start(irq->ii_res); break; case IFLIB_INTR_RX: q = &ctx->ifc_rxqs[qid]; gtask = &ctx->ifc_rxqs[qid].ifr_task; tqg = qgroup_if_io_tqg; fn = _task_fn_rx; + if (irq != NULL) + irq_num = rman_get_start(irq->ii_res); break; case IFLIB_INTR_IOV: q = ctx; gtask = &ctx->ifc_vflr_task; tqg = qgroup_if_config_tqg; - rid = -1; fn = _task_fn_iov; break; default: panic("unknown net intr type"); } GROUPTASK_INIT(gtask, 0, fn, q); - taskqgroup_attach(tqg, gtask, q, rid, name); + taskqgroup_attach(tqg, gtask, q, irq_num, name); } void Modified: head/sys/net/iflib.h ============================================================================== --- head/sys/net/iflib.h Thu Oct 5 13:29:54 2017 (r324317) +++ head/sys/net/iflib.h Thu Oct 5 14:43:30 2017 (r324318) @@ -361,7 +361,7 @@ int iflib_irq_alloc(if_ctx_t, if_irq_t, int, driver_fi int iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, int rid, iflib_intr_type_t type, driver_filter_t *filter, void *filter_arg, int qid, char *name); -void iflib_softirq_alloc_generic(if_ctx_t ctx, int rid, iflib_intr_type_t type, void *arg, int qid, char *name); +void iflib_softirq_alloc_generic(if_ctx_t ctx, if_irq_t irq, iflib_intr_type_t type, void *arg, int qid, char *name); void iflib_irq_free(if_ctx_t ctx, if_irq_t irq); From owner-svn-src-head@freebsd.org Thu Oct 5 15:10:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C72CE3ADE5; Thu, 5 Oct 2017 15:10:25 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C1BC74F2F; Thu, 5 Oct 2017 15:10:23 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 9dd24c17; Thu, 5 Oct 2017 17:10:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=JmUEVhrQ0Nc/IRxrYUxftFKWEAc=; b=hkACNLa3s5CqFQM8yZcwJD6X1b1t vqVVKYb5dXitnamFOEFVHmnyYFs63nXVlHEbFWA4gStg472QlSTilw3xDAmKQkCy PNLVR6sWklAjeerP84oVolluXYfCCWm/5LeYFbgal1VPxxw1H2ZJyQc6bgMK9jJN Nk99U5Sh1u3gZFI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=jBL/WL0zIEjd3YMXuZbKoeokEsNg43aWop7K/aeQb96cQm2/LJYaSSjI JaFCWObimp6LoF156x7rhxOxoUhSFqrODyDhh/pB+PbU2EpFxadThCIIbznjPiXR +V1VmGLhwJplDVHgd3B2VOVmmu4791EwE2e1omsYVNjTfSJVOrs= Received: from arcadia (evadot.gandi.net [217.70.181.36]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 05040498 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 5 Oct 2017 17:10:20 +0200 (CEST) Date: Thu, 5 Oct 2017 17:10:19 +0200 From: Emmanuel Vadot To: Guy Yur Cc: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324054 - head/sys/kern Message-Id: <20171005171019.d77c9f4fabd2d431d7033a4a@bidouilliste.com> In-Reply-To: References: <201709270939.v8R9dGhR063228@repo.freebsd.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 15:10:25 -0000 On Thu, 5 Oct 2017 17:17:48 +0300 Guy Yur wrote: > On 27 September 2017 at 12:39, Emmanuel Vadot wrote: > > Author: manu > > Date: Wed Sep 27 09:39:16 2017 > > New Revision: 324054 > > URL: https://svnweb.freebsd.org/changeset/base/324054 > > > > Log: > > vfs_export: Simplify vfs_export_lookup > > > > If the filesystem is not exported directly return NULL. > > If no address is given and filesystem is exported using some default > > one return it directly, if it doesn't have a default one directly > > return NULL. > > > > Reviewed by: kib, bapt > > MFC after: 1 week > > Sponsored by: Gandi.net > > Differential Revision: https://reviews.freebsd.org/D12505 > > > > Modified: > > head/sys/kern/vfs_export.c > > > > ... > > _______________________________________________ > > svn-src-head@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > > Hi, > > After this commit I can't mount from a host with the following exports: > > # cat /etc/exports > /export -ro > /export/obj -maproot=root > V4: /export > > # cat /etc/fstab > ... > /usr/obj /export/obj nullfs rw 0 0 > > # mount -t nfs -oro,nfsv4 vm4:/obj /mnt > mount_nfs: nmount: /mnt: Permission denied > > > Adding debug prints: > nam = 0xfffff80002c10700 > saddr->sa_family = 28 > rnh = 0 > > Before the commit, rnh == NULL would continue to MNT_DEFEXPORTED check. > > > Thanks, > Guy Hello, Could you see if https://people.freebsd.org/~manu/0001-vfs_export_lookup-Fix-r324054.patch fixes it ? I won't have time to test or commit today but will tomorow. Thanks, -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Thu Oct 5 15:41:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75903E3B861; Thu, 5 Oct 2017 15:41:07 +0000 (UTC) (envelope-from guyyur@gmail.com) Received: from mail-wr0-x22c.google.com (mail-wr0-x22c.google.com [IPv6:2a00:1450:400c:c0c::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 1986A765AE; Thu, 5 Oct 2017 15:41:07 +0000 (UTC) (envelope-from guyyur@gmail.com) Received: by mail-wr0-x22c.google.com with SMTP id z1so2355555wre.3; Thu, 05 Oct 2017 08:41:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=fzGWCnjPi50Gu1jyrBhJdWLub3jrWsHCRAYQEI924qc=; b=qRBCk6Sx/5HtFNwBq7ypMq14JA4J6KVoP1NGD24WbseUTVQ2kUcol9HE/dsiFvp82r T5W0VeIvcJfv3EZsr1YSgFyDv96wecf3RZQ/aWyHiNcdiCWEI4XbCaPoFiZrgBNPZ2C9 HiPYn7dIKHfUDXG6NbTxuxaNOcNw2YtjbwzWsovUdOQjm1pTFlH9OP8gTlfX6tfC1wMK zN2ttS2Awy2VSnX5LJIhVLNJjk/jIYtGcKV/xvdHwUoPFbVqSo9cb7kzuSBfG+HjLyQB mGRUcMP9RJAs7zWjrYYiqPUsDiOD2FjlWSkg5GpHSsw8GjP4XhE/PJ0OwH32BxA7EQ8g qQCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=fzGWCnjPi50Gu1jyrBhJdWLub3jrWsHCRAYQEI924qc=; b=gYTG/Es5/CuxB+RsWJehtoIJv9iE3AsJeBlazDInZbZ8Yg9J4AkS7G4YKICIgt2fDP svC/X85uIiGX5zaDwVzVEZ1UluMr59ryH2Jc9fR9XCmbW5QMBpYQPaZ2AmxhoqVY97Rc C6B2Qt874CIQiREdCS6pvX543gVfLaUcpv33wneiHHwYNTUvxxGilvxCbGqEG3dI2Glr GCuy+VUZMk8dDhRmhorOGW0dteSYK2VecipnN2wJwSMQRn0DWqSffIg8Iy57c5s3OgOO JnHZtQLAPi5+lcGeQksiJzoD+HIWhqaOvOSE4p7VZ3X6KOdgf1FGQTghs7yZb+uX1eRT /iAw== X-Gm-Message-State: AMCzsaVfaKeTQqr1LHbowLdUzBDhoLSp2hI/lMmZBcmXTE11Go9RoYgc 15jy1oYPU5olmQZ6B8cnn8eKeSlIxb2MBk/24dHHIKVK X-Google-Smtp-Source: AOwi7QD67aGG/DLJaoCJ3QRT8Kbx08EhccPW7lEr43W+mSn80IhgEe3iHmyl2dxILvcqBHUO9/Umnpnzb+Ytq0kBCoE= X-Received: by 10.223.176.25 with SMTP id f25mr8191315wra.128.1507218065432; Thu, 05 Oct 2017 08:41:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.197.141 with HTTP; Thu, 5 Oct 2017 08:41:04 -0700 (PDT) In-Reply-To: <20171005171019.d77c9f4fabd2d431d7033a4a@bidouilliste.com> References: <201709270939.v8R9dGhR063228@repo.freebsd.org> <20171005171019.d77c9f4fabd2d431d7033a4a@bidouilliste.com> From: Guy Yur Date: Thu, 5 Oct 2017 18:41:04 +0300 Message-ID: Subject: Re: svn commit: r324054 - head/sys/kern To: Emmanuel Vadot Cc: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 15:41:07 -0000 On 5 October 2017 at 18:10, Emmanuel Vadot wrote: > On Thu, 5 Oct 2017 17:17:48 +0300 > Guy Yur wrote: > >> On 27 September 2017 at 12:39, Emmanuel Vadot wrote: >> > Author: manu >> > Date: Wed Sep 27 09:39:16 2017 >> > New Revision: 324054 >> > URL: https://svnweb.freebsd.org/changeset/base/324054 >> > >> > Log: >> > vfs_export: Simplify vfs_export_lookup >> > >> > If the filesystem is not exported directly return NULL. >> > If no address is given and filesystem is exported using some default >> > one return it directly, if it doesn't have a default one directly >> > return NULL. >> > >> > Reviewed by: kib, bapt >> > MFC after: 1 week >> > Sponsored by: Gandi.net >> > Differential Revision: https://reviews.freebsd.org/D12505 >> > >> > Modified: >> > head/sys/kern/vfs_export.c >> > >> > ... >> > _______________________________________________ >> > svn-src-head@freebsd.org mailing list >> > https://lists.freebsd.org/mailman/listinfo/svn-src-head >> > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" >> >> Hi, >> >> After this commit I can't mount from a host with the following exports: >> >> # cat /etc/exports >> /export -ro >> /export/obj -maproot=root >> V4: /export >> >> # cat /etc/fstab >> ... >> /usr/obj /export/obj nullfs rw 0 0 >> >> # mount -t nfs -oro,nfsv4 vm4:/obj /mnt >> mount_nfs: nmount: /mnt: Permission denied >> >> >> Adding debug prints: >> nam = 0xfffff80002c10700 >> saddr->sa_family = 28 >> rnh = 0 >> >> Before the commit, rnh == NULL would continue to MNT_DEFEXPORTED check. >> >> >> Thanks, >> Guy > > Hello, > > Could you see if > https://people.freebsd.org/~manu/0001-vfs_export_lookup-Fix-r324054.patch > fixes it ? > > I won't have time to test or commit today but will tomorow. > Thanks, > > -- > Emmanuel Vadot Hi, I am getting "Error 503 Backend fetch failed" trying to access the patch. Do you have another location I can download it from? Thanks, Guy From owner-svn-src-head@freebsd.org Thu Oct 5 16:20:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E592CE3C43B; Thu, 5 Oct 2017 16:20:27 +0000 (UTC) (envelope-from guyyur@gmail.com) Received: from mail-wr0-x234.google.com (mail-wr0-x234.google.com [IPv6:2a00:1450:400c:c0c::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 78E767798D; Thu, 5 Oct 2017 16:20:27 +0000 (UTC) (envelope-from guyyur@gmail.com) Received: by mail-wr0-x234.google.com with SMTP id u5so11093240wrc.5; Thu, 05 Oct 2017 09:20:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=oBXYKFlPLOlgP7dsxlJHLs7MJ/bwFVlUzNmcZy8mJvQ=; b=GKlWtaNR7ctazDjxibDRDG8S8Bpspunq0pfiFmjR6Mk1Gq7l4pHr9VqmUrfA7PLI3y bXay52NENODyHgAf2b/73ZS2idTmzg5XyRgLSMHHQ7rtnx2uGwzsCrH9tc8r/WXLLLFc 26DgXd2HOfffNvi/oREfGblz2FXYzBr4EEAFVXeQ6T926WCC9fxmvZgeytkrMDyF8S0T bEPfbjDec/lim3IMusxGXm3BAKX5a5J9UdTlVXqpRmLl7EvYTHRSJzAlDRRiH0EXzhVh R9AEe7x0a9+Zaf9UTPGHl/XZ3xdZyof0+LdBPogLs1AGc+uJvgGwuM+EGYM5M/SAQXbF qT1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=oBXYKFlPLOlgP7dsxlJHLs7MJ/bwFVlUzNmcZy8mJvQ=; b=Tbo/jLTORr11RiDQllsyujSJ1VG3qc/qhanZoHxVI59ypm1y2t7wr4DI+aoGBGvrWG JR0jfkAS6PnkGilmMyjy89Zv/k/iagH/v5V3P+ht59mXxVcNJrjnYr0vPuWJvKMhBJhN KwgLrGvDKMC/nJNlfB2zG9fZwmJYyRpuf00MUXn55Gjts/yWsWaMztapkOlN7/DSzInD 8io8iw1HjoY805jz6s98Z6Uq2jnA9of26DV4PYadG5JRM5ofBswsn4noJVssdeIK1BAo PCNBWHDCDGqOhBtW0RS3D2yNU1gidQJCVx5bs8wEKlnW7Y+xngaxQmEoOHdX8zSDdpIv TtZw== X-Gm-Message-State: AHPjjUgUoKM40j6ZYcg6Dm+KxhSJaYMsM9qfB9p0vdc9ejEBywruoy48 zt9TqtKpAUowUQY5oaf1kGpkH4GX+VAurGw4B5I= X-Google-Smtp-Source: AOwi7QBfPIz16Gnod672FZNkIsYjDauyz7vUGROPLmjVJ8aYDe7JlM0aqF4+mPl4yy8QqA2Jt9BwhoWvJ9nFQB0qu9w= X-Received: by 10.223.160.119 with SMTP id l52mr22972694wrl.53.1507220425701; Thu, 05 Oct 2017 09:20:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.197.141 with HTTP; Thu, 5 Oct 2017 09:20:24 -0700 (PDT) In-Reply-To: References: <201709270939.v8R9dGhR063228@repo.freebsd.org> <20171005171019.d77c9f4fabd2d431d7033a4a@bidouilliste.com> From: Guy Yur Date: Thu, 5 Oct 2017 19:20:24 +0300 Message-ID: Subject: Re: svn commit: r324054 - head/sys/kern To: Emmanuel Vadot Cc: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Steven Hartland Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 16:20:28 -0000 On 5 October 2017 at 18:41, Guy Yur wrote: > On 5 October 2017 at 18:10, Emmanuel Vadot wrote: >> On Thu, 5 Oct 2017 17:17:48 +0300 >> Guy Yur wrote: >> >>> On 27 September 2017 at 12:39, Emmanuel Vadot wrote: >>> > Author: manu >>> > Date: Wed Sep 27 09:39:16 2017 >>> > New Revision: 324054 >>> > URL: https://svnweb.freebsd.org/changeset/base/324054 >>> > >>> > Log: >>> > vfs_export: Simplify vfs_export_lookup >>> > >>> > If the filesystem is not exported directly return NULL. >>> > If no address is given and filesystem is exported using some default >>> > one return it directly, if it doesn't have a default one directly >>> > return NULL. >>> > >>> > Reviewed by: kib, bapt >>> > MFC after: 1 week >>> > Sponsored by: Gandi.net >>> > Differential Revision: https://reviews.freebsd.org/D12505 >>> > >>> > Modified: >>> > head/sys/kern/vfs_export.c >>> > >>> > ... >>> > _______________________________________________ >>> > svn-src-head@freebsd.org mailing list >>> > https://lists.freebsd.org/mailman/listinfo/svn-src-head >>> > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" >>> >>> Hi, >>> >>> After this commit I can't mount from a host with the following exports: >>> >>> # cat /etc/exports >>> /export -ro >>> /export/obj -maproot=root >>> V4: /export >>> >>> # cat /etc/fstab >>> ... >>> /usr/obj /export/obj nullfs rw 0 0 >>> >>> # mount -t nfs -oro,nfsv4 vm4:/obj /mnt >>> mount_nfs: nmount: /mnt: Permission denied >>> >>> >>> Adding debug prints: >>> nam = 0xfffff80002c10700 >>> saddr->sa_family = 28 >>> rnh = 0 >>> >>> Before the commit, rnh == NULL would continue to MNT_DEFEXPORTED check. >>> >>> >>> Thanks, >>> Guy >> >> Hello, >> >> Could you see if >> https://people.freebsd.org/~manu/0001-vfs_export_lookup-Fix-r324054.patch >> fixes it ? >> >> I won't have time to test or commit today but will tomorow. >> Thanks, >> >> -- >> Emmanuel Vadot > > Hi, > > I am getting "Error 503 Backend fetch failed" trying to access the patch. > Do you have another location I can download it from? > > Thanks, > Guy Hi, Steven sent me the patch and it is working for me. Thanks, Guy From owner-svn-src-head@freebsd.org Thu Oct 5 16:40:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58717E3CADA; Thu, 5 Oct 2017 16:40:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28E837C804; Thu, 5 Oct 2017 16:40:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95Geoep048406; Thu, 5 Oct 2017 16:40:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95GeoFP048405; Thu, 5 Oct 2017 16:40:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710051640.v95GeoFP048405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 5 Oct 2017 16:40:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324319 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 324319 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 16:40:51 -0000 Author: imp Date: Thu Oct 5 16:40:50 2017 New Revision: 324319 URL: https://svnweb.freebsd.org/changeset/base/324319 Log: Document KERNBUILDDIR. Sponsored by: Netflix Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Thu Oct 5 14:43:30 2017 (r324318) +++ head/sys/conf/kmod.mk Thu Oct 5 16:40:50 2017 (r324319) @@ -44,6 +44,10 @@ # # DESTDIR The tree where the module gets installed. [not set] # +# KERNBUILDDIR +# Set to the location of the kernel build directory where +# the opt_*.h files, .o's and kernel winds up. +# # +++ targets +++ # # install: From owner-svn-src-head@freebsd.org Thu Oct 5 16:42:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C647E3CCB3; Thu, 5 Oct 2017 16:42:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58B0B7CAB8; Thu, 5 Oct 2017 16:42:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95Gg2q3048505; Thu, 5 Oct 2017 16:42:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95Gg2Mx048502; Thu, 5 Oct 2017 16:42:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710051642.v95Gg2Mx048502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 5 Oct 2017 16:42:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324320 - in head: lib/libcuse sys/fs/cuse X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head: lib/libcuse sys/fs/cuse X-SVN-Commit-Revision: 324320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 16:42:03 -0000 Author: hselasky Date: Thu Oct 5 16:42:02 2017 New Revision: 324320 URL: https://svnweb.freebsd.org/changeset/base/324320 Log: Add support for new cuse(3) error code, CUSE_ERR_NO_DEVICE. This error code is useful when emulating Linux input event devices from userspace. PR: 218626 Submitted by: jan.kokemueller@gmail.com MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/lib/libcuse/cuse.3 head/sys/fs/cuse/cuse.c head/sys/fs/cuse/cuse_defs.h Modified: head/lib/libcuse/cuse.3 ============================================================================== --- head/lib/libcuse/cuse.3 Thu Oct 5 16:40:50 2017 (r324319) +++ head/lib/libcuse/cuse.3 Thu Oct 5 16:42:02 2017 (r324320) @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 6, 2014 +.Dd October 5, 2017 .Dt CUSE 3 .Os .Sh NAME @@ -292,6 +292,7 @@ enum { CUSE_ERR_SIGNAL CUSE_ERR_OTHER CUSE_ERR_NOT_LOADED + CUSE_ERR_NO_DEVICE CUSE_POLL_NONE CUSE_POLL_READ Modified: head/sys/fs/cuse/cuse.c ============================================================================== --- head/sys/fs/cuse/cuse.c Thu Oct 5 16:40:50 2017 (r324319) +++ head/sys/fs/cuse/cuse.c Thu Oct 5 16:42:02 2017 (r324320) @@ -390,6 +390,8 @@ cuse_convert_error(int error) return (EFAULT); case CUSE_ERR_SIGNAL: return (EINTR); + case CUSE_ERR_NO_DEVICE: + return (ENODEV); default: return (ENXIO); } Modified: head/sys/fs/cuse/cuse_defs.h ============================================================================== --- head/sys/fs/cuse/cuse_defs.h Thu Oct 5 16:40:50 2017 (r324319) +++ head/sys/fs/cuse/cuse_defs.h Thu Oct 5 16:42:02 2017 (r324320) @@ -27,7 +27,7 @@ #ifndef _CUSE_DEFS_H_ #define _CUSE_DEFS_H_ -#define CUSE_VERSION 0x000122 +#define CUSE_VERSION 0x000123 #define CUSE_ERR_NONE 0 #define CUSE_ERR_BUSY -1 @@ -38,6 +38,7 @@ #define CUSE_ERR_SIGNAL -6 #define CUSE_ERR_OTHER -7 #define CUSE_ERR_NOT_LOADED -8 +#define CUSE_ERR_NO_DEVICE -9 #define CUSE_POLL_NONE 0 #define CUSE_POLL_READ 1 From owner-svn-src-head@freebsd.org Thu Oct 5 16:44:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99243E3CE22; Thu, 5 Oct 2017 16:44:22 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 648B07CDB6; Thu, 5 Oct 2017 16:44:22 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (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 116A526014D; Thu, 5 Oct 2017 18:44:12 +0200 (CEST) Subject: Re: svn commit: r324319 - head/sys/conf To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710051640.v95GeoFP048405@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Thu, 5 Oct 2017 18:41:35 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <201710051640.v95GeoFP048405@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 16:44:22 -0000 On 10/05/17 18:40, Warner Losh wrote: > Author: imp > Date: Thu Oct 5 16:40:50 2017 > New Revision: 324319 > URL: https://svnweb.freebsd.org/changeset/base/324319 > > Log: > Document KERNBUILDDIR. > > Sponsored by: Netflix > > Modified: > head/sys/conf/kmod.mk > > Modified: head/sys/conf/kmod.mk > ============================================================================== > --- head/sys/conf/kmod.mk Thu Oct 5 14:43:30 2017 (r324318) > +++ head/sys/conf/kmod.mk Thu Oct 5 16:40:50 2017 (r324319) > @@ -44,6 +44,10 @@ > # > # DESTDIR The tree where the module gets installed. [not set] > # > +# KERNBUILDDIR > +# Set to the location of the kernel build directory where > +# the opt_*.h files, .o's and kernel winds up. > +# > # +++ targets +++ > # > # install: > > An idea: Should all this information be printed to stdout when typing: make help ??? --HPS From owner-svn-src-head@freebsd.org Thu Oct 5 16:48:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D79ECE3CED2; Thu, 5 Oct 2017 16:48:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 846097CF2D; Thu, 5 Oct 2017 16:48:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95Gm5Mv051750; Thu, 5 Oct 2017 16:48:05 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95Gm51s051749; Thu, 5 Oct 2017 16:48:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710051648.v95Gm51s051749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 5 Oct 2017 16:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324321 - head/sys/boot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot X-SVN-Commit-Revision: 324321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 16:48:07 -0000 Author: imp Date: Thu Oct 5 16:48:05 2017 New Revision: 324321 URL: https://svnweb.freebsd.org/changeset/base/324321 Log: This README file was quite relevant for FreeBSD 3 or 4. However, the information in this file is now somewhat dated, or is present mostly correct in the man pages. Retire this file rather than fix it. Noticed by: cognet@ Sponsored by: Netflix Deleted: head/sys/boot/README From owner-svn-src-head@freebsd.org Thu Oct 5 16:57:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C6DFE3D45E for ; Thu, 5 Oct 2017 16:57:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x232.google.com (mail-io0-x232.google.com [IPv6:2607:f8b0:4001:c06::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 C41707D7EF for ; Thu, 5 Oct 2017 16:57:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x232.google.com with SMTP id m16so5556840iod.1 for ; Thu, 05 Oct 2017 09:57:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=S6GoeXCyXXf1kdVhYF37TEch8mkfxiDGtEorx1NemJQ=; b=DhfTvCWpNXL8AQ79X5k6PW9dkc59gNKsjdUoMXpscc33016CzwhQLPYLl92tV69HUg xrx/2OXEOzXnY72mFs+5LWnGNLB5COdHYsExQX8hELlvcQcK+Gz23tHtYRGdltGKs1We CE6RwfyLEDkQ2oWPJrXQ4SFj/0JpPrjXCHS+coyWKyZmHB/9Sz8/y4VocmYEOWxRV0XL 82wRzu8loa/CVedBtqgV4lBjF7DXU0GnkHuZV5u0J6LD7pIJAi+i6WVV8UQTH+cSvF4t ryruBO0SwtKUtyIq2l+ME+VHEc1yeGt16/lDtLEf5pzE8cxZtqRD3imzhDZZO6E10OfH Xmzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=S6GoeXCyXXf1kdVhYF37TEch8mkfxiDGtEorx1NemJQ=; b=sTvYV/zfkNXFDA9KYIjMCnAMtDwqmejoul7wMgta6LslK29qS9jN2K/FyjSkHvutzL PT0S4sVMqV6UxklNIvjkNL8WPesrST51Xc7N0rGLuRVj1ybBP6OQsTW2qXPvDxCVJBED FR890SEuTkp5FpY2iRaMbWlaLTF91NGDeFJj4KlN+QY1kabMX+HsvEYf5KILNAjgpk7/ HOCz2c+w0f7MYTJqpCN+1PhP9bDTFYBlPUKqPMS3EwNH6n2wJvYKKQ3UsqzH69uDzI/K u1KjYIFOXEPwuMweV6y+N1OZDYg80uGWzlQPJ0gLtL0AyMjQRPDOArEqmBO1q+Gwsfce naTw== X-Gm-Message-State: AMCzsaUbJ+jISzUN2DT4+E+fSCO1MpYgU8dqyhsLkRFav2O4R/SIlCW0 liAb9AmyiS0g1QKv1RWdtxI7ASVu7IuJjiLWbDtRTg== X-Google-Smtp-Source: AOwi7QClWJ53NIXve3NcCRUArdUDznQJqe/ujHgqfD5vtieyygS+sJfyaS0mfo7blKRjOTxZVPnIaAETjrQl6PNjQOM= X-Received: by 10.107.16.162 with SMTP id 34mr2418073ioq.169.1507222657153; Thu, 05 Oct 2017 09:57:37 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.94.130 with HTTP; Thu, 5 Oct 2017 09:57:36 -0700 (PDT) X-Originating-IP: [208.185.168.99] Received: by 10.79.94.130 with HTTP; Thu, 5 Oct 2017 09:57:36 -0700 (PDT) In-Reply-To: References: <201710051640.v95GeoFP048405@repo.freebsd.org> From: Warner Losh Date: Thu, 5 Oct 2017 09:57:36 -0700 X-Google-Sender-Auth: A9hKLGhgvefuHk_02a5QpvjqDH0 Message-ID: Subject: Re: svn commit: r324319 - head/sys/conf To: Hans Petter Selasky Cc: src-committers , svn-src-head@freebsd.org, svn-src-all@freebsd.org, Warner Losh Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 16:57:38 -0000 On Oct 5, 2017 9:44 AM, "Hans Petter Selasky" wrote: On 10/05/17 18:40, Warner Losh wrote: > Author: imp > Date: Thu Oct 5 16:40:50 2017 > New Revision: 324319 > URL: https://svnweb.freebsd.org/changeset/base/324319 > > Log: > Document KERNBUILDDIR. > Sponsored by: Netflix > > Modified: > head/sys/conf/kmod.mk > > Modified: head/sys/conf/kmod.mk > ============================================================ > ================== > --- head/sys/conf/kmod.mk Thu Oct 5 14:43:30 2017 (r324318) > +++ head/sys/conf/kmod.mk Thu Oct 5 16:40:50 2017 (r324319) > @@ -44,6 +44,10 @@ > # > # DESTDIR The tree where the module gets installed. [not set] > # > +# KERNBUILDDIR > +# Set to the location of the kernel build directory where > +# the opt_*.h files, .o's and kernel winds up. > +# > # +++ targets +++ > # > # install: > > > An idea: Should all this information be printed to stdout when typing: make help No. I don't think this would be good value. Warner From owner-svn-src-head@freebsd.org Thu Oct 5 17:45:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A87C2E3E3DF; Thu, 5 Oct 2017 17:45:00 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::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 62CDD7EF6D; Thu, 5 Oct 2017 17:45:00 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x229.google.com with SMTP id y138so2348306itc.5; Thu, 05 Oct 2017 10:45:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=GjRHVBkiQ3DHEf/9dtxOCgwRz53jMdXUr3AAtS6OGhA=; b=YXFlBVamlReIafkce8GeLzzij+fKlBsBg0dcPf+ZyvVCPIAYdpUX1ABkTaffhja++h /cajASNBzxMZ5vU4SptGuzWwyvh7DaRjAtXIJSKzCp2ErkwuRPNtbEGwg0ZrFDPua/1A YEHCFamE5sJzf9lyRz+0VXKcPgAjp3yj+xXV739cTNyGXadwILDY1fPVS1fWZ0H4/Q7D XrW2WgNf+AfBDoxFNwJcb/MoFDtW0s401F8Chq//iWZsaOKgPL8E35gAaPArRsIj2oY9 2rhEfT/D3wxGa6Q+L6ZYYaowZSstKz4xE6ONweUE0Llh+aEttron3vGCHdVsu0bYcp0L Roag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=GjRHVBkiQ3DHEf/9dtxOCgwRz53jMdXUr3AAtS6OGhA=; b=HXDEvVlExWpWnqLIYU8VJzRKtB+KkYEtwNUPLdjBqxl84ii2QE2Ue2lE6Rr8NF5CXq 4vkeeyg6Vt12V8UjJcXwFmS4a//wPfDIiOO619kSJCjBifKnip8bix7uaxl7fLp3197Z O5AVcrFzTXS8wwMUCHTTm+L+ZKFa04I5FvJlcAvja+SmFj8aLnPdPmjlt4WCJVjdK6QR J5YvAnOu53q44exunGkRm4waTPLvzXma0ZYkmiD5Gy5bV1bM4YhO/0ZNTdK6HoZrwbuE PmgkMdGDjAvh4/aZnJHAcrlzE3D6R6nAs0rUxfTofopAO73gUfh1M6+Ot7ZpsCmx16HR Bj7w== X-Gm-Message-State: AMCzsaV4qkAdicI22HbQyjb603uvRPTvXML2gRq2Yi3tZmTkCI83avU6 UFYFcJ5Lr2tyobX4gWYjGXi+hfDJZ9vppvRHRg+tdA== X-Google-Smtp-Source: AOwi7QDdr7Vqd63E+KCb5dCoGD8WOYM9GdoHuPYWzFuj6meUxV0wpu6OnfG6CLnvmGyDT9oejVp8cudqD5bTxuo0w9s= X-Received: by 10.36.90.205 with SMTP id v196mr32377204ita.70.1507225499615; Thu, 05 Oct 2017 10:44:59 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.4.80 with HTTP; Thu, 5 Oct 2017 10:44:38 -0700 (PDT) In-Reply-To: <1daf8629-7c80-5b43-3d8e-31a925b44538@FreeBSD.org> References: <201710012012.v91KCUvU024559@repo.freebsd.org> <73fc56c3-2a00-44a4-9d3c-5ff77053ddf6@FreeBSD.org> <1daf8629-7c80-5b43-3d8e-31a925b44538@FreeBSD.org> From: Ed Maste Date: Thu, 5 Oct 2017 19:44:38 +0200 X-Google-Sender-Auth: IFnUq-dK4v0JshZUpIB2mueKFIk Message-ID: Subject: Re: svn commit: r324178 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua To: Andriy Gapon Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 17:45:00 -0000 On 5 October 2017 at 08:29, Andriy Gapon wrote: > > Now I see where I tripped. The code built fine on sparc64 and powerpc does not > build ZFS at all and powerpc64 (with char unsigned) kept failing. > > I am going to commit a platform independent fix soon. Thanks! And sorry for the powerpc64/sparc64 confusion. From owner-svn-src-head@freebsd.org Thu Oct 5 17:52:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98592E3E84A; Thu, 5 Oct 2017 17:52:39 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65FEE7F565; Thu, 5 Oct 2017 17:52:39 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95HqcG2080504; Thu, 5 Oct 2017 17:52:38 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95HqcuE080503; Thu, 5 Oct 2017 17:52:38 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201710051752.v95HqcuE080503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Thu, 5 Oct 2017 17:52:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324323 - head/sys/dev/bnxt X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/dev/bnxt X-SVN-Commit-Revision: 324323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 17:52:39 -0000 Author: shurd Date: Thu Oct 5 17:52:38 2017 New Revision: 324323 URL: https://svnweb.freebsd.org/changeset/base/324323 Log: bnxt: fix intermittent VLAN issues bnxt_init() is invokes Function Reset (bnxt_hwrm_func_reset) and thus FW configuration for VLANs get erased. To fix this, in bnxt_init(), Invoking HWRM to configure VLANs (bnxt_hwrm_cfa_l2_set_rx_mask). Submitted by: Siva Kallam Reviewed by: shurd, sbruno Approved by: sbruno (mentor) Sponsored by: Broadcom Limited Differential Revision: https://reviews.freebsd.org/D12527 Modified: head/sys/dev/bnxt/if_bnxt.c Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Thu Oct 5 17:02:21 2017 (r324322) +++ head/sys/dev/bnxt/if_bnxt.c Thu Oct 5 17:52:38 2017 (r324323) @@ -1125,6 +1125,7 @@ bnxt_init(if_ctx_t ctx) bnxt_do_enable_intr(&softc->def_cp_ring); bnxt_media_status(softc->ctx, &ifmr); + bnxt_hwrm_cfa_l2_set_rx_mask(softc, &softc->vnic_info); return; fail: From owner-svn-src-head@freebsd.org Thu Oct 5 18:42:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC90EE3F5FF; Thu, 5 Oct 2017 18:42:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 889728104D; Thu, 5 Oct 2017 18:42:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95IgDN5001994; Thu, 5 Oct 2017 18:42:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95IgDC4001993; Thu, 5 Oct 2017 18:42:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710051842.v95IgDC4001993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Oct 2017 18:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324326 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 324326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 18:42:14 -0000 Author: kib Date: Thu Oct 5 18:42:13 2017 New Revision: 324326 URL: https://svnweb.freebsd.org/changeset/base/324326 Log: Style. Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/sys_machdep.c Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Thu Oct 5 18:38:42 2017 (r324325) +++ head/sys/i386/i386/sys_machdep.c Thu Oct 5 18:42:13 2017 (r324326) @@ -166,7 +166,7 @@ sysarch(struct thread *td, struct sysarch_args *uap) break; } - switch(uap->op) { + switch (uap->op) { case I386_GET_LDT: error = i386_get_ldt(td, &kargs.largs); break; @@ -432,8 +432,7 @@ user_ldt_alloc(struct mdproc *mdp, int len) mtx_assert(&dt_lock, MA_OWNED); mtx_unlock_spin(&dt_lock); - new_ldt = malloc(sizeof(struct proc_ldt), - M_SUBPROC, M_WAITOK); + new_ldt = malloc(sizeof(struct proc_ldt), M_SUBPROC, M_WAITOK); new_ldt->ldt_len = len = NEW_MAX_LD(len); new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_arena, @@ -463,10 +462,11 @@ user_ldt_alloc(struct mdproc *mdp, int len) void user_ldt_free(struct thread *td) { - struct mdproc *mdp = &td->td_proc->p_md; + struct mdproc *mdp; struct proc_ldt *pldt; mtx_assert(&dt_lock, MA_OWNED); + mdp = &td->td_proc->p_md; if ((pldt = mdp->md_ldt) == NULL) { mtx_unlock_spin(&dt_lock); return; @@ -587,12 +587,11 @@ i386_set_ldt(td, uap, descs) return (0); } - if (!(uap->start == LDT_AUTO_ALLOC && uap->num == 1)) { + if (uap->start != LDT_AUTO_ALLOC || uap->num != 1) { /* verify range of descriptors to modify */ largest_ld = uap->start + uap->num; - if (uap->start >= MAX_LD || largest_ld > MAX_LD) { + if (uap->start >= MAX_LD || largest_ld > MAX_LD) return (EINVAL); - } } /* Check descriptors for access violations */ @@ -618,12 +617,7 @@ i386_set_ldt(td, uap, descs) case SDT_SYS386TGT: /* system 386 trap gate */ case SDT_SYS286CGT: /* system 286 call gate */ case SDT_SYS386CGT: /* system 386 call gate */ - /* I can't think of any reason to allow a user proc - * to create a segment of these types. They are - * for OS use only. - */ return (EACCES); - /*NOTREACHED*/ /* memory segment types */ case SDT_MEMEC: /* memory execute only conforming */ @@ -648,12 +642,11 @@ i386_set_ldt(td, uap, descs) case SDT_MEMERA: /* memory execute read accessed */ break; default: - return(EINVAL); - /*NOTREACHED*/ + return (EINVAL); } /* Only user (ring-3) descriptors may be present. */ - if ((dp->sd.sd_p != 0) && (dp->sd.sd_dpl != SEL_UPL)) + if (dp->sd.sd_p != 0 && dp->sd.sd_dpl != SEL_UPL) return (EACCES); } From owner-svn-src-head@freebsd.org Thu Oct 5 18:51:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6149EE3F8A3; Thu, 5 Oct 2017 18:51:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D53681703; Thu, 5 Oct 2017 18:51:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95IpmTZ005785; Thu, 5 Oct 2017 18:51:48 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95IpmRF005784; Thu, 5 Oct 2017 18:51:48 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710051851.v95IpmRF005784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 5 Oct 2017 18:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324328 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 324328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 18:51:49 -0000 Author: mjg Date: Thu Oct 5 18:51:48 2017 New Revision: 324328 URL: https://svnweb.freebsd.org/changeset/base/324328 Log: amd64: remove unused variable from pmap_delayed_invl_genp Reported by: gcc MFC after: 1 week Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Oct 5 18:51:32 2017 (r324327) +++ head/sys/amd64/amd64/pmap.c Thu Oct 5 18:51:48 2017 (r324328) @@ -535,14 +535,12 @@ pmap_delayed_invl_genp(vm_page_t m) static void pmap_delayed_invl_wait(vm_page_t m) { - struct thread *td; struct turnstile *ts; u_long *m_gen; #ifdef PV_STATS bool accounted = false; #endif - td = curthread; m_gen = pmap_delayed_invl_genp(m); while (*m_gen > pmap_invl_gen) { #ifdef PV_STATS From owner-svn-src-head@freebsd.org Thu Oct 5 18:58:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23D9EE3FA47; Thu, 5 Oct 2017 18:58:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4F9581B8B; Thu, 5 Oct 2017 18:58:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95IwTVN007173; Thu, 5 Oct 2017 18:58:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95IwTEg007172; Thu, 5 Oct 2017 18:58:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710051858.v95IwTEg007172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Oct 2017 18:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324330 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 324330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 18:58:30 -0000 Author: kib Date: Thu Oct 5 18:58:28 2017 New Revision: 324330 URL: https://svnweb.freebsd.org/changeset/base/324330 Log: Correct format specifiers in the debug code. Style. Requested by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/sys_machdep.c Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Thu Oct 5 18:58:24 2017 (r324329) +++ head/sys/i386/i386/sys_machdep.c Thu Oct 5 18:58:28 2017 (r324330) @@ -511,8 +511,8 @@ i386_get_ldt(td, uap) int nldt, num; union descriptor *lp; -#ifdef DEBUG - printf("i386_get_ldt: start=%d num=%d descs=%p\n", +#ifdef DEBUG + printf("i386_get_ldt: start=%u num=%u descs=%p\n", uap->start, uap->num, (void *)uap->descs); #endif @@ -553,8 +553,8 @@ i386_set_ldt(td, uap, descs) struct proc_ldt *pldt; union descriptor *dp; -#ifdef DEBUG - printf("i386_set_ldt: start=%d num=%d descs=%p\n", +#ifdef DEBUG + printf("i386_set_ldt: start=%u num=%u descs=%p\n", uap->start, uap->num, (void *)uap->descs); #endif error = 0; From owner-svn-src-head@freebsd.org Thu Oct 5 19:00:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CA00E3FB86; Thu, 5 Oct 2017 19:00:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C9AC81E8F; Thu, 5 Oct 2017 19:00:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95J0M9i007387; Thu, 5 Oct 2017 19:00:22 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95J0MEj007386; Thu, 5 Oct 2017 19:00:22 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201710051900.v95J0MEj007386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 5 Oct 2017 19:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324331 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 324331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 19:00:23 -0000 Author: gjb Date: Thu Oct 5 19:00:22 2017 New Revision: 324331 URL: https://svnweb.freebsd.org/changeset/base/324331 Log: Fix the 'reldoc' target, following doc commit r51047. Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Thu Oct 5 18:58:28 2017 (r324330) +++ head/release/Makefile Thu Oct 5 19:00:22 2017 (r324331) @@ -161,14 +161,18 @@ ports.txz: ${XZ_CMD} > ${.OBJDIR}/ports.txz reldoc: - cd ${.CURDIR}/doc && ${MAKE} all install clean 'FORMATS=html txt' \ + cd ${DOCDIR}/en_US.ISO8859-1/htdocs/releases/${REVISION}R && \ + ${MAKE} all install clean 'FORMATS=html txt' \ INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc mkdir -p reldoc .for i in hardware readme relnotes errata - ln -f rdoc/${RELNOTES_LANG}/${i}/article.txt reldoc/${i:tu}.TXT - ln -f rdoc/${RELNOTES_LANG}/${i}/article.html reldoc/${i:tu}.HTM + ln -f ${DOCDIR}/${RELNOTES_LANG}/htdocs/releases/${REVISION}R/${i}/${i:tl}.txt \ + reldoc/${i:tu}.TXT + ln -f ${DOCDIR}/${RELNOTES_LANG}/htdocs/releases/${REVISION}R/${i}/${i:tl}.html \ + reldoc/${i:tu}.HTM .endfor - cp rdoc/${RELNOTES_LANG}/readme/docbook.css reldoc + cp ${DOCDIR}/${RELNOTES_LANG}/htdocs/releases/${REVISION}R/readme/docbook.css \ + reldoc disc1: packagesystem # Install system From owner-svn-src-head@freebsd.org Thu Oct 5 19:11:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDA5CE400C6; Thu, 5 Oct 2017 19:11:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8450A829D0; Thu, 5 Oct 2017 19:11:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95JBPqD011999; Thu, 5 Oct 2017 19:11:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95JBP6F011998; Thu, 5 Oct 2017 19:11:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710051911.v95JBP6F011998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Oct 2017 19:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324334 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 324334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 19:11:26 -0000 Author: kib Date: Thu Oct 5 19:11:25 2017 New Revision: 324334 URL: https://svnweb.freebsd.org/changeset/base/324334 Log: Use ANSI C declarations. Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/sys_machdep.c Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Thu Oct 5 19:03:50 2017 (r324333) +++ head/sys/i386/i386/sys_machdep.c Thu Oct 5 19:11:25 2017 (r324334) @@ -502,9 +502,7 @@ user_ldt_deref(struct proc_ldt *pldt) * the OS-specific one. */ int -i386_get_ldt(td, uap) - struct thread *td; - struct i386_ldt_args *uap; +i386_get_ldt(struct thread *td, struct i386_ldt_args *uap) { int error = 0; struct proc_ldt *pldt; @@ -542,10 +540,8 @@ i386_get_ldt(td, uap) } int -i386_set_ldt(td, uap, descs) - struct thread *td; - struct i386_ldt_args *uap; - union descriptor *descs; +i386_set_ldt(struct thread *td, struct i386_ldt_args *uap, + union descriptor *descs) { int error, i; int largest_ld; From owner-svn-src-head@freebsd.org Thu Oct 5 19:18:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1694DE401D9; Thu, 5 Oct 2017 19:18:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E102A82C82; Thu, 5 Oct 2017 19:18:03 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95JI262016037; Thu, 5 Oct 2017 19:18:02 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95JI2aA016034; Thu, 5 Oct 2017 19:18:02 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710051918.v95JI2aA016034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 5 Oct 2017 19:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324335 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 324335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 19:18:04 -0000 Author: mjg Date: Thu Oct 5 19:18:02 2017 New Revision: 324335 URL: https://svnweb.freebsd.org/changeset/base/324335 Log: locks: take the number of readers into account when waiting Previous code would always spin once before checking the lock. But a lock with e.g. 6 readers is not going to become free in the duration of once spin even if they start draining immediately. Conservatively perform one for each reader. Note that the total number of allowed spins is still extremely small and is subject to change later. MFC after: 1 week Modified: head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c head/sys/sys/lock.h Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Thu Oct 5 19:11:25 2017 (r324334) +++ head/sys/kern/kern_rwlock.c Thu Oct 5 19:18:02 2017 (r324335) @@ -414,7 +414,7 @@ __rw_rlock_hard(volatile uintptr_t *c, struct thread * #ifdef ADAPTIVE_RWLOCKS volatile struct thread *owner; int spintries = 0; - int i; + int i, n; #endif #ifdef LOCK_PROFILING uint64_t waittime = 0; @@ -488,8 +488,9 @@ __rw_rlock_hard(volatile uintptr_t *c, struct thread * KTR_STATE1(KTR_SCHED, "thread", sched_tdname(curthread), "spinning", "lockname:\"%s\"", rw->lock_object.lo_name); - for (i = 0; i < rowner_loops; i++) { - cpu_spinwait(); + for (i = 0; i < rowner_loops; i += n) { + n = RW_READERS(v); + lock_delay_spin(n); v = RW_READ_VALUE(rw); if ((v & RW_LOCK_READ) == 0 || RW_CAN_READ(td, v)) break; @@ -830,7 +831,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v, ui #ifdef ADAPTIVE_RWLOCKS volatile struct thread *owner; int spintries = 0; - int i; + int i, n; #endif uintptr_t x; #ifdef LOCK_PROFILING @@ -928,8 +929,9 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v, ui KTR_STATE1(KTR_SCHED, "thread", sched_tdname(curthread), "spinning", "lockname:\"%s\"", rw->lock_object.lo_name); - for (i = 0; i < rowner_loops; i++) { - cpu_spinwait(); + for (i = 0; i < rowner_loops; i += n) { + n = RW_READERS(v); + lock_delay_spin(n); v = RW_READ_VALUE(rw); if ((v & RW_LOCK_WRITE_SPINNER) == 0) break; Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Thu Oct 5 19:11:25 2017 (r324334) +++ head/sys/kern/kern_sx.c Thu Oct 5 19:18:02 2017 (r324335) @@ -502,7 +502,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t t GIANT_DECLARE; #ifdef ADAPTIVE_SX volatile struct thread *owner; - u_int i, spintries = 0; + u_int i, n, spintries = 0; #endif #ifdef LOCK_PROFILING uint64_t waittime = 0; @@ -600,12 +600,13 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t t "lockname:\"%s\"", sx->lock_object.lo_name); GIANT_SAVE(); spintries++; - for (i = 0; i < asx_loops; i++) { + for (i = 0; i < asx_loops; i += n) { if (LOCK_LOG_TEST(&sx->lock_object, 0)) CTR4(KTR_LOCK, "%s: shared spinning on %p with %u and %u", __func__, sx, spintries, i); - cpu_spinwait(); + n = SX_SHARERS(x); + lock_delay_spin(n); x = SX_READ_VALUE(sx); if ((x & SX_LOCK_SHARED) == 0 || SX_SHARERS(x) == 0) Modified: head/sys/sys/lock.h ============================================================================== --- head/sys/sys/lock.h Thu Oct 5 19:11:25 2017 (r324334) +++ head/sys/sys/lock.h Thu Oct 5 19:18:02 2017 (r324335) @@ -226,6 +226,13 @@ lock_delay_arg_init(struct lock_delay_arg *la, struct la->spin_cnt = 0; } +#define lock_delay_spin(n) do { \ + u_int _i; \ + \ + for (_i = (n); _i > 0; _i--) \ + cpu_spinwait(); \ +} while (0) + #define LOCK_DELAY_SYSINIT(func) \ SYSINIT(func##_ld, SI_SUB_LOCK, SI_ORDER_ANY, func, NULL) From owner-svn-src-head@freebsd.org Thu Oct 5 20:10:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D24CE41843; Thu, 5 Oct 2017 20:10:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 181AD71; Thu, 5 Oct 2017 20:10:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95KAeN0038227; Thu, 5 Oct 2017 20:10:40 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95KAef9038224; Thu, 5 Oct 2017 20:10:40 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201710052010.v95KAef9038224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 5 Oct 2017 20:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324336 - in head/sys/fs: nfs nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 324336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 20:10:41 -0000 Author: rmacklem Date: Thu Oct 5 20:10:40 2017 New Revision: 324336 URL: https://svnweb.freebsd.org/changeset/base/324336 Log: Add Flex File Layout support to the NFSv4.1 pNFS client. This patch adds support for the Flexible File Layout to the pNFS client. Although the patch is rather large, it should only affect NFS mounts using the "pnfs" option against pNFS servers that do not support File Layout. There are still a couple of things missing from the Flexible File Layout client implementation: - The code does not yet do a LayoutReturn with I/O error stats when I/O error(s) occur when attempting to do I/O on a DS. This will be fixed in a future commit, since it is important for the MDS to know that I/O on a DS is failing. - The current code does writes and commits to mirror DSs serially. Making them happen concurrently will be done in a future commit, after discussion on freebsd-current@ on the best way to do this. - The code does not handle NFSv4.0 DSs. Since there is no extant pNFS server that implements NFSv4.0 DSs and NFSv4.1 DSs makes more sense now, I don't intend to implement this until there is a need for it. There is support for NFSv4.1 and NFSv3 DSs. Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Thu Oct 5 19:18:02 2017 (r324335) +++ head/sys/fs/nfs/nfs_var.h Thu Oct 5 20:10:40 2017 (r324336) @@ -555,7 +555,7 @@ int nfscl_tryclose(struct nfsclopen *, struct ucred *, struct nfsmount *, NFSPROC_T *); void nfscl_cleanup(NFSPROC_T *); int nfscl_layout(struct nfsmount *, vnode_t, u_int8_t *, int, nfsv4stateid_t *, - int, struct nfsclflayouthead *, struct nfscllayout **, struct ucred *, + int, int, struct nfsclflayouthead *, struct nfscllayout **, struct ucred *, NFSPROC_T *); struct nfscllayout *nfscl_getlayout(struct nfsclclient *, uint8_t *, int, uint64_t, struct nfsclflayout **, int *); Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Thu Oct 5 19:18:02 2017 (r324335) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Thu Oct 5 20:10:40 2017 (r324336) @@ -116,18 +116,28 @@ static int nfscl_doflayoutio(vnode_t, struct uio *, in nfsv4stateid_t *, int, struct nfscldevinfo *, struct nfscllayout *, struct nfsclflayout *, uint64_t, uint64_t, int, struct ucred *, NFSPROC_T *); +static int nfscl_dofflayoutio(vnode_t, struct uio *, int *, int *, int *, + nfsv4stateid_t *, int, struct nfscldevinfo *, struct nfscllayout *, + struct nfsclflayout *, uint64_t, uint64_t, int, int, struct mbuf *, + struct ucred *, NFSPROC_T *); +static struct mbuf *nfsm_copym(struct mbuf *, int, int); static int nfsrpc_readds(vnode_t, struct uio *, nfsv4stateid_t *, int *, - struct nfsclds *, uint64_t, int, struct nfsfh *, struct ucred *, - NFSPROC_T *); + struct nfsclds *, uint64_t, int, struct nfsfh *, int, int, int, + struct ucred *, NFSPROC_T *); static int nfsrpc_writeds(vnode_t, struct uio *, int *, int *, nfsv4stateid_t *, struct nfsclds *, uint64_t, int, - struct nfsfh *, int, struct ucred *, NFSPROC_T *); + struct nfsfh *, int, int, int, int, struct ucred *, NFSPROC_T *); +static int nfsrpc_writedsmir(vnode_t, int *, int *, nfsv4stateid_t *, + struct nfsclds *, uint64_t, int, struct nfsfh *, struct mbuf *, int, int, + struct ucred *, NFSPROC_T *); static enum nfsclds_state nfscl_getsameserver(struct nfsmount *, struct nfsclds *, struct nfsclds **); static int nfsrpc_commitds(vnode_t, uint64_t, int, struct nfsclds *, - struct nfsfh *, struct ucred *, NFSPROC_T *); + struct nfsfh *, int, int, struct ucred *, NFSPROC_T *); static void nfsrv_setuplayoutget(struct nfsrv_descript *, int, uint64_t, - uint64_t, uint64_t, nfsv4stateid_t *, int, int); + uint64_t, uint64_t, nfsv4stateid_t *, int, int, int); +static int nfsrv_parseug(struct nfsrv_descript *, int, uid_t *, gid_t *, + NFSPROC_T *); static int nfsrv_parselayoutget(struct nfsrv_descript *, nfsv4stateid_t *, int *, struct nfsclflayouthead *); static int nfsrpc_getopenlayout(struct nfsmount *, vnode_t, u_int8_t *, @@ -139,19 +149,19 @@ static int nfsrpc_getcreatelayout(vnode_t, char *, int struct nfsfh **, int *, int *, void *, int *); static int nfsrpc_openlayoutrpc(struct nfsmount *, vnode_t, u_int8_t *, int, uint8_t *, int, uint32_t, struct nfsclopen *, uint8_t *, int, - struct nfscldeleg **, nfsv4stateid_t *, int, int, int *, + struct nfscldeleg **, nfsv4stateid_t *, int, int, int, int *, struct nfsclflayouthead *, int *, struct ucred *, NFSPROC_T *); static int nfsrpc_createlayout(vnode_t, char *, int, struct vattr *, nfsquad_t, int, struct nfsclowner *, struct nfscldeleg **, struct ucred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *, struct nfsfh **, int *, int *, void *, int *, nfsv4stateid_t *, - int, int, int *, struct nfsclflayouthead *, int *); + int, int, int, int *, struct nfsclflayouthead *, int *); static int nfsrpc_layoutget(struct nfsmount *, uint8_t *, int, int, uint64_t, - uint64_t, uint64_t, int, nfsv4stateid_t *, int *, struct nfsclflayouthead *, - struct ucred *, NFSPROC_T *, void *); + uint64_t, uint64_t, int, int, nfsv4stateid_t *, int *, + struct nfsclflayouthead *, struct ucred *, NFSPROC_T *, void *); static int nfsrpc_layoutgetres(struct nfsmount *, vnode_t, uint8_t *, int, nfsv4stateid_t *, int, uint32_t *, struct nfscllayout **, - struct nfsclflayouthead *, int, int *, struct ucred *, NFSPROC_T *); + struct nfsclflayouthead *, int, int, int *, struct ucred *, NFSPROC_T *); /* * nfs null call from vfs. @@ -4849,9 +4859,10 @@ nfsrpc_destroyclient(struct nfsmount *nmp, struct nfsc */ static int nfsrpc_layoutget(struct nfsmount *nmp, uint8_t *fhp, int fhlen, int iomode, - uint64_t offset, uint64_t len, uint64_t minlen, int layoutlen, - nfsv4stateid_t *stateidp, int *retonclosep, struct nfsclflayouthead *flhp, - struct ucred *cred, NFSPROC_T *p, void *stuff) + uint64_t offset, uint64_t len, uint64_t minlen, int layouttype, + int layoutlen, nfsv4stateid_t *stateidp, int *retonclosep, + struct nfsclflayouthead *flhp, struct ucred *cred, NFSPROC_T *p, + void *stuff) { struct nfsrv_descript nfsd, *nd = &nfsd; int error; @@ -4859,7 +4870,7 @@ nfsrpc_layoutget(struct nfsmount *nmp, uint8_t *fhp, i nfscl_reqstart(nd, NFSPROC_LAYOUTGET, nmp, fhp, fhlen, NULL, NULL, 0, 0); nfsrv_setuplayoutget(nd, iomode, offset, len, minlen, stateidp, - layoutlen, 0); + layouttype, layoutlen, 0); nd->nd_flag |= ND_USEGSSNAME; error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred, NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); @@ -4882,7 +4893,7 @@ nfsrpc_getdeviceinfo(struct nfsmount *nmp, uint8_t *de uint32_t *notifybitsp, struct nfscldevinfo **ndip, struct ucred *cred, NFSPROC_T *p) { - uint32_t cnt, *tl; + uint32_t cnt, *tl, vers, minorvers; struct nfsrv_descript nfsd; struct nfsrv_descript *nd = &nfsd; struct sockaddr_in sin, ssin; @@ -4915,51 +4926,68 @@ nfsrpc_getdeviceinfo(struct nfsmount *nmp, uint8_t *de if (error != 0) return (error); if (nd->nd_repstat == 0) { - NFSM_DISSECT(tl, uint32_t *, 3 * NFSX_UNSIGNED); - if (layouttype != fxdr_unsigned(int, *tl++)) + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); + if (layouttype != fxdr_unsigned(int, *tl)) printf("EEK! devinfo layout type not same!\n"); - stripecnt = fxdr_unsigned(int, *++tl); - NFSCL_DEBUG(4, "stripecnt=%d\n", stripecnt); - if (stripecnt < 1 || stripecnt > 4096) { - printf("NFS devinfo stripecnt %d: out of range\n", - stripecnt); - error = NFSERR_BADXDR; - goto nfsmout; - } - NFSM_DISSECT(tl, uint32_t *, (stripecnt + 1) * NFSX_UNSIGNED); - addrcnt = fxdr_unsigned(int, *(tl + stripecnt)); - NFSCL_DEBUG(4, "addrcnt=%d\n", addrcnt); - if (addrcnt < 1 || addrcnt > 128) { - printf("NFS devinfo addrcnt %d: out of range\n", - addrcnt); - error = NFSERR_BADXDR; - goto nfsmout; - } - - /* - * Now we know how many stripe indices and addresses, so - * we can allocate the structure the correct size. - */ - i = (stripecnt * sizeof(uint8_t)) / sizeof(struct nfsclds *) - + 1; - NFSCL_DEBUG(4, "stripeindices=%d\n", i); - ndi = malloc(sizeof(*ndi) + (addrcnt + i) * - sizeof(struct nfsclds *), M_NFSDEVINFO, M_WAITOK | M_ZERO); - NFSBCOPY(deviceid, ndi->nfsdi_deviceid, NFSX_V4DEVICEID); - ndi->nfsdi_refcnt = 0; - ndi->nfsdi_stripecnt = stripecnt; - ndi->nfsdi_addrcnt = addrcnt; - /* Fill in the stripe indices. */ - for (i = 0; i < stripecnt; i++) { - stripeindex = fxdr_unsigned(uint8_t, *tl++); - NFSCL_DEBUG(4, "stripeind=%d\n", stripeindex); - if (stripeindex >= addrcnt) { - printf("NFS devinfo stripeindex %d: too big\n", - (int)stripeindex); + if (layouttype == NFSLAYOUT_NFSV4_1_FILES) { + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); + stripecnt = fxdr_unsigned(int, *tl); + NFSCL_DEBUG(4, "stripecnt=%d\n", stripecnt); + if (stripecnt < 1 || stripecnt > 4096) { + printf("pNFS File layout devinfo stripecnt %d:" + " out of range\n", stripecnt); error = NFSERR_BADXDR; goto nfsmout; } - nfsfldi_setstripeindex(ndi, i, stripeindex); + NFSM_DISSECT(tl, uint32_t *, (stripecnt + 1) * + NFSX_UNSIGNED); + addrcnt = fxdr_unsigned(int, *(tl + stripecnt)); + NFSCL_DEBUG(4, "addrcnt=%d\n", addrcnt); + if (addrcnt < 1 || addrcnt > 128) { + printf("NFS devinfo addrcnt %d: out of range\n", + addrcnt); + error = NFSERR_BADXDR; + goto nfsmout; + } + + /* + * Now we know how many stripe indices and addresses, so + * we can allocate the structure the correct size. + */ + i = (stripecnt * sizeof(uint8_t)) / + sizeof(struct nfsclds *) + 1; + NFSCL_DEBUG(4, "stripeindices=%d\n", i); + ndi = malloc(sizeof(*ndi) + (addrcnt + i) * + sizeof(struct nfsclds *), M_NFSDEVINFO, M_WAITOK | + M_ZERO); + NFSBCOPY(deviceid, ndi->nfsdi_deviceid, + NFSX_V4DEVICEID); + ndi->nfsdi_refcnt = 0; + ndi->nfsdi_flags = NFSDI_FILELAYOUT; + ndi->nfsdi_stripecnt = stripecnt; + ndi->nfsdi_addrcnt = addrcnt; + /* Fill in the stripe indices. */ + for (i = 0; i < stripecnt; i++) { + stripeindex = fxdr_unsigned(uint8_t, *tl++); + NFSCL_DEBUG(4, "stripeind=%d\n", stripeindex); + if (stripeindex >= addrcnt) { + printf("pNFS File Layout devinfo" + " stripeindex %d: too big\n", + (int)stripeindex); + error = NFSERR_BADXDR; + goto nfsmout; + } + nfsfldi_setstripeindex(ndi, i, stripeindex); + } + } else if (layouttype == NFSLAYOUT_FLEXFILE) { + /* For Flex File, we only get one address list. */ + ndi = malloc(sizeof(*ndi) + sizeof(struct nfsclds *), + M_NFSDEVINFO, M_WAITOK | M_ZERO); + NFSBCOPY(deviceid, ndi->nfsdi_deviceid, + NFSX_V4DEVICEID); + ndi->nfsdi_refcnt = 0; + ndi->nfsdi_flags = NFSDI_FLEXFILE; + addrcnt = ndi->nfsdi_addrcnt = 1; } /* Now, dissect the server address(es). */ @@ -5005,6 +5033,46 @@ nfsrpc_getdeviceinfo(struct nfsmount *nmp, uint8_t *de } gotvers = NFS_VER4; /* Always NFSv4 for File Layout. */ + /* For Flex File, we will take one of the versions to use. */ + if (layouttype == NFSLAYOUT_FLEXFILE) { + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); + j = fxdr_unsigned(int, *tl); + if (j < 1 || j > NFSDEV_MAXVERS) { + printf("pNFS: too many versions\n"); + error = NFSERR_BADXDR; + goto nfsmout; + } + gotvers = 0; + for (i = 0; i < j; i++) { + NFSM_DISSECT(tl, uint32_t *, 5 * NFSX_UNSIGNED); + vers = fxdr_unsigned(uint32_t, *tl++); + minorvers = fxdr_unsigned(uint32_t, *tl++); + if ((vers == NFS_VER4 && minorvers == + NFSV41_MINORVERSION) || (vers == NFS_VER3 && + gotvers == 0)) { + gotvers = vers; + /* We'll take this one. */ + ndi->nfsdi_versindex = i; + ndi->nfsdi_vers = vers; + ndi->nfsdi_minorvers = minorvers; + ndi->nfsdi_rsize = fxdr_unsigned( + uint32_t, *tl++); + ndi->nfsdi_wsize = fxdr_unsigned( + uint32_t, *tl++); + if (*tl == newnfs_true) + ndi->nfsdi_flags |= + NFSDI_TIGHTCOUPLED; + else + ndi->nfsdi_flags &= + ~NFSDI_TIGHTCOUPLED; + } + } + if (gotvers == 0) { + printf("pNFS: no NFSv3 or NFSv4.1\n"); + error = NFSERR_BADXDR; + goto nfsmout; + } + } /* And the notify bits. */ NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); @@ -5033,7 +5101,7 @@ nfsrpc_getdeviceinfo(struct nfsmount *nmp, uint8_t *de *gotdspp = dsp; } } - if (nd->nd_repstat != 0) + if (nd->nd_repstat != 0 && error == 0) error = nd->nd_repstat; nfsmout: if (error != 0 && ndi != NULL) @@ -5126,7 +5194,15 @@ nfsrpc_layoutreturn(struct nfsmount *nmp, uint8_t *fh, *tl++ = stateidp->other[0]; *tl++ = stateidp->other[1]; *tl++ = stateidp->other[2]; - *tl = txdr_unsigned(0); + if (layouttype == NFSLAYOUT_NFSV4_1_FILES) + *tl = txdr_unsigned(0); + else if (layouttype == NFSLAYOUT_FLEXFILE) { + *tl = txdr_unsigned(2 * NFSX_UNSIGNED); + NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); + /* No ioerrs or stats yet. */ + *tl++ = 0; + *tl = 0; + } } nd->nd_flag |= ND_USEGSSNAME; error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred, @@ -5162,11 +5238,15 @@ nfsrpc_getlayout(struct nfsmount *nmp, vnode_t vp, str struct nfscllayout *lyp; struct nfsclflayout *flp; struct nfsclflayouthead flh; - int error = 0, islocked, layoutlen, recalled, retonclose; + int error = 0, islocked, layoutlen, layouttype, recalled, retonclose; nfsv4stateid_t stateid; struct nfsclsession *tsep; *lypp = NULL; + if (NFSHASFLEXFILE(nmp)) + layouttype = NFSLAYOUT_FLEXFILE; + else + layouttype = NFSLAYOUT_NFSV4_1_FILES; /* * If lyp is returned non-NULL, there will be a refcnt (shared lock) * on it, iff flp != NULL or a lock (exclusive lock) on it iff @@ -5189,8 +5269,8 @@ nfsrpc_getlayout(struct nfsmount *nmp, vnode_t vp, str stateid.other[2] = stateidp->other[2]; error = nfsrpc_layoutget(nmp, nfhp->nfh_fh, nfhp->nfh_len, iomode, (uint64_t)0, UINT64_MAX, - (uint64_t)0, layoutlen, &stateid, &retonclose, - &flh, cred, p, NULL); + (uint64_t)0, layouttype, layoutlen, &stateid, + &retonclose, &flh, cred, p, NULL); } else { islocked = 1; stateid.seqid = lyp->nfsly_stateid.seqid; @@ -5199,12 +5279,12 @@ nfsrpc_getlayout(struct nfsmount *nmp, vnode_t vp, str stateid.other[2] = lyp->nfsly_stateid.other[2]; error = nfsrpc_layoutget(nmp, nfhp->nfh_fh, nfhp->nfh_len, iomode, off, UINT64_MAX, - (uint64_t)0, layoutlen, &stateid, &retonclose, - &flh, cred, p, NULL); + (uint64_t)0, layouttype, layoutlen, &stateid, + &retonclose, &flh, cred, p, NULL); } error = nfsrpc_layoutgetres(nmp, vp, nfhp->nfh_fh, nfhp->nfh_len, &stateid, retonclose, notifybitsp, &lyp, - &flh, error, NULL, cred, p); + &flh, layouttype, error, NULL, cred, p); if (error == 0) *lypp = lyp; else if (islocked != 0) @@ -5336,38 +5416,53 @@ nfsrpc_fillsa(struct nfsmount *nmp, struct sockaddr_in error = newnfs_connect(nmp, nrp, NULL, p, 0); NFSCL_DEBUG(3, "DS connect=%d\n", error); + dsp = NULL; /* Now, do the exchangeid and create session. */ if (error == 0) { - error = nfsrpc_exchangeid(nmp, clp, nrp, NFSV4EXCH_USEPNFSDS, - &dsp, nrp->nr_cred, p); - NFSCL_DEBUG(3, "DS exchangeid=%d\n", error); - if (error != 0) - newnfs_disconnect(nrp); + if (vers == NFS_VER4) { + error = nfsrpc_exchangeid(nmp, clp, nrp, + NFSV4EXCH_USEPNFSDS, &dsp, nrp->nr_cred, p); + NFSCL_DEBUG(3, "DS exchangeid=%d\n", error); + if (error != 0) + newnfs_disconnect(nrp); + } else { + dsp = malloc(sizeof(struct nfsclds), M_NFSCLDS, + M_WAITOK | M_ZERO); + dsp->nfsclds_flags |= NFSCLDS_DS; + dsp->nfsclds_expire = INT32_MAX; /* No renews needed. */ + mtx_init(&dsp->nfsclds_mtx, "nfsds", NULL, MTX_DEF); + mtx_init(&dsp->nfsclds_sess.nfsess_mtx, "nfssession", + NULL, MTX_DEF); + } } if (error == 0) { dsp->nfsclds_sockp = nrp; - NFSLOCKMNT(nmp); - retv = nfscl_getsameserver(nmp, dsp, &tdsp); - NFSCL_DEBUG(3, "getsame ret=%d\n", retv); - if (retv == NFSDSP_USETHISSESSION) { + if (vers == NFS_VER4) { + NFSLOCKMNT(nmp); + retv = nfscl_getsameserver(nmp, dsp, &tdsp); + NFSCL_DEBUG(3, "getsame ret=%d\n", retv); + if (retv == NFSDSP_USETHISSESSION) { + NFSUNLOCKMNT(nmp); + /* + * If there is already a session for this + * server, use it. + */ + (void)newnfs_disconnect(nrp); + nfscl_freenfsclds(dsp); + *dspp = tdsp; + return (0); + } + if (retv == NFSDSP_SEQTHISSESSION) + sequenceid = + tdsp->nfsclds_sess.nfsess_sequenceid; + else + sequenceid = + dsp->nfsclds_sess.nfsess_sequenceid; NFSUNLOCKMNT(nmp); - /* - * If there is already a session for this server, - * use it. - */ - (void)newnfs_disconnect(nrp); - nfscl_freenfsclds(dsp); - *dspp = tdsp; - return (0); + error = nfsrpc_createsession(nmp, &dsp->nfsclds_sess, + nrp, sequenceid, 0, nrp->nr_cred, p); + NFSCL_DEBUG(3, "DS createsess=%d\n", error); } - if (retv == NFSDSP_SEQTHISSESSION) - sequenceid = tdsp->nfsclds_sess.nfsess_sequenceid; - else - sequenceid = dsp->nfsclds_sess.nfsess_sequenceid; - NFSUNLOCKMNT(nmp); - error = nfsrpc_createsession(nmp, &dsp->nfsclds_sess, - nrp, sequenceid, 0, nrp->nr_cred, p); - NFSCL_DEBUG(3, "DS createsess=%d\n", error); } else { NFSFREECRED(nrp->nr_cred); NFSFREEMUTEX(&nrp->nr_mtx); @@ -5448,11 +5543,17 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode struct nfscllayout *layp; struct nfscldevinfo *dip; struct nfsclflayout *rflp; + struct mbuf *m; nfsv4stateid_t stateid; struct ucred *newcred; uint64_t lastbyte, len, off, oresid, xfer; - int eof, error, iolaymode, recalled; + int eof, error, firstmirror, i, iolaymode, mirrorcnt, recalled; void *lckp; + uint8_t *dev; + void *iovbase; + size_t iovlen; + off_t offs; + ssize_t resid; if (!NFSHASPNFS(nmp) || nfscl_enablecallb == 0 || nfs_numnfscbd == 0 || (np->n_flag & NNOLAYOUT) != 0) @@ -5520,30 +5621,93 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode oresid = xfer = (uint64_t)uiop->uio_resid; if (xfer > (rflp->nfsfl_end - rflp->nfsfl_off)) xfer = rflp->nfsfl_end - rflp->nfsfl_off; - dip = nfscl_getdevinfo(nmp->nm_clp, rflp->nfsfl_dev, - rflp->nfsfl_devp); - if (dip != NULL) { - error = nfscl_doflayoutio(vp, uiop, iomode, - must_commit, &eof, &stateid, rwaccess, dip, - layp, rflp, off, xfer, docommit, newcred, - p); - nfscl_reldevinfo(dip); - lastbyte = off + xfer - 1; - if (error == 0) { + /* + * For Flex File layout with mirrored DSs, select one + * of them at random for reads. For writes and commits, + * do all mirrors. + */ + m = NULL; + firstmirror = 0; + mirrorcnt = 1; + if ((layp->nfsly_flags & NFSLY_FLEXFILE) != 0 && + (mirrorcnt = rflp->nfsfl_mirrorcnt) > 1) { + if (rwaccess == NFSV4OPEN_ACCESSREAD) { + firstmirror = arc4random() % mirrorcnt; + mirrorcnt = firstmirror + 1; + } else if (docommit == 0) { + /* + * Save values, so uiop can be rolled + * back upon a write error. + */ + offs = uiop->uio_offset; + resid = uiop->uio_resid; + iovbase = uiop->uio_iov->iov_base; + iovlen = uiop->uio_iov->iov_len; + m = nfsm_uiombuflist(uiop, len, NULL, + NULL); + } + } + for (i = firstmirror; i < mirrorcnt && error == 0; i++){ + if ((layp->nfsly_flags & NFSLY_FLEXFILE) != 0) + dev = rflp->nfsfl_ffm[i].dev; + else + dev = rflp->nfsfl_dev; + dip = nfscl_getdevinfo(nmp->nm_clp, dev, + rflp->nfsfl_devp); + if (dip != NULL) { + if ((rflp->nfsfl_flags & NFSFL_FLEXFILE) + != 0) + error = nfscl_dofflayoutio(vp, + uiop, iomode, must_commit, + &eof, &stateid, rwaccess, + dip, layp, rflp, off, xfer, + i, docommit, m, newcred, + p); + else + error = nfscl_doflayoutio(vp, + uiop, iomode, must_commit, + &eof, &stateid, rwaccess, + dip, layp, rflp, off, xfer, + docommit, newcred, p); + nfscl_reldevinfo(dip); + } else + error = EIO; + } + if (m != NULL) + m_freem(m); + if (error == 0) { + if (mirrorcnt > 1 && rwaccess == + NFSV4OPEN_ACCESSWRITE && docommit == 0) { NFSLOCKCLSTATE(); - if (lastbyte > layp->nfsly_lastbyte) - layp->nfsly_lastbyte = lastbyte; + layp->nfsly_flags |= NFSLY_WRITTEN; NFSUNLOCKCLSTATE(); - } else if (error == NFSERR_OPENMODE && - rwaccess == NFSV4OPEN_ACCESSREAD) { - NFSLOCKMNT(nmp); - nmp->nm_state |= NFSSTA_OPENMODE; - NFSUNLOCKMNT(nmp); } + lastbyte = off + xfer - 1; + NFSLOCKCLSTATE(); + if (lastbyte > layp->nfsly_lastbyte) + layp->nfsly_lastbyte = lastbyte; + NFSUNLOCKCLSTATE(); + } else if (error == NFSERR_OPENMODE && + rwaccess == NFSV4OPEN_ACCESSREAD) { + NFSLOCKMNT(nmp); + nmp->nm_state |= NFSSTA_OPENMODE; + NFSUNLOCKMNT(nmp); } else error = EIO; if (error == 0) len -= (oresid - (uint64_t)uiop->uio_resid); + else if (mirrorcnt > 1 && rwaccess == + NFSV4OPEN_ACCESSWRITE && docommit == 0) { + /* + * In case the rpc gets retried, roll the + * uio fields changed by nfsm_uiombuflist() + * back. + */ + uiop->uio_offset = offs; + uiop->uio_resid = resid; + uiop->uio_iov->iov_base = iovbase; + uiop->uio_iov->iov_len = iovlen; + } } } if (lckp != NULL) @@ -5555,6 +5719,38 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode } /* + * Make a copy of the mbuf chain and add an mbuf for null padding, as required. + */ +static struct mbuf * +nfsm_copym(struct mbuf *m, int off, int xfer) +{ + struct mbuf *m2, *m3, *m4; + uint32_t *tl; + int rem; + + m2 = m_copym(m, off, xfer, M_WAITOK); + rem = NFSM_RNDUP(xfer) - xfer; + if (rem > 0) { + /* + * The zero padding to a multiple of 4 bytes is required by + * the XDR. So that the mbufs copied by reference aren't + * modified, add an mbuf with the zero'd bytes to the list. + * rem will be a maximum of 3, so one zero'd uint32_t is + * sufficient. + */ + m3 = m2; + while (m3->m_next != NULL) + m3 = m3->m_next; + NFSMGET(m4); + tl = NFSMTOD(m4, uint32_t *); + *tl = 0; + mbuf_setlen(m4, rem); + mbuf_setnext(m3, m4); + } + return (m2); +} + +/* * Find a file layout that will handle the first bytes of the requested * range and return the information from it needed to to the I/O operation. */ @@ -5659,7 +5855,7 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *i if (docommit != 0) { if (error == 0) error = nfsrpc_commitds(vp, io_off, xfer, - *dspp, fhp, cred, p); + *dspp, fhp, 0, 0, cred, p); if (error == 0) { /* * Set both eof and uio_resid = 0 to end any @@ -5674,11 +5870,11 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *i } } else if (rwflag == NFSV4OPEN_ACCESSREAD) error = nfsrpc_readds(vp, uiop, stateidp, eofp, *dspp, - io_off, xfer, fhp, cred, p); + io_off, xfer, fhp, 0, 0, 0, cred, p); else { error = nfsrpc_writeds(vp, uiop, iomode, must_commit, stateidp, *dspp, io_off, xfer, fhp, commit_thru_mds, - cred, p); + 0, 0, 0, cred, p); if (error == 0) { NFSLOCKCLSTATE(); lyp->nfsly_flags |= NFSLY_WRITTEN; @@ -5696,42 +5892,174 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *i } /* + * Do I/O using an NFSv4.1 flex file layout. + */ +static int +nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, + int *eofp, nfsv4stateid_t *stateidp, int rwflag, struct nfscldevinfo *dp, + struct nfscllayout *lyp, struct nfsclflayout *flp, uint64_t off, + uint64_t len, int mirror, int docommit, struct mbuf *mp, struct ucred *cred, + NFSPROC_T *p) +{ + uint64_t transfer, xfer; + int error, rel_off; + struct nfsnode *np; + struct nfsfh *fhp; + struct nfsclds **dspp; + struct ucred *tcred; + struct mbuf *m; + + np = VTONFS(vp); + error = 0; + rel_off = 0; + NFSCL_DEBUG(4, "nfscl_dofflayoutio: off=%ju len=%ju\n", (uintmax_t)off, + (uintmax_t)len); + /* Loop around, doing I/O for each stripe unit. */ + while (len > 0 && error == 0) { + dspp = nfsfldi_addr(dp, 0); + fhp = flp->nfsfl_ffm[mirror].fh[dp->nfsdi_versindex]; + stateidp = &flp->nfsfl_ffm[mirror].st; + NFSCL_DEBUG(4, "mirror=%d vind=%d fhlen=%d st.seqid=0x%x\n", + mirror, dp->nfsdi_versindex, fhp->nfh_len, stateidp->seqid); + if ((dp->nfsdi_flags & NFSDI_TIGHTCOUPLED) == 0) { + tcred = NFSNEWCRED(cred); + tcred->cr_uid = flp->nfsfl_ffm[mirror].user; + tcred->cr_groups[0] = flp->nfsfl_ffm[mirror].group; + tcred->cr_ngroups = 1; + } else + tcred = cred; + if (rwflag == NFSV4OPEN_ACCESSREAD) + transfer = dp->nfsdi_rsize; + else + transfer = dp->nfsdi_wsize; + mtx_lock(&np->n_mtx); + np->n_flag |= NDSCOMMIT; + mtx_unlock(&np->n_mtx); + if (len > transfer && docommit == 0) + xfer = transfer; + else + xfer = len; + if (docommit != 0) { + if (error == 0) + error = nfsrpc_commitds(vp, off, xfer, *dspp, + fhp, dp->nfsdi_vers, dp->nfsdi_minorvers, + tcred, p); + NFSCL_DEBUG(4, "aft nfsrpc_commitds=%d\n", error); + if (error == 0) { + /* + * Set both eof and uio_resid = 0 to end any + * loops. + */ + *eofp = 1; + uiop->uio_resid = 0; + } else { + mtx_lock(&np->n_mtx); + np->n_flag &= ~NDSCOMMIT; + mtx_unlock(&np->n_mtx); + } + } else if (rwflag == NFSV4OPEN_ACCESSREAD) + error = nfsrpc_readds(vp, uiop, stateidp, eofp, *dspp, + off, xfer, fhp, 1, dp->nfsdi_vers, + dp->nfsdi_minorvers, tcred, p); + else { + if (flp->nfsfl_mirrorcnt == 1) { + error = nfsrpc_writeds(vp, uiop, iomode, + must_commit, stateidp, *dspp, off, xfer, + fhp, 0, 1, dp->nfsdi_vers, + dp->nfsdi_minorvers, tcred, p); + if (error == 0) { + NFSLOCKCLSTATE(); + lyp->nfsly_flags |= NFSLY_WRITTEN; + NFSUNLOCKCLSTATE(); + } + } else { + m = nfsm_copym(mp, rel_off, xfer); + NFSCL_DEBUG(4, "mcopy reloff=%d xfer=%jd\n", + rel_off, (uintmax_t)xfer); + error = nfsrpc_writedsmir(vp, iomode, + must_commit, stateidp, *dspp, off, xfer, + fhp, m, dp->nfsdi_vers, dp->nfsdi_minorvers, + tcred, p); + NFSCL_DEBUG(4, "nfsrpc_writedsmir=%d\n", error); + } + } + NFSCL_DEBUG(4, "aft read/writeds=%d\n", error); + if (error == 0) { + len -= xfer; + off += xfer; + rel_off += xfer; + } + if ((dp->nfsdi_flags & NFSDI_TIGHTCOUPLED) == 0) + NFSFREECRED(tcred); + } + NFSCL_DEBUG(4, "eo nfscl_dofflayoutio=%d\n", error); + return (error); +} + +/* * The actual read RPC done to a DS. */ static int nfsrpc_readds(vnode_t vp, struct uio *uiop, nfsv4stateid_t *stateidp, int *eofp, - struct nfsclds *dsp, uint64_t io_off, int len, struct nfsfh *fhp, - struct ucred *cred, NFSPROC_T *p) + struct nfsclds *dsp, uint64_t io_off, int len, struct nfsfh *fhp, int flex, + int vers, int minorvers, struct ucred *cred, NFSPROC_T *p) { uint32_t *tl; - int error, retlen; + int attrflag, error, retlen; struct nfsrv_descript nfsd; struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsrv_descript *nd = &nfsd; struct nfssockreq *nrp; + struct nfsvattr na; nd->nd_mrep = NULL; - nfscl_reqstart(nd, NFSPROC_READDS, nmp, fhp->nfh_fh, fhp->nfh_len, - NULL, &dsp->nfsclds_sess, 0, 0); - nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSEQIDZERO); + if (vers == 0 || vers == NFS_VER4) { + nfscl_reqstart(nd, NFSPROC_READDS, nmp, fhp->nfh_fh, + fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); + vers = NFS_VER4; + NFSCL_DEBUG(4, "nfsrpc_readds: vers4 minvers=%d\n", minorvers); + if (flex != 0) + nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); + else + nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSEQIDZERO); + } else { + nfscl_reqstart(nd, NFSPROC_READ, nmp, fhp->nfh_fh, + fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); + NFSCL_DEBUG(4, "nfsrpc_readds: vers3\n"); + } NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED * 3); txdr_hyper(io_off, tl); *(tl + 2) = txdr_unsigned(len); nrp = dsp->nfsclds_sockp; + NFSCL_DEBUG(4, "nfsrpc_readds: nrp=%p\n", nrp); if (nrp == NULL) /* If NULL, use the MDS socket. */ nrp = &nmp->nm_sockreq; error = newnfs_request(nd, nmp, NULL, nrp, vp, p, cred, - NFS_PROG, NFS_VER4, NULL, 1, NULL, &dsp->nfsclds_sess); + NFS_PROG, vers, NULL, 1, NULL, &dsp->nfsclds_sess); + NFSCL_DEBUG(4, "nfsrpc_readds: stat=%d err=%d\n", nd->nd_repstat, + error); if (error != 0) return (error); + if (vers == NFS_VER3) { + error = nfscl_postop_attr(nd, &na, &attrflag, NULL); + NFSCL_DEBUG(4, "nfsrpc_readds: postop=%d\n", error); + if (error != 0) + goto nfsmout; + } if (nd->nd_repstat != 0) { error = nd->nd_repstat; goto nfsmout; } - NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); - *eofp = fxdr_unsigned(int, *tl); + if (vers == NFS_VER3) { + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); + *eofp = fxdr_unsigned(int, *(tl + 1)); + } else { + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); + *eofp = fxdr_unsigned(int, *tl); + } NFSM_STRSIZ(retlen, len); + NFSCL_DEBUG(4, "nfsrpc_readds: retlen=%d eof=%d\n", retlen, *eofp); error = nfsm_mbufuio(nd, uiop, retlen); nfsmout: if (nd->nd_mrep != NULL) @@ -5745,24 +6073,40 @@ nfsmout: static int nfsrpc_writeds(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, nfsv4stateid_t *stateidp, struct nfsclds *dsp, uint64_t io_off, int len, - struct nfsfh *fhp, int commit_thru_mds, struct ucred *cred, NFSPROC_T *p) + struct nfsfh *fhp, int commit_thru_mds, int flex, int vers, int minorvers, + struct ucred *cred, NFSPROC_T *p) { uint32_t *tl; struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); - int error, rlen, commit, committed = NFSWRITE_FILESYNC; + int attrflag, error, rlen, commit, committed = NFSWRITE_FILESYNC; int32_t backup; struct nfsrv_descript nfsd; struct nfsrv_descript *nd = &nfsd; struct nfssockreq *nrp; + struct nfsvattr na; KASSERT(uiop->uio_iovcnt == 1, ("nfs: writerpc iovcnt > 1")); nd->nd_mrep = NULL; - nfscl_reqstart(nd, NFSPROC_WRITEDS, nmp, fhp->nfh_fh, fhp->nfh_len, - NULL, &dsp->nfsclds_sess, 0, 0); - nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSEQIDZERO); - NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); + if (vers == 0 || vers == NFS_VER4) { + nfscl_reqstart(nd, NFSPROC_WRITEDS, nmp, fhp->nfh_fh, + fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); + NFSCL_DEBUG(4, "nfsrpc_writeds: vers4 minvers=%d\n", minorvers); + vers = NFS_VER4; + if (flex != 0) + nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); + else + nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSEQIDZERO); + NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); + } else { + nfscl_reqstart(nd, NFSPROC_WRITE, nmp, fhp->nfh_fh, + fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); + NFSCL_DEBUG(4, "nfsrpc_writeds: vers3\n"); + NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 3 * NFSX_UNSIGNED); + } txdr_hyper(io_off, tl); tl += 2; + if (vers == NFS_VER3) + *tl++ = txdr_unsigned(len); *tl++ = txdr_unsigned(*iomode); *tl = txdr_unsigned(len); nfsm_uiombuf(nd, uiop, len); @@ -5771,7 +6115,9 @@ nfsrpc_writeds(vnode_t vp, struct uio *uiop, int *iomo /* If NULL, use the MDS socket. */ nrp = &nmp->nm_sockreq; error = newnfs_request(nd, nmp, NULL, nrp, vp, p, cred, - NFS_PROG, NFS_VER4, NULL, 1, NULL, &dsp->nfsclds_sess); + NFS_PROG, vers, NULL, 1, NULL, &dsp->nfsclds_sess); + NFSCL_DEBUG(4, "nfsrpc_writeds: err=%d stat=%d\n", error, + nd->nd_repstat); if (error != 0) return (error); if (nd->nd_repstat != 0) { @@ -5786,8 +6132,16 @@ nfsrpc_writeds(vnode_t vp, struct uio *uiop, int *iomo uio_iov_len_add(uiop, len); error = nd->nd_repstat; } else { + if (vers == NFS_VER3) { + error = nfscl_wcc_data(nd, vp, &na, &attrflag, NULL, + NULL); + NFSCL_DEBUG(4, "nfsrpc_writeds: wcc_data=%d\n", error); + if (error != 0) + goto nfsmout; + } NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED + NFSX_VERF); rlen = fxdr_unsigned(int, *tl++); + NFSCL_DEBUG(4, "nfsrpc_writeds: len=%d rlen=%d\n", len, rlen); if (rlen == 0) { error = NFSERR_IO; goto nfsmout; @@ -5842,6 +6196,117 @@ nfsmout: } /* + * The actual write RPC done to a DS. + * This variant is called from a separate kernel process for mirrors. + * Any short write is considered an IO error. + */ +static int +nfsrpc_writedsmir(vnode_t vp, int *iomode, int *must_commit, + nfsv4stateid_t *stateidp, struct nfsclds *dsp, uint64_t io_off, int len, + struct nfsfh *fhp, struct mbuf *m, int vers, int minorvers, + struct ucred *cred, NFSPROC_T *p) +{ + uint32_t *tl; + struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); + int attrflag, error, commit, committed = NFSWRITE_FILESYNC, rlen; + struct nfsrv_descript nfsd; + struct nfsrv_descript *nd = &nfsd; + struct nfssockreq *nrp; + struct nfsvattr na; + + nd->nd_mrep = NULL; + if (vers == 0 || vers == NFS_VER4) { + nfscl_reqstart(nd, NFSPROC_WRITEDS, nmp, fhp->nfh_fh, + fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); + vers = NFS_VER4; + NFSCL_DEBUG(4, "nfsrpc_writedsmir: vers4 minvers=%d\n", + minorvers); + nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); + NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); + } else { + nfscl_reqstart(nd, NFSPROC_WRITE, nmp, fhp->nfh_fh, + fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); + NFSCL_DEBUG(4, "nfsrpc_writedsmir: vers3\n"); + NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 3 * NFSX_UNSIGNED); + } + txdr_hyper(io_off, tl); + tl += 2; + if (vers == NFS_VER3) + *tl++ = txdr_unsigned(len); + *tl++ = txdr_unsigned(*iomode); + *tl = txdr_unsigned(len); + if (len > 0) { + /* Put data in mbuf chain. */ + nd->nd_mb->m_next = m; + /* Set nd_mb and nd_bpos to end of data. */ + while (m->m_next != NULL) + m = m->m_next; + nd->nd_mb = m; + nd->nd_bpos = mtod(m, char *) + m->m_len; + NFSCL_DEBUG(4, "nfsrpc_writedsmir: lastmb len=%d\n", m->m_len); + } + nrp = dsp->nfsclds_sockp; + if (nrp == NULL) + /* If NULL, use the MDS socket. */ + nrp = &nmp->nm_sockreq; + error = newnfs_request(nd, nmp, NULL, nrp, vp, p, cred, + NFS_PROG, vers, NULL, 1, NULL, &dsp->nfsclds_sess); + NFSCL_DEBUG(4, "nfsrpc_writedsmir: err=%d stat=%d\n", error, + nd->nd_repstat); + if (error != 0) + return (error); + if (nd->nd_repstat != 0) + error = nd->nd_repstat; + else { + if (vers == NFS_VER3) { + error = nfscl_wcc_data(nd, vp, &na, &attrflag, NULL, + NULL); + NFSCL_DEBUG(4, "nfsrpc_writedsmir: wcc_data=%d\n", + error); + if (error != 0) + goto nfsmout; + } + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED + NFSX_VERF); + rlen = fxdr_unsigned(int, *tl++); + NFSCL_DEBUG(4, "nfsrpc_writedsmir: len=%d rlen=%d\n", len, + rlen); + if (rlen != len) { + error = NFSERR_IO; + NFSCL_DEBUG(4, "nfsrpc_writedsmir: len=%d rlen=%d\n", + len, rlen); + goto nfsmout; + } + commit = fxdr_unsigned(int, *tl++); + + /* + * Return the lowest commitment level + * obtained by any of the RPCs. + */ + if (committed == NFSWRITE_FILESYNC) + committed = commit; + else if (committed == NFSWRITE_DATASYNC && + commit == NFSWRITE_UNSTABLE) + committed = commit; + NFSLOCKDS(dsp); + if ((dsp->nfsclds_flags & NFSCLDS_HASWRITEVERF) == 0) { + NFSBCOPY(tl, dsp->nfsclds_verf, NFSX_VERF); + dsp->nfsclds_flags |= NFSCLDS_HASWRITEVERF; + } else if (NFSBCMP(tl, dsp->nfsclds_verf, NFSX_VERF)) { + *must_commit = 1; + NFSBCOPY(tl, dsp->nfsclds_verf, NFSX_VERF); + } + NFSUNLOCKDS(dsp); + } +nfsmout: + if (nd->nd_mrep != NULL) + mbuf_freem(nd->nd_mrep); + *iomode = committed; + if (nd->nd_repstat != 0 && error == 0) + error = nd->nd_repstat; + return (error); +} + +/* * Free up the nfsclds structure. */ void @@ -5913,17 +6378,26 @@ nfscl_getsameserver(struct nfsmount *nmp, struct nfscl */ static int nfsrpc_commitds(vnode_t vp, uint64_t offset, int cnt, struct nfsclds *dsp, - struct nfsfh *fhp, struct ucred *cred, NFSPROC_T *p) + struct nfsfh *fhp, int vers, int minorvers, struct ucred *cred, + NFSPROC_T *p) { uint32_t *tl; struct nfsrv_descript nfsd, *nd = &nfsd; struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfssockreq *nrp; - int error; + struct nfsvattr na; + int attrflag, error; nd->nd_mrep = NULL; - nfscl_reqstart(nd, NFSPROC_COMMITDS, nmp, fhp->nfh_fh, fhp->nfh_len, - NULL, &dsp->nfsclds_sess, 0, 0); + if (vers == 0 || vers == NFS_VER4) { + nfscl_reqstart(nd, NFSPROC_COMMITDS, nmp, fhp->nfh_fh, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Oct 5 20:54:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B734DE427D0; Thu, 5 Oct 2017 20:54:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BB231E34; Thu, 5 Oct 2017 20:54:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95KsV5f058704; Thu, 5 Oct 2017 20:54:31 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95KsVJQ058703; Thu, 5 Oct 2017 20:54:31 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201710052054.v95KsVJQ058703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 5 Oct 2017 20:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324338 - head/release/doc X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/doc X-SVN-Commit-Revision: 324338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 20:54:32 -0000 Author: gjb Date: Thu Oct 5 20:54:31 2017 New Revision: 324338 URL: https://svnweb.freebsd.org/changeset/base/324338 Log: Remove release-related documentation from the base repository, moved to the doc repository (see revisions r51045:r51061). Sponsored by: The FreeBSD Foundation Deleted: head/release/doc/ From owner-svn-src-head@freebsd.org Thu Oct 5 23:01:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20363E44AE8; Thu, 5 Oct 2017 23:01:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7EEA6526F; Thu, 5 Oct 2017 23:01:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95N1aCN013658; Thu, 5 Oct 2017 23:01:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95N1XKR013634; Thu, 5 Oct 2017 23:01:33 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710052301.v95N1XKR013634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 5 Oct 2017 23:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324340 - in head: . gnu/usr.bin/binutils/as gnu/usr.bin/cc lib/clang lib/libc lib/libc/arm lib/libc/arm/aeabi lib/libc/arm/gen lib/libc/sys lib/libcompiler_rt lib/msun/arm release shar... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . gnu/usr.bin/binutils/as gnu/usr.bin/cc lib/clang lib/libc lib/libc/arm lib/libc/arm/aeabi lib/libc/arm/gen lib/libc/sys lib/libcompiler_rt lib/msun/arm release share/mk sys/conf sys/modules... X-SVN-Commit-Revision: 324340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 23:01:37 -0000 Author: imp Date: Thu Oct 5 23:01:33 2017 New Revision: 324340 URL: https://svnweb.freebsd.org/changeset/base/324340 Log: Support armv7 builds for userland Make armv7 as a new MACHINE_ARCH. Copy all the places we do armv6 and add armv7 as basically an alias. clang appears to generate code for armv7 by default. armv7 hard float isn't supported by the the in-tree gcc, so it hasn't been updated to have a new default. Support armv7 as a new valid MACHINE_ARCH (and by extension TARGET_ARCH). Add armv7 to the universe build. Differential Revision: https://reviews.freebsd.org/D12010 Modified: head/Makefile head/Makefile.inc1 head/Makefile.libcompat head/gnu/usr.bin/binutils/as/Makefile head/gnu/usr.bin/cc/Makefile.inc head/lib/clang/llvm.build.mk head/lib/libc/Makefile head/lib/libc/arm/Makefile.inc head/lib/libc/arm/aeabi/Makefile.inc head/lib/libc/arm/gen/Makefile.inc head/lib/libc/sys/Makefile.inc head/lib/libcompiler_rt/Makefile.inc head/lib/msun/arm/Makefile.inc head/release/Makefile.mirrors head/share/mk/bsd.cpu.mk head/share/mk/local.meta.sys.mk head/share/mk/src.opts.mk head/share/mk/sys.mk head/sys/conf/Makefile.arm head/sys/conf/kern.mk head/sys/conf/kern.opts.mk head/sys/conf/kern.pre.mk head/sys/modules/Makefile head/sys/modules/cloudabi32/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Thu Oct 5 21:36:56 2017 (r324339) +++ head/Makefile Thu Oct 5 23:01:33 2017 (r324340) @@ -435,7 +435,7 @@ worlds: .PHONY .if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets) TARGETS?=amd64 arm arm64 i386 mips powerpc riscv sparc64 _UNIVERSE_TARGETS= ${TARGETS} -TARGET_ARCHES_arm?= arm armeb armv6 +TARGET_ARCHES_arm?= arm armeb armv6 armv7 TARGET_ARCHES_arm64?= aarch64 TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 mipselhf mipshf mips64elhf mips64hf TARGET_ARCHES_powerpc?= powerpc powerpc64 powerpcspe Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Oct 5 21:36:56 2017 (r324339) +++ head/Makefile.inc1 Thu Oct 5 23:01:33 2017 (r324340) @@ -398,6 +398,7 @@ KNOWN_ARCHES?= aarch64/arm64 \ arm \ armeb/arm \ armv6/arm \ + armv7/arm \ i386 \ mips \ mipsel/mips \ @@ -614,7 +615,7 @@ BFLAGS+= -B${CROSS_BINUTILS_PREFIX} BFLAGS+= -B${WORLDTMP}/usr/bin .endif .if ${TARGET} == "arm" -.if ${TARGET_ARCH:Marmv6*} != "" && ${TARGET_CPUTYPE:M*soft*} == "" +.if ${TARGET_ARCH:Marmv[67]*} != "" && ${TARGET_CPUTYPE:M*soft*} == "" TARGET_ABI= gnueabihf .else TARGET_ABI= gnueabi @@ -650,7 +651,7 @@ XCFLAGS+= ${BFLAGS} ${TARGET_ARCH} == "powerpc64" || ${TARGET_ARCH:Mmips64*} != "") LIBCOMPAT= 32 .include "Makefile.libcompat" -.elif ${MK_LIBSOFT} != "no" && ${TARGET_ARCH} == "armv6" +.elif ${MK_LIBSOFT} != "no" && ${TARGET_ARCH:Marmv[67]*} != "" LIBCOMPAT= SOFT .include "Makefile.libcompat" .endif Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Thu Oct 5 21:36:56 2017 (r324339) +++ head/Makefile.libcompat Thu Oct 5 23:01:33 2017 (r324340) @@ -59,10 +59,10 @@ LIB32WMAKEFLAGS+= -DCOMPAT_32BIT # ------------------------------------------------------------------- # soft-fp world -.if ${TARGET_ARCH} == "armv6" +.if ${TARGET_ARCH:Marmv[67]*} != "" LIBSOFTCFLAGS= -DCOMPAT_SOFTFP LIBSOFTCPUFLAGS= -mfloat-abi=softfp -LIBSOFTWMAKEENV= CPUTYPE=soft MACHINE=arm MACHINE_ARCH=armv6 +LIBSOFTWMAKEENV= CPUTYPE=soft MACHINE=arm MACHINE_ARCH=${TARGET_ARCH} LIBSOFTWMAKEFLAGS= -DCOMPAT_SOFTFP .endif Modified: head/gnu/usr.bin/binutils/as/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/as/Makefile Thu Oct 5 21:36:56 2017 (r324339) +++ head/gnu/usr.bin/binutils/as/Makefile Thu Oct 5 23:01:33 2017 (r324340) @@ -46,8 +46,11 @@ SRCS+= app.c \ # DEO: why not used? #SRCS+= itbl-ops.c -.if ${TARGET_ARCH} == "armv6" || ${TARGET_ARCH} == "armv6eb" +.if ${TARGET_ARCH:Marmv6*} != "" CFLAGS+= -DCPU_DEFAULT=ARM_ARCH_V6K +.endif +.if ${TARGET_ARCH:Marmv7*} != "" +CFLAGS+= -DCPU_DEFAULT=ARM_ARCH_V7A .endif .if ${TARGET_CPUARCH} == "mips" Modified: head/gnu/usr.bin/cc/Makefile.inc ============================================================================== --- head/gnu/usr.bin/cc/Makefile.inc Thu Oct 5 21:36:56 2017 (r324339) +++ head/gnu/usr.bin/cc/Makefile.inc Thu Oct 5 23:01:33 2017 (r324340) @@ -34,8 +34,11 @@ CFLAGS+= -DTARGET_ARM_EABI .if ${TARGET_ARCH:Marm*eb} != "" CFLAGS += -DTARGET_ENDIAN_DEFAULT=MASK_BIG_END .endif -.if ${TARGET_ARCH} == "armv6" || ${TARGET_ARCH} == "armv6eb" +.if ${TARGET_ARCH:Marmv6*} != "" CFLAGS += -DFREEBSD_ARCH_armv6 +.endif +.if ${TARGET_ARCH:Marmv7*} != "" +CFLAGS += -DFREEBSD_ARCH_armv7 .endif .if ${TARGET_CPUARCH} == "mips" Modified: head/lib/clang/llvm.build.mk ============================================================================== --- head/lib/clang/llvm.build.mk Thu Oct 5 21:36:56 2017 (r324339) +++ head/lib/clang/llvm.build.mk Thu Oct 5 23:01:33 2017 (r324340) @@ -20,10 +20,10 @@ CFLAGS+= -D__STDC_CONSTANT_MACROS TARGET_ARCH?= ${MACHINE_ARCH} BUILD_ARCH?= ${MACHINE_ARCH} -# Armv6 uses hard float abi, unless the CPUTYPE has soft in it. +# Armv6 and armv7 uses hard float abi, unless the CPUTYPE has soft in it. # arm (for armv4 and armv5 CPUs) always uses the soft float ABI. # For all other targets, we stick with 'unknown'. -.if ${TARGET_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") +.if ${TARGET_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") TARGET_ABI= -gnueabihf .elif ${TARGET_ARCH:Marm*} TARGET_ABI= -gnueabi Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Thu Oct 5 21:36:56 2017 (r324339) +++ head/lib/libc/Makefile Thu Oct 5 23:01:33 2017 (r324340) @@ -110,7 +110,7 @@ NOASM= .include "${LIBC_SRCTOP}/uuid/Makefile.inc" .include "${LIBC_SRCTOP}/xdr/Makefile.inc" .if (${LIBC_ARCH} == "arm" && \ - (${MACHINE_ARCH:Marmv6*} == "" || (defined(CPUTYPE) && ${CPUTYPE:M*soft*}))) || \ + (${MACHINE_ARCH:Marmv[67]*} == "" || (defined(CPUTYPE) && ${CPUTYPE:M*soft*}))) || \ (${LIBC_ARCH} == "mips" && ${MACHINE_ARCH:Mmips*hf} == "") || \ (${LIBC_ARCH} == "riscv" && ${MACHINE_ARCH:Mriscv*sf} != "") .include "${LIBC_SRCTOP}/softfloat/Makefile.inc" Modified: head/lib/libc/arm/Makefile.inc ============================================================================== --- head/lib/libc/arm/Makefile.inc Thu Oct 5 21:36:56 2017 (r324339) +++ head/lib/libc/arm/Makefile.inc Thu Oct 5 23:01:33 2017 (r324340) @@ -11,7 +11,7 @@ SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol.map .include "${LIBC_SRCTOP}/arm/aeabi/Makefile.inc" -.if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") +.if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol_vfp.map .endif Modified: head/lib/libc/arm/aeabi/Makefile.inc ============================================================================== --- head/lib/libc/arm/aeabi/Makefile.inc Thu Oct 5 21:36:56 2017 (r324339) +++ head/lib/libc/arm/aeabi/Makefile.inc Thu Oct 5 23:01:33 2017 (r324340) @@ -5,14 +5,14 @@ SRCS+= aeabi_atexit.c \ aeabi_unwind_cpp.c \ aeabi_unwind_exidx.c -.if (${MACHINE_ARCH:Marmv6*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != "") || \ - ${MACHINE_ARCH:Marmv6*} == "" +.if (${MACHINE_ARCH:Marmv[67]*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != "") || \ + ${MACHINE_ARCH:Marmv[67]*} == "" SRCS+= aeabi_asm_double.S \ aeabi_asm_float.S \ aeabi_double.c \ aeabi_float.c .endif -.if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") +.if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") SRCS+= aeabi_vfp_double.S \ aeabi_vfp_float.S .endif Modified: head/lib/libc/arm/gen/Makefile.inc ============================================================================== --- head/lib/libc/arm/gen/Makefile.inc Thu Oct 5 21:36:56 2017 (r324339) +++ head/lib/libc/arm/gen/Makefile.inc Thu Oct 5 23:01:33 2017 (r324340) @@ -7,7 +7,7 @@ SRCS+= _ctx_start.S _setjmp.S _set_tp.c alloca.S fabs. arm_initfini.c \ trivial-getcontextx.c -.if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") +.if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") SRCS+= fpgetmask_vfp.c fpgetround_vfp.c fpgetsticky_vfp.c fpsetmask_vfp.c \ fpsetround_vfp.c fpsetsticky_vfp.c .endif Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Thu Oct 5 21:36:56 2017 (r324339) +++ head/lib/libc/sys/Makefile.inc Thu Oct 5 23:01:33 2017 (r324340) @@ -124,7 +124,7 @@ SYM_MAPS+= ${LIBC_SRCTOP}/sys/Symbol.map CLEANFILES+= ${SASM} ${SPSEUDO} .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ - ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_ARCH:Marmv6*} + ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_ARCH:Marmv[67]*} NOTE_GNU_STACK='\t.section .note.GNU-stack,"",%%progbits\n' .else NOTE_GNU_STACK='' Modified: head/lib/libcompiler_rt/Makefile.inc ============================================================================== --- head/lib/libcompiler_rt/Makefile.inc Thu Oct 5 21:36:56 2017 (r324339) +++ head/lib/libcompiler_rt/Makefile.inc Thu Oct 5 23:01:33 2017 (r324340) @@ -204,7 +204,7 @@ SRCF+= stdatomic .endif .for file in ${SRCF} -.if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ +.if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) SRCS+= ${file}vfp.S . elif exists(${CRTSRC}/${CRTARCH}/${file}.S) Modified: head/lib/msun/arm/Makefile.inc ============================================================================== --- head/lib/msun/arm/Makefile.inc Thu Oct 5 21:36:56 2017 (r324339) +++ head/lib/msun/arm/Makefile.inc Thu Oct 5 23:01:33 2017 (r324340) @@ -3,7 +3,7 @@ LDBL_PREC = 53 SYM_MAPS += ${.CURDIR}/arm/Symbol.map -.if ${MACHINE_ARCH:Marmv6*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != "" +.if ${MACHINE_ARCH:Marmv[67]*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != "" ARCH_SRCS = fenv-softfp.c fenv-vfp.c .endif Modified: head/release/Makefile.mirrors ============================================================================== --- head/release/Makefile.mirrors Thu Oct 5 21:36:56 2017 (r324339) +++ head/release/Makefile.mirrors Thu Oct 5 23:01:33 2017 (r324340) @@ -57,7 +57,7 @@ TLD?= ${FTPDIR}/releases .endif .if defined(EMBEDDED) && !empty(EMBEDDED) -. if ${TARGET:Marm*} != "" && (${TARGET_ARCH} == "armv6" || ${TARGET_ARCH} == "aarch64") +. if ${TARGET:Marm*} != "" && (${TARGET_ARCH:Marmv[67]} != "" || ${TARGET_ARCH} == "aarch64") . if !defined(BOARDNAME) && empty(BOARDNAME) BOARDNAME:= ${KERNCONF} . else Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Thu Oct 5 21:36:56 2017 (r324339) +++ head/share/mk/bsd.cpu.mk Thu Oct 5 23:01:33 2017 (r324340) @@ -110,8 +110,6 @@ _CPUCFLAGS = -march=${CPUTYPE} _CPUCFLAGS = -march=armv5te -D__XSCALE__ . elif ${CPUTYPE:M*soft*} != "" _CPUCFLAGS = -mfloat-abi=softfp -. elif ${CPUTYPE} == "armv6" -_CPUCFLAGS = -march=${CPUTYPE} . elif ${CPUTYPE} == "cortexa" _CPUCFLAGS = -march=armv7 -mfpu=vfp . elif ${CPUTYPE:Marmv[4567]*} != "" @@ -339,18 +337,20 @@ MACHINE_CPU += arm . if ${MACHINE_ARCH:Marmv6*} != "" MACHINE_CPU += armv6 . endif -# armv6 is a hybrid. It can use the softfp ABI, but doesn't emulate -# floating point in the general case, so don't define softfp for -# it at this time. arm and armeb are pure softfp, so define it -# for them. -. if ${MACHINE_ARCH:Marmv6*} == "" +. if ${MACHINE_ARCH:Marmv7*} != "" +MACHINE_CPU += armv7 +. endif +# armv6 and armv7 are a hybrid. It can use the softfp ABI, but doesn't emulate +# floating point in the general case, so don't define softfp for it at this +# time. arm and armeb are pure softfp, so define it for them. +. if ${MACHINE_ARCH:Marmv[67]*} == "" MACHINE_CPU += softfp . endif -# Normally armv6 is hard float ABI from FreeBSD 11 onwards. However -# when CPUTYPE has 'soft' in it, we use the soft-float ABI to allow -# building of soft-float ABI libraries. In this case, we have to -# add the -mfloat-abi=softfp to force that. -.if ${MACHINE_ARCH:Marmv6*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != "" +# Normally armv6 and armv7 are hard float ABI from FreeBSD 11 onwards. However +# when CPUTYPE has 'soft' in it, we use the soft-float ABI to allow building of +# soft-float ABI libraries. In this case, we have to add the -mfloat-abi=softfp +# to force that. +.if ${MACHINE_ARCH:Marmv[67]*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != "" # Needs to be CFLAGS not _CPUCFLAGS because it's needed for the ABI # not a nice optimization. CFLAGS += -mfloat-abi=softfp Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Thu Oct 5 21:36:56 2017 (r324339) +++ head/share/mk/local.meta.sys.mk Thu Oct 5 23:01:33 2017 (r324340) @@ -43,7 +43,7 @@ OBJROOT:= ${OBJROOT:H:tA}/${OBJROOT:T} .endif # from src/Makefile (for universe) -TARGET_ARCHES_arm?= arm armeb armv6 +TARGET_ARCHES_arm?= arm armeb armv6 armv7 TARGET_ARCHES_arm64?= aarch64 TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 mipsn32el TARGET_ARCHES_powerpc?= powerpc powerpc64 powerpcspe Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Oct 5 21:36:56 2017 (r324339) +++ head/share/mk/src.opts.mk Thu Oct 5 23:01:33 2017 (r324340) @@ -273,7 +273,7 @@ __DEFAULT_NO_OPTIONS+=GDB_LIBEXEC __DEFAULT_YES_OPTIONS+=GDB_LIBEXEC .endif # Only doing soft float API stuff on armv6 -.if ${__T} != "armv6" +.if ${__T} != "armv6" && ${__T} != "armv7" BROKEN_OPTIONS+=LIBSOFT .endif .if ${__T:Mmips*} Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Thu Oct 5 21:36:56 2017 (r324339) +++ head/share/mk/sys.mk Thu Oct 5 23:01:33 2017 (r324340) @@ -13,7 +13,7 @@ unix ?= We run FreeBSD, not UNIX. # and/or endian. This is called MACHINE_CPU in NetBSD, but that's used # for something different in FreeBSD. # -__TO_CPUARCH=C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc(64|spe)/powerpc/:C/riscv64(sf)?/riscv/ +__TO_CPUARCH=C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v[67])?(eb)?/arm/:C/powerpc(64|spe)/powerpc/:C/riscv64(sf)?/riscv/ MACHINE_CPUARCH=${MACHINE_ARCH:${__TO_CPUARCH}} .endif Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Thu Oct 5 21:36:56 2017 (r324339) +++ head/sys/conf/Makefile.arm Thu Oct 5 23:01:33 2017 (r324340) @@ -75,7 +75,7 @@ FILES_CPU_FUNC = \ $S/$M/$M/cpufunc_asm_pj4b.S $S/$M/$M/cpufunc_asm_armv6.S \ $S/$M/$M/cpufunc_asm_armv7.S -.if ${MACHINE_ARCH} != "armv6" && defined(KERNPHYSADDR) +.if ${MACHINE_ARCH:Marmv[67]*} == "" && defined(KERNPHYSADDR) KERNEL_EXTRA=trampoline KERNEL_EXTRA_INSTALL=kernel.gz.tramp trampoline: ${KERNEL_KO}.tramp Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Thu Oct 5 21:36:56 2017 (r324339) +++ head/sys/conf/kern.mk Thu Oct 5 23:01:33 2017 (r324340) @@ -259,6 +259,7 @@ LD_EMULATION_amd64=elf_x86_64_fbsd LD_EMULATION_arm=armelf_fbsd LD_EMULATION_armeb=armelfb_fbsd LD_EMULATION_armv6=armelf_fbsd +LD_EMULATION_armv7=armelf_fbsd LD_EMULATION_i386=elf_i386_fbsd LD_EMULATION_mips= elf32btsmip_fbsd LD_EMULATION_mips64= elf64btsmip_fbsd Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Thu Oct 5 21:36:56 2017 (r324339) +++ head/sys/conf/kern.opts.mk Thu Oct 5 23:01:33 2017 (r324340) @@ -62,7 +62,7 @@ __DEFAULT_NO_OPTIONS = \ # Things that don't work based on the CPU .if ${MACHINE_CPUARCH} == "arm" -. if ${MACHINE_ARCH:Marmv6*} == "" +. if ${MACHINE_ARCH:Marmv[67]*} == "" BROKEN_OPTIONS+= CDDL ZFS . endif .endif Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Thu Oct 5 21:36:56 2017 (r324339) +++ head/sys/conf/kern.pre.mk Thu Oct 5 23:01:33 2017 (r324340) @@ -255,6 +255,7 @@ EMBEDFS_ARCH.${MACHINE_ARCH}!= sed -n '/OUTPUT_ARCH/s/ EMBEDFS_FORMAT.arm?= elf32-littlearm EMBEDFS_FORMAT.armv6?= elf32-littlearm +EMBEDFS_FORMAT.armv7?= elf32-littlearm EMBEDFS_FORMAT.aarch64?= elf64-littleaarch64 EMBEDFS_FORMAT.mips?= elf32-tradbigmips EMBEDFS_FORMAT.mipsel?= elf32-tradlittlemips Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Oct 5 21:36:56 2017 (r324339) +++ head/sys/modules/Makefile Thu Oct 5 23:01:33 2017 (r324340) @@ -426,7 +426,7 @@ _autofs= autofs .endif .if ${MK_CDDL} != "no" || defined(ALL_MODULES) -.if (${MACHINE_CPUARCH} != "arm" || ${MACHINE_ARCH:Marmv6*} != "") && \ +.if (${MACHINE_CPUARCH} != "arm" || ${MACHINE_ARCH:Marmv[67]*} != "") && \ ${MACHINE_CPUARCH} != "mips" && \ ${MACHINE_CPUARCH} != "sparc64" SUBDIR+= dtrace @@ -800,7 +800,7 @@ _em= em _epic= epic .endif -.if (${MACHINE_CPUARCH} == "amd64" || ${MACHINE_ARCH} == "armv6" || \ +.if (${MACHINE_CPUARCH} == "amd64" || ${MACHINE_ARCH:Marmv[67]*} != "" || \ ${MACHINE_CPUARCH} == "i386") _cloudabi32= cloudabi32 .endif @@ -810,7 +810,7 @@ _cloudabi64= cloudabi64 .endif -.if ${MACHINE_ARCH} == "armv6" +.if ${MACHINE_ARCH:Marmv[67]*} != "" _ffec= ffec .endif Modified: head/sys/modules/cloudabi32/Makefile ============================================================================== --- head/sys/modules/cloudabi32/Makefile Thu Oct 5 21:36:56 2017 (r324339) +++ head/sys/modules/cloudabi32/Makefile Thu Oct 5 23:01:33 2017 (r324340) @@ -18,7 +18,7 @@ CLEANFILES=cloudabi32_vdso.o VDSO_SRCS=${SYSDIR}/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S OUTPUT_TARGET=elf64-x86-64-freebsd BINARY_ARCHITECTURE=i386 -.elif ${MACHINE_ARCH} == "armv6" +.elif ${MACHINE_ARCH:Marmv[67]*} != "" VDSO_SRCS=${SYSDIR}/contrib/cloudabi/cloudabi_vdso_armv6.S OUTPUT_TARGET=elf32-littlearm BINARY_ARCHITECTURE=arm From owner-svn-src-head@freebsd.org Thu Oct 5 23:01:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCB5BE44B41; Thu, 5 Oct 2017 23:01:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D9AC653BC; Thu, 5 Oct 2017 23:01:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95N1swP013759; Thu, 5 Oct 2017 23:01:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95N1olt013714; Thu, 5 Oct 2017 23:01:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710052301.v95N1olt013714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 5 Oct 2017 23:01:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324341 - in head/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/broadcom/bcm2835 arm/conf arm/freescale/imx arm/freescale/vybrid arm/mv arm/mv/armad... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/broadcom/bcm2835 arm/conf arm/freescale/imx arm/freescale/vybrid arm/mv arm/mv/armada38x arm/nvidia/tegra124 ... X-SVN-Commit-Revision: 324341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 23:01:55 -0000 Author: imp Date: Thu Oct 5 23:01:50 2017 New Revision: 324341 URL: https://svnweb.freebsd.org/changeset/base/324341 Log: Tag all armv7 kernels as such in their machine config line. Transition all boards that support arm cortex CPUs to armv7. This leaves two armv6 kernels in the tree. RPI-B, which uses the BCM2835 which has a ARM1176 core, and VERSATILEPB, which is a qemu board setup around the time RPI-B went in. Copy std.armv6 to std.armv7, even though that duplicates a lot of stuff. More work needs to be done to sort out the duplication. Differential Revision: https://reviews.freebsd.org/D12027 Added: head/sys/arm/conf/VIRT - copied, changed from r324340, head/sys/arm/conf/ARMADAXP head/sys/arm/conf/std.armv7 - copied, changed from r324340, head/sys/arm/conf/std.armv6 Modified: head/sys/arm/allwinner/std.allwinner head/sys/arm/allwinner/std.allwinner_up head/sys/arm/altera/socfpga/std.socfpga head/sys/arm/amlogic/aml8726/std.aml8726 head/sys/arm/annapurna/alpine/std.alpine head/sys/arm/broadcom/bcm2835/std.bcm2836 head/sys/arm/conf/ALLWINNER_UP head/sys/arm/conf/ALPINE head/sys/arm/conf/AML8726 head/sys/arm/conf/ARMADA38X head/sys/arm/conf/ARMADAXP head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/EXYNOS5.common head/sys/arm/conf/GENERIC head/sys/arm/conf/IMX53 head/sys/arm/conf/IMX6 head/sys/arm/conf/PANDABOARD head/sys/arm/conf/RK3188 head/sys/arm/conf/RPI2 head/sys/arm/conf/SOCFPGA head/sys/arm/conf/TEGRA124 head/sys/arm/conf/VYBRID head/sys/arm/conf/ZEDBOARD head/sys/arm/conf/std.armv6 head/sys/arm/freescale/imx/std.imx51 head/sys/arm/freescale/imx/std.imx53 head/sys/arm/freescale/imx/std.imx6 head/sys/arm/freescale/vybrid/std.vybrid head/sys/arm/mv/armada38x/std.armada38x head/sys/arm/mv/std-pj4b.mv head/sys/arm/nvidia/tegra124/std.tegra124 head/sys/arm/qemu/std.virt head/sys/arm/rockchip/std.rk30xx head/sys/arm/samsung/exynos/std.exynos5250 head/sys/arm/samsung/exynos/std.exynos5420 head/sys/arm/ti/std.ti head/sys/arm/xilinx/std.zynq7 head/sys/conf/files.arm head/sys/conf/options.arm Modified: head/sys/arm/allwinner/std.allwinner ============================================================================== --- head/sys/arm/allwinner/std.allwinner Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/allwinner/std.allwinner Thu Oct 5 23:01:50 2017 (r324341) @@ -2,7 +2,7 @@ #$FreeBSD$ cpu CPU_CORTEXA -machine arm armv6 +machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" makeoptions KERNVIRTADDR=0xc0200000 Modified: head/sys/arm/allwinner/std.allwinner_up ============================================================================== --- head/sys/arm/allwinner/std.allwinner_up Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/allwinner/std.allwinner_up Thu Oct 5 23:01:50 2017 (r324341) @@ -2,7 +2,7 @@ #$FreeBSD$ cpu CPU_CORTEXA -machine arm armv6 +machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" makeoptions KERNVIRTADDR=0xc0200000 Modified: head/sys/arm/altera/socfpga/std.socfpga ============================================================================== --- head/sys/arm/altera/socfpga/std.socfpga Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/altera/socfpga/std.socfpga Thu Oct 5 23:01:50 2017 (r324341) @@ -1,7 +1,7 @@ # $FreeBSD$ cpu CPU_CORTEXA -machine arm armv6 +machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" makeoptions KERNVIRTADDR=0xc0f00000 Modified: head/sys/arm/amlogic/aml8726/std.aml8726 ============================================================================== --- head/sys/arm/amlogic/aml8726/std.aml8726 Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/amlogic/aml8726/std.aml8726 Thu Oct 5 23:01:50 2017 (r324341) @@ -1,7 +1,7 @@ # $FreeBSD$ cpu CPU_CORTEXA -machine arm armv6 +machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" # Physical memory starts at 0x80000000. We assume the kernel is loaded Modified: head/sys/arm/annapurna/alpine/std.alpine ============================================================================== --- head/sys/arm/annapurna/alpine/std.alpine Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/annapurna/alpine/std.alpine Thu Oct 5 23:01:50 2017 (r324341) @@ -1,7 +1,7 @@ # $FreeBSD$ cpu CPU_CORTEXA -machine arm armv6 +machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a -DAL_HAVE_TYPES" makeoptions KERNVIRTADDR=0xa0200000 Modified: head/sys/arm/broadcom/bcm2835/std.bcm2836 ============================================================================== --- head/sys/arm/broadcom/bcm2835/std.bcm2836 Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/broadcom/bcm2835/std.bcm2836 Thu Oct 5 23:01:50 2017 (r324341) @@ -1,6 +1,6 @@ # $FreeBSD$ -machine arm armv6 +machine arm armv7 cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" options SOC_BCM2836 Modified: head/sys/arm/conf/ALLWINNER_UP ============================================================================== --- head/sys/arm/conf/ALLWINNER_UP Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/conf/ALLWINNER_UP Thu Oct 5 23:01:50 2017 (r324341) @@ -20,7 +20,7 @@ ident ALLWINNER_UP -include "std.armv6" +include "std.armv7" include "../allwinner/std.allwinner_up" options INTRNG Modified: head/sys/arm/conf/ALPINE ============================================================================== --- head/sys/arm/conf/ALPINE Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/conf/ALPINE Thu Oct 5 23:01:50 2017 (r324341) @@ -19,7 +19,7 @@ ident ALPINE -include "std.armv6" +include "std.armv7" include "../annapurna/alpine/std.alpine" makeoptions MODULES_OVERRIDE="" Modified: head/sys/arm/conf/AML8726 ============================================================================== --- head/sys/arm/conf/AML8726 Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/conf/AML8726 Thu Oct 5 23:01:50 2017 (r324341) @@ -23,7 +23,7 @@ ident AML8726 -include "std.armv6" +include "std.armv7" include "../amlogic/aml8726/std.aml8726" options SCHED_ULE # ULE scheduler Modified: head/sys/arm/conf/ARMADA38X ============================================================================== --- head/sys/arm/conf/ARMADA38X Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/conf/ARMADA38X Thu Oct 5 23:01:50 2017 (r324341) @@ -5,7 +5,7 @@ # include "../mv/armada38x/std.armada38x" -include "std.armv6" +include "std.armv7" ident ARMADA38X Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/conf/ARMADAXP Thu Oct 5 23:01:50 2017 (r324341) @@ -23,7 +23,7 @@ ident MV-88F78XX0 -include "std.armv6" +include "std.armv7" include "../mv/armadaxp/std.mv78x60" options SOC_MV_ARMADAXP Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/conf/BEAGLEBONE Thu Oct 5 23:01:50 2017 (r324341) @@ -23,7 +23,7 @@ ident BEAGLEBONE -include "std.armv6" +include "std.armv7" include "../ti/am335x/std.am335x" makeoptions MODULES_EXTRA="dtb/am335x am335x_dmtpps" Modified: head/sys/arm/conf/EFIKA_MX ============================================================================== --- head/sys/arm/conf/EFIKA_MX Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/conf/EFIKA_MX Thu Oct 5 23:01:50 2017 (r324341) @@ -20,7 +20,7 @@ ident EFIKA_MX -include "std.armv6" +include "std.armv7" include "../freescale/imx/std.imx51" makeoptions WITHOUT_MODULES="ahc" Modified: head/sys/arm/conf/EXYNOS5.common ============================================================================== --- head/sys/arm/conf/EXYNOS5.common Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/conf/EXYNOS5.common Thu Oct 5 23:01:50 2017 (r324341) @@ -20,7 +20,7 @@ makeoptions WERROR="-Werror" -include "std.armv6" +include "std.armv7" options SCHED_ULE # ULE scheduler options PLATFORM # Platform based SoC options PREEMPTION # Enable kernel thread preemption Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/conf/GENERIC Thu Oct 5 23:01:50 2017 (r324341) @@ -22,13 +22,13 @@ ident GENERIC cpu CPU_CORTEXA options SMP_ON_UP -machine arm armv6 +machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" makeoptions KERNVIRTADDR=0xc0000000 options KERNVIRTADDR=0xc0000000 -include "std.armv6" +include "std.armv7" files "../allwinner/files.allwinner" files "../allwinner/files.allwinner_up" files "../allwinner/a10/files.a10" Modified: head/sys/arm/conf/IMX53 ============================================================================== --- head/sys/arm/conf/IMX53 Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/conf/IMX53 Thu Oct 5 23:01:50 2017 (r324341) @@ -20,7 +20,7 @@ ident IMX53 -include "std.armv6" +include "std.armv7" include "../freescale/imx/std.imx53" options SOC_IMX53 Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/conf/IMX6 Thu Oct 5 23:01:50 2017 (r324341) @@ -19,7 +19,7 @@ # $FreeBSD$ ident IMX6 -include "std.armv6" +include "std.armv7" include "../freescale/imx/std.imx6" options INTRNG Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/conf/PANDABOARD Thu Oct 5 23:01:50 2017 (r324341) @@ -27,7 +27,7 @@ ident PANDABOARD hints "PANDABOARD.hints" -include "std.armv6" +include "std.armv7" include "../ti/omap4/std.omap4" makeoptions MODULES_EXTRA=dtb/omap4 Modified: head/sys/arm/conf/RK3188 ============================================================================== --- head/sys/arm/conf/RK3188 Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/conf/RK3188 Thu Oct 5 23:01:50 2017 (r324341) @@ -20,7 +20,7 @@ ident RK3188 -include "std.armv6" +include "std.armv7" include "../rockchip/std.rk30xx" options SOC_ROCKCHIP_RK3188 Modified: head/sys/arm/conf/RPI2 ============================================================================== --- head/sys/arm/conf/RPI2 Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/conf/RPI2 Thu Oct 5 23:01:50 2017 (r324341) @@ -22,7 +22,7 @@ ident RPI2 -include "std.armv6" +include "std.armv7" include "../broadcom/bcm2835/std.rpi" include "../broadcom/bcm2835/std.bcm2836" Modified: head/sys/arm/conf/SOCFPGA ============================================================================== --- head/sys/arm/conf/SOCFPGA Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/conf/SOCFPGA Thu Oct 5 23:01:50 2017 (r324341) @@ -19,7 +19,7 @@ # $FreeBSD$ ident SOCFPGA -include "std.armv6" +include "std.armv7" include "../altera/socfpga/std.socfpga" makeoptions MODULES_OVERRIDE="" Modified: head/sys/arm/conf/TEGRA124 ============================================================================== --- head/sys/arm/conf/TEGRA124 Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/conf/TEGRA124 Thu Oct 5 23:01:50 2017 (r324341) @@ -18,7 +18,7 @@ # # $FreeBSD$ -include "std.armv6" +include "std.armv7" include "../nvidia/tegra124/std.tegra124" ident TEGRA124 Copied and modified: head/sys/arm/conf/VIRT (from r324340, head/sys/arm/conf/ARMADAXP) ============================================================================== --- head/sys/arm/conf/ARMADAXP Thu Oct 5 23:01:33 2017 (r324340, copy source) +++ head/sys/arm/conf/VIRT Thu Oct 5 23:01:50 2017 (r324341) @@ -1,5 +1,5 @@ # -# Custom kernel for Marvell Armada XP +# VIRT -- Custom configuration for the qemu virt platform # # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: @@ -18,73 +18,42 @@ # # $FreeBSD$ -# TODO: Port to INTRNG -#NO_UNIVERSE +ident VIRT -ident MV-88F78XX0 +include "std.armv7" +include "../qemu/std.virt" -include "std.armv6" -include "../mv/armadaxp/std.mv78x60" - -options SOC_MV_ARMADAXP - -makeoptions WERROR="-Werror" - options SCHED_ULE # ULE scheduler +options PLATFORM options SMP # Enable multiple cores -# NFS root from boopt/dhcp -options BOOTP -options BOOTP_NFSROOT -options BOOTP_NFSV3 -options BOOTP_WIRED_TO=mge0 +# Interrupt controller +device gic +options INTRNG -options ROOTDEVNAME=\"ufs:/dev/da0p1\" +# ARM Generic Timer +device generic_timer -options MUTEX_NOINLINE -options RWLOCK_NOINLINE -options NO_FFS_SNAPSHOT -options NO_SWAPPING - -# Pseudo devices -device random -device pty +device bpf device loop -device md - -# USB -device usb -device ehci -device umass -device scbus -device pass -device da - -# SATA -device mvs - -# Serial ports +device ether device uart +device pty +device snp +device pl011 +device psci -# I2C (TWSI) -device iic -device iicbus -device twsi +device virtio +device virtio_mmio +device virtio_blk +device vtnet -#Network -device ether -device mge # Marvell Gigabit Ethernet controller -device mii -device mdio -device e1000phy -device bpf -options DEVICE_POLLING -device vlan +device md +device random # Entropy device -#PCI/PCIE -device pci - # Flattened Device Tree options FDT # Configure using FDT/DTB data -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=db78460.dts + +# Extensible Firmware Interface +options EFI + Modified: head/sys/arm/conf/VYBRID ============================================================================== --- head/sys/arm/conf/VYBRID Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/conf/VYBRID Thu Oct 5 23:01:50 2017 (r324341) @@ -19,7 +19,7 @@ # $FreeBSD$ ident VYBRID -include "std.armv6" +include "std.armv7" include "../freescale/vybrid/std.vybrid" makeoptions WERROR="-Werror" Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/conf/ZEDBOARD Thu Oct 5 23:01:50 2017 (r324341) @@ -21,7 +21,7 @@ ident ZEDBOARD -include "std.armv6" +include "std.armv7" include "../xilinx/std.zynq7" makeoptions MODULES_EXTRA="dtb/zynq" Modified: head/sys/arm/conf/std.armv6 ============================================================================== --- head/sys/arm/conf/std.armv6 Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/conf/std.armv6 Thu Oct 5 23:01:50 2017 (r324341) @@ -1,4 +1,4 @@ -# Standard kernel config items for all ARMv6/v7 systems. +# Standard kernel config items for all ARMv6 systems. # # $FreeBSD$ Copied and modified: head/sys/arm/conf/std.armv7 (from r324340, head/sys/arm/conf/std.armv6) ============================================================================== --- head/sys/arm/conf/std.armv6 Thu Oct 5 23:01:33 2017 (r324340, copy source) +++ head/sys/arm/conf/std.armv7 Thu Oct 5 23:01:50 2017 (r324341) @@ -1,4 +1,4 @@ -# Standard kernel config items for all ARMv6/v7 systems. +# Standard kernel config items for all ARMv7 systems. # # $FreeBSD$ Modified: head/sys/arm/freescale/imx/std.imx51 ============================================================================== --- head/sys/arm/freescale/imx/std.imx51 Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/freescale/imx/std.imx51 Thu Oct 5 23:01:50 2017 (r324341) @@ -1,5 +1,5 @@ # $FreeBSD$ -machine arm armv6 +machine arm armv7 cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" Modified: head/sys/arm/freescale/imx/std.imx53 ============================================================================== --- head/sys/arm/freescale/imx/std.imx53 Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/freescale/imx/std.imx53 Thu Oct 5 23:01:50 2017 (r324341) @@ -1,5 +1,5 @@ # $FreeBSD$ -machine arm armv6 +machine arm armv7 cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" Modified: head/sys/arm/freescale/imx/std.imx6 ============================================================================== --- head/sys/arm/freescale/imx/std.imx6 Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/freescale/imx/std.imx6 Thu Oct 5 23:01:50 2017 (r324341) @@ -1,5 +1,5 @@ # $FreeBSD$ -machine arm armv6 +machine arm armv7 cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" Modified: head/sys/arm/freescale/vybrid/std.vybrid ============================================================================== --- head/sys/arm/freescale/vybrid/std.vybrid Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/freescale/vybrid/std.vybrid Thu Oct 5 23:01:50 2017 (r324341) @@ -1,7 +1,7 @@ # $FreeBSD$ cpu CPU_CORTEXA -machine arm armv6 +machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" makeoptions KERNVIRTADDR=0xc0100000 Modified: head/sys/arm/mv/armada38x/std.armada38x ============================================================================== --- head/sys/arm/mv/armada38x/std.armada38x Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/mv/armada38x/std.armada38x Thu Oct 5 23:01:50 2017 (r324341) @@ -2,7 +2,7 @@ files "../mv/armada38x/files.armada38x" files "../mv/files.mv" cpu CPU_CORTEXA -machine arm armv6 +machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" makeoptions KERNVIRTADDR=0xc0000000 Modified: head/sys/arm/mv/std-pj4b.mv ============================================================================== --- head/sys/arm/mv/std-pj4b.mv Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/mv/std-pj4b.mv Thu Oct 5 23:01:50 2017 (r324341) @@ -2,7 +2,7 @@ files "../mv/files.mv" cpu CPU_MV_PJ4B -machine arm armv6 +machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" # This was originally defined as "(KERNBASE-(1024*1024*1024))" but that Modified: head/sys/arm/nvidia/tegra124/std.tegra124 ============================================================================== --- head/sys/arm/nvidia/tegra124/std.tegra124 Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/nvidia/tegra124/std.tegra124 Thu Oct 5 23:01:50 2017 (r324341) @@ -1,6 +1,6 @@ # $FreeBSD$ cpu CPU_CORTEXA -machine arm armv6 +machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" options KERNVIRTADDR = 0xc0200000 Modified: head/sys/arm/qemu/std.virt ============================================================================== --- head/sys/arm/qemu/std.virt Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/qemu/std.virt Thu Oct 5 23:01:50 2017 (r324341) @@ -1,5 +1,5 @@ # $FreeBSD$ -machine arm armv6 +machine arm armv7 cpu CPU_CORTEXA makeoptions CONF_CFLAGS="-march=armv7a" Modified: head/sys/arm/rockchip/std.rk30xx ============================================================================== --- head/sys/arm/rockchip/std.rk30xx Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/rockchip/std.rk30xx Thu Oct 5 23:01:50 2017 (r324341) @@ -2,7 +2,7 @@ #$FreeBSD$ cpu CPU_CORTEXA -machine arm armv6 +machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" makeoptions KERNVIRTADDR=0xc0400000 Modified: head/sys/arm/samsung/exynos/std.exynos5250 ============================================================================== --- head/sys/arm/samsung/exynos/std.exynos5250 Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/samsung/exynos/std.exynos5250 Thu Oct 5 23:01:50 2017 (r324341) @@ -1,7 +1,7 @@ # $FreeBSD$ cpu CPU_CORTEXA -machine arm armv6 +machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" makeoptions KERNVIRTADDR=0xc0f00000 Modified: head/sys/arm/samsung/exynos/std.exynos5420 ============================================================================== --- head/sys/arm/samsung/exynos/std.exynos5420 Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/samsung/exynos/std.exynos5420 Thu Oct 5 23:01:50 2017 (r324341) @@ -1,7 +1,7 @@ # $FreeBSD$ cpu CPU_CORTEXA -machine arm armv6 +machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" makeoptions KERNVIRTADDR=0xc0f00000 Modified: head/sys/arm/ti/std.ti ============================================================================== --- head/sys/arm/ti/std.ti Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/ti/std.ti Thu Oct 5 23:01:50 2017 (r324341) @@ -1,6 +1,6 @@ # $FreeBSD$ -machine arm armv6 +machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" files "../ti/files.ti" Modified: head/sys/arm/xilinx/std.zynq7 ============================================================================== --- head/sys/arm/xilinx/std.zynq7 Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/arm/xilinx/std.zynq7 Thu Oct 5 23:01:50 2017 (r324341) @@ -4,7 +4,7 @@ # $FreeBSD$ cpu CPU_CORTEXA -machine arm armv6 +machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" files "../xilinx/files.zynq7" Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/conf/files.arm Thu Oct 5 23:01:50 2017 (r324341) @@ -25,8 +25,8 @@ arm/arm/blockio.S standard arm/arm/bus_space_asm_generic.S standard arm/arm/bus_space_base.c optional fdt arm/arm/bus_space_generic.c standard -arm/arm/busdma_machdep-v4.c optional !armv6 !ARM_USE_V6_BUSDMA -arm/arm/busdma_machdep-v6.c optional armv6 | ARM_USE_V6_BUSDMA +arm/arm/busdma_machdep-v4.c optional !armv7 !armv6 !ARM_USE_V6_BUSDMA +arm/arm/busdma_machdep-v6.c optional armv7 | armv6 | ARM_USE_V6_BUSDMA arm/arm/copystr.S standard arm/arm/cpufunc.c standard arm/arm/cpufunc_asm.S standard @@ -43,11 +43,12 @@ arm/arm/cpufunc_asm_sheeva.S optional cpu_arm9e arm/arm/cpufunc_asm_xscale.S optional cpu_xscale_pxa2x0 | cpu_xscale_ixp425 | cpu_xscale_81342 arm/arm/cpufunc_asm_xscale_c3.S optional cpu_xscale_81342 arm/arm/cpuinfo.c standard -arm/arm/cpu_asm-v6.S optional armv6 +arm/arm/cpu_asm-v6.S optional armv7 | armv6 arm/arm/db_disasm.c optional ddb arm/arm/db_interface.c optional ddb arm/arm/db_trace.c optional ddb arm/arm/debug_monitor.c optional ddb armv6 +arm/arm/debug_monitor.c optional ddb armv7 arm/arm/disassem.c optional ddb arm/arm/dump_machdep.c standard arm/arm/elf_machdep.c standard @@ -60,14 +61,14 @@ arm/arm/gdb_machdep.c optional gdb arm/arm/generic_timer.c optional generic_timer arm/arm/gic.c optional gic arm/arm/gic_fdt.c optional gic fdt -arm/arm/identcpu-v4.c optional !armv6 -arm/arm/identcpu-v6.c optional armv6 +arm/arm/identcpu-v4.c optional !armv7 !armv6 +arm/arm/identcpu-v6.c optional armv7 | armv6 arm/arm/in_cksum.c optional inet | inet6 arm/arm/in_cksum_arm.S optional inet | inet6 arm/arm/intr.c optional !intrng kern/subr_intr.c optional intrng arm/arm/locore.S standard no-obj -arm/arm/hypervisor-stub.S optional armv6 +arm/arm/hypervisor-stub.S optional armv7 | armv6 arm/arm/machdep.c standard arm/arm/machdep_boot.c standard arm/arm/machdep_kdb.c standard @@ -85,8 +86,8 @@ arm/arm/pl310.c optional pl310 arm/arm/platform.c optional platform arm/arm/platform_if.m optional platform arm/arm/platform_pl310_if.m optional platform pl310 -arm/arm/pmap-v4.c optional !armv6 -arm/arm/pmap-v6.c optional armv6 +arm/arm/pmap-v4.c optional !armv7 !armv6 +arm/arm/pmap-v6.c optional armv7 | armv6 arm/arm/pmu.c optional pmu | fdt hwpmc arm/arm/ptrace_machdep.c standard arm/arm/sc_machdep.c optional sc @@ -97,12 +98,12 @@ arm/arm/stdatomic.c standard \ compile-with "${NORMAL_C:N-Wmissing-prototypes}" arm/arm/support.S standard arm/arm/swtch.S standard -arm/arm/swtch-v4.S optional !armv6 -arm/arm/swtch-v6.S optional armv6 +arm/arm/swtch-v4.S optional !armv7 !armv6 +arm/arm/swtch-v6.S optional armv7 | armv6 arm/arm/sys_machdep.c standard arm/arm/syscall.c standard -arm/arm/trap-v4.c optional !armv6 -arm/arm/trap-v6.c optional armv6 +arm/arm/trap-v4.c optional !armv7 !armv6 +arm/arm/trap-v6.c optional armv7 | armv6 arm/arm/uio_machdep.c standard arm/arm/undefined.c standard arm/arm/unwind.c optional ddb | kdtrace_hooks @@ -128,6 +129,7 @@ dev/fdt/fdt_arm_platform.c optional platform fdt dev/hdmi/hdmi_if.m optional hdmi dev/hwpmc/hwpmc_arm.c optional hwpmc dev/hwpmc/hwpmc_armv7.c optional hwpmc armv6 +dev/hwpmc/hwpmc_armv7.c optional hwpmc armv7 dev/iicbus/twsi/twsi.c optional twsi dev/ofw/ofwpci.c optional fdt pci dev/pci/pci_host_generic.c optional pci_host_generic pci Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Thu Oct 5 23:01:33 2017 (r324340) +++ head/sys/conf/options.arm Thu Oct 5 23:01:50 2017 (r324341) @@ -1,5 +1,6 @@ #$FreeBSD$ ARMV6 opt_global.h +ARMV7 opt_global.h ARM_CACHE_LOCK_ENABLE opt_global.h ARM_KERN_DIRECTMAP opt_vm.h ARM_L2_PIPT opt_global.h From owner-svn-src-head@freebsd.org Thu Oct 5 23:05:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66399E44DC6; Thu, 5 Oct 2017 23:05:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 344166578D; Thu, 5 Oct 2017 23:05:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v95N5vns013991; Thu, 5 Oct 2017 23:05:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v95N5vhj013989; Thu, 5 Oct 2017 23:05:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710052305.v95N5vhj013989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 5 Oct 2017 23:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324342 - in head: . sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . sys/sys X-SVN-Commit-Revision: 324342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 23:05:58 -0000 Author: imp Date: Thu Oct 5 23:05:56 2017 New Revision: 324342 URL: https://svnweb.freebsd.org/changeset/base/324342 Log: Add updating for armv7 and bump FreeBSD_version. Sponsored by: Netflix Modified: head/UPDATING head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Oct 5 23:01:50 2017 (r324341) +++ head/UPDATING Thu Oct 5 23:05:56 2017 (r324342) @@ -51,6 +51,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20171005: + The arm port has split armv6 into armv6 and armv7. armv7 is now + a valid TARGET_ARCH/MACHINE_ARCH setting. + 20171003: When building multiple kernels using KERNCONF, non-existent KERNCONF files will produce an error and buildkernel will fail. Previously Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Oct 5 23:01:50 2017 (r324341) +++ head/sys/sys/param.h Thu Oct 5 23:05:56 2017 (r324342) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200049 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200050 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Fri Oct 6 07:52:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECD2DE2F75F; Fri, 6 Oct 2017 07:52:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8A8B731FE; Fri, 6 Oct 2017 07:52:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v967qQxw033992; Fri, 6 Oct 2017 07:52:26 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v967qPHP033991; Fri, 6 Oct 2017 07:52:25 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710060752.v967qPHP033991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 6 Oct 2017 07:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324343 - head/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zdb X-SVN-Commit-Revision: 324343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 07:52:27 -0000 Author: avg Date: Fri Oct 6 07:52:25 2017 New Revision: 324343 URL: https://svnweb.freebsd.org/changeset/base/324343 Log: MFV r316862: 6410 teach zdb to perform object lookups by path illumos/illumos-gate@ed61ec1da9132e570b0853386d0f78a32f852cd2 https://github.com/illumos/illumos-gate/commit/ed61ec1da9132e570b0853386d0f78a32f852cd2 FreeBSD note: this commit does not update the manual page. The original change includes conversion of the manual page from *roff format to mandoc format. So, it is hard to extract the content change from that. I am going to replace our zdb manual page, which is an earlier independent conversion, with a slighly modified version of the upstream page. https://www.illumos.org/issues/6410 This is primarily intended to ease debugging & testing ZFS when one is only interested in things like the on-disk location of a specific object's blocks, but doesn't know their object id. This allows doing things like the following (FreeBSD-based example): # zpool create -f foo da0 # dd if=/dev/zero of=/foo/1 bs=1M count=4 >/dev/null 2>&1 # zpool export foo # zdb -vvvvv -o "ZFS plain file" foo /1 Object lvl iblk dblk dsize lsize %full type 8 2 16K 128K 3.99M 4M 100.00 ZFS plain file (K=inherit) (Z=inherit) 168 bonus System attributes dnode flags: USED_BYTES USERUSED_ACCOUNTED dnode maxblkid: 31 path /1 uid 0 gid 0 atime Thu Apr 23 22:45:32 2015 mtime Thu Apr 23 22:45:32 2015 ctime Thu Apr 23 22:45:32 2015 crtime Thu Apr 23 22:45:32 2015 gen 7 mode 100644 size 4194304 parent 4 links 1 pflags 40800000004 Indirect blocks: 0 L1 DVA[0]=<0:c19200:600> DVA[1]=<0:10800019200:600> [L1 ZFS plain file] fletcher4 lz4 LE contiguous unique double size=4000L/200P birth=7L/ Reviewed by: Pavel Zakharov Reviewed by: Matthew Ahrens Reviewed by: Will Andrews Approved by: Dan McDonald Author: Yuri Pankov MFC after: 3 weeks Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/zdb/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Oct 5 23:05:56 2017 (r324342) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Oct 6 07:52:25 2017 (r324343) @@ -23,7 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] - * Copyright 2016 Nexenta Systems, Inc. + * Copyright 2017 Nexenta Systems, Inc. */ #include @@ -121,19 +121,22 @@ static void usage(void) { (void) fprintf(stderr, - "Usage: %s [-CmMdibcsDvhLXFPAG] [-t txg] [-e [-p path...]] " - "[-U config] [-I inflight I/Os] [-x dumpdir] [-o var=value] " - "poolname [object...]\n" - " %s [-divPA] [-e -p path...] [-U config] dataset " - "[object...]\n" - " %s -mM [-LXFPA] [-t txg] [-e [-p path...]] [-U config] " - "poolname [vdev [metaslab...]]\n" - " %s -R [-A] [-e [-p path...]] poolname " - "vdev:offset:size[:flags]\n" - " %s -S [-PA] [-e [-p path...]] [-U config] poolname\n" - " %s -l [-Aqu] device\n" - " %s -C [-A] [-U config]\n\n", - cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); + "Usage:\t%s [-AbcdDFGhiLMPsvX] [-e [-p ...]] " + "[-I ]\n" + "\t\t[-o =]... [-t ] [-U ] [-x ]\n" + "\t\t[ [ ...]]\n" + "\t%s [-AdiPv] [-e [-p ...]] [-U ] " + "[ ...]\n" + "\t%s -C [-A] [-U ]\n" + "\t%s -l [-Aqu] \n" + "\t%s -m [-AFLPX] [-e [-p ...]] [-t ] [-U ]\n" + "\t\t [ [ ...]]\n" + "\t%s -O \n" + "\t%s -R [-A] [-e [-p ...]] [-U ]\n" + "\t\t ::[:]\n" + "\t%s -S [-AP] [-e [-p ...]] [-U ] \n\n", + cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, + cmdname); (void) fprintf(stderr, " Dataset name must include at least one " "separator character '/' or '@'\n"); @@ -142,52 +145,54 @@ usage(void) (void) fprintf(stderr, " If object numbers are specified, only " "those objects are dumped\n\n"); (void) fprintf(stderr, " Options to control amount of output:\n"); - (void) fprintf(stderr, " -d dataset(s)\n"); - (void) fprintf(stderr, " -i intent logs\n"); - (void) fprintf(stderr, " -C config (or cachefile if alone)\n"); - (void) fprintf(stderr, " -h pool history\n"); (void) fprintf(stderr, " -b block statistics\n"); - (void) fprintf(stderr, " -m metaslabs\n"); - (void) fprintf(stderr, " -M metaslab groups\n"); (void) fprintf(stderr, " -c checksum all metadata (twice for " "all data) blocks\n"); - (void) fprintf(stderr, " -s report stats on zdb's I/O\n"); + (void) fprintf(stderr, " -C config (or cachefile if alone)\n"); + (void) fprintf(stderr, " -d dataset(s)\n"); (void) fprintf(stderr, " -D dedup statistics\n"); - (void) fprintf(stderr, " -S simulate dedup to measure effect\n"); - (void) fprintf(stderr, " -v verbose (applies to all others)\n"); + (void) fprintf(stderr, " -h pool history\n"); + (void) fprintf(stderr, " -i intent logs\n"); (void) fprintf(stderr, " -l read label contents\n"); (void) fprintf(stderr, " -L disable leak tracking (do not " "load spacemaps)\n"); + (void) fprintf(stderr, " -m metaslabs\n"); + (void) fprintf(stderr, " -M metaslab groups\n"); + (void) fprintf(stderr, " -O perform object lookups by path\n"); (void) fprintf(stderr, " -R read and display block from a " - "device\n\n"); + "device\n"); + (void) fprintf(stderr, " -s report stats on zdb's I/O\n"); + (void) fprintf(stderr, " -S simulate dedup to measure effect\n"); + (void) fprintf(stderr, " -v verbose (applies to all " + "others)\n\n"); (void) fprintf(stderr, " Below options are intended for use " "with other options:\n"); (void) fprintf(stderr, " -A ignore assertions (-A), enable " "panic recovery (-AA) or both (-AAA)\n"); - (void) fprintf(stderr, " -F attempt automatic rewind within " - "safe range of transaction groups\n"); - (void) fprintf(stderr, " -U -- use alternate " - "cachefile\n"); - (void) fprintf(stderr, " -X attempt extreme rewind (does not " - "work with dataset)\n"); (void) fprintf(stderr, " -e pool is exported/destroyed/" "has altroot/not in a cachefile\n"); - (void) fprintf(stderr, " -p -- use one or more with " - "-e to specify path to vdev dir\n"); - (void) fprintf(stderr, " -x -- " - "dump all read blocks into specified directory\n"); - (void) fprintf(stderr, " -P print numbers in parseable form\n"); - (void) fprintf(stderr, " -t -- highest txg to use when " - "searching for uberblocks\n"); + (void) fprintf(stderr, " -F attempt automatic rewind within " + "safe range of transaction groups\n"); + (void) fprintf(stderr, " -G dump zfs_dbgmsg buffer before " + "exiting\n"); (void) fprintf(stderr, " -I -- " "specify the maximum number of " "checksumming I/Os [default is 200]\n"); - (void) fprintf(stderr, " -G dump zfs_dbgmsg buffer before " - "exiting\n"); (void) fprintf(stderr, " -o = set global " "variable to an unsigned 32-bit integer value\n"); + (void) fprintf(stderr, " -p -- use one or more with " + "-e to specify path to vdev dir\n"); + (void) fprintf(stderr, " -P print numbers in parseable form\n"); (void) fprintf(stderr, " -q don't print label contents\n"); + (void) fprintf(stderr, " -t -- highest txg to use when " + "searching for uberblocks\n"); (void) fprintf(stderr, " -u uberblock\n"); + (void) fprintf(stderr, " -U -- use alternate " + "cachefile\n"); + (void) fprintf(stderr, " -x -- " + "dump all read blocks into specified directory\n"); + (void) fprintf(stderr, " -X attempt extreme rewind (does not " + "work with dataset)\n\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " "to make only that option verbose\n"); (void) fprintf(stderr, "Default is to dump everything non-verbosely\n"); @@ -1603,10 +1608,57 @@ dump_deadlist(dsl_deadlist_t *dl) static avl_tree_t idx_tree; static avl_tree_t domain_tree; static boolean_t fuid_table_loaded; -static boolean_t sa_loaded; -sa_attr_type_t *sa_attr_table; +static objset_t *sa_os = NULL; +static sa_attr_type_t *sa_attr_table = NULL; +static int +open_objset(const char *path, dmu_objset_type_t type, void *tag, objset_t **osp) +{ + int err; + uint64_t sa_attrs = 0; + uint64_t version = 0; + + VERIFY3P(sa_os, ==, NULL); + err = dmu_objset_own(path, type, B_TRUE, tag, osp); + if (err != 0) { + (void) fprintf(stderr, "failed to own dataset '%s': %s\n", path, + strerror(err)); + return (err); + } + + if (dmu_objset_type(*osp) == DMU_OST_ZFS) { + (void) zap_lookup(*osp, MASTER_NODE_OBJ, ZPL_VERSION_STR, + 8, 1, &version); + if (version >= ZPL_VERSION_SA) { + (void) zap_lookup(*osp, MASTER_NODE_OBJ, ZFS_SA_ATTRS, + 8, 1, &sa_attrs); + } + err = sa_setup(*osp, sa_attrs, zfs_attr_table, ZPL_END, + &sa_attr_table); + if (err != 0) { + (void) fprintf(stderr, "sa_setup failed: %s\n", + strerror(err)); + dmu_objset_disown(*osp, tag); + *osp = NULL; + } + } + sa_os = *osp; + + return (0); +} + static void +close_objset(objset_t *os, void *tag) +{ + VERIFY3P(os, ==, sa_os); + if (os->os_sa != NULL) + sa_tear_down(os); + dmu_objset_disown(os, tag); + sa_attr_table = NULL; + sa_os = NULL; +} + +static void fuid_table_destroy() { if (fuid_table_loaded) { @@ -1676,25 +1728,7 @@ dump_znode(objset_t *os, uint64_t object, void *data, int idx = 0; int error; - if (!sa_loaded) { - uint64_t sa_attrs = 0; - uint64_t version; - - VERIFY(zap_lookup(os, MASTER_NODE_OBJ, ZPL_VERSION_STR, - 8, 1, &version) == 0); - if (version >= ZPL_VERSION_SA) { - VERIFY(zap_lookup(os, MASTER_NODE_OBJ, ZFS_SA_ATTRS, - 8, 1, &sa_attrs) == 0); - } - if ((error = sa_setup(os, sa_attrs, zfs_attr_table, - ZPL_END, &sa_attr_table)) != 0) { - (void) printf("sa_setup failed errno %d, can't " - "display znode contents\n", error); - return; - } - sa_loaded = B_TRUE; - } - + VERIFY3P(os, ==, sa_os); if (sa_handle_get(os, object, NULL, SA_HDL_PRIVATE, &hdl)) { (void) printf("Failed to get handle for SA znode\n"); return; @@ -2162,7 +2196,109 @@ dump_label_uberblocks(vdev_label_t *lbl, uint64_t ashi } } +static char curpath[PATH_MAX]; + +/* + * Iterate through the path components, recursively passing + * current one's obj and remaining path until we find the obj + * for the last one. + */ static int +dump_path_impl(objset_t *os, uint64_t obj, char *name) +{ + int err; + int header = 1; + uint64_t child_obj; + char *s; + dmu_buf_t *db; + dmu_object_info_t doi; + + if ((s = strchr(name, '/')) != NULL) + *s = '\0'; + err = zap_lookup(os, obj, name, 8, 1, &child_obj); + + (void) strlcat(curpath, name, sizeof (curpath)); + + if (err != 0) { + (void) fprintf(stderr, "failed to lookup %s: %s\n", + curpath, strerror(err)); + return (err); + } + + child_obj = ZFS_DIRENT_OBJ(child_obj); + err = sa_buf_hold(os, child_obj, FTAG, &db); + if (err != 0) { + (void) fprintf(stderr, + "failed to get SA dbuf for obj %llu: %s\n", + (u_longlong_t)child_obj, strerror(err)); + return (EINVAL); + } + dmu_object_info_from_db(db, &doi); + sa_buf_rele(db, FTAG); + + if (doi.doi_bonus_type != DMU_OT_SA && + doi.doi_bonus_type != DMU_OT_ZNODE) { + (void) fprintf(stderr, "invalid bonus type %d for obj %llu\n", + doi.doi_bonus_type, (u_longlong_t)child_obj); + return (EINVAL); + } + + if (dump_opt['v'] > 6) { + (void) printf("obj=%llu %s type=%d bonustype=%d\n", + (u_longlong_t)child_obj, curpath, doi.doi_type, + doi.doi_bonus_type); + } + + (void) strlcat(curpath, "/", sizeof (curpath)); + + switch (doi.doi_type) { + case DMU_OT_DIRECTORY_CONTENTS: + if (s != NULL && *(s + 1) != '\0') + return (dump_path_impl(os, child_obj, s + 1)); + /*FALLTHROUGH*/ + case DMU_OT_PLAIN_FILE_CONTENTS: + dump_object(os, child_obj, dump_opt['v'], &header); + return (0); + default: + (void) fprintf(stderr, "object %llu has non-file/directory " + "type %d\n", (u_longlong_t)obj, doi.doi_type); + break; + } + + return (EINVAL); +} + +/* + * Dump the blocks for the object specified by path inside the dataset. + */ +static int +dump_path(char *ds, char *path) +{ + int err; + objset_t *os; + uint64_t root_obj; + + err = open_objset(ds, DMU_OST_ZFS, FTAG, &os); + if (err != 0) + return (err); + + err = zap_lookup(os, MASTER_NODE_OBJ, ZFS_ROOT_OBJ, 8, 1, &root_obj); + if (err != 0) { + (void) fprintf(stderr, "can't lookup root znode: %s\n", + strerror(err)); + dmu_objset_disown(os, FTAG); + return (EINVAL); + } + + (void) snprintf(curpath, sizeof (curpath), "dataset=%s path=/", ds); + + err = dump_path_impl(os, root_obj, path); + + close_objset(os, FTAG); + return (err); +} + +static int dump_label(const char *dev) { int fd; @@ -2266,11 +2402,9 @@ dump_one_dir(const char *dsname, void *arg) int error; objset_t *os; - error = dmu_objset_own(dsname, DMU_OST_ANY, B_TRUE, FTAG, &os); - if (error) { - (void) printf("Could not open %s, error %d\n", dsname, error); + error = open_objset(dsname, DMU_OST_ANY, FTAG, &os); + if (error != 0) return (0); - } for (spa_feature_t f = 0; f < SPA_FEATURES; f++) { if (!dmu_objset_ds(os)->ds_feature_inuse[f]) @@ -2281,9 +2415,8 @@ dump_one_dir(const char *dsname, void *arg) } dump_dir(os); - dmu_objset_disown(os, FTAG); + close_objset(os, FTAG); fuid_table_destroy(); - sa_loaded = B_FALSE; return (0); } @@ -3635,35 +3768,37 @@ main(int argc, char **argv) spa_config_path = spa_config_path_env; while ((c = getopt(argc, argv, - "bcdhilmMI:suCDRSAFLXx:evp:t:U:PGo:q")) != -1) { + "AbcCdDeFGhiI:lLmMo:Op:PqRsSt:uU:vx:X")) != -1) { switch (c) { case 'b': case 'c': + case 'C': case 'd': + case 'D': + case 'G': case 'h': case 'i': case 'l': case 'm': - case 's': - case 'u': - case 'C': - case 'D': case 'M': + case 'O': case 'R': + case 's': case 'S': - case 'G': + case 'u': dump_opt[c]++; dump_all = 0; break; case 'A': + case 'e': case 'F': case 'L': - case 'X': - case 'e': case 'P': case 'q': + case 'X': dump_opt[c]++; break; + /* NB: Sort single match options below. */ case 'I': max_inflight = strtoull(optarg, NULL, 0); if (max_inflight == 0) { @@ -3673,6 +3808,11 @@ main(int argc, char **argv) usage(); } break; + case 'o': + error = set_global_var(optarg); + if (error != 0) + usage(); + break; case 'p': if (searchdirs == NULL) { searchdirs = umem_alloc(sizeof (char *), @@ -3705,11 +3845,6 @@ main(int argc, char **argv) case 'x': vn_dumpdir = optarg; break; - case 'o': - error = set_global_var(optarg); - if (error != 0) - usage(); - break; default: usage(); break; @@ -3748,7 +3883,7 @@ main(int argc, char **argv) verbose = MAX(verbose, 1); for (c = 0; c < 256; c++) { - if (dump_all && !strchr("elAFLRSXP", c)) + if (dump_all && strchr("AeFlLOPRSX", c) == NULL) dump_opt[c] = 1; if (dump_opt[c]) dump_opt[c] += verbose; @@ -3773,6 +3908,13 @@ main(int argc, char **argv) if (dump_opt['l']) return (dump_label(argv[0])); + if (dump_opt['O']) { + if (argc != 2) + usage(); + dump_opt['v'] = verbose + 3; + return (dump_path(argv[0], argv[1])); + } + if (dump_opt['X'] || dump_opt['F']) rewind = ZPOOL_DO_REWIND | (dump_opt['X'] ? ZPOOL_EXTREME_REWIND : 0); @@ -3847,8 +3989,7 @@ main(int argc, char **argv) } } } else { - error = dmu_objset_own(target, DMU_OST_ANY, - B_TRUE, FTAG, &os); + error = open_objset(target, DMU_OST_ANY, FTAG, &os); } } nvlist_free(policy); @@ -3891,10 +4032,12 @@ main(int argc, char **argv) zdb_read_block(argv[i], spa); } - (os != NULL) ? dmu_objset_disown(os, FTAG) : spa_close(spa, FTAG); + if (os != NULL) + close_objset(os, FTAG); + else + spa_close(spa, FTAG); fuid_table_destroy(); - sa_loaded = B_FALSE; dump_debug_buffer(); From owner-svn-src-head@freebsd.org Fri Oct 6 08:09:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76400E3001F; Fri, 6 Oct 2017 08:09:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5242873BDB; Fri, 6 Oct 2017 08:09:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9689K5h038592; Fri, 6 Oct 2017 08:09:20 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9689Ktr038591; Fri, 6 Oct 2017 08:09:20 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710060809.v9689Ktr038591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 6 Oct 2017 08:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324344 - head/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zdb X-SVN-Commit-Revision: 324344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 08:09:21 -0000 Author: avg Date: Fri Oct 6 08:09:20 2017 New Revision: 324344 URL: https://svnweb.freebsd.org/changeset/base/324344 Log: MFV r316864: 6392 zdb: introduce -V for verbatim import illumos/illumos-gate@dfd5965f7e43b6a630e5ac86708ae76b4f02cc40 https://github.com/illumos/illumos-gate/commit/dfd5965f7e43b6a630e5ac86708ae76b4f02cc40 FreeBSD note: the manual page is to be updated separately. https://www.illumos.org/issues/6392 When given a pool name via -e, zdb would attempt an import. If it failed, then it would attempt a verbatim import. This behavior is not always desirable so a -V switch is added to zdb to control the behavior. When specified, a verbatim import is done. Otherwise, the behavior is as it was previously, except no verbatim import is done on failure. https://github.com/zfsonlinux/zfs/commit/a5778ea2427bd340e3b4f697d9b6e1452bd71909 Reviewed by: Brian Behlendorf Reviewed by: Matthew Ahrens Reviewed by: Yuri Pankov Reviewed by: Brian Behlendorf Reviewed by: Matt Ahrens Reviewed by: Pavel Zakharov Approved by: Dan McDonald Author: Richard Yao MFC after: 3 weeks Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/zdb/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Oct 6 07:52:25 2017 (r324343) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Oct 6 08:09:20 2017 (r324344) @@ -121,20 +121,21 @@ static void usage(void) { (void) fprintf(stderr, - "Usage:\t%s [-AbcdDFGhiLMPsvX] [-e [-p ...]] " + "Usage:\t%s [-AbcdDFGhiLMPsvX] [-e [-V] [-p ...]] " "[-I ]\n" "\t\t[-o =]... [-t ] [-U ] [-x ]\n" "\t\t[ [ ...]]\n" - "\t%s [-AdiPv] [-e [-p ...]] [-U ] " + "\t%s [-AdiPv] [-e [-V] [-p ...]] [-U ] " "[ ...]\n" "\t%s -C [-A] [-U ]\n" "\t%s -l [-Aqu] \n" - "\t%s -m [-AFLPX] [-e [-p ...]] [-t ] [-U ]\n" - "\t\t [ [ ...]]\n" + "\t%s -m [-AFLPX] [-e [-V] [-p ...]] [-t ] " + "[-U ]\n\t\t [ [ ...]]\n" "\t%s -O \n" - "\t%s -R [-A] [-e [-p ...]] [-U ]\n" + "\t%s -R [-A] [-e [-V] [-p ...]] [-U ]\n" "\t\t ::[:]\n" - "\t%s -S [-AP] [-e [-p ...]] [-U ] \n\n", + "\t%s -S [-AP] [-e [-V] [-p ...]] [-U ] " + "\n\n", cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); @@ -189,6 +190,7 @@ usage(void) (void) fprintf(stderr, " -u uberblock\n"); (void) fprintf(stderr, " -U -- use alternate " "cachefile\n"); + (void) fprintf(stderr, " -V do verbatim import\n"); (void) fprintf(stderr, " -x -- " "dump all read blocks into specified directory\n"); (void) fprintf(stderr, " -X attempt extreme rewind (does not " @@ -3749,6 +3751,7 @@ main(int argc, char **argv) char *target; nvlist_t *policy = NULL; uint64_t max_txg = UINT64_MAX; + int flags = ZFS_IMPORT_MISSING_LOG; int rewind = ZPOOL_NEVER_REWIND; char *spa_config_path_env; boolean_t target_is_spa = B_TRUE; @@ -3768,7 +3771,7 @@ main(int argc, char **argv) spa_config_path = spa_config_path_env; while ((c = getopt(argc, argv, - "AbcCdDeFGhiI:lLmMo:Op:PqRsSt:uU:vx:X")) != -1) { + "AbcCdDeFGhiI:lLmMo:Op:PqRsSt:uU:vVx:X")) != -1) { switch (c) { case 'b': case 'c': @@ -3842,6 +3845,9 @@ main(int argc, char **argv) case 'v': verbose++; break; + case 'V': + flags = ZFS_IMPORT_VERBATIM; + break; case 'x': vn_dumpdir = optarg; break; @@ -3942,11 +3948,7 @@ main(int argc, char **argv) fatal("can't open '%s': %s", target, strerror(ENOMEM)); } - if ((error = spa_import(name, cfg, NULL, - ZFS_IMPORT_MISSING_LOG)) != 0) { - error = spa_import(name, cfg, NULL, - ZFS_IMPORT_VERBATIM); - } + error = spa_import(name, cfg, NULL, flags); } } From owner-svn-src-head@freebsd.org Fri Oct 6 08:10:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AB5CE301CB; Fri, 6 Oct 2017 08:10:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59B0A73D86; Fri, 6 Oct 2017 08:10:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v968As1o041083; Fri, 6 Oct 2017 08:10:54 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v968Aslg041082; Fri, 6 Oct 2017 08:10:54 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710060810.v968Aslg041082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 6 Oct 2017 08:10:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324345 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 324345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 08:10:55 -0000 Author: avg Date: Fri Oct 6 08:10:54 2017 New Revision: 324345 URL: https://svnweb.freebsd.org/changeset/base/324345 Log: MFV r316877: 7571 non-present readonly numeric ZFS props do not have default value illumos/illumos-gate@ad2760acbd9c3b479bf632f05c6f03d89830799d https://github.com/illumos/illumos-gate/commit/ad2760acbd9c3b479bf632f05c6f03d89830799d https://www.illumos.org/issues/7571 ZFS displays the default value for non-present readonly numeric (and index) properties. However, these properties default values are not meaningful. Instead, we should display a "-", indicating that they are not present. For example, on a version-12 pool, the usedby* properties are not available, but they show up as the incorrect value "0": 1. zfs get all test12 ... test12 usedbysnapshots 0 - test12 usedbydataset 0 - test12 usedbychildren 0 - test12 usedbyrefreservation 0 - We will be introducing more sometimes-present numeric readonly properties, so it would be nice to fix this. Reviewed by: Dan Kimmel Reviewed by: George Wilson Approved by: Robert Mustacchi Author: Matthew Ahrens MFC after: 3 weeks Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Oct 6 08:09:20 2017 (r324344) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Oct 6 08:10:54 2017 (r324345) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek. All rights reserved. * Copyright (c) 2013 Martin Matuska. All rights reserved. @@ -2166,6 +2166,7 @@ get_numeric_property(zfs_handle_t *zhp, zfs_prop_t pro if (zfs_prop_readonly(prop) && *source != NULL && (*source)[0] == '\0') { *source = NULL; + return (-1); } break; From owner-svn-src-head@freebsd.org Fri Oct 6 08:12:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9468E30243; Fri, 6 Oct 2017 08:12:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B57A3740AD; Fri, 6 Oct 2017 08:12:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v968CDEf042763; Fri, 6 Oct 2017 08:12:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v968CD5P042762; Fri, 6 Oct 2017 08:12:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710060812.v968CD5P042762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 6 Oct 2017 08:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324346 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 324346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 08:12:15 -0000 Author: avg Date: Fri Oct 6 08:12:13 2017 New Revision: 324346 URL: https://svnweb.freebsd.org/changeset/base/324346 Log: MFV r316931: 6268 zfs diff confused by moving a file to another directory illumos/illumos-gate@aab04418a72c0a29040a5da7eec08efe19dbef04 https://github.com/illumos/illumos-gate/commit/aab04418a72c0a29040a5da7eec08efe19dbef04 https://www.illumos.org/issues/6268 The zfs diff command presents a description of the changes that have occurred to files within a filesystem between two snapshots. If a file is renamed, the tool is capable of reporting this, e.g.: cd /some/zfs/dataset/subdir mv file0 file1 Will result in a diff record like: R /some/zfs/dataset/subdir/file0 -> /some/zfs/dataset/subdir/file1 Unfortunately, it seems that rename detection only uses the base filename to determine if a file has been renamed or simply modified. This leads to misreporting only the original filename, omitting the more relevant destination filename entirely. For example: cd /some/zfs/dataset/subdir mv file0 ../otherdir/file0 Will result in a diff entry: M /some/zfs/dataset/subdir/file0 But it should really emit: R /some/zfs/dataset/subdir/file0 -> /some/zfs/dataset/otherdir/file0 Reviewed by: Matthew Ahrens Reviewed by: Justin Gibbs Approved by: Dan McDonald Author: Joshua M. Clulow MFC after: 3 weeks Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Fri Oct 6 08:10:54 2017 (r324345) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Fri Oct 6 08:12:13 2017 (r324346) @@ -55,15 +55,6 @@ #define ZDIFF_REMOVED '-' #define ZDIFF_RENAMED 'R' -static boolean_t -do_name_cmp(const char *fpath, const char *tpath) -{ - char *fname, *tname; - fname = strrchr(fpath, '/') + 1; - tname = strrchr(tpath, '/') + 1; - return (strcmp(fname, tname) == 0); -} - typedef struct differ_info { zfs_handle_t *zhp; char *fromsnap; @@ -262,7 +253,6 @@ static int write_inuse_diffs_one(FILE *fp, differ_info_t *di, uint64_t dobj) { struct zfs_stat fsb, tsb; - boolean_t same_name; mode_t fmode, tmode; char fobjname[MAXPATHLEN], tobjname[MAXPATHLEN]; int fobjerr, tobjerr; @@ -323,7 +313,6 @@ write_inuse_diffs_one(FILE *fp, differ_info_t *di, uin if (fmode != tmode && fsb.zs_gen == tsb.zs_gen) tsb.zs_gen++; /* Force a generational difference */ - same_name = do_name_cmp(fobjname, tobjname); /* Simple modification or no change */ if (fsb.zs_gen == tsb.zs_gen) { @@ -334,7 +323,7 @@ write_inuse_diffs_one(FILE *fp, differ_info_t *di, uin if (change) { print_link_change(fp, di, change, change > 0 ? fobjname : tobjname, &tsb); - } else if (same_name) { + } else if (strcmp(fobjname, tobjname) == 0) { print_file(fp, di, ZDIFF_MODIFIED, fobjname, &tsb); } else { print_rename(fp, di, fobjname, tobjname, &tsb); From owner-svn-src-head@freebsd.org Fri Oct 6 08:15:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E069E3038D; Fri, 6 Oct 2017 08:15:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC15A743F0; Fri, 6 Oct 2017 08:15:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v968Fc7E043078; Fri, 6 Oct 2017 08:15:38 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v968FcV1043077; Fri, 6 Oct 2017 08:15:38 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710060815.v968FcV1043077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 6 Oct 2017 08:15:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324347 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 324347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 08:15:39 -0000 Author: avg Date: Fri Oct 6 08:15:37 2017 New Revision: 324347 URL: https://svnweb.freebsd.org/changeset/base/324347 Log: MFV r316933: 5142 libzfs support raidz root pool (loader project) illumos/illumos-gate@d5f26ad8122c3762fb16413a17bfb497db86a782 https://github.com/illumos/illumos-gate/commit/d5f26ad8122c3762fb16413a17bfb497db86a782 https://www.illumos.org/issues/5142 the current libzfs only allows simple disk and mirror setup for boot pool, as loader does support booting from raidz, this feature will remove raidz restriction from boot pool setup. FreeBSD note: we have long supported this feature, this commit only removes a small difference in libzfs. Reviewed by: George Wilson Reviewed by: Yuri Pankov Reviewed by: Andrew Stormont Reviewed by: Albert Lee Approved by: Robert Mustacchi Author: Toomas Soome MFC after: 3 weeks Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Oct 6 08:12:13 2017 (r324346) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Oct 6 08:15:37 2017 (r324347) @@ -2295,6 +2295,7 @@ vdev_get_physpaths(nvlist_t *nv, char *physpath, size_ return (ret); } } else if (strcmp(type, VDEV_TYPE_MIRROR) == 0 || + strcmp(type, VDEV_TYPE_RAIDZ) == 0 || strcmp(type, VDEV_TYPE_REPLACING) == 0 || (is_spare = (strcmp(type, VDEV_TYPE_SPARE) == 0))) { nvlist_t **child; From owner-svn-src-head@freebsd.org Fri Oct 6 08:17:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10CCFE3040B; Fri, 6 Oct 2017 08:17:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D23877454A; Fri, 6 Oct 2017 08:17:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v968HDEJ043208; Fri, 6 Oct 2017 08:17:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v968HClm043207; Fri, 6 Oct 2017 08:17:12 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710060817.v968HClm043207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 6 Oct 2017 08:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324348 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 324348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 08:17:14 -0000 Author: avg Date: Fri Oct 6 08:17:12 2017 New Revision: 324348 URL: https://svnweb.freebsd.org/changeset/base/324348 Log: MFV r316934: 7340 receive manual origin should override automatic origin illumos/illumos-gate@ed4e7a6a5cbc5e8986dc649ad54435210487b102 https://github.com/illumos/illumos-gate/commit/ed4e7a6a5cbc5e8986dc649ad54435210487b102 https://www.illumos.org/issues/7340 When -o origin= is specified as part of a ZFS receive, that origin should override the automatic detection in libzfs. Reviewed by: George Wilson Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Paul Dagnelie MFC after: 3 weeks Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Oct 6 08:15:37 2017 (r324347) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Oct 6 08:17:12 2017 (r324348) @@ -3212,7 +3212,12 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const /* * Determine the name of the origin snapshot, store in zc_string. */ - if (drrb->drr_flags & DRR_FLAG_CLONE) { + if (originsnap) { + (void) strncpy(zc.zc_string, originsnap, sizeof (zc.zc_string)); + if (flags->verbose) + (void) printf("using provided clone origin %s\n", + zc.zc_string); + } else if (drrb->drr_flags & DRR_FLAG_CLONE) { if (guid_to_name(hdl, zc.zc_value, drrb->drr_fromguid, B_FALSE, zc.zc_string) != 0) { zcmd_free_nvlists(&zc); @@ -3223,11 +3228,6 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const } if (flags->verbose) (void) printf("found clone origin %s\n", zc.zc_string); - } else if (originsnap) { - (void) strncpy(zc.zc_string, originsnap, sizeof (zc.zc_string)); - if (flags->verbose) - (void) printf("using provided clone origin %s\n", - zc.zc_string); } boolean_t resuming = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) & From owner-svn-src-head@freebsd.org Fri Oct 6 08:18:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CAD6E3047E; Fri, 6 Oct 2017 08:18:14 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 65FFA74695; Fri, 6 Oct 2017 08:18:12 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id db94e527; Fri, 6 Oct 2017 10:18:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=xfxTEmzJCukHQ9x10jng1xfHNfM=; b=e7F26iqB0pnT4F+ggMHmcAW111DB jlq5YZsW08qX2wJO9E75xE4aju0Ff9UJeRezt7asAYviWz76IQi20BsgF66RFErO ooHzTVqynBS4vFh+/8Y36Sueq2WTonf/avJIgV1KC+pemTFpZ/q2asDiTxl/9knI 9mQ7ADPwKb8bl4Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=WM1to8UHuwGVqWr/Jb27hxFg0YZ8Kv8EEri44X83BobVbm6T4xC1s2s/ vEZpMYjHOfK7dSZe1/l4R6cooz2P1qkZPIlLMQLcdgnjvzaIsJrvda2v5vMD39n+ hvHVd2Ie/4HDvtRxPWH7EWKtHN2kxUGDLFpyo25cREBEu/FVMrA= Received: from arcadia (evadot.gandi.net [217.70.181.36]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 986a9694 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Fri, 6 Oct 2017 10:18:03 +0200 (CEST) Date: Fri, 6 Oct 2017 10:17:54 +0200 From: Emmanuel Vadot To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324341 - in head/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/broadcom/bcm2835 arm/conf arm/freescale/imx arm/freescale/vybrid arm/mv arm/mv/armad... Message-Id: <20171006101754.d4e24806227c183a2b836af3@bidouilliste.com> In-Reply-To: <201710052301.v95N1olt013714@repo.freebsd.org> References: <201710052301.v95N1olt013714@repo.freebsd.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 08:18:14 -0000 Hi Warner, On Thu, 5 Oct 2017 23:01:50 +0000 (UTC) Warner Losh wrote: > Author: imp > Date: Thu Oct 5 23:01:50 2017 > New Revision: 324341 > URL: https://svnweb.freebsd.org/changeset/base/324341 > > Log: > Tag all armv7 kernels as such in their machine config line. > > Transition all boards that support arm cortex CPUs to armv7. This > leaves two armv6 kernels in the tree. RPI-B, which uses the BCM2835 > which has a ARM1176 core, and VERSATILEPB, which is a qemu board setup > around the time RPI-B went in. Copy std.armv6 to std.armv7, even > though that duplicates a lot of stuff. More work needs to be done to > sort out the duplication. > > Differential Revision: https://reviews.freebsd.org/D12027 > > Added: > head/sys/arm/conf/VIRT > - copied, changed from r324340, head/sys/arm/conf/ARMADAXP > head/sys/arm/conf/std.armv7 > - copied, changed from r324340, head/sys/arm/conf/std.armv6 > Modified: > head/sys/arm/allwinner/std.allwinner > head/sys/arm/allwinner/std.allwinner_up > head/sys/arm/altera/socfpga/std.socfpga > head/sys/arm/amlogic/aml8726/std.aml8726 > head/sys/arm/annapurna/alpine/std.alpine > head/sys/arm/broadcom/bcm2835/std.bcm2836 > head/sys/arm/conf/ALLWINNER_UP > head/sys/arm/conf/ALPINE > head/sys/arm/conf/AML8726 > head/sys/arm/conf/ARMADA38X > head/sys/arm/conf/ARMADAXP > head/sys/arm/conf/BEAGLEBONE > head/sys/arm/conf/EFIKA_MX > head/sys/arm/conf/EXYNOS5.common > head/sys/arm/conf/GENERIC > head/sys/arm/conf/IMX53 > head/sys/arm/conf/IMX6 > head/sys/arm/conf/PANDABOARD > head/sys/arm/conf/RK3188 > head/sys/arm/conf/RPI2 > head/sys/arm/conf/SOCFPGA > head/sys/arm/conf/TEGRA124 > head/sys/arm/conf/VYBRID > head/sys/arm/conf/ZEDBOARD > head/sys/arm/conf/std.armv6 > head/sys/arm/freescale/imx/std.imx51 > head/sys/arm/freescale/imx/std.imx53 > head/sys/arm/freescale/imx/std.imx6 > head/sys/arm/freescale/vybrid/std.vybrid > head/sys/arm/mv/armada38x/std.armada38x > head/sys/arm/mv/std-pj4b.mv > head/sys/arm/nvidia/tegra124/std.tegra124 > head/sys/arm/qemu/std.virt > head/sys/arm/rockchip/std.rk30xx > head/sys/arm/samsung/exynos/std.exynos5250 > head/sys/arm/samsung/exynos/std.exynos5420 > head/sys/arm/ti/std.ti > head/sys/arm/xilinx/std.zynq7 > head/sys/conf/files.arm > head/sys/conf/options.arm > None of the release conf files have been updated so they will likely fail. Thanks, -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Fri Oct 6 08:21:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7383E30600; Fri, 6 Oct 2017 08:21:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A06267493D; Fri, 6 Oct 2017 08:21:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v968L6IF043444; Fri, 6 Oct 2017 08:21:06 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v968L6Db043441; Fri, 6 Oct 2017 08:21:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710060821.v968L6Db043441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 6 Oct 2017 08:21:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324349 - in head: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 324349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 08:21:07 -0000 Author: avg Date: Fri Oct 6 08:21:06 2017 New Revision: 324349 URL: https://svnweb.freebsd.org/changeset/base/324349 Log: MFV r322235: 8067 zdb should be able to dump literal embedded block pointer illumos/illumos-gate@4923c69fddc0887da5604a262585af3efd82ee20 https://github.com/illumos/illumos-gate/commit/4923c69fddc0887da5604a262585af3efd82ee20 FreeBSD note: the manual page is to be updated separately. https://www.illumos.org/issues/8067 Add an option to zdb to print a literal embedded block pointer supplied on the command line: zdb -E [-A] word0:word1:...:word15 Reviewed by: George Wilson Reviewed by: Alex Reece Reviewed by: Yuri Pankov Approved by: Robert Mustacchi Author: Matthew Ahrens MFC after: 3 weeks Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/blkptr.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/blkptr.h Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/zdb/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Oct 6 08:17:12 2017 (r324348) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Oct 6 08:21:06 2017 (r324349) @@ -61,6 +61,7 @@ #include #include #include +#include #include #undef verify #include @@ -134,10 +135,11 @@ usage(void) "\t%s -O \n" "\t%s -R [-A] [-e [-V] [-p ...]] [-U ]\n" "\t\t ::[:]\n" + "\t%s -E [-A] word0:word1:...:word15\n" "\t%s -S [-AP] [-e [-V] [-p ...]] [-U ] " "\n\n", cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, - cmdname); + cmdname, cmdname); (void) fprintf(stderr, " Dataset name must include at least one " "separator character '/' or '@'\n"); @@ -152,6 +154,8 @@ usage(void) (void) fprintf(stderr, " -C config (or cachefile if alone)\n"); (void) fprintf(stderr, " -d dataset(s)\n"); (void) fprintf(stderr, " -D dedup statistics\n"); + (void) fprintf(stderr, " -E decode and display block from an " + "embedded block pointer\n"); (void) fprintf(stderr, " -h pool history\n"); (void) fprintf(stderr, " -i intent logs\n"); (void) fprintf(stderr, " -l read label contents\n"); @@ -3653,6 +3657,33 @@ out: free(dup); } +static void +zdb_embedded_block(char *thing) +{ + blkptr_t bp = { 0 }; + unsigned long long *words = (void *)&bp; + char buf[SPA_MAXBLOCKSIZE]; + int err; + + err = sscanf(thing, "%llx:%llx:%llx:%llx:%llx:%llx:%llx:%llx:" + "%llx:%llx:%llx:%llx:%llx:%llx:%llx:%llx", + words + 0, words + 1, words + 2, words + 3, + words + 4, words + 5, words + 6, words + 7, + words + 8, words + 9, words + 10, words + 11, + words + 12, words + 13, words + 14, words + 15); + if (err != 16) { + (void) printf("invalid input format\n"); + exit(1); + } + ASSERT3U(BPE_GET_LSIZE(&bp), <=, SPA_MAXBLOCKSIZE); + err = decode_embedded_bp(&bp, buf, BPE_GET_LSIZE(&bp)); + if (err != 0) { + (void) printf("decode failed: %u\n", err); + exit(1); + } + zdb_dump_block_raw(buf, BPE_GET_LSIZE(&bp), 0); +} + static boolean_t pool_match(nvlist_t *cfg, char *tgt) { @@ -3771,13 +3802,14 @@ main(int argc, char **argv) spa_config_path = spa_config_path_env; while ((c = getopt(argc, argv, - "AbcCdDeFGhiI:lLmMo:Op:PqRsSt:uU:vVx:X")) != -1) { + "AbcCdDeEFGhiI:lLmMo:Op:PqRsSt:uU:vVx:X")) != -1) { switch (c) { case 'b': case 'c': case 'C': case 'd': case 'D': + case 'E': case 'G': case 'h': case 'i': @@ -3841,6 +3873,12 @@ main(int argc, char **argv) break; case 'U': spa_config_path = optarg; + if (spa_config_path[0] != '/') { + (void) fprintf(stderr, + "cachefile must be an absolute path " + "(i.e. start with a slash)\n"); + usage(); + } break; case 'v': verbose++; @@ -3889,7 +3927,7 @@ main(int argc, char **argv) verbose = MAX(verbose, 1); for (c = 0; c < 256; c++) { - if (dump_all && strchr("AeFlLOPRSX", c) == NULL) + if (dump_all && strchr("AeEFlLOPRSX", c) == NULL) dump_opt[c] = 1; if (dump_opt[c]) dump_opt[c] += verbose; @@ -3903,6 +3941,14 @@ main(int argc, char **argv) if (argc < 2 && dump_opt['R']) usage(); + + if (dump_opt['E']) { + if (argc != 1) + usage(); + zdb_embedded_block(argv[0]); + return (0); + } + if (argc < 1) { if (!dump_opt['e'] && dump_opt['C']) { dump_cachefile(spa_config_path); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/blkptr.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/blkptr.c Fri Oct 6 08:17:12 2017 (r324348) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/blkptr.c Fri Oct 6 08:21:06 2017 (r324349) @@ -117,3 +117,36 @@ decode_embedded_bp_compressed(const blkptr_t *bp, void buf8[i] = BF64_GET(w, (i % sizeof (w)) * NBBY, NBBY); } } + +/* + * Fill in the buffer with the (decompressed) payload of the embedded + * blkptr_t. Takes into account compression and byteorder (the payload is + * treated as a stream of bytes). + * Return 0 on success, or ENOSPC if it won't fit in the buffer. + */ +int +decode_embedded_bp(const blkptr_t *bp, void *buf, int buflen) +{ + int lsize, psize; + + ASSERT(BP_IS_EMBEDDED(bp)); + + lsize = BPE_GET_LSIZE(bp); + psize = BPE_GET_PSIZE(bp); + + if (lsize > buflen) + return (ENOSPC); + ASSERT3U(lsize, ==, buflen); + + if (BP_GET_COMPRESS(bp) != ZIO_COMPRESS_OFF) { + uint8_t dstbuf[BPE_PAYLOAD_SIZE]; + decode_embedded_bp_compressed(bp, dstbuf); + VERIFY0(zio_decompress_data_buf(BP_GET_COMPRESS(bp), + dstbuf, buf, psize, buflen)); + } else { + ASSERT3U(lsize, ==, psize); + decode_embedded_bp_compressed(bp, buf); + } + + return (0); +} Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/blkptr.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/blkptr.h Fri Oct 6 08:17:12 2017 (r324348) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/blkptr.h Fri Oct 6 08:21:06 2017 (r324349) @@ -30,6 +30,7 @@ extern "C" { void encode_embedded_bp_compressed(blkptr_t *, void *, enum zio_compress, int, int); void decode_embedded_bp_compressed(const blkptr_t *, void *); +int decode_embedded_bp(const blkptr_t *, void *, int); #ifdef __cplusplus } From owner-svn-src-head@freebsd.org Fri Oct 6 08:25:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A71B2E3089B; Fri, 6 Oct 2017 08:25:38 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 7319274D40; Fri, 6 Oct 2017 08:25:37 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from dhcp-10-248-98-167.eduroam.wireless.private.cam.ac.uk (global-5-141.nat-2.net.cam.ac.uk [131.111.5.141]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id D50924ECDA; Fri, 6 Oct 2017 08:16:14 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r324341 - in head/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/broadcom/bcm2835 arm/conf arm/freescale/imx arm/freescale/vybrid arm/mv arm/mv/armad... From: Andrew Turner In-Reply-To: <201710052301.v95N1olt013714@repo.freebsd.org> Date: Fri, 6 Oct 2017 09:16:13 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <18316188-B3F3-4D70-9502-6461B2095FE0@fubar.geek.nz> References: <201710052301.v95N1olt013714@repo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 08:25:38 -0000 > On 6 Oct 2017, at 00:01, Warner Losh wrote: > > Author: imp > Date: Thu Oct 5 23:01:50 2017 > New Revision: 324341 > URL: https://svnweb.freebsd.org/changeset/base/324341 > > Log: > Tag all armv7 kernels as such in their machine config line. > > Transition all boards that support arm cortex CPUs to armv7. This > leaves two armv6 kernels in the tree. RPI-B, which uses the BCM2835 > which has a ARM1176 core, and VERSATILEPB, which is a qemu board setup > around the time RPI-B went in. Copy std.armv6 to std.armv7, even > though that duplicates a lot of stuff. More work needs to be done to > sort out the duplication. > > Differential Revision: https://reviews.freebsd.org/D12027 > > Added: > head/sys/arm/conf/VIRT > - copied, changed from r324340, head/sys/arm/conf/ARMADAXP Did you mean to add VIRT? Andrew From owner-svn-src-head@freebsd.org Fri Oct 6 08:28:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7857DE3092B; Fri, 6 Oct 2017 08:28:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 448D374EA1; Fri, 6 Oct 2017 08:28:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v968SZ8u047511; Fri, 6 Oct 2017 08:28:35 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v968SZvQ047510; Fri, 6 Oct 2017 08:28:35 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710060828.v968SZvQ047510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 6 Oct 2017 08:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324350 - head/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zdb X-SVN-Commit-Revision: 324350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 08:28:36 -0000 Author: avg Date: Fri Oct 6 08:28:35 2017 New Revision: 324350 URL: https://svnweb.freebsd.org/changeset/base/324350 Log: zdb.8: replace with the slighly modified upstream version The upstream has converted their manual page to the same format as we have, so we can use the upstream version with minimal modifications. The current modifications are: - different zpool.cache path - different manual sections for zdb, zfs, zpool commands igor reports a few minor issues, it would be nice to fix them both in FreeBSD and in the upstream. MFC after: 3 weeks Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Fri Oct 6 08:21:06 2017 (r324349) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Fri Oct 6 08:28:35 2017 (r324350) @@ -1,6 +1,3 @@ -'\" te -.\" Copyright (c) 2012, Martin Matuska . -.\" All Rights Reserved. .\" .\" This file and its contents are supplied under the terms of the .\" Common Development and Distribution License ("CDDL"), version 1.0. @@ -13,73 +10,75 @@ .\" .\" .\" Copyright 2012, Richard Lowe. -.\" Copyright (c) 2012, Marcelo Araujo . -.\" Copyright (c) 2012, 2014 by Delphix. All rights reserved. -.\" Copyright 2016 Nexenta Systems, Inc. -.\" All Rights Reserved. +.\" Copyright (c) 2012, 2017 by Delphix. All rights reserved. +.\" Copyright 2017 Nexenta Systems, Inc. .\" -.\" $FreeBSD$ -.\" -.Dd October 1, 2017 +.Dd October 06, 2017 .Dt ZDB 8 .Os .Sh NAME .Nm zdb -.Nd Display zpool debugging and consistency information +.Nd display zpool debugging and consistency information .Sh SYNOPSIS .Nm -.Op Fl CmdibcsDvhLMXFPA -.Op Fl e Op Fl p Ar path... +.Op Fl AbcdDFGhiLMPsvX +.Op Fl e Oo Fl V Oc Op Fl p Ar path ... +.Op Fl I Ar inflight I/Os +.Oo Fl o Ar var Ns = Ns Ar value Oc Ns ... .Op Fl t Ar txg .Op Fl U Ar cache -.Op Fl I Ar inflight I/Os .Op Fl x Ar dumpdir -.Op Fl o Ar var=value -.Ar poolname -.Op Ar object ... +.Op Ar poolname Op Ar object ... .Nm -.Op Fl divPA -.Op Fl e Op Fl p Ar path... +.Op Fl AdiPv +.Op Fl e Oo Fl V Oc Op Fl p Ar path ... .Op Fl U Ar cache -.Ar dataset -.Op Ar object ... +.Ar dataset Op Ar object ... .Nm -.Fl m Op Fl MLXFPA -.Op Fl t Ar txg -.Op Fl e Op Fl p Ar path... +.Fl C +.Op Fl A .Op Fl U Ar cache -.Ar poolname .Nm -.Fl R Op Fl A -.Op Fl e Op Fl p Ar path... -.Op Fl U Ar cache -.Ar poolname -.Ar poolname -.Ar vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op Ns : Ns Ar flags +.Fl E +.Op Fl A +.Ar word0 Ns \&: Ns Ar word1 Ns :...: Ns Ar word15 .Nm -.Fl S -.Op Fl AP -.Op Fl e Op Fl p Ar path... -.Op Fl U Ar cache -.Ar poolname -.Ar poolname -.Nm .Fl l .Op Fl Aqu .Ar device .Nm -.Fl C +.Fl m +.Op Fl AFLPX +.Op Fl e Oo Fl V Oc Op Fl p Ar path ... +.Op Fl t Ar txg +.Op Fl U Ar cache +.Ar poolname Op Ar vdev Op Ar metaslab ... +.Nm +.Fl O +.Ar dataset path +.Nm +.Fl R .Op Fl A +.Op Fl e Oo Fl V Oc Op Fl p Ar path ... .Op Fl U Ar cache +.Ar poolname vdev Ns \&: Ns Ar offset Ns \&: Ns Ar size Ns Op : Ns Ar flags +.Nm +.Fl S +.Op Fl AP +.Op Fl e Oo Fl V Oc Op Fl p Ar path ... +.Op Fl U Ar cache +.Ar poolname .Sh DESCRIPTION The .Nm -utility displays information about a ZFS pool useful for debugging and -performs some amount of consistency checking. -It is a not a general purpose tool and options (and facilities) may change. +utility displays information about a ZFS pool useful for debugging and performs +some amount of consistency checking. +It is a not a general purpose tool and options +.Pq and facilities +may change. This is neither a .Xr fsck 8 -nor a +nor an .Xr fsdb 8 utility. .Pp @@ -91,81 +90,99 @@ internals is assumed. If the .Ar dataset argument does not contain any -.Sy / +.Qq Sy / or -.Sy @ +.Qq Sy @ characters, it is interpreted as a pool name. The root dataset can be specified as -.Pa pool Ns Sy / -(pool name followed by a slash). +.Ar pool Ns / +.Pq pool name followed by a slash . .Pp When operating on an imported and active pool it is possible, though unlikely, that zdb may interpret inconsistent pool data and behave erratically. .Sh OPTIONS Display options: -.Bl -tag -width indent +.Bl -tag -width Ds .It Fl b -Display statistics regarding the number, size (logical, physical and -allocated) and deduplication of blocks. +Display statistics regarding the number, size +.Pq logical, physical and allocated +and deduplication of blocks. .It Fl c Verify the checksum of all metadata blocks while printing block statistics -(see -.Fl b Ns ). +.Po see +.Fl b +.Pc . .Pp If specified multiple times, verify the checksums of all blocks. .It Fl C -Display information about the configuration. If specified with no other -options, instead display information about the cache file -.Po Pa /etc/zfs/zpool.cache Pc . +Display information about the configuration. +If specified with no other options, instead display information about the cache +file +.Pq Pa /boot/zfs/zpool.cache . To specify the cache file to display, see -.Fl U +.Fl U . .Pp -If specified multiple times, and a pool name is also specified display both -the cached configuration and the on-disk configuration. +If specified multiple times, and a pool name is also specified display both the +cached configuration and the on-disk configuration. If specified multiple times with .Fl e -also display the configuration that would be used were the pool to be -imported. +also display the configuration that would be used were the pool to be imported. .It Fl d -Display information about datasets. Specified once, displays basic dataset -information: ID, create transaction, size, and object count. +Display information about datasets. +Specified once, displays basic dataset information: ID, create transaction, +size, and object count. .Pp If specified multiple times provides greater and greater verbosity. .Pp -If object IDs are specified, display information about those specific objects only. +If object IDs are specified, display information about those specific objects +only. .It Fl D -Display deduplication statistics, including the deduplication ratio (dedup), -compression ratio (compress), inflation due to the zfs copies property -(copies), and an overall effective ratio (dedup * compress / copies). -.Pp -If specified twice, display a histogram of deduplication statistics, showing -the allocated (physically present on disk) and referenced (logically -referenced in the pool) block counts and sizes by reference count. -.Pp -If specified a third time, display the statistics independently for each deduplication table. -.Pp -If specified a fourth time, dump the contents of the deduplication tables describing duplicate blocks. -.Pp -If specified a fifth time, also dump the contents of the deduplication tables describing unique blocks. +Display deduplication statistics, including the deduplication ratio +.Pq Sy dedup , +compression ratio +.Pq Sy compress , +inflation due to the zfs copies property +.Pq Sy copies , +and an overall effective ratio +.Pq Sy dedup No * Sy compress No / Sy copies . +.It Fl DD +Display a histogram of deduplication statistics, showing the allocated +.Pq physically present on disk +and referenced +.Pq logically referenced in the pool +block counts and sizes by reference count. +.It Fl DDD +Display the statistics independently for each deduplication table. +.It Fl DDDD +Dump the contents of the deduplication tables describing duplicate blocks. +.It Fl DDDDD +Also dump the contents of the deduplication tables describing unique blocks. +.It Fl E Ar word0 Ns \&: Ns Ar word1 Ns :...: Ns Ar word15 +Decode and display block from an embedded block pointer specified by the +.Ar word +arguments. .It Fl h Display pool history similar to -.Cm zpool history , +.Nm zpool Cm history , but include internal changes, transaction, and dataset information. .It Fl i -Display information about intent log (ZIL) entries relating to each -dataset. -If specified multiple times, display counts of each intent log transaction -type. +Display information about intent log +.Pq ZIL +entries relating to each dataset. +If specified multiple times, display counts of each intent log transaction type. .It Fl l Ar device Read the vdev labels from the specified device. -Return 0 if a valid label was found, 1 if an error occurred, and 2 if no valid +.Nm Fl l +will return 0 if valid label was found, 1 if error occurred, and 2 if no valid labels were found. +.Pp If the +.Fl q +option is also specified, don't print the labels. +.Pp +If the .Fl u option is also specified, also display the uberblocks on this device. -If the -.Fl q -option is also specified, also display the uberblocks on this device. .It Fl L Disable leak tracing and the loading of space maps. By default, @@ -173,36 +190,55 @@ By default, verifies that all non-free blocks are referenced, which can be very expensive. .It Fl m Display the offset, spacemap, and free space of each metaslab. -When specified twice, also display information about the on-disk free -space histogram associated with each metaslab. When specified three time, -display the maximum contiguous free space, the in-core free space histogram, -and the percentage of free space in each space map. When specified -four times display every spacemap record. +.It Fl mm +Also display information about the on-disk free space histogram associated with +each metaslab. +.It Fl mmm +Display the maximum contiguous free space, the in-core free space histogram, and +the percentage of free space in each space map. +.It Fl mmmm +Display every spacemap record. .It Fl M Display the offset, spacemap, and free space of each metaslab. -When specified twice, also display information about the maximum contiguous -free space and the percentage of free space in each space map. -When specified three times display every spacemap record. +.It Fl MM +Also display information about the maximum contiguous free space and the +percentage of free space in each space map. +.It Fl MMM +Display every spacemap record. +.It Fl O Ar dataset path +Look up the specified +.Ar path +inside of the +.Ar dataset +and display its metadata and indirect blocks. +Specified +.Ar path +must be relative to the root of +.Ar dataset . +This option can be combined with +.Fl v +for increasing verbosity. .It Xo -.Fl R Ar poolname -.Ar vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op Ns : Ns Ar flags +.Fl R Ar poolname vdev Ns \&: Ns Ar offset Ns \&: Ns Ar size Ns Op : Ns Ar flags .Xc -Read and display a block from the specified device. By default the block is -displayed as a hex dump, but see the description of the -.Fl r +Read and display a block from the specified device. +By default the block is displayed as a hex dump, but see the description of the +.Sy r flag, below. .Pp The block is specified in terms of a colon-separated tuple .Ar vdev -(an integer vdev identifier) +.Pq an integer vdev identifier .Ar offset -(the offset within the vdev) +.Pq the offset within the vdev .Ar size -(the size of the block to read) and, optionally, +.Pq the size of the block to read +and, optionally, .Ar flags -(a set of flags, described below). -.Bl -tag -width indent -.It Sy b offset +.Pq a set of flags, described below . +.Pp +.Bl -tag -compact -width "b offset" +.It Sy b Ar offset Print block pointer .It Sy d Decompress the block @@ -217,19 +253,20 @@ Dump raw uninterpreted block data .El .It Fl s Report statistics on -.Nm Ns 's +.Nm zdb I/O. Display operation counts, bandwidth, and error counts of I/O to the pool from .Nm . .It Fl S Simulate the effects of deduplication, constructing a DDT and then display -that DDT as with \fB-DD\fR. +that DDT as with +.Fl DD . .It Fl u Display the current uberblock. .El .Pp Other options: -.Bl -tag -width indent +.Bl -tag -width Ds .It Fl A Do not abort should any assertion fail. .It Fl AA @@ -237,32 +274,41 @@ Enable panic recovery, certain errors which would othe demoted to warnings. .It Fl AAA Do not abort if asserts fail and also enable panic recovery. -.It Fl e Op Fl p Ar path... +.It Fl e Op Fl p Ar path ... Operate on an exported pool, not present in -.Pa /etc/zfs/zpool.cache . +.Pa /boot/zfs/zpool.cache . The .Fl p flag specifies the path under which devices are to be searched. .It Fl x Ar dumpdir All blocks accessed will be copied to files in the specified directory. The blocks will be placed in sparse files whose name is the same as -that of the file or device read. zdb can be then run on the generated files. +that of the file or device read. +.Nm +can be then run on the generated files. Note that the .Fl bbc -flags are sufficient to access (and thus copy) +flags are sufficient to access +.Pq and thus copy all metadata on the pool. .It Fl F Attempt to make an unreadable pool readable by trying progressively older transactions. +.It Fl G +Dump the contents of the zfs_dbgmsg buffer before exiting +.Nm . +zfs_dbgmsg is a buffer used by ZFS to dump advanced debug information. .It Fl I Ar inflight I/Os Limit the number of outstanding checksum I/Os to the specified value. -The default value is 200. This option affects the performance of the +The default value is 200. +This option affects the performance of the .Fl c option. -.It Fl o Ar var=value -Set the given global libzpool variable to the provided value. The value must be -an unsigned 32-bit integer. Currently only little-endian systems are supported -to avoid accidentally setting the high 32 bits of 64-bit variables. +.It Fl o Ar var Ns = Ns Ar value ... +Set the given global libzpool variable to the provided value. +The value must be an unsigned 32-bit integer. +Currently only little-endian systems are supported to avoid accidentally setting +the high 32 bits of 64-bit variables. .It Fl P Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather than 1M. @@ -280,9 +326,14 @@ Use a cache file other than .It Fl v Enable verbosity. Specify multiple times for increased verbosity. +.It Fl V +Attempt verbatim import. +This mimics the behavior of the kernel when loading a pool from a cachefile. +Only usable with +.Fl e . .It Fl X Attempt -.Ql extreme +.Qq extreme transaction rewind, that is attempt the same recovery as .Fl F but read transactions otherwise deemed too old. @@ -294,46 +345,58 @@ option, with more occurrences enabling more verbosity. If no options are specified, all information about the named pool will be displayed at default verbosity. .Sh EXAMPLES -.Bl -tag -width 0n -.It Sy Example 1 Display the configuration of imported pool 'rpool' -.Bd -literal -offset 2n -.Li # Ic zdb -C rpool +.Bl -tag -width Ds +.It Xo +.Sy Example 1 +Display the configuration of imported pool +.Pa rpool +.Xc +.Bd -literal +# zdb -C rpool MOS Configuration: version: 28 name: 'rpool' ... .Ed -.It Sy Example 2 Display basic dataset information about 'rpool' -.Bd -literal -offset 2n -.Li # Ic zdb -d rpool +.It Xo +.Sy Example 2 +Display basic dataset information about +.Pa rpool +.Xc +.Bd -literal +# zdb -d rpool Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects ... .Ed -.It Xo Sy Example 3 Display basic information about object 0 in -.Sy 'rpool/export/home' +.It Xo +.Sy Example 3 +Display basic information about object 0 in +.Pa rpool/export/home .Xc -.Bd -literal -offset 2n -.Li # Ic zdb -d rpool/export/home 0 +.Bd -literal +# zdb -d rpool/export/home 0 Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects Object lvl iblk dblk dsize lsize %full type 0 7 16K 16K 15.0K 16K 25.00 DMU dnode .Ed -.It Xo Sy Example 4 Display the predicted effect of enabling deduplication on -.Sy 'rpool' +.It Xo +.Sy Example 4 +Display the predicted effect of enabling deduplication on +.Pa rpool .Xc -.Bd -literal -offset 2n -.Li # Ic zdb -S rpool +.Bd -literal +# zdb -S rpool Simulated DDT histogram: -bucket allocated referenced -______ ______________________________ ______________________________ -refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE ------- ------ ----- ----- ----- ------ ----- ----- ----- - 1 694K 27.1G 15.0G 15.0G 694K 27.1G 15.0G 15.0G - 2 35.0K 1.33G 699M 699M 74.7K 2.79G 1.45G 1.45G +bucket allocated referenced +______ ______________________________ ______________________________ +refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE +------ ------ ----- ----- ----- ------ ----- ----- ----- + 1 694K 27.1G 15.0G 15.0G 694K 27.1G 15.0G 15.0G + 2 35.0K 1.33G 699M 699M 74.7K 2.79G 1.45G 1.45G ... dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00 .Ed @@ -341,22 +404,3 @@ dedup = 1.11, compress = 1.80, copies = 1.00, dedup * .Sh SEE ALSO .Xr zfs 8 , .Xr zpool 8 -.Sh AUTHORS -This manual page is a -.Xr mdoc 7 -reimplementation of the -.Tn illumos -manual page -.Em zdb(1M) , -modified and customized for -.Fx -and licensed under the -Common Development and Distribution License -.Pq Tn CDDL . -.Pp -The -.Xr mdoc 7 -implementation of this manual page was initially written by -.An Martin Matuska Aq mm@FreeBSD.org -and -.An Marcelo Araujo Aq araujo@FreeBSD.org . From owner-svn-src-head@freebsd.org Fri Oct 6 08:43:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59C8FE30D5A; Fri, 6 Oct 2017 08:43:17 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 123F075693; Fri, 6 Oct 2017 08:43:16 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v968hGrN055523; Fri, 6 Oct 2017 08:43:16 GMT (envelope-from jlh@FreeBSD.org) Received: (from jlh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v968hEZh055509; Fri, 6 Oct 2017 08:43:14 GMT (envelope-from jlh@FreeBSD.org) Message-Id: <201710060843.v968hEZh055509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jlh set sender to jlh@FreeBSD.org using -f From: Jeremie Le Hen Date: Fri, 6 Oct 2017 08:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324351 - in head: . bin bin/rcp etc etc/mtree etc/pam.d libexec libexec/rlogind libexec/rshd rescue/rescue share/man/man5 share/mk tools/build/mk tools/build/options tools/tools/nanobs... X-SVN-Group: head X-SVN-Commit-Author: jlh X-SVN-Commit-Paths: in head: . bin bin/rcp etc etc/mtree etc/pam.d libexec libexec/rlogind libexec/rshd rescue/rescue share/man/man5 share/mk tools/build/mk tools/build/options tools/tools/nanobsd/dhcpd tools/tools/nanob... X-SVN-Commit-Revision: 324351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 08:43:17 -0000 Author: jlh Date: Fri Oct 6 08:43:14 2017 New Revision: 324351 URL: https://svnweb.freebsd.org/changeset/base/324351 Log: Remove rcmds. If they are still needed, you can find them in the net/bsdrcmds port. This was proposed June, 20th and approved by various committers [1]. They have been marked as deprecated on CURRENT in r320644 [2] on July, 4th. Both stable/11 and release/11.1 contain the deprecation notice (thanks to allanjude@). Note that ruptime(1)/rwho(1)/rwhod(8) were initially thought to be part of rcmds but this was a mistake and those are therefore NOT removed. [1] https://lists.freebsd.org/pipermail/freebsd-arch/2017-June/018239.html [2] https://svnweb.freebsd.org/base?view=revision&revision=320644 Reviewed by: bapt, brooks Differential Revision: https://reviews.freebsd.org/D12573 Deleted: head/bin/rcp/ head/etc/pam.d/rsh head/libexec/rlogind/ head/libexec/rshd/ head/tools/build/options/WITHOUT_RCMDS head/tools/build/options/WITH_RCMDS head/usr.bin/rlogin/ head/usr.bin/rsh/ Modified: head/ObsoleteFiles.inc head/bin/Makefile head/etc/inetd.conf head/etc/mtree/BSD.tests.dist head/etc/pam.d/Makefile head/libexec/Makefile head/rescue/rescue/Makefile head/share/man/man5/src.conf.5 head/share/mk/src.opts.mk head/tools/build/mk/OptionalObsoleteFiles.inc head/tools/tools/nanobsd/dhcpd/common head/tools/tools/nanobsd/embedded/common head/tools/tools/nanobsd/gateworks/common head/usr.bin/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Oct 6 08:28:35 2017 (r324350) +++ head/ObsoleteFiles.inc Fri Oct 6 08:43:14 2017 (r324351) @@ -38,6 +38,18 @@ # xargs -n1 | sort | uniq -d; # done +# 20171003: remove RCMDS +OLD_FILES+=bin/rcp +OLD_FILES+=rescue/rcp +OLD_FILES+=usr/bin/rlogin +OLD_FILES+=usr/bin/rsh +OLD_FILES+=usr/libexec/rlogind +OLD_FILES+=usr/libexec/rshd +OLD_FILES+=usr/share/man/man1/rcp.1.gz +OLD_FILES+=usr/share/man/man1/rlogin.1.gz +OLD_FILES+=usr/share/man/man1/rsh.1.gz +OLD_FILES+=usr/share/man/man8/rlogind.8.gz +OLD_FILES+=usr/share/man/man8/rshd.8.gz # 20170927: crshared OLD_FILES+=usr/share/man/man9/crshared.9.gz # 20170927: procctl Modified: head/bin/Makefile ============================================================================== --- head/bin/Makefile Fri Oct 6 08:28:35 2017 (r324350) +++ head/bin/Makefile Fri Oct 6 08:43:14 2017 (r324351) @@ -40,7 +40,6 @@ SUBDIR= cat \ test \ uuidgen -SUBDIR.${MK_RCMDS}+= rcp SUBDIR.${MK_SENDMAIL}+= rmail SUBDIR.${MK_TCSH}+= csh SUBDIR.${MK_TESTS}+= tests Modified: head/etc/inetd.conf ============================================================================== --- head/etc/inetd.conf Fri Oct 6 08:28:35 2017 (r324350) +++ head/etc/inetd.conf Fri Oct 6 08:43:14 2017 (r324351) @@ -12,10 +12,10 @@ #ssh stream tcp6 nowait root /usr/sbin/sshd sshd -i -6 #telnet stream tcp nowait root /usr/libexec/telnetd telnetd #telnet stream tcp6 nowait root /usr/libexec/telnetd telnetd -#shell stream tcp nowait root /usr/libexec/rshd rshd -#shell stream tcp6 nowait root /usr/libexec/rshd rshd -#login stream tcp nowait root /usr/libexec/rlogind rlogind -#login stream tcp6 nowait root /usr/libexec/rlogind rlogind +#shell stream tcp nowait root /usr/local/sbin/rshd rshd +#shell stream tcp6 nowait root /usr/local/sbin/rshd rshd +#login stream tcp nowait root /usr/local/sbin/rlogind rlogind +#login stream tcp6 nowait root /usr/local/sbin/rlogind rlogind #finger stream tcp nowait/3/10 nobody /usr/libexec/fingerd fingerd -k -s #finger stream tcp6 nowait/3/10 nobody /usr/libexec/fingerd fingerd -k -s # Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Fri Oct 6 08:28:35 2017 (r324350) +++ head/etc/mtree/BSD.tests.dist Fri Oct 6 08:43:14 2017 (r324351) @@ -34,8 +34,6 @@ .. pwait .. - rcp - .. rmdir .. sh Modified: head/etc/pam.d/Makefile ============================================================================== --- head/etc/pam.d/Makefile Fri Oct 6 08:28:35 2017 (r324350) +++ head/etc/pam.d/Makefile Fri Oct 6 08:43:14 2017 (r324351) @@ -35,14 +35,6 @@ FTPMODE= ${FILESMODE} LINKS= ${FILESDIR}/ftpd ${FILESDIR}/ftp .endif -.if ${MK_RCMDS} != "no" -FILESGROUPS+= RCMDS -RCMDS+= rsh -RCMDSPACKAGE+= rcmds -RCMDSDIR= ${FILESDIR} -RCMDSMODE= ${FILESMODE} -.endif - .if ${MK_TELNET} != "no" FILESGROUPS+= TELNET TELNET+= telnetd Modified: head/libexec/Makefile ============================================================================== --- head/libexec/Makefile Fri Oct 6 08:28:35 2017 (r324350) +++ head/libexec/Makefile Fri Oct 6 08:43:14 2017 (r324351) @@ -79,11 +79,6 @@ _rtld-elf= rtld-elf SUBDIR+= rbootd .endif -.if ${MK_RCMDS} != "no" -_rlogind= rlogind -_rshd= rshd -.endif - .if ${MK_SENDMAIL} != "no" _mail.local= mail.local _smrsh= smrsh Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Fri Oct 6 08:28:35 2017 (r324350) +++ head/rescue/rescue/Makefile Fri Oct 6 08:43:14 2017 (r324351) @@ -67,10 +67,6 @@ CRUNCH_ALIAS_rm= unlink CRUNCH_ALIAS_ed= red CRUNCH_ALIAS_pkill= pgrep -.if ${MK_RCMDS} != "no" -CRUNCH_PROGS_bin+= rcp -.endif - .if ${MK_TCSH} != "no" CRUNCH_PROGS_bin+= csh CRUNCH_ALIAS_csh= -csh tcsh -tcsh Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Fri Oct 6 08:28:35 2017 (r324350) +++ head/share/man/man5/src.conf.5 Fri Oct 6 08:43:14 2017 (r324351) @@ -1294,14 +1294,6 @@ by proxy. .It Va WITHOUT_RBOOTD Set to not build or install .Xr rbootd 8 . -.It Va WITH_RCMDS -Enable building of the -.Bx -r-commands. -This includes -.Xr rlogin 1 , -.Xr rsh 1 , -etc. .It Va WITH_REPRODUCIBLE_BUILD Set to exclude build metadata (such as the build time, user, or host) from the kernel, boot loaders, and uname output, so that builds produce Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri Oct 6 08:28:35 2017 (r324350) +++ head/share/mk/src.opts.mk Fri Oct 6 08:43:14 2017 (r324351) @@ -184,7 +184,6 @@ __DEFAULT_NO_OPTIONS = \ NAND \ OFED \ OPENLDAP \ - RCMDS \ REPRODUCIBLE_BUILD \ RPCBIND_WARMSTART_SUPPORT \ SHARED_TOOLCHAIN \ Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Oct 6 08:28:35 2017 (r324350) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Oct 6 08:43:14 2017 (r324351) @@ -7107,20 +7107,6 @@ OLD_FILES+=usr/libexec/rbootd OLD_FILES+=usr/share/man/man8/rbootd.8.gz .endif -.if ${MK_RCMDS} == no -OLD_FILES+=bin/rcp -OLD_FILES+=rescue/rcp -OLD_FILES+=usr/bin/rlogin -OLD_FILES+=usr/bin/rsh -OLD_FILES+=usr/libexec/rlogind -OLD_FILES+=usr/libexec/rshd -OLD_FILES+=usr/share/man/man1/rcp.1.gz -OLD_FILES+=usr/share/man/man1/rlogin.1.gz -OLD_FILES+=usr/share/man/man1/rsh.1.gz -OLD_FILES+=usr/share/man/man8/rlogind.8.gz -OLD_FILES+=usr/share/man/man8/rshd.8.gz -.endif - .if ${MK_RESCUE} == no . if exists(${DESTDIR}${TESTSBASE}) RESCUE_DIRS!=find ${DESTDIR}/rescue -type d 2>/dev/null | sed -e 's,^${DESTDIR}/,,'; echo Modified: head/tools/tools/nanobsd/dhcpd/common ============================================================================== --- head/tools/tools/nanobsd/dhcpd/common Fri Oct 6 08:28:35 2017 (r324350) +++ head/tools/tools/nanobsd/dhcpd/common Fri Oct 6 08:43:14 2017 (r324351) @@ -129,7 +129,6 @@ WITHOUT_NLS=true WITHOUT_NS_CACHING=true WITHOUT_OBJC=true WITHOUT_PROFILE=true -WITHOUT_RCMDS=true WITHOUT_SENDMAIL=true WITHOUT_SHAREDOCS=true WITHOUT_SYSCONS=true Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Fri Oct 6 08:28:35 2017 (r324350) +++ head/tools/tools/nanobsd/embedded/common Fri Oct 6 08:43:14 2017 (r324351) @@ -160,7 +160,6 @@ WITHOUT_NLS=true WITHOUT_NS_CACHING=true WITHOUT_OBJC=true WITHOUT_PROFILE=true -WITHOUT_RCMDS=true WITHOUT_SENDMAIL=true WITHOUT_SHAREDOCS=true WITHOUT_SYSCONS=true Modified: head/tools/tools/nanobsd/gateworks/common ============================================================================== --- head/tools/tools/nanobsd/gateworks/common Fri Oct 6 08:28:35 2017 (r324350) +++ head/tools/tools/nanobsd/gateworks/common Fri Oct 6 08:43:14 2017 (r324351) @@ -140,7 +140,6 @@ WITHOUT_PMC=true WITHOUT_PORTSNAP=true WITHOUT_PROFILE=true WITHOUT_QUOTAS=true -WITHOUT_RCMDS=true WITHOUT_RCS=true WITHOUT_RESCUE=true WITHOUT_SENDMAIL=true Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Fri Oct 6 08:28:35 2017 (r324350) +++ head/usr.bin/Makefile Fri Oct 6 08:43:14 2017 (r324351) @@ -250,8 +250,6 @@ SUBDIR.${MK_OPENSSL}+= chkey SUBDIR.${MK_OPENSSL}+= dc SUBDIR.${MK_OPENSSL}+= newkey SUBDIR.${MK_QUOTAS}+= quota -SUBDIR.${MK_RCMDS}+= rlogin -SUBDIR.${MK_RCMDS}+= rsh SUBDIR.${MK_SENDMAIL}+= vacation SUBDIR.${MK_TALK}+= talk SUBDIR.${MK_TELNET}+= telnet From owner-svn-src-head@freebsd.org Fri Oct 6 08:49:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67029E30E83; Fri, 6 Oct 2017 08:49:17 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FE00758D3; Fri, 6 Oct 2017 08:49:17 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v968nGQ9055776; Fri, 6 Oct 2017 08:49:16 GMT (envelope-from jlh@FreeBSD.org) Received: (from jlh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v968nGHn055775; Fri, 6 Oct 2017 08:49:16 GMT (envelope-from jlh@FreeBSD.org) Message-Id: <201710060849.v968nGHn055775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jlh set sender to jlh@FreeBSD.org using -f From: Jeremie Le Hen Date: Fri, 6 Oct 2017 08:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324352 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: jlh X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 324352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 08:49:17 -0000 Author: jlh Date: Fri Oct 6 08:49:15 2017 New Revision: 324352 URL: https://svnweb.freebsd.org/changeset/base/324352 Log: Bump src.conf.5's Dd. This file shouldn't be modified manually but well, I did it in my previous commit. So go down further the rabbit hole so as to at least keep some consistency. Reported by: bapt Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Fri Oct 6 08:43:14 2017 (r324351) +++ head/share/man/man5/src.conf.5 Fri Oct 6 08:49:15 2017 (r324352) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd August 14, 2017 +.Dd October 06, 2017 .Dt SRC.CONF 5 .Os .Sh NAME From owner-svn-src-head@freebsd.org Fri Oct 6 09:02:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 750F5E31641; Fri, 6 Oct 2017 09:02:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FF3B7646E; Fri, 6 Oct 2017 09:02:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9692aUA063732; Fri, 6 Oct 2017 09:02:36 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9692aMa063731; Fri, 6 Oct 2017 09:02:36 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201710060902.v9692aMa063731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 6 Oct 2017 09:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324353 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 09:02:37 -0000 Author: manu Date: Fri Oct 6 09:02:36 2017 New Revision: 324353 URL: https://svnweb.freebsd.org/changeset/base/324353 Log: vfs_export_lookup: Fix r324054 When using the default address list nam is still valid, the code in r324054 assumed that is was NULL. Reported by: Guy Yur Tested by: Guy Yur Modified: head/sys/kern/vfs_export.c Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Fri Oct 6 08:49:15 2017 (r324352) +++ head/sys/kern/vfs_export.c Fri Oct 6 09:02:36 2017 (r324353) @@ -459,34 +459,33 @@ vfs_export_lookup(struct mount *mp, struct sockaddr *n return (NULL); /* - * If no address is provided, use the default if it exists. + * Lookup in the export list */ - if (nam == NULL) { - if ((mp->mnt_flag & MNT_DEFEXPORTED) != 0) - return (&nep->ne_defexported); - return (NULL); + if (nam != NULL) { + saddr = nam; + rnh = NULL; + switch (saddr->sa_family) { + case AF_INET: + rnh = nep->ne4; + break; + case AF_INET6: + rnh = nep->ne6; + break; + } + if (rnh != NULL) { + RADIX_NODE_HEAD_RLOCK(rnh); + np = (struct netcred *) (*rnh->rnh_matchaddr)(saddr, &rnh->rh); + RADIX_NODE_HEAD_RUNLOCK(rnh); + if (np != NULL && (np->netc_rnodes->rn_flags & RNF_ROOT) != 0) + return (NULL); + } } /* - * Lookup in the export list + * If no address match, use the default if it exists. */ - saddr = nam; - rnh = NULL; - switch (saddr->sa_family) { - case AF_INET: - rnh = nep->ne4; - break; - case AF_INET6: - rnh = nep->ne6; - break; - } - if (rnh != NULL) { - RADIX_NODE_HEAD_RLOCK(rnh); - np = (struct netcred *) (*rnh->rnh_matchaddr)(saddr, &rnh->rh); - RADIX_NODE_HEAD_RUNLOCK(rnh); - if (np != NULL && (np->netc_rnodes->rn_flags & RNF_ROOT) != 0) - return (NULL); - } + if (np == NULL && (mp->mnt_flag & MNT_DEFEXPORTED) != 0) + return (&nep->ne_defexported); return (np); } From owner-svn-src-head@freebsd.org Fri Oct 6 10:16:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A831EE32EDB; Fri, 6 Oct 2017 10:16:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CCB37C61A; Fri, 6 Oct 2017 10:16:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96AGvtq092711; Fri, 6 Oct 2017 10:16:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96AGvqW092710; Fri, 6 Oct 2017 10:16:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710061016.v96AGvqW092710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 6 Oct 2017 10:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324354 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 324354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 10:16:58 -0000 Author: kib Date: Fri Oct 6 10:16:57 2017 New Revision: 324354 URL: https://svnweb.freebsd.org/changeset/base/324354 Log: Style. Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/sys_machdep.c Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Fri Oct 6 09:02:36 2017 (r324353) +++ head/sys/i386/i386/sys_machdep.c Fri Oct 6 10:16:57 2017 (r324354) @@ -533,10 +533,10 @@ i386_get_ldt(struct thread *td, struct i386_ldt_args * return(EINVAL); error = copyout(lp, uap->descs, num * sizeof(union descriptor)); - if (!error) + if (error == 0) td->td_retval[0] = num; - return(error); + return (error); } int @@ -545,7 +545,7 @@ i386_set_ldt(struct thread *td, struct i386_ldt_args * { int error, i; int largest_ld; - struct mdproc *mdp = &td->td_proc->p_md; + struct mdproc *mdp; struct proc_ldt *pldt; union descriptor *dp; @@ -554,6 +554,7 @@ i386_set_ldt(struct thread *td, struct i386_ldt_args * uap->start, uap->num, (void *)uap->descs); #endif error = 0; + mdp = &td->td_proc->p_md; if (descs == NULL) { /* Free descriptors */ From owner-svn-src-head@freebsd.org Fri Oct 6 10:17:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 636DCE32F4B; Fri, 6 Oct 2017 10:17:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31A257C766; Fri, 6 Oct 2017 10:17:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96AHo9c092787; Fri, 6 Oct 2017 10:17:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96AHot8092786; Fri, 6 Oct 2017 10:17:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710061017.v96AHot8092786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 6 Oct 2017 10:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324355 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 324355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 10:17:51 -0000 Author: kib Date: Fri Oct 6 10:17:50 2017 New Revision: 324355 URL: https://svnweb.freebsd.org/changeset/base/324355 Log: Remove unneeded cast. Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/sys_machdep.c Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Fri Oct 6 10:16:57 2017 (r324354) +++ head/sys/i386/i386/sys_machdep.c Fri Oct 6 10:17:50 2017 (r324355) @@ -172,8 +172,7 @@ sysarch(struct thread *td, struct sysarch_args *uap) break; case I386_SET_LDT: if (kargs.largs.descs != NULL) { - lp = (union descriptor *)malloc( - kargs.largs.num * sizeof(union descriptor), + lp = malloc(kargs.largs.num * sizeof(union descriptor), M_TEMP, M_WAITOK); error = copyin(kargs.largs.descs, lp, kargs.largs.num * sizeof(union descriptor)); From owner-svn-src-head@freebsd.org Fri Oct 6 11:06:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FCFFE33F2A for ; Fri, 6 Oct 2017 11:06:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::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 1A9EA7E91C for ; Fri, 6 Oct 2017 11:06:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x234.google.com with SMTP id j140so287091itj.1 for ; Fri, 06 Oct 2017 04:06:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Gnz+Th5d0bPytmYSWaNpy+zAKoOAOYX65exjMBDdPBY=; b=mSYyEr4hDTNl3EmPSUzOA29EOalrU+IUg2Z3TTIKRlo4R4wGNGrMJPQ73tni7WELuG kA5Ct9RUTZ70FSGwWNjl9NB0CLNllGbAiRJGOhvl9x0G+28Gat8LgBH+gc4gtsZ1vyrL JYkcgbyE4TF1k14bCFX+yIprPcrW4T6rVpLAG7U1afkHDXZJguYu6TWmZApTIaengw80 GXrJ+Ha1vxaRub4b68xJRB4Wci79m8T7gnsUJ3SYEhJy0X9sljxIOELWZYpL/Bzx/jOI 0BOy04WJuxLi5omxnOoYzdbkWb7HTzxSPh9RtFCvLJylz6/9AkAQrlIDWf6tdPAGCKW6 0W+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Gnz+Th5d0bPytmYSWaNpy+zAKoOAOYX65exjMBDdPBY=; b=C3tIYzjbYnmAgZmGKwfWIbUEeJ13kWbxAt0ITWixSY77Ik0LT+EDq4FlziFHnYhlqr B94NiqXa4MzL1J6FAkvk1TXWWaygOWyzsSIL3PNO9TojknkKy8q4WIcP605XJE3/n6y7 LlYKhryTxElw5PhCQL/E+EBNoM5ilvJV/2vg/maIfp3R0XKHLKVhLvIkWpFZvhecz6vj BPtLCqwprxTQrQYeuoxS5xiHogn3g/h9ZUZzCxhiuM2gTY9Dh5/nQa1D2mGsWoLsIolS SDnw1YzZsOdMrnsSVlhjqm/NPmE8ZvExwXAfm1yd2D5keU803eEQuZyIA0a8cdpoNjGf sCQQ== X-Gm-Message-State: AMCzsaVMEfFlHNp890VPtyrU9CghI4hZjC6gvanYY0ZuWHRHJpnAl7qm hsuUdk4u/mO+bJwvoYBWqXCoeSWia+bWhb7wEecErQ== X-Google-Smtp-Source: AOwi7QC5iYIp4A6CwtT5kR3wvo8ZPNaZSEZj+Gct+/Hp8bxSXJcXfud7VC6M3pNsuRxYbUNqD3gcnKsGuGEC9Qj/wpY= X-Received: by 10.36.203.3 with SMTP id u3mr1687163itg.136.1507287999212; Fri, 06 Oct 2017 04:06:39 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.94.130 with HTTP; Fri, 6 Oct 2017 04:06:38 -0700 (PDT) X-Originating-IP: [208.185.168.99] In-Reply-To: <18316188-B3F3-4D70-9502-6461B2095FE0@fubar.geek.nz> References: <201710052301.v95N1olt013714@repo.freebsd.org> <18316188-B3F3-4D70-9502-6461B2095FE0@fubar.geek.nz> From: Warner Losh Date: Fri, 6 Oct 2017 04:06:38 -0700 X-Google-Sender-Auth: Bz81jqOSjS2mNSu0KR4hqVauuH4 Message-ID: Subject: Re: svn commit: r324341 - in head/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/broadcom/bcm2835 arm/conf arm/freescale/imx arm/freescale/vybrid arm/mv arm/mv/armad... To: Andrew Turner Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 11:06:40 -0000 On Fri, Oct 6, 2017 at 1:16 AM, Andrew Turner wrote: > > > On 6 Oct 2017, at 00:01, Warner Losh wrote: > > > > Author: imp > > Date: Thu Oct 5 23:01:50 2017 > > New Revision: 324341 > > URL: https://svnweb.freebsd.org/changeset/base/324341 > > > > Log: > > Tag all armv7 kernels as such in their machine config line. > > > > Transition all boards that support arm cortex CPUs to armv7. This > > leaves two armv6 kernels in the tree. RPI-B, which uses the BCM2835 > > which has a ARM1176 core, and VERSATILEPB, which is a qemu board setup > > around the time RPI-B went in. Copy std.armv6 to std.armv7, even > > though that duplicates a lot of stuff. More work needs to be done to > > sort out the duplication. > > > > Differential Revision: https://reviews.freebsd.org/D12027 > > > > Added: > > head/sys/arm/conf/VIRT > > - copied, changed from r324340, head/sys/arm/conf/ARMADAXP > > Did you mean to add VIRT? > No. I think that was a mismerge along the way. Warner From owner-svn-src-head@freebsd.org Fri Oct 6 11:48:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4BE5E34C31; Fri, 6 Oct 2017 11:48:10 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B04027FE24; Fri, 6 Oct 2017 11:48:10 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96Bm9CN032359; Fri, 6 Oct 2017 11:48:09 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96Bm9Wr032352; Fri, 6 Oct 2017 11:48:09 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201710061148.v96Bm9Wr032352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 6 Oct 2017 11:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324358 - in head/contrib: ctfdump mdocml X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head/contrib: ctfdump mdocml X-SVN-Commit-Revision: 324358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 11:48:10 -0000 Author: bapt Date: Fri Oct 6 11:48:09 2017 New Revision: 324358 URL: https://svnweb.freebsd.org/changeset/base/324358 Log: Import 1.14.3 MFC after: 1 week Added: head/contrib/ctfdump/ - copied from r323072, vendor/ctfdump/dist/ Modified: head/contrib/mdocml/Makefile head/contrib/mdocml/NEWS head/contrib/mdocml/man_term.c head/contrib/mdocml/mansearch.c head/contrib/mdocml/mdoc_validate.c head/contrib/mdocml/tbl_html.c head/contrib/mdocml/tbl_term.c Directory Properties: head/contrib/mdocml/ (props changed) Modified: head/contrib/mdocml/Makefile ============================================================================== --- head/contrib/mdocml/Makefile Fri Oct 6 11:46:37 2017 (r324357) +++ head/contrib/mdocml/Makefile Fri Oct 6 11:48:09 2017 (r324358) @@ -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. -VERSION = 1.14.2 +VERSION = 1.14.3 # === LIST OF FILES ==================================================== Modified: head/contrib/mdocml/NEWS ============================================================================== --- head/contrib/mdocml/NEWS Fri Oct 6 11:46:37 2017 (r324357) +++ head/contrib/mdocml/NEWS Fri Oct 6 11:48:09 2017 (r324358) @@ -2,6 +2,21 @@ $Id: NEWS,v 1.26 2017/07/28 14:57:56 schwarze Exp $ This file lists the most important changes in the mandoc.bsd.lv distribution. +Changes in version 1.14.3, released on August 5, 2017 + + --- BUG FIXES --- + * man(7): Do not crash with out-of-bounds read access to a constant + array if .sp or a blank line immediately precedes .SS or .SH. + * mdoc(7): Do not crash with out-of-bounds read access to a constant + array if .sp or a blank line precede the first .Sh macro. + * tbl(7): Ignore explicitly specified negative column widths rather than + wrapping around to huge numbers and risking memory exhaustion. + * man(1): No longer use names that only occur in the SYNOPSIS section. + Gets rid of some surprising behaviour and bogus warnings. + --- THANKS TO --- + Leah Neukirchen (Void Linux), Markus Waldeck (Debian), + Peter Bui (nd.edu), and Yuri Pankov (illumos) for bug reports. + Changes in version 1.14.2, released on July 28, 2017 --- MAJOR NEW FEATURES --- Modified: head/contrib/mdocml/man_term.c ============================================================================== --- head/contrib/mdocml/man_term.c Fri Oct 6 11:46:37 2017 (r324357) +++ head/contrib/mdocml/man_term.c Fri Oct 6 11:48:09 2017 (r324358) @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.208 2017/06/25 11:42:02 schwarze Exp $ */ +/* $Id: man_term.c,v 1.209 2017/07/31 15:19:06 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2015, 2017 Ingo Schwarze @@ -673,7 +673,7 @@ pre_SS(DECL_ARGS) do { n = n->prev; - } while (n != NULL && n->tok != TOKEN_NONE && + } while (n != NULL && n->tok >= MAN_TH && termacts[n->tok].flags & MAN_NOTEXT); if (n == NULL || (n->tok == MAN_SS && n->body->child == NULL)) break; @@ -735,7 +735,7 @@ pre_SH(DECL_ARGS) do { n = n->prev; - } while (n != NULL && n->tok != TOKEN_NONE && + } while (n != NULL && n->tok >= MAN_TH && termacts[n->tok].flags & MAN_NOTEXT); if (n == NULL || (n->tok == MAN_SH && n->body->child == NULL)) break; Modified: head/contrib/mdocml/mansearch.c ============================================================================== --- head/contrib/mdocml/mansearch.c Fri Oct 6 11:46:37 2017 (r324357) +++ head/contrib/mdocml/mansearch.c Fri Oct 6 11:48:09 2017 (r324358) @@ -1,4 +1,4 @@ -/* $OpenBSD: mansearch.c,v 1.50 2016/07/09 15:23:36 schwarze Exp $ */ +/* $Id: mansearch.c,v 1.76 2017/08/02 13:29:04 schwarze Exp $ */ /* * Copyright (c) 2012 Kristaps Dzonsons * Copyright (c) 2013-2017 Ingo Schwarze @@ -171,7 +171,9 @@ mansearch(const struct mansearch *search, page = dbm_page_get(rp->page); if (lstmatch(search->sec, page->sect) == 0 || - lstmatch(search->arch, page->arch) == 0) + lstmatch(search->arch, page->arch) == 0 || + (search->argmode == ARG_NAME && + rp->bits <= (int32_t)(NAME_SYN & NAME_MASK))) continue; if (res == NULL) { @@ -452,14 +454,28 @@ lstlen(const char *cp, size_t sep) { size_t sz; - for (sz = 0;; sz++) { - if (cp[0] == '\0') { - if (cp[1] == '\0') - break; - sz += sep - 1; - } else if (cp[0] < ' ') - sz--; - cp++; + for (sz = 0; *cp != '\0'; cp++) { + + /* Skip names appearing only in the SYNOPSIS. */ + if (*cp <= (char)(NAME_SYN & NAME_MASK)) { + while (*cp != '\0') + cp++; + continue; + } + + /* Skip name class markers. */ + if (*cp < ' ') + cp++; + + /* Print a separator before each but the first string. */ + if (sz) + sz += sep; + + /* Copy one string. */ + while (*cp != '\0') { + sz++; + cp++; + } } return sz; } @@ -471,19 +487,34 @@ lstlen(const char *cp, size_t sep) static void lstcat(char *buf, size_t *i, const char *cp, const char *sep) { - const char *s; + const char *s; + size_t i_start; - for (;;) { - if (cp[0] == '\0') { - if (cp[1] == '\0') - break; + for (i_start = *i; *cp != '\0'; cp++) { + + /* Skip names appearing only in the SYNOPSIS. */ + if (*cp <= (char)(NAME_SYN & NAME_MASK)) { + while (*cp != '\0') + cp++; + continue; + } + + /* Skip name class markers. */ + if (*cp < ' ') + cp++; + + /* Print a separator before each but the first string. */ + if (*i > i_start) { s = sep; while (*s != '\0') buf[(*i)++] = *s++; - } else if (cp[0] >= ' ') - buf[(*i)++] = cp[0]; - cp++; + } + + /* Copy one string. */ + while (*cp != '\0') + buf[(*i)++] = *cp++; } + } /* Modified: head/contrib/mdocml/mdoc_validate.c ============================================================================== --- head/contrib/mdocml/mdoc_validate.c Fri Oct 6 11:46:37 2017 (r324357) +++ head/contrib/mdocml/mdoc_validate.c Fri Oct 6 11:48:09 2017 (r324358) @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.350 2017/07/20 12:54:02 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.352 2017/08/02 13:29:04 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2017 Ingo Schwarze @@ -1137,8 +1137,6 @@ post_fname(POST_ARGS) if ( ! (cp[0] == '\0' || (cp[0] == '(' && cp[1] == '*'))) mandoc_msg(MANDOCERR_FN_PAREN, mdoc->parse, n->line, n->pos + pos, n->string); - if (n->sec == SEC_SYNOPSIS && mdoc->meta.msec != NULL) - mandoc_xr_add(mdoc->meta.msec, n->string, -1, -1); } static void @@ -1205,9 +1203,8 @@ post_nm(POST_ARGS) n = mdoc->last; - if ((n->sec == SEC_NAME || n->sec == SEC_SYNOPSIS) && - n->child != NULL && n->child->type == ROFFT_TEXT && - mdoc->meta.msec != NULL) + if (n->sec == SEC_NAME && n->child != NULL && + n->child->type == ROFFT_TEXT && mdoc->meta.msec != NULL) mandoc_xr_add(mdoc->meta.msec, n->child->string, -1, -1); if (n->last != NULL && @@ -1931,7 +1928,7 @@ post_root(POST_ARGS) /* Check that we begin with a proper `Sh'. */ n = mdoc->first->child; - while (n != NULL && n->tok != TOKEN_NONE && + while (n != NULL && n->tok >= MDOC_Dd && mdoc_macros[n->tok].flags & MDOC_PROLOGUE) n = n->next; Modified: head/contrib/mdocml/tbl_html.c ============================================================================== --- head/contrib/mdocml/tbl_html.c Fri Oct 6 11:46:37 2017 (r324357) +++ head/contrib/mdocml/tbl_html.c Fri Oct 6 11:48:09 2017 (r324358) @@ -1,4 +1,4 @@ -/* $Id: tbl_html.c,v 1.22 2017/06/12 20:14:18 schwarze Exp $ */ +/* $Id: tbl_html.c,v 1.23 2017/07/31 16:14:10 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2017 Ingo Schwarze @@ -49,6 +49,9 @@ html_tbl_strlen(const char *p, void *arg) static size_t html_tbl_sulen(const struct roffsu *su, void *arg) { + if (su->scale < 0.0) + return 0; + switch (su->unit) { case SCALE_FS: /* 2^16 basic units */ return su->scale * 65536.0 / 24.0; Modified: head/contrib/mdocml/tbl_term.c ============================================================================== --- head/contrib/mdocml/tbl_term.c Fri Oct 6 11:46:37 2017 (r324357) +++ head/contrib/mdocml/tbl_term.c Fri Oct 6 11:48:09 2017 (r324358) @@ -1,4 +1,4 @@ -/* $Id: tbl_term.c,v 1.56 2017/07/08 13:43:15 schwarze Exp $ */ +/* $Id: tbl_term.c,v 1.57 2017/07/31 16:14:10 schwarze Exp $ */ /* * Copyright (c) 2009, 2011 Kristaps Dzonsons * Copyright (c) 2011,2012,2014,2015,2017 Ingo Schwarze @@ -51,7 +51,10 @@ static void tbl_word(struct termp *, const struct tbl_ static size_t term_tbl_sulen(const struct roffsu *su, void *arg) { - return term_hen((const struct termp *)arg, su); + int i; + + i = term_hen((const struct termp *)arg, su); + return i > 0 ? i : 0; } static size_t From owner-svn-src-head@freebsd.org Fri Oct 6 12:20:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E54EE35C2A; Fri, 6 Oct 2017 12:20:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B9F780DB3; Fri, 6 Oct 2017 12:20:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96CKOja044722; Fri, 6 Oct 2017 12:20:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96CKOtt044720; Fri, 6 Oct 2017 12:20:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710061220.v96CKOtt044720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 6 Oct 2017 12:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324359 - in head/sys/boot/efi: include libefi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot/efi: include libefi X-SVN-Commit-Revision: 324359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 12:20:25 -0000 Author: imp Date: Fri Oct 6 12:20:24 2017 New Revision: 324359 URL: https://svnweb.freebsd.org/changeset/base/324359 Log: Add efi_devpath_is_prefix efi_devpath_is_prefix determines if a path matches a passed-in prefix. Differential Revision: https://reviews.freebsd.org/D12564 Submitted by: Eric McCorkle Modified: head/sys/boot/efi/include/efilib.h head/sys/boot/efi/libefi/devpath.c Modified: head/sys/boot/efi/include/efilib.h ============================================================================== --- head/sys/boot/efi/include/efilib.h Fri Oct 6 11:48:09 2017 (r324358) +++ head/sys/boot/efi/include/efilib.h Fri Oct 6 12:20:24 2017 (r324359) @@ -82,6 +82,7 @@ EFI_HANDLE efi_devpath_handle(EFI_DEVICE_PATH *); EFI_DEVICE_PATH *efi_devpath_last_node(EFI_DEVICE_PATH *); EFI_DEVICE_PATH *efi_devpath_trim(EFI_DEVICE_PATH *); bool efi_devpath_match(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *); +int efi_devpath_is_prefix(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *); CHAR16 *efi_devpath_name(EFI_DEVICE_PATH *); void efi_free_devpath_name(CHAR16 *); Modified: head/sys/boot/efi/libefi/devpath.c ============================================================================== --- head/sys/boot/efi/libefi/devpath.c Fri Oct 6 11:48:09 2017 (r324358) +++ head/sys/boot/efi/libefi/devpath.c Fri Oct 6 12:20:24 2017 (r324359) @@ -166,3 +166,32 @@ efi_devpath_match(EFI_DEVICE_PATH *devpath1, EFI_DEVIC } return (true); } + +int +efi_devpath_is_prefix(EFI_DEVICE_PATH *prefix, EFI_DEVICE_PATH *path) +{ + int len; + + if (prefix == NULL || path == NULL) + return (0); + + while (1) { + if (IsDevicePathEnd(prefix)) + break; + + if (DevicePathType(prefix) != DevicePathType(path) || + DevicePathSubType(prefix) != DevicePathSubType(path)) + return (0); + + len = DevicePathNodeLength(prefix); + if (len != DevicePathNodeLength(path)) + return (0); + + if (memcmp(prefix, path, (size_t)len) != 0) + return (0); + + prefix = NextDevicePathNode(prefix); + path = NextDevicePathNode(path); + } + return (1); +} From owner-svn-src-head@freebsd.org Fri Oct 6 12:21:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 249DAE35F8D; Fri, 6 Oct 2017 12:21:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE7F78115C; Fri, 6 Oct 2017 12:21:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96CLlIb046240; Fri, 6 Oct 2017 12:21:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96CLko0046237; Fri, 6 Oct 2017 12:21:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710061221.v96CLko0046237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 6 Oct 2017 12:21:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324360 - in head/sys/boot/efi: include libefi loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot/efi: include libefi loader X-SVN-Commit-Revision: 324360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 12:21:48 -0000 Author: imp Date: Fri Oct 6 12:21:46 2017 New Revision: 324360 URL: https://svnweb.freebsd.org/changeset/base/324360 Log: Encapsulate ZFS preferences into efi_zfs_is_preferred Move the retrieval of the image information into loader's main instead of doing it in efizfs.c Differential Revision: https://reviews.freebsd.org/D12564 Submitted by: Eric McCorkle Modified: head/sys/boot/efi/include/efizfs.h head/sys/boot/efi/libefi/efizfs.c head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/include/efizfs.h ============================================================================== --- head/sys/boot/efi/include/efizfs.h Fri Oct 6 12:20:24 2017 (r324359) +++ head/sys/boot/efi/include/efizfs.h Fri Oct 6 12:21:46 2017 (r324360) @@ -27,6 +27,7 @@ */ #include +#include #ifndef _EFIZFS_H_ #define _EFIZFS_H_ @@ -45,6 +46,7 @@ extern uint64_t pool_guid; extern void efi_zfs_probe(void); extern zfsinfo_list_t *efizfs_get_zfsinfo_list(void); +extern bool efi_zfs_is_preferred(EFI_HANDLE *h); extern EFI_HANDLE efizfs_get_handle_by_guid(uint64_t); #endif Modified: head/sys/boot/efi/libefi/efizfs.c ============================================================================== --- head/sys/boot/efi/libefi/efizfs.c Fri Oct 6 12:20:24 2017 (r324359) +++ head/sys/boot/efi/libefi/efizfs.c Fri Oct 6 12:21:46 2017 (r324360) @@ -81,12 +81,9 @@ efi_zfs_probe(void) { pdinfo_list_t *hdi; pdinfo_t *hd, *pd = NULL; - EFI_GUID imgid = LOADED_IMAGE_PROTOCOL; - EFI_LOADED_IMAGE *img; char devname[SPECNAMELEN + 1]; uint64_t guid; - BS->HandleProtocol(IH, &imgid, (VOID**)&img); hdi = efiblk_get_pdinfo_list(&efipart_hddev); STAILQ_INIT(&zfsinfo); @@ -105,7 +102,7 @@ efi_zfs_probe(void) if (zfs_probe_dev(devname, &guid) == 0) { insert_zfs(pd->pd_handle, guid); - if (pd->pd_handle == img->DeviceHandle) + if (efi_zfs_is_preferred(pd->pd_handle)) pool_guid = guid; } Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Fri Oct 6 12:20:24 2017 (r324359) +++ head/sys/boot/efi/loader/main.c Fri Oct 6 12:21:46 2017 (r324360) @@ -72,6 +72,15 @@ EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID; EFI_GUID fdtdtb = FDT_TABLE_GUID; EFI_GUID inputid = SIMPLE_TEXT_INPUT_PROTOCOL; +static EFI_LOADED_IMAGE *img; + +bool +efi_zfs_is_preferred(EFI_HANDLE *h) +{ + return (h == img->DeviceHandle); +} + + static int has_keyboard(void) { @@ -300,7 +309,6 @@ EFI_STATUS main(int argc, CHAR16 *argv[]) { char var[128]; - EFI_LOADED_IMAGE *img; EFI_GUID *guid; int i, j, vargood, howto; UINTN k; @@ -319,6 +327,9 @@ main(int argc, CHAR16 *argv[]) archsw.arch_zfs_probe = efi_zfs_probe; #endif + /* Get our loaded image protocol interface structure. */ + BS->HandleProtocol(IH, &imgid, (VOID**)&img); + /* Init the time source */ efi_time_init(); @@ -445,9 +456,6 @@ main(int argc, CHAR16 *argv[]) for (i = 0; devsw[i] != NULL; i++) if (devsw[i]->dv_init != NULL) (devsw[i]->dv_init)(); - - /* Get our loaded image protocol interface structure. */ - BS->HandleProtocol(IH, &imgid, (VOID**)&img); printf("Command line arguments:"); for (i = 0; i < argc; i++) From owner-svn-src-head@freebsd.org Fri Oct 6 12:30:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6282E361E3; Fri, 6 Oct 2017 12:30:56 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A29118152C; Fri, 6 Oct 2017 12:30:56 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96CUtFe048898; Fri, 6 Oct 2017 12:30:55 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96CUtZT048891; Fri, 6 Oct 2017 12:30:55 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201710061230.v96CUtZT048891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 6 Oct 2017 12:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324361 - in head/contrib: ctfdump mdocml X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head/contrib: ctfdump mdocml X-SVN-Commit-Revision: 324361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 12:30:56 -0000 Author: bapt Date: Fri Oct 6 12:30:54 2017 New Revision: 324361 URL: https://svnweb.freebsd.org/changeset/base/324361 Log: Revert r324358, some cruft when in with it, it will be properly reimported in another commit Deleted: head/contrib/ctfdump/ Modified: head/contrib/mdocml/Makefile head/contrib/mdocml/NEWS head/contrib/mdocml/man_term.c head/contrib/mdocml/mansearch.c head/contrib/mdocml/mdoc_validate.c head/contrib/mdocml/tbl_html.c head/contrib/mdocml/tbl_term.c Directory Properties: head/contrib/mdocml/ (props changed) Modified: head/contrib/mdocml/Makefile ============================================================================== --- head/contrib/mdocml/Makefile Fri Oct 6 12:21:46 2017 (r324360) +++ head/contrib/mdocml/Makefile Fri Oct 6 12:30:54 2017 (r324361) @@ -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. -VERSION = 1.14.3 +VERSION = 1.14.2 # === LIST OF FILES ==================================================== Modified: head/contrib/mdocml/NEWS ============================================================================== --- head/contrib/mdocml/NEWS Fri Oct 6 12:21:46 2017 (r324360) +++ head/contrib/mdocml/NEWS Fri Oct 6 12:30:54 2017 (r324361) @@ -2,21 +2,6 @@ $Id: NEWS,v 1.26 2017/07/28 14:57:56 schwarze Exp $ This file lists the most important changes in the mandoc.bsd.lv distribution. -Changes in version 1.14.3, released on August 5, 2017 - - --- BUG FIXES --- - * man(7): Do not crash with out-of-bounds read access to a constant - array if .sp or a blank line immediately precedes .SS or .SH. - * mdoc(7): Do not crash with out-of-bounds read access to a constant - array if .sp or a blank line precede the first .Sh macro. - * tbl(7): Ignore explicitly specified negative column widths rather than - wrapping around to huge numbers and risking memory exhaustion. - * man(1): No longer use names that only occur in the SYNOPSIS section. - Gets rid of some surprising behaviour and bogus warnings. - --- THANKS TO --- - Leah Neukirchen (Void Linux), Markus Waldeck (Debian), - Peter Bui (nd.edu), and Yuri Pankov (illumos) for bug reports. - Changes in version 1.14.2, released on July 28, 2017 --- MAJOR NEW FEATURES --- Modified: head/contrib/mdocml/man_term.c ============================================================================== --- head/contrib/mdocml/man_term.c Fri Oct 6 12:21:46 2017 (r324360) +++ head/contrib/mdocml/man_term.c Fri Oct 6 12:30:54 2017 (r324361) @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.209 2017/07/31 15:19:06 schwarze Exp $ */ +/* $Id: man_term.c,v 1.208 2017/06/25 11:42:02 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2015, 2017 Ingo Schwarze @@ -673,7 +673,7 @@ pre_SS(DECL_ARGS) do { n = n->prev; - } while (n != NULL && n->tok >= MAN_TH && + } while (n != NULL && n->tok != TOKEN_NONE && termacts[n->tok].flags & MAN_NOTEXT); if (n == NULL || (n->tok == MAN_SS && n->body->child == NULL)) break; @@ -735,7 +735,7 @@ pre_SH(DECL_ARGS) do { n = n->prev; - } while (n != NULL && n->tok >= MAN_TH && + } while (n != NULL && n->tok != TOKEN_NONE && termacts[n->tok].flags & MAN_NOTEXT); if (n == NULL || (n->tok == MAN_SH && n->body->child == NULL)) break; Modified: head/contrib/mdocml/mansearch.c ============================================================================== --- head/contrib/mdocml/mansearch.c Fri Oct 6 12:21:46 2017 (r324360) +++ head/contrib/mdocml/mansearch.c Fri Oct 6 12:30:54 2017 (r324361) @@ -1,4 +1,4 @@ -/* $Id: mansearch.c,v 1.76 2017/08/02 13:29:04 schwarze Exp $ */ +/* $OpenBSD: mansearch.c,v 1.50 2016/07/09 15:23:36 schwarze Exp $ */ /* * Copyright (c) 2012 Kristaps Dzonsons * Copyright (c) 2013-2017 Ingo Schwarze @@ -171,9 +171,7 @@ mansearch(const struct mansearch *search, page = dbm_page_get(rp->page); if (lstmatch(search->sec, page->sect) == 0 || - lstmatch(search->arch, page->arch) == 0 || - (search->argmode == ARG_NAME && - rp->bits <= (int32_t)(NAME_SYN & NAME_MASK))) + lstmatch(search->arch, page->arch) == 0) continue; if (res == NULL) { @@ -454,28 +452,14 @@ lstlen(const char *cp, size_t sep) { size_t sz; - for (sz = 0; *cp != '\0'; cp++) { - - /* Skip names appearing only in the SYNOPSIS. */ - if (*cp <= (char)(NAME_SYN & NAME_MASK)) { - while (*cp != '\0') - cp++; - continue; - } - - /* Skip name class markers. */ - if (*cp < ' ') - cp++; - - /* Print a separator before each but the first string. */ - if (sz) - sz += sep; - - /* Copy one string. */ - while (*cp != '\0') { - sz++; - cp++; - } + for (sz = 0;; sz++) { + if (cp[0] == '\0') { + if (cp[1] == '\0') + break; + sz += sep - 1; + } else if (cp[0] < ' ') + sz--; + cp++; } return sz; } @@ -487,34 +471,19 @@ lstlen(const char *cp, size_t sep) static void lstcat(char *buf, size_t *i, const char *cp, const char *sep) { - const char *s; - size_t i_start; + const char *s; - for (i_start = *i; *cp != '\0'; cp++) { - - /* Skip names appearing only in the SYNOPSIS. */ - if (*cp <= (char)(NAME_SYN & NAME_MASK)) { - while (*cp != '\0') - cp++; - continue; - } - - /* Skip name class markers. */ - if (*cp < ' ') - cp++; - - /* Print a separator before each but the first string. */ - if (*i > i_start) { + for (;;) { + if (cp[0] == '\0') { + if (cp[1] == '\0') + break; s = sep; while (*s != '\0') buf[(*i)++] = *s++; - } - - /* Copy one string. */ - while (*cp != '\0') - buf[(*i)++] = *cp++; + } else if (cp[0] >= ' ') + buf[(*i)++] = cp[0]; + cp++; } - } /* Modified: head/contrib/mdocml/mdoc_validate.c ============================================================================== --- head/contrib/mdocml/mdoc_validate.c Fri Oct 6 12:21:46 2017 (r324360) +++ head/contrib/mdocml/mdoc_validate.c Fri Oct 6 12:30:54 2017 (r324361) @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.352 2017/08/02 13:29:04 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.350 2017/07/20 12:54:02 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2017 Ingo Schwarze @@ -1137,6 +1137,8 @@ post_fname(POST_ARGS) if ( ! (cp[0] == '\0' || (cp[0] == '(' && cp[1] == '*'))) mandoc_msg(MANDOCERR_FN_PAREN, mdoc->parse, n->line, n->pos + pos, n->string); + if (n->sec == SEC_SYNOPSIS && mdoc->meta.msec != NULL) + mandoc_xr_add(mdoc->meta.msec, n->string, -1, -1); } static void @@ -1203,8 +1205,9 @@ post_nm(POST_ARGS) n = mdoc->last; - if (n->sec == SEC_NAME && n->child != NULL && - n->child->type == ROFFT_TEXT && mdoc->meta.msec != NULL) + if ((n->sec == SEC_NAME || n->sec == SEC_SYNOPSIS) && + n->child != NULL && n->child->type == ROFFT_TEXT && + mdoc->meta.msec != NULL) mandoc_xr_add(mdoc->meta.msec, n->child->string, -1, -1); if (n->last != NULL && @@ -1928,7 +1931,7 @@ post_root(POST_ARGS) /* Check that we begin with a proper `Sh'. */ n = mdoc->first->child; - while (n != NULL && n->tok >= MDOC_Dd && + while (n != NULL && n->tok != TOKEN_NONE && mdoc_macros[n->tok].flags & MDOC_PROLOGUE) n = n->next; Modified: head/contrib/mdocml/tbl_html.c ============================================================================== --- head/contrib/mdocml/tbl_html.c Fri Oct 6 12:21:46 2017 (r324360) +++ head/contrib/mdocml/tbl_html.c Fri Oct 6 12:30:54 2017 (r324361) @@ -1,4 +1,4 @@ -/* $Id: tbl_html.c,v 1.23 2017/07/31 16:14:10 schwarze Exp $ */ +/* $Id: tbl_html.c,v 1.22 2017/06/12 20:14:18 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2017 Ingo Schwarze @@ -49,9 +49,6 @@ html_tbl_strlen(const char *p, void *arg) static size_t html_tbl_sulen(const struct roffsu *su, void *arg) { - if (su->scale < 0.0) - return 0; - switch (su->unit) { case SCALE_FS: /* 2^16 basic units */ return su->scale * 65536.0 / 24.0; Modified: head/contrib/mdocml/tbl_term.c ============================================================================== --- head/contrib/mdocml/tbl_term.c Fri Oct 6 12:21:46 2017 (r324360) +++ head/contrib/mdocml/tbl_term.c Fri Oct 6 12:30:54 2017 (r324361) @@ -1,4 +1,4 @@ -/* $Id: tbl_term.c,v 1.57 2017/07/31 16:14:10 schwarze Exp $ */ +/* $Id: tbl_term.c,v 1.56 2017/07/08 13:43:15 schwarze Exp $ */ /* * Copyright (c) 2009, 2011 Kristaps Dzonsons * Copyright (c) 2011,2012,2014,2015,2017 Ingo Schwarze @@ -51,10 +51,7 @@ static void tbl_word(struct termp *, const struct tbl_ static size_t term_tbl_sulen(const struct roffsu *su, void *arg) { - int i; - - i = term_hen((const struct termp *)arg, su); - return i > 0 ? i : 0; + return term_hen((const struct termp *)arg, su); } static size_t From owner-svn-src-head@freebsd.org Fri Oct 6 12:31:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62A7EE3638A; Fri, 6 Oct 2017 12:31:57 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F32D8183F; Fri, 6 Oct 2017 12:31:57 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96CVuXW049001; Fri, 6 Oct 2017 12:31:56 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96CVtlD048994; Fri, 6 Oct 2017 12:31:55 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201710061231.v96CVtlD048994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 6 Oct 2017 12:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324362 - head/contrib/mdocml X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/contrib/mdocml X-SVN-Commit-Revision: 324362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 12:31:57 -0000 Author: bapt Date: Fri Oct 6 12:31:55 2017 New Revision: 324362 URL: https://svnweb.freebsd.org/changeset/base/324362 Log: Import mandoc 1.14.3 MFC after: 1 week Modified: head/contrib/mdocml/Makefile head/contrib/mdocml/NEWS head/contrib/mdocml/man_term.c head/contrib/mdocml/mansearch.c head/contrib/mdocml/mdoc_validate.c head/contrib/mdocml/tbl_html.c head/contrib/mdocml/tbl_term.c Directory Properties: head/contrib/mdocml/ (props changed) Modified: head/contrib/mdocml/Makefile ============================================================================== --- head/contrib/mdocml/Makefile Fri Oct 6 12:30:54 2017 (r324361) +++ head/contrib/mdocml/Makefile Fri Oct 6 12:31:55 2017 (r324362) @@ -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. -VERSION = 1.14.2 +VERSION = 1.14.3 # === LIST OF FILES ==================================================== Modified: head/contrib/mdocml/NEWS ============================================================================== --- head/contrib/mdocml/NEWS Fri Oct 6 12:30:54 2017 (r324361) +++ head/contrib/mdocml/NEWS Fri Oct 6 12:31:55 2017 (r324362) @@ -2,6 +2,21 @@ $Id: NEWS,v 1.26 2017/07/28 14:57:56 schwarze Exp $ This file lists the most important changes in the mandoc.bsd.lv distribution. +Changes in version 1.14.3, released on August 5, 2017 + + --- BUG FIXES --- + * man(7): Do not crash with out-of-bounds read access to a constant + array if .sp or a blank line immediately precedes .SS or .SH. + * mdoc(7): Do not crash with out-of-bounds read access to a constant + array if .sp or a blank line precede the first .Sh macro. + * tbl(7): Ignore explicitly specified negative column widths rather than + wrapping around to huge numbers and risking memory exhaustion. + * man(1): No longer use names that only occur in the SYNOPSIS section. + Gets rid of some surprising behaviour and bogus warnings. + --- THANKS TO --- + Leah Neukirchen (Void Linux), Markus Waldeck (Debian), + Peter Bui (nd.edu), and Yuri Pankov (illumos) for bug reports. + Changes in version 1.14.2, released on July 28, 2017 --- MAJOR NEW FEATURES --- Modified: head/contrib/mdocml/man_term.c ============================================================================== --- head/contrib/mdocml/man_term.c Fri Oct 6 12:30:54 2017 (r324361) +++ head/contrib/mdocml/man_term.c Fri Oct 6 12:31:55 2017 (r324362) @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.208 2017/06/25 11:42:02 schwarze Exp $ */ +/* $Id: man_term.c,v 1.209 2017/07/31 15:19:06 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2015, 2017 Ingo Schwarze @@ -673,7 +673,7 @@ pre_SS(DECL_ARGS) do { n = n->prev; - } while (n != NULL && n->tok != TOKEN_NONE && + } while (n != NULL && n->tok >= MAN_TH && termacts[n->tok].flags & MAN_NOTEXT); if (n == NULL || (n->tok == MAN_SS && n->body->child == NULL)) break; @@ -735,7 +735,7 @@ pre_SH(DECL_ARGS) do { n = n->prev; - } while (n != NULL && n->tok != TOKEN_NONE && + } while (n != NULL && n->tok >= MAN_TH && termacts[n->tok].flags & MAN_NOTEXT); if (n == NULL || (n->tok == MAN_SH && n->body->child == NULL)) break; Modified: head/contrib/mdocml/mansearch.c ============================================================================== --- head/contrib/mdocml/mansearch.c Fri Oct 6 12:30:54 2017 (r324361) +++ head/contrib/mdocml/mansearch.c Fri Oct 6 12:31:55 2017 (r324362) @@ -1,4 +1,4 @@ -/* $OpenBSD: mansearch.c,v 1.50 2016/07/09 15:23:36 schwarze Exp $ */ +/* $Id: mansearch.c,v 1.76 2017/08/02 13:29:04 schwarze Exp $ */ /* * Copyright (c) 2012 Kristaps Dzonsons * Copyright (c) 2013-2017 Ingo Schwarze @@ -171,7 +171,9 @@ mansearch(const struct mansearch *search, page = dbm_page_get(rp->page); if (lstmatch(search->sec, page->sect) == 0 || - lstmatch(search->arch, page->arch) == 0) + lstmatch(search->arch, page->arch) == 0 || + (search->argmode == ARG_NAME && + rp->bits <= (int32_t)(NAME_SYN & NAME_MASK))) continue; if (res == NULL) { @@ -452,14 +454,28 @@ lstlen(const char *cp, size_t sep) { size_t sz; - for (sz = 0;; sz++) { - if (cp[0] == '\0') { - if (cp[1] == '\0') - break; - sz += sep - 1; - } else if (cp[0] < ' ') - sz--; - cp++; + for (sz = 0; *cp != '\0'; cp++) { + + /* Skip names appearing only in the SYNOPSIS. */ + if (*cp <= (char)(NAME_SYN & NAME_MASK)) { + while (*cp != '\0') + cp++; + continue; + } + + /* Skip name class markers. */ + if (*cp < ' ') + cp++; + + /* Print a separator before each but the first string. */ + if (sz) + sz += sep; + + /* Copy one string. */ + while (*cp != '\0') { + sz++; + cp++; + } } return sz; } @@ -471,19 +487,34 @@ lstlen(const char *cp, size_t sep) static void lstcat(char *buf, size_t *i, const char *cp, const char *sep) { - const char *s; + const char *s; + size_t i_start; - for (;;) { - if (cp[0] == '\0') { - if (cp[1] == '\0') - break; + for (i_start = *i; *cp != '\0'; cp++) { + + /* Skip names appearing only in the SYNOPSIS. */ + if (*cp <= (char)(NAME_SYN & NAME_MASK)) { + while (*cp != '\0') + cp++; + continue; + } + + /* Skip name class markers. */ + if (*cp < ' ') + cp++; + + /* Print a separator before each but the first string. */ + if (*i > i_start) { s = sep; while (*s != '\0') buf[(*i)++] = *s++; - } else if (cp[0] >= ' ') - buf[(*i)++] = cp[0]; - cp++; + } + + /* Copy one string. */ + while (*cp != '\0') + buf[(*i)++] = *cp++; } + } /* Modified: head/contrib/mdocml/mdoc_validate.c ============================================================================== --- head/contrib/mdocml/mdoc_validate.c Fri Oct 6 12:30:54 2017 (r324361) +++ head/contrib/mdocml/mdoc_validate.c Fri Oct 6 12:31:55 2017 (r324362) @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.350 2017/07/20 12:54:02 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.352 2017/08/02 13:29:04 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2017 Ingo Schwarze @@ -1137,8 +1137,6 @@ post_fname(POST_ARGS) if ( ! (cp[0] == '\0' || (cp[0] == '(' && cp[1] == '*'))) mandoc_msg(MANDOCERR_FN_PAREN, mdoc->parse, n->line, n->pos + pos, n->string); - if (n->sec == SEC_SYNOPSIS && mdoc->meta.msec != NULL) - mandoc_xr_add(mdoc->meta.msec, n->string, -1, -1); } static void @@ -1205,9 +1203,8 @@ post_nm(POST_ARGS) n = mdoc->last; - if ((n->sec == SEC_NAME || n->sec == SEC_SYNOPSIS) && - n->child != NULL && n->child->type == ROFFT_TEXT && - mdoc->meta.msec != NULL) + if (n->sec == SEC_NAME && n->child != NULL && + n->child->type == ROFFT_TEXT && mdoc->meta.msec != NULL) mandoc_xr_add(mdoc->meta.msec, n->child->string, -1, -1); if (n->last != NULL && @@ -1931,7 +1928,7 @@ post_root(POST_ARGS) /* Check that we begin with a proper `Sh'. */ n = mdoc->first->child; - while (n != NULL && n->tok != TOKEN_NONE && + while (n != NULL && n->tok >= MDOC_Dd && mdoc_macros[n->tok].flags & MDOC_PROLOGUE) n = n->next; Modified: head/contrib/mdocml/tbl_html.c ============================================================================== --- head/contrib/mdocml/tbl_html.c Fri Oct 6 12:30:54 2017 (r324361) +++ head/contrib/mdocml/tbl_html.c Fri Oct 6 12:31:55 2017 (r324362) @@ -1,4 +1,4 @@ -/* $Id: tbl_html.c,v 1.22 2017/06/12 20:14:18 schwarze Exp $ */ +/* $Id: tbl_html.c,v 1.23 2017/07/31 16:14:10 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2017 Ingo Schwarze @@ -49,6 +49,9 @@ html_tbl_strlen(const char *p, void *arg) static size_t html_tbl_sulen(const struct roffsu *su, void *arg) { + if (su->scale < 0.0) + return 0; + switch (su->unit) { case SCALE_FS: /* 2^16 basic units */ return su->scale * 65536.0 / 24.0; Modified: head/contrib/mdocml/tbl_term.c ============================================================================== --- head/contrib/mdocml/tbl_term.c Fri Oct 6 12:30:54 2017 (r324361) +++ head/contrib/mdocml/tbl_term.c Fri Oct 6 12:31:55 2017 (r324362) @@ -1,4 +1,4 @@ -/* $Id: tbl_term.c,v 1.56 2017/07/08 13:43:15 schwarze Exp $ */ +/* $Id: tbl_term.c,v 1.57 2017/07/31 16:14:10 schwarze Exp $ */ /* * Copyright (c) 2009, 2011 Kristaps Dzonsons * Copyright (c) 2011,2012,2014,2015,2017 Ingo Schwarze @@ -51,7 +51,10 @@ static void tbl_word(struct termp *, const struct tbl_ static size_t term_tbl_sulen(const struct roffsu *su, void *arg) { - return term_hen((const struct termp *)arg, su); + int i; + + i = term_hen((const struct termp *)arg, su); + return i > 0 ? i : 0; } static size_t From owner-svn-src-head@freebsd.org Fri Oct 6 13:43:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFACBE37CFB; Fri, 6 Oct 2017 13:43:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD567B3; Fri, 6 Oct 2017 13:43:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96DhGqK082022; Fri, 6 Oct 2017 13:43:16 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96DhGMK082021; Fri, 6 Oct 2017 13:43:16 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710061343.v96DhGMK082021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 6 Oct 2017 13:43:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324363 - head/sys/arm/include X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/arm/include X-SVN-Commit-Revision: 324363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 13:43:18 -0000 Author: imp Date: Fri Oct 6 13:43:16 2017 New Revision: 324363 URL: https://svnweb.freebsd.org/changeset/base/324363 Log: Oversight on armv7 bulk commit: Make MACHINE_ARCH be armv7 for new enough processors. This isn't ideal, because one could still compile MACHINE_ARCH armv6, but with armv7 options enabled. We don't normally do that, and it's a bit of an edge case so accept the less than ideal solution here in the absence of something better. Reported by: strejda@ Sponsored by: Netflix Modified: head/sys/arm/include/param.h Modified: head/sys/arm/include/param.h ============================================================================== --- head/sys/arm/include/param.h Fri Oct 6 12:31:55 2017 (r324362) +++ head/sys/arm/include/param.h Fri Oct 6 13:43:16 2017 (r324363) @@ -52,10 +52,12 @@ #define __PCI_REROUTE_INTERRUPT -#if __ARM_ARCH >= 6 -#define _V6_SUFFIX "v6" +#if __ARM_ARCH >= 7 +#define _V_SUFFIX "v7" +#elif __ARM_ARCH >= 6 +#define _V_SUFFIX "v6" #else -#define _V6_SUFFIX "" +#define _V_SUFFIX "" #endif #ifdef __ARM_BIG_ENDIAN @@ -68,7 +70,7 @@ #define MACHINE "arm" #endif #ifndef MACHINE_ARCH -#define MACHINE_ARCH "arm" _V6_SUFFIX _EB_SUFFIX +#define MACHINE_ARCH "arm" _V_SUFFIX _EB_SUFFIX #endif #if defined(SMP) || defined(KLD_MODULE) From owner-svn-src-head@freebsd.org Fri Oct 6 13:46:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72DDEE37D73; Fri, 6 Oct 2017 13:46:06 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46C24256; Fri, 6 Oct 2017 13:46:06 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96Dk5gQ082197; Fri, 6 Oct 2017 13:46:05 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96Dk56n082196; Fri, 6 Oct 2017 13:46:05 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201710061346.v96Dk56n082196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Fri, 6 Oct 2017 13:46:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324364 - head/libexec/ftpd X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/libexec/ftpd X-SVN-Commit-Revision: 324364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 13:46:06 -0000 Author: eugen (ports committer) Date: Fri Oct 6 13:46:05 2017 New Revision: 324364 URL: https://svnweb.freebsd.org/changeset/base/324364 Log: ftpd(8): fix user context handling. Apply authenticated user context after update of wtmp(5) at start of session, so that ftpd process is not killed by kernel with SIGXFSZ when user has "filesize" limit lower than size of system wtmp file. Same applies to session finalization: revert to super-user context before update of wtmp. If ftpd hits limit while writing a file at user request, do not get killed with SIGXFSZ instantly but apparently ignore the signal, process error and report it to the user, and continue with the session. PR: 143570 Approved by: avg (mentor), mav (mentor) MFC after: 1 week Modified: head/libexec/ftpd/ftpd.c Modified: head/libexec/ftpd/ftpd.c ============================================================================== --- head/libexec/ftpd/ftpd.c Fri Oct 6 13:43:16 2017 (r324363) +++ head/libexec/ftpd/ftpd.c Fri Oct 6 13:46:05 2017 (r324364) @@ -430,6 +430,10 @@ main(int argc, char *argv[], char **envp) } } + /* handle filesize limit gracefully */ + sa.sa_handler = SIG_IGN; + (void)sigaction(SIGXFSZ, &sa, NULL); + if (daemon_mode) { int *ctl_sock, fd, maxfd = -1, nfds, i; fd_set defreadfds, readfds; @@ -1196,14 +1200,14 @@ end_login(void) #endif (void) seteuid(0); - if (logged_in && dowtmp) - ftpd_logwtmp(wtmpid, NULL, NULL); - pw = NULL; #ifdef LOGIN_CAP setusercontext(NULL, getpwuid(0), 0, LOGIN_SETALL & ~(LOGIN_SETLOGIN | LOGIN_SETUSER | LOGIN_SETGROUP | LOGIN_SETPATH | LOGIN_SETENV)); #endif + if (logged_in && dowtmp) + ftpd_logwtmp(wtmpid, NULL, NULL); + pw = NULL; #ifdef USE_PAM if (pamh) { if ((e = pam_setcred(pamh, PAM_DELETE_CRED)) != PAM_SUCCESS) @@ -1478,7 +1482,7 @@ skip: } } setusercontext(lc, pw, 0, LOGIN_SETALL & - ~(LOGIN_SETUSER | LOGIN_SETPATH | LOGIN_SETENV)); + ~(LOGIN_SETRESOURCES | LOGIN_SETUSER | LOGIN_SETPATH | LOGIN_SETENV)); #else setlogin(pw->pw_name); (void) initgroups(pw->pw_name, pw->pw_gid); @@ -1520,6 +1524,10 @@ skip: (struct sockaddr *)&his_addr); logged_in = 1; +#ifdef LOGIN_CAP + setusercontext(lc, pw, 0, LOGIN_SETRESOURCES); +#endif + if (guest && stats && statfd < 0) #ifdef VIRTUAL_HOSTING statfd = open(thishost->statfile, O_WRONLY|O_APPEND); @@ -2770,6 +2778,11 @@ dologout(int status) if (logged_in && dowtmp) { (void) seteuid(0); +#ifdef LOGIN_CAP + setusercontext(NULL, getpwuid(0), 0, LOGIN_SETALL & ~(LOGIN_SETLOGIN | + LOGIN_SETUSER | LOGIN_SETGROUP | LOGIN_SETPATH | + LOGIN_SETENV)); +#endif ftpd_logwtmp(wtmpid, NULL, NULL); } /* beware of flushing buffers after a SIGPIPE */ From owner-svn-src-head@freebsd.org Fri Oct 6 13:48:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69B44E37E49; Fri, 6 Oct 2017 13:48:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3935669D; Fri, 6 Oct 2017 13:48:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96DmcLm082332; Fri, 6 Oct 2017 13:48:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96DmcKb082331; Fri, 6 Oct 2017 13:48:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710061348.v96DmcKb082331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 6 Oct 2017 13:48:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324365 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 324365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 13:48:39 -0000 Author: imp Date: Fri Oct 6 13:48:38 2017 New Revision: 324365 URL: https://svnweb.freebsd.org/changeset/base/324365 Log: Note about workaround for native armv7 builds using a kernel prior to r324363. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Oct 6 13:46:05 2017 (r324364) +++ head/UPDATING Fri Oct 6 13:48:38 2017 (r324365) @@ -53,7 +53,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: 20171005: The arm port has split armv6 into armv6 and armv7. armv7 is now - a valid TARGET_ARCH/MACHINE_ARCH setting. + a valid TARGET_ARCH/MACHINE_ARCH setting. If you have an armv7 system + and are running a kernel from before r324363, you will need to add + MACHINE_ARCH=armv7 to 'make buildworld' to do a native build. 20171003: When building multiple kernels using KERNCONF, non-existent KERNCONF From owner-svn-src-head@freebsd.org Fri Oct 6 14:29:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54B39E389EC; Fri, 6 Oct 2017 14:29:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F09E1D98; Fri, 6 Oct 2017 14:29:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96ETrp2099071; Fri, 6 Oct 2017 14:29:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96ETrcr099070; Fri, 6 Oct 2017 14:29:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710061429.v96ETrcr099070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 6 Oct 2017 14:29:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324366 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 324366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 14:29:54 -0000 Author: kib Date: Fri Oct 6 14:29:53 2017 New Revision: 324366 URL: https://svnweb.freebsd.org/changeset/base/324366 Log: Improve i386_get_ldt(). Provide consistent snapshot of the requested descriptors by preventing other threads from modifying LDT while we fetch the data, lock dt_lock around the read. Copy the data into intermediate buffer, which is copied out after the lock is dropped. Comparing with the amd64 version, the read is done byte by byte, since there is no atomic 64bit read (cmpxchg8b method is too heavy comparing with the avoided issues). Improve overflow checking for the descriptors range calculations and remove unneeded casts. Use unsigned types for sizes. Allow zero num argument to i386_get_ldt() and i386_set_ldt(). This case is handled naturally by the code flow. Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/sys_machdep.c Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Fri Oct 6 13:48:38 2017 (r324365) +++ head/sys/i386/i386/sys_machdep.c Fri Oct 6 14:29:53 2017 (r324366) @@ -154,8 +154,6 @@ sysarch(struct thread *td, struct sysarch_args *uap) if ((error = copyin(uap->parms, &kargs.largs, sizeof(struct i386_ldt_args))) != 0) return (error); - if (kargs.largs.num > MAX_LD || kargs.largs.num <= 0) - return (EINVAL); break; case I386_GET_XFPUSTATE: if ((error = copyin(uap->parms, &kargs.xfpu, @@ -172,6 +170,8 @@ sysarch(struct thread *td, struct sysarch_args *uap) break; case I386_SET_LDT: if (kargs.largs.descs != NULL) { + if (kargs.largs.num > MAX_LD) + return (EINVAL); lp = malloc(kargs.largs.num * sizeof(union descriptor), M_TEMP, M_WAITOK); error = copyin(kargs.largs.descs, lp, @@ -503,38 +503,37 @@ user_ldt_deref(struct proc_ldt *pldt) int i386_get_ldt(struct thread *td, struct i386_ldt_args *uap) { - int error = 0; struct proc_ldt *pldt; - int nldt, num; - union descriptor *lp; + char *data; + u_int nldt, num; + int error; #ifdef DEBUG printf("i386_get_ldt: start=%u num=%u descs=%p\n", uap->start, uap->num, (void *)uap->descs); #endif + if (uap->start >= MAX_LD) + return (EINVAL); + num = min(uap->num, MAX_LD - uap->start); + data = malloc(uap->num * sizeof(union descriptor), M_TEMP, M_WAITOK); mtx_lock_spin(&dt_lock); - if ((pldt = td->td_proc->p_md.md_ldt) != NULL) { - nldt = pldt->ldt_len; - lp = &((union descriptor *)(pldt->ldt_base))[uap->start]; + pldt = td->td_proc->p_md.md_ldt; + nldt = pldt != NULL ? pldt->ldt_len : nitems(ldt); + num = min(num, nldt); + if (uap->start > nldt || uap->start + num > nldt) { mtx_unlock_spin(&dt_lock); - num = min(uap->num, nldt); - } else { - mtx_unlock_spin(&dt_lock); - nldt = sizeof(ldt)/sizeof(ldt[0]); - num = min(uap->num, nldt); - lp = &ldt[uap->start]; + return (EINVAL); } + bcopy(pldt != NULL ? + &((union descriptor *)(pldt->ldt_base))[uap->start] : + &ldt[uap->start], data, num * sizeof(union descriptor)); + mtx_unlock_spin(&dt_lock); - if ((uap->start > (unsigned int)nldt) || - ((unsigned int)num > (unsigned int)nldt) || - ((unsigned int)(uap->start + num) > (unsigned int)nldt)) - return(EINVAL); - - error = copyout(lp, uap->descs, num * sizeof(union descriptor)); + error = copyout(data, uap->descs, num * sizeof(union descriptor)); if (error == 0) td->td_retval[0] = num; - + free(data, M_TEMP); return (error); } @@ -542,11 +541,11 @@ int i386_set_ldt(struct thread *td, struct i386_ldt_args *uap, union descriptor *descs) { - int error, i; - int largest_ld; struct mdproc *mdp; struct proc_ldt *pldt; union descriptor *dp; + u_int largest_ld, i; + int error; #ifdef DEBUG printf("i386_set_ldt: start=%u num=%u descs=%p\n", @@ -565,8 +564,6 @@ i386_set_ldt(struct thread *td, struct i386_ldt_args * uap->start = NLDT; uap->num = MAX_LD - NLDT; } - if (uap->num == 0) - return (EINVAL); mtx_lock_spin(&dt_lock); if ((pldt = mdp->md_ldt) == NULL || uap->start >= pldt->ldt_len) { From owner-svn-src-head@freebsd.org Fri Oct 6 15:09:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0BD8E39623; Fri, 6 Oct 2017 15:09:29 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AF103279; Fri, 6 Oct 2017 15:09:29 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96F9Suf016208; Fri, 6 Oct 2017 15:09:28 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96F9ScT016207; Fri, 6 Oct 2017 15:09:28 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201710061509.v96F9ScT016207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 6 Oct 2017 15:09:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324367 - head/bin/ps X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/bin/ps X-SVN-Commit-Revision: 324367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 15:09:29 -0000 Author: trasz Date: Fri Oct 6 15:09:28 2017 New Revision: 324367 URL: https://svnweb.freebsd.org/changeset/base/324367 Log: Fix kvm_getprocs(3) error reporting in ps(1). Previously it just didn't work at all - kvm_getprocs(3) doesn't update the &nentries when it returns NULL. The end result was that ps(1) showed garbage data instead of reporting kinfo_proc size mismatch. Reviewed by: cem Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12414 Modified: head/bin/ps/ps.c Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Fri Oct 6 14:29:53 2017 (r324366) +++ head/bin/ps/ps.c Fri Oct 6 15:09:28 2017 (r324367) @@ -523,7 +523,11 @@ main(int argc, char *argv[]) */ nentries = -1; kp = kvm_getprocs(kd, what, flag, &nentries); - if ((kp == NULL && nentries > 0) || (kp != NULL && nentries < 0)) + /* + * Ignore ESRCH to preserve behaviour of "ps -p nonexistent-pid" + * not reporting an error. + */ + if ((kp == NULL && errno != ESRCH) || (kp != NULL && nentries < 0)) xo_errx(1, "%s", kvm_geterr(kd)); nkept = 0; if (nentries > 0) { From owner-svn-src-head@freebsd.org Fri Oct 6 15:46:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 913A9E39F53; Fri, 6 Oct 2017 15:46:12 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FCCF637D0; Fri, 6 Oct 2017 15:46:12 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96FkBmx033047; Fri, 6 Oct 2017 15:46:11 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96FkBbU033046; Fri, 6 Oct 2017 15:46:11 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201710061546.v96FkBbU033046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 6 Oct 2017 15:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324368 - head/sys/dev/psci X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/psci X-SVN-Commit-Revision: 324368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 15:46:12 -0000 Author: andrew Date: Fri Oct 6 15:46:11 2017 New Revision: 324368 URL: https://svnweb.freebsd.org/changeset/base/324368 Log: Also handle psci 1.0. This can be seen as a bug fix update for the 0.2 specification we already support, with the only changes in functions we don't currently use. Sponsored by: DARPA, AFRL Modified: head/sys/dev/psci/psci.c Modified: head/sys/dev/psci/psci.c ============================================================================== --- head/sys/dev/psci/psci.c Fri Oct 6 15:09:28 2017 (r324367) +++ head/sys/dev/psci/psci.c Fri Oct 6 15:46:11 2017 (r324368) @@ -97,6 +97,7 @@ struct psci_softc *psci_softc = NULL; #ifdef FDT static struct ofw_compat_data compat_data[] = { + {"arm,psci-1.0", (uintptr_t)psci_v0_2_init}, {"arm,psci-0.2", (uintptr_t)psci_v0_2_init}, {"arm,psci", (uintptr_t)psci_v0_1_init}, {NULL, 0} @@ -332,9 +333,11 @@ psci_fdt_callfn(psci_callfn_t *callfn) phandle_t node; node = ofw_bus_find_compatible(OF_peer(0), "arm,psci-0.2"); - if (node == 0) - /* TODO: Handle psci 0.1 */ - return (PSCI_MISSING); + if (node == 0) { + node = ofw_bus_find_compatible(OF_peer(0), "arm,psci-1.0"); + if (node == 0) + return (PSCI_MISSING); + } *callfn = psci_fdt_get_callfn(node); return (0); From owner-svn-src-head@freebsd.org Fri Oct 6 16:38:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CC61E3B3D7; Fri, 6 Oct 2017 16:38:02 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB474655FF; Fri, 6 Oct 2017 16:38:01 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96Gc0e8053543; Fri, 6 Oct 2017 16:38:00 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96Gc0OT053542; Fri, 6 Oct 2017 16:38:00 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201710061638.v96Gc0OT053542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 6 Oct 2017 16:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324369 - head/sbin/geom/class/part X-SVN-Group: head X-SVN-Commit-Author: marcel X-SVN-Commit-Paths: head/sbin/geom/class/part X-SVN-Commit-Revision: 324369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 16:38:02 -0000 Author: marcel Date: Fri Oct 6 16:38:00 2017 New Revision: 324369 URL: https://svnweb.freebsd.org/changeset/base/324369 Log: Fix alignment of 'last' in autofill. 'last' is the sector number of the last usable sector. Sector numbers start with 0. As such, 'last' is always 1 less than the count of sectors and aligning 'last' down as-is means that the number of free sectors is pessimized by 'alignment - 1' if the number of usable sectors was already a multiple of the alignment. Consequently, gpart(8) failed to create a partition when the alignment and size were such that it would extend to the end of the disk. Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Fri Oct 6 15:46:11 2017 (r324368) +++ head/sbin/geom/class/part/geom_part.c Fri Oct 6 16:38:00 2017 (r324369) @@ -547,7 +547,7 @@ gpart_autofill(struct gctl_req *req) last = (off_t)strtoimax(s, NULL, 0); grade = ~0ULL; a_first = ALIGNUP(first + offset, alignment); - last = ALIGNDOWN(last + offset, alignment); + last = ALIGNDOWN(last + offset + 1, alignment) - 1; if (a_first < start) a_first = start; while ((pp = find_provider(gp, first)) != NULL) { From owner-svn-src-head@freebsd.org Fri Oct 6 17:30:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D222E3CB5A; Fri, 6 Oct 2017 17:30:20 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC020676B9; Fri, 6 Oct 2017 17:30:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96HUJEq074221; Fri, 6 Oct 2017 17:30:19 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96HUInj074213; Fri, 6 Oct 2017 17:30:18 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201710061730.v96HUInj074213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 6 Oct 2017 17:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324370 - head/release/arm X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/arm X-SVN-Commit-Revision: 324370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 17:30:20 -0000 Author: gjb Date: Fri Oct 6 17:30:18 2017 New Revision: 324370 URL: https://svnweb.freebsd.org/changeset/base/324370 Log: Catch up with r324340, switching relevant arm SoCs from armv6 to armv7. Sponsored by: The FreeBSD Foundation Modified: head/release/arm/BANANAPI.conf head/release/arm/BEAGLEBONE.conf head/release/arm/CUBIEBOARD.conf head/release/arm/CUBIEBOARD2.conf head/release/arm/CUBOX-HUMMINGBOARD.conf head/release/arm/PANDABOARD.conf head/release/arm/RPI2.conf head/release/arm/WANDBOARD.conf Modified: head/release/arm/BANANAPI.conf ============================================================================== --- head/release/arm/BANANAPI.conf Fri Oct 6 16:38:00 2017 (r324369) +++ head/release/arm/BANANAPI.conf Fri Oct 6 17:30:18 2017 (r324370) @@ -5,7 +5,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" -EMBEDDED_TARGET_ARCH="armv6" +EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-bananapi" KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" Modified: head/release/arm/BEAGLEBONE.conf ============================================================================== --- head/release/arm/BEAGLEBONE.conf Fri Oct 6 16:38:00 2017 (r324369) +++ head/release/arm/BEAGLEBONE.conf Fri Oct 6 17:30:18 2017 (r324370) @@ -5,7 +5,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" -EMBEDDED_TARGET_ARCH="armv6" +EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-beaglebone" KERNEL="BEAGLEBONE" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" Modified: head/release/arm/CUBIEBOARD.conf ============================================================================== --- head/release/arm/CUBIEBOARD.conf Fri Oct 6 16:38:00 2017 (r324369) +++ head/release/arm/CUBIEBOARD.conf Fri Oct 6 17:30:18 2017 (r324370) @@ -5,7 +5,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" -EMBEDDED_TARGET_ARCH="armv6" +EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-cubieboard" KERNEL="ALLWINNER_UP" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" Modified: head/release/arm/CUBIEBOARD2.conf ============================================================================== --- head/release/arm/CUBIEBOARD2.conf Fri Oct 6 16:38:00 2017 (r324369) +++ head/release/arm/CUBIEBOARD2.conf Fri Oct 6 17:30:18 2017 (r324370) @@ -5,7 +5,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" -EMBEDDED_TARGET_ARCH="armv6" +EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-cubieboard2" KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" Modified: head/release/arm/CUBOX-HUMMINGBOARD.conf ============================================================================== --- head/release/arm/CUBOX-HUMMINGBOARD.conf Fri Oct 6 16:38:00 2017 (r324369) +++ head/release/arm/CUBOX-HUMMINGBOARD.conf Fri Oct 6 17:30:18 2017 (r324370) @@ -5,7 +5,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" -EMBEDDED_TARGET_ARCH="armv6" +EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-cubox-hummingboard" KERNEL="IMX6" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x12000000" Modified: head/release/arm/PANDABOARD.conf ============================================================================== --- head/release/arm/PANDABOARD.conf Fri Oct 6 16:38:00 2017 (r324369) +++ head/release/arm/PANDABOARD.conf Fri Oct 6 17:30:18 2017 (r324370) @@ -5,7 +5,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" -EMBEDDED_TARGET_ARCH="armv6" +EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-pandaboard" KERNEL="PANDABOARD" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" Modified: head/release/arm/RPI2.conf ============================================================================== --- head/release/arm/RPI2.conf Fri Oct 6 16:38:00 2017 (r324369) +++ head/release/arm/RPI2.conf Fri Oct 6 17:30:18 2017 (r324370) @@ -5,7 +5,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" -EMBEDDED_TARGET_ARCH="armv6" +EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-rpi2" KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" Modified: head/release/arm/WANDBOARD.conf ============================================================================== --- head/release/arm/WANDBOARD.conf Fri Oct 6 16:38:00 2017 (r324369) +++ head/release/arm/WANDBOARD.conf Fri Oct 6 17:30:18 2017 (r324370) @@ -5,7 +5,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" -EMBEDDED_TARGET_ARCH="armv6" +EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-wandboard" KERNEL="IMX6" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x12000000" From owner-svn-src-head@freebsd.org Fri Oct 6 18:27:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F58BE3E13B; Fri, 6 Oct 2017 18:27:57 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDA6A69D46; Fri, 6 Oct 2017 18:27:56 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96IRuqd098944; Fri, 6 Oct 2017 18:27:56 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96IRu1Q098943; Fri, 6 Oct 2017 18:27:56 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201710061827.v96IRu1Q098943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 6 Oct 2017 18:27:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324372 - head/sys/dev/random X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/random X-SVN-Commit-Revision: 324372 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 18:27:57 -0000 Author: cem Date: Fri Oct 6 18:27:55 2017 New Revision: 324372 URL: https://svnweb.freebsd.org/changeset/base/324372 Log: random(4): Discard low entropy inputs The later fields of the harvest_event structure are predictable and provide little value to the entropy pool. Only feed in the relatively high entropy counter and explicit entropy buffer to increase measured input entropy. See also: https://people.freebsd.org/~jmg/vbsdcon_2017_ddfreebsdrng_slides.pdf PR: 222807 Submitted by: W. Dean Freeman Reviewed by: jmg (earlier version), delphij Approved by: secteam (delphij) Obtained from: HBSD 8d809124d563937edd84c9c9d5494406e359c55c Security: no -- low entropy marginal input has no known negative affect on pool quality Differential Revision: https://reviews.freebsd.org/D12610 Modified: head/sys/dev/random/fortuna.c Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Fri Oct 6 18:22:36 2017 (r324371) +++ head/sys/dev/random/fortuna.c Fri Oct 6 18:27:55 2017 (r324372) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2017 W. Dean Freeman * Copyright (c) 2013-2015 Mark R V Murray * All rights reserved. * @@ -87,7 +88,7 @@ __FBSDID("$FreeBSD$"); * and too small may compromise initial security but get faster reseeds. */ #define RANDOM_FORTUNA_MINPOOLSIZE 16 -#define RANDOM_FORTUNA_MAXPOOLSIZE UINT_MAX +#define RANDOM_FORTUNA_MAXPOOLSIZE INT_MAX CTASSERT(RANDOM_FORTUNA_MINPOOLSIZE <= RANDOM_FORTUNA_DEFPOOLSIZE); CTASSERT(RANDOM_FORTUNA_DEFPOOLSIZE <= RANDOM_FORTUNA_MAXPOOLSIZE); @@ -232,17 +233,29 @@ random_fortuna_process_event(struct harvest_event *eve * during accumulation/reseeding and reading/regating. */ pl = event->he_destination % RANDOM_FORTUNA_NPOOLS; - randomdev_hash_iterate(&fortuna_state.fs_pool[pl].fsp_hash, event, sizeof(*event)); + /* + * We ignore low entropy static/counter fields towards the end of the + * he_event structure in order to increase measurable entropy when + * conducting SP800-90B entropy analysis measurements of seed material + * fed into PRNG. + * -- wdf + */ + KASSERT(event->he_size <= sizeof(event->he_entropy), + ("%s: event->he_size: %hhu > sizeof(event->he_entropy): %zu\n", + __func__, event->he_size, sizeof(event->he_entropy))); + randomdev_hash_iterate(&fortuna_state.fs_pool[pl].fsp_hash, + &event->he_somecounter, sizeof(event->he_somecounter)); + randomdev_hash_iterate(&fortuna_state.fs_pool[pl].fsp_hash, + event->he_entropy, event->he_size); + /*- - * Don't wrap the length. Doing this the hard way so as not to wrap at MAXUINT. - * This is a "saturating" add. + * Don't wrap the length. This is a "saturating" add. * XXX: FIX!!: We don't actually need lengths for anything but fs_pool[0], * but it's been useful debugging to see them all. */ - if (RANDOM_FORTUNA_MAXPOOLSIZE - fortuna_state.fs_pool[pl].fsp_length > event->he_size) - fortuna_state.fs_pool[pl].fsp_length += event->he_size; - else - fortuna_state.fs_pool[pl].fsp_length = RANDOM_FORTUNA_MAXPOOLSIZE; + fortuna_state.fs_pool[pl].fsp_length = MIN(RANDOM_FORTUNA_MAXPOOLSIZE, + fortuna_state.fs_pool[pl].fsp_length + + sizeof(event->he_somecounter) + event->he_size); explicit_bzero(event, sizeof(*event)); RANDOM_RESEED_UNLOCK(); } From owner-svn-src-head@freebsd.org Fri Oct 6 18:29:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD3BFE3E1EE; Fri, 6 Oct 2017 18:29:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A58C69F25; Fri, 6 Oct 2017 18:29:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96IT0H2099045; Fri, 6 Oct 2017 18:29:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96IT0Zc099043; Fri, 6 Oct 2017 18:29:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201710061829.v96IT0Zc099043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 6 Oct 2017 18:29:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324373 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Commit-Revision: 324373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 18:29:01 -0000 Author: markj Date: Fri Oct 6 18:29:00 2017 New Revision: 324373 URL: https://svnweb.freebsd.org/changeset/base/324373 Log: Avoid adding an extra "0x" prefix before pointer formats. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c Fri Oct 6 18:27:55 2017 (r324372) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c Fri Oct 6 18:29:00 2017 (r324373) @@ -434,7 +434,7 @@ dt_dis(const dtrace_difo_t *dp, FILE *fp) ulong_t i = 0; char type[DT_TYPE_NAMELEN]; - (void) fprintf(fp, "\nDIFO 0x%p returns %s\n", (void *)dp, + (void) fprintf(fp, "\nDIFO %p returns %s\n", (void *)dp, dt_dis_typestr(&dp->dtdo_rtype, type, sizeof (type))); (void) fprintf(fp, "%-3s %-8s %s\n", Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Fri Oct 6 18:27:55 2017 (r324372) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Fri Oct 6 18:29:00 2017 (r324373) @@ -377,7 +377,7 @@ dt_print_array(ctf_id_t base, ulong_t off, dt_printarg ctf_id_t rtype; if (ctf_array_info(ctfp, base, &car) == CTF_ERR) { - (void) fprintf(fp, "0x%p", (void *)addr); + (void) fprintf(fp, "%p", (void *)addr); return; } From owner-svn-src-head@freebsd.org Fri Oct 6 20:33:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F253E41240; Fri, 6 Oct 2017 20:33:42 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0EDF6ED9D; Fri, 6 Oct 2017 20:33:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96KXfrK053674; Fri, 6 Oct 2017 20:33:41 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96KXfrN053672; Fri, 6 Oct 2017 20:33:41 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201710062033.v96KXfrN053672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 6 Oct 2017 20:33:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324374 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 324374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 20:33:42 -0000 Author: glebius Date: Fri Oct 6 20:33:40 2017 New Revision: 324374 URL: https://svnweb.freebsd.org/changeset/base/324374 Log: Declare pmtud_blackhole global variables in tcp_timer.h, so that alternative TCP stacks can legally use them. Modified: head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Fri Oct 6 18:29:00 2017 (r324373) +++ head/sys/netinet/tcp_timer.c Fri Oct 6 20:33:40 2017 (r324374) @@ -141,16 +141,14 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, rexmit_drop_option &tcp_rexmit_drop_options, 0, "Drop TCP options from 3rd and later retransmitted SYN"); -static VNET_DEFINE(int, tcp_pmtud_blackhole_detect); -#define V_tcp_pmtud_blackhole_detect VNET(tcp_pmtud_blackhole_detect) +VNET_DEFINE(int, tcp_pmtud_blackhole_detect); SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_detection, CTLFLAG_RW|CTLFLAG_VNET, &VNET_NAME(tcp_pmtud_blackhole_detect), 0, "Path MTU Discovery Black Hole Detection Enabled"); #ifdef INET -static VNET_DEFINE(int, tcp_pmtud_blackhole_mss) = 1200; -#define V_tcp_pmtud_blackhole_mss VNET(tcp_pmtud_blackhole_mss) +VNET_DEFINE(int, tcp_pmtud_blackhole_mss) = 1200; SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_mss, CTLFLAG_RW|CTLFLAG_VNET, &VNET_NAME(tcp_pmtud_blackhole_mss), 0, @@ -158,8 +156,7 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_ms #endif #ifdef INET6 -static VNET_DEFINE(int, tcp_v6pmtud_blackhole_mss) = 1220; -#define V_tcp_v6pmtud_blackhole_mss VNET(tcp_v6pmtud_blackhole_mss) +VNET_DEFINE(int, tcp_v6pmtud_blackhole_mss) = 1220; SYSCTL_INT(_net_inet_tcp, OID_AUTO, v6pmtud_blackhole_mss, CTLFLAG_RW|CTLFLAG_VNET, &VNET_NAME(tcp_v6pmtud_blackhole_mss), 0, Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Fri Oct 6 18:29:00 2017 (r324373) +++ head/sys/netinet/tcp_timer.h Fri Oct 6 20:33:40 2017 (r324374) @@ -198,6 +198,13 @@ extern int tcp_syn_backoff[]; extern int tcp_finwait2_timeout; extern int tcp_fast_finwait2_recycle; +VNET_DECLARE(int, tcp_pmtud_blackhole_detect); +#define V_tcp_pmtud_blackhole_detect VNET(tcp_pmtud_blackhole_detect) +VNET_DECLARE(int, tcp_pmtud_blackhole_mss); +#define V_tcp_pmtud_blackhole_mss VNET(tcp_pmtud_blackhole_mss) +VNET_DECLARE(int, tcp_v6pmtud_blackhole_mss); +#define V_tcp_v6pmtud_blackhole_mss VNET(tcp_v6pmtud_blackhole_mss) + int tcp_inpinfo_lock_add(struct inpcb *inp); void tcp_inpinfo_lock_del(struct inpcb *inp, struct tcpcb *tp); From owner-svn-src-head@freebsd.org Fri Oct 6 20:43:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CCF4E414FB; Fri, 6 Oct 2017 20:43:16 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 688626F25C; Fri, 6 Oct 2017 20:43:16 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96KhFGS057898; Fri, 6 Oct 2017 20:43:15 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96KhFqZ057892; Fri, 6 Oct 2017 20:43:15 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201710062043.v96KhFqZ057892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 6 Oct 2017 20:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324375 - in head: etc/mtree tests/sys tests/sys/netpfil tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head: etc/mtree tests/sys tests/sys/netpfil tests/sys/netpfil/pf X-SVN-Commit-Revision: 324375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 20:43:16 -0000 Author: kp Date: Fri Oct 6 20:43:14 2017 New Revision: 324375 URL: https://svnweb.freebsd.org/changeset/base/324375 Log: pf: Basic automated test using VIMAGE If VIMAGE is present we can start jails with their own pf instance. This makes it fairly easy to run tests. For example, this basic test verifies that drop/pass and icmp classification works. It's a basic sanity test for pf, and hopefully an example on how to write more pf tests. The tests are skipped if VIMAGE is not enabled. This work is inspired by the GSoC work of Panagiotes Mousikides. Differential Revision: https://reviews.freebsd.org/D12580 Added: head/tests/sys/netpfil/ head/tests/sys/netpfil/Makefile (contents, props changed) head/tests/sys/netpfil/pf/ head/tests/sys/netpfil/pf/Makefile (contents, props changed) head/tests/sys/netpfil/pf/pass_block.sh (contents, props changed) head/tests/sys/netpfil/pf/utils.subr (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/tests/sys/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Fri Oct 6 20:33:40 2017 (r324374) +++ head/etc/mtree/BSD.tests.dist Fri Oct 6 20:43:14 2017 (r324375) @@ -476,6 +476,10 @@ .. netinet .. + netpfil + pf + .. + .. opencrypto .. pjdfstest Modified: head/tests/sys/Makefile ============================================================================== --- head/tests/sys/Makefile Fri Oct 6 20:33:40 2017 (r324374) +++ head/tests/sys/Makefile Fri Oct 6 20:43:14 2017 (r324375) @@ -13,6 +13,7 @@ TESTS_SUBDIRS+= kqueue TESTS_SUBDIRS+= mac TESTS_SUBDIRS+= mqueue TESTS_SUBDIRS+= netinet +TESTS_SUBDIRS+= netpfil TESTS_SUBDIRS+= opencrypto TESTS_SUBDIRS+= posixshm TESTS_SUBDIRS+= sys Added: head/tests/sys/netpfil/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/Makefile Fri Oct 6 20:43:14 2017 (r324375) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/sys/netpfil + +TESTS_SUBDIRS+= pf + +.include Added: head/tests/sys/netpfil/pf/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/pf/Makefile Fri Oct 6 20:43:14 2017 (r324375) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +PACKAGE= tests + +TESTSDIR= ${TESTSBASE}/sys/netpfil/pf + +ATF_TESTS_SH+= pass_block + +${PACKAGE}FILES+= utils.subr + +.include Added: head/tests/sys/netpfil/pf/pass_block.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/pf/pass_block.sh Fri Oct 6 20:43:14 2017 (r324375) @@ -0,0 +1,91 @@ +# $FreeBSD$ + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "v4" "cleanup" +v4_head() +{ + atf_set descr 'Basic pass/block test for IPv4' + atf_set require.user root +} + +v4_body() +{ + pft_init + + epair=$(pft_mkepair) + ifconfig ${epair}a 192.0.2.1/24 up + + # Set up a simple jail with one interface + pft_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + + # Trivial ping to the jail, without pf + atf_check -s exit:0 -o ignore ping -c 1 -t 1 192.0.2.2 + + # pf without policy will let us ping + jexec alcatraz pfctl -e + atf_check -s exit:0 -o ignore ping -c 1 -t 1 192.0.2.2 + + # Block everything + printf "block in\n" | jexec alcatraz pfctl -f - + atf_check -s exit:2 -o ignore ping -c 1 -t 1 192.0.2.2 + + # Block everything but ICMP + printf "block in\npass in proto icmp\n" | jexec alcatraz pfctl -f - + atf_check -s exit:0 -o ignore ping -c 1 -t 1 192.0.2.2 +} + +v4_cleanup() +{ + pft_cleanup +} + +atf_test_case "v6" "cleanup" +v6_head() +{ + atf_set descr 'Basic pass/block test for IPv6' + atf_set require.user root +} + +v6_body() +{ + pft_init + + epair=$(pft_mkepair) + ifconfig ${epair}a inet6 2001:db8:42::1/64 up no_dad + + # Set up a simple jail with one interface + pft_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 2001:db8:42::2/64 up no_dad + + # Trivial ping to the jail, without pf + atf_check -s exit:0 -o ignore ping6 -c 1 -x 1 2001:db8:42::2 + + # pf without policy will let us ping + jexec alcatraz pfctl -e + atf_check -s exit:0 -o ignore ping6 -c 1 -x 1 2001:db8:42::2 + + # Block everything + printf "block in\n" | jexec alcatraz pfctl -f - + atf_check -s exit:2 -o ignore ping6 -c 1 -x 1 2001:db8:42::2 + + # Block everything but ICMP + printf "block in\npass in proto icmp6\n" | jexec alcatraz pfctl -f - + atf_check -s exit:0 -o ignore ping6 -c 1 -x 1 2001:db8:42::2 + + # Allowing ICMPv4 does not allow ICMPv6 + printf "block in\npass in proto icmp\n" | jexec alcatraz pfctl -f - + atf_check -s exit:2 -o ignore ping6 -c 1 -x 1 2001:db8:42::2 +} + +v6_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "v4" + atf_add_test_case "v6" +} Added: head/tests/sys/netpfil/pf/utils.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/pf/utils.subr Fri Oct 6 20:43:14 2017 (r324375) @@ -0,0 +1,47 @@ +# $FreeBSD$ +# Utility functions +## + +pft_init() +{ + if [ ! -c /dev/pf ]; then + atf_skip "This test requires pf" + fi + + if [ "`sysctl -i -n kern.features.vimage`" != 1 ]; then + atf_skip "This test requires VIMAGE" + fi +} + +pft_mkepair() +{ + ifname=$(ifconfig epair create) + echo $ifname >> created_interfaces.lst + echo ${ifname%a} +} + +pft_mkjail() +{ + jailname=$1 + ifname=$2 + jail -c name=${jailname} persist vnet vnet.interface=${ifname} + + echo $jailname >> created_jails.lst +} + +pft_cleanup() +{ + if [ -f created_interfaces.lst ]; then + for ifname in `cat created_interfaces.lst` + do + ifconfig ${ifname} destroy + done + fi + + if [ -f created_jails.lst ]; then + for jailname in `cat created_jails.lst` + do + jail -r ${jailname} + done + fi +} From owner-svn-src-head@freebsd.org Fri Oct 6 20:51:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B125E417F9; Fri, 6 Oct 2017 20:51:34 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E86376F5D3; Fri, 6 Oct 2017 20:51:33 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96KpXaO061159; Fri, 6 Oct 2017 20:51:33 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96KpWj0061155; Fri, 6 Oct 2017 20:51:32 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201710062051.v96KpWj0061155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 6 Oct 2017 20:51:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324376 - head/tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf X-SVN-Commit-Revision: 324376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 20:51:34 -0000 Author: kp Date: Fri Oct 6 20:51:32 2017 New Revision: 324376 URL: https://svnweb.freebsd.org/changeset/base/324376 Log: pf: Very basic forwarding test This test illustrates the use of scapy to test pf. Differential Revision: https://reviews.freebsd.org/D12581 Added: head/tests/sys/netpfil/pf/forward.sh (contents, props changed) head/tests/sys/netpfil/pf/pft_ping.py (contents, props changed) Modified: head/tests/sys/netpfil/pf/Makefile head/tests/sys/netpfil/pf/utils.subr Modified: head/tests/sys/netpfil/pf/Makefile ============================================================================== --- head/tests/sys/netpfil/pf/Makefile Fri Oct 6 20:43:14 2017 (r324375) +++ head/tests/sys/netpfil/pf/Makefile Fri Oct 6 20:51:32 2017 (r324376) @@ -4,8 +4,12 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/netpfil/pf -ATF_TESTS_SH+= pass_block +ATF_TESTS_SH+= pass_block \ + forward -${PACKAGE}FILES+= utils.subr +${PACKAGE}FILES+= utils.subr \ + pft_ping.py + +${PACKAGE}FILESMODE_pft_ping.py= 0555 .include Added: head/tests/sys/netpfil/pf/forward.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/pf/forward.sh Fri Oct 6 20:51:32 2017 (r324376) @@ -0,0 +1,67 @@ +# $FreeBSD$ + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "v4" "cleanup" +v4_head() +{ + atf_set descr 'Basic forwarding test' + atf_set require.user root + + # We need scapy to be installed for out test scripts to work + atf_set require.progs scapy +} + +v4_body() +{ + pft_init + + epair_send=$(pft_mkepair) + ifconfig ${epair_send}a 192.0.2.1/24 up + + epair_recv=$(pft_mkepair) + ifconfig ${epair_recv}a up + + pft_mkjail alcatraz ${epair_send}b ${epair_recv}b + jexec alcatraz ifconfig ${epair_send}b 192.0.2.2/24 up + jexec alcatraz ifconfig ${epair_recv}b 198.51.100.2/24 up + jexec alcatraz sysctl net.inet.ip.forwarding=1 + jexec alcatraz arp -s 198.51.100.3 00:01:02:03:04:05 + route add -net 198.51.100.0/24 192.0.2.2 + + # Sanity check, can we forward ICMP echo requests without pf? + atf_check -s exit:0 $(atf_get_srcdir)/pft_ping.py \ + --sendif ${epair_send}a \ + --to 198.51.100.3 \ + --recvif ${epair_recv}a + + # Forward with pf enabled + printf "block in\n" | jexec alcatraz pfctl -ef - + atf_check -s exit:1 $(atf_get_srcdir)/pft_ping.py \ + --sendif ${epair_send}a \ + --to 198.51.100.3 \ + --recvif ${epair_recv}a + + printf "block out\n" | jexec alcatraz pfctl -f - + atf_check -s exit:1 $(atf_get_srcdir)/pft_ping.py \ + --sendif ${epair_send}a \ + --to 198.51.100.3 \ + --recv ${epair_recv}a + + # Allow ICMP + printf "block in\npass in proto icmp\n" | jexec alcatraz pfctl -f - + atf_check -s exit:0 $(atf_get_srcdir)/pft_ping.py \ + --sendif ${epair_send}a \ + --to 198.51.100.3 \ + --recvif ${epair_recv}a +} + +v4_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "v4" +} Added: head/tests/sys/netpfil/pf/pft_ping.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/pf/pft_ping.py Fri Oct 6 20:51:32 2017 (r324376) @@ -0,0 +1,83 @@ +#!/usr/local/bin/python2.7 + +import argparse +import scapy.all as sp +import sys +import threading + +PAYLOAD_MAGIC = 0x42c0ffee + +class Sniffer(threading.Thread): + def __init__(self, recvif): + threading.Thread.__init__(self) + + self._recvif = recvif + + self.start() + + def run(self): + self.packets = sp.sniff(iface=self._recvif, timeout=3) + +def check_ping_request(packet, dst_ip): + """ + Verify that the packet matches what we'd have sent + """ + ip = packet.getlayer(sp.IP) + if not ip: + return False + if ip.dst != dst_ip: + return False + + icmp = packet.getlayer(sp.ICMP) + if not icmp: + return False + if sp.icmptypes[icmp.type] != 'echo-request': + return False + + raw = packet.getlayer(sp.Raw) + if not raw: + return False + if raw.load != str(PAYLOAD_MAGIC): + return False + + return True + +def ping(send_if, dst_ip): + req = sp.Ether() \ + / sp.IP(dst=dst_ip) \ + / sp.ICMP(type='echo-request') \ + / sp.Raw(PAYLOAD_MAGIC) + sp.sendp(req, iface=send_if, verbose=False) + +def main(): + parser = argparse.ArgumentParser("pft_ping.py", + description="Ping test tool") + parser.add_argument('--sendif', nargs=1, + required=True, + help='The interface through which the packet(s) will be sent') + parser.add_argument('--recvif', nargs=1, + help='The interface on which to expect the ICMP echo response') + parser.add_argument('--to', nargs=1, + required=True, + help='The destination IP address for the ICMP echo request') + + args = parser.parse_args() + + sniffer = None + if not args.recvif is None: + sniffer = Sniffer(args.recvif[0]) + + ping(args.sendif[0], args.to[0]) + + if sniffer: + sniffer.join() + + for packet in sniffer.packets: + if check_ping_request(packet, args.to[0]): + sys.exit(0) + + # We did not get the packet we expected + sys.exit(1) + +if __name__ == '__main__': + main() Modified: head/tests/sys/netpfil/pf/utils.subr ============================================================================== --- head/tests/sys/netpfil/pf/utils.subr Fri Oct 6 20:43:14 2017 (r324375) +++ head/tests/sys/netpfil/pf/utils.subr Fri Oct 6 20:51:32 2017 (r324376) @@ -23,8 +23,14 @@ pft_mkepair() pft_mkjail() { jailname=$1 - ifname=$2 - jail -c name=${jailname} persist vnet vnet.interface=${ifname} + shift + + vnet_interfaces= + for ifname in $@ + do + vnet_interfaces="${vnet_interfaces} vnet.interface=${ifname}" + done + jail -c name=${jailname} persist vnet ${vnet_interfaces} echo $jailname >> created_jails.lst } From owner-svn-src-head@freebsd.org Fri Oct 6 21:52:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 078EBE42778; Fri, 6 Oct 2017 21:52:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D611E710F0; Fri, 6 Oct 2017 21:52:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96LqTj9086576; Fri, 6 Oct 2017 21:52:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96LqSLk086571; Fri, 6 Oct 2017 21:52:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201710062152.v96LqSLk086571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 6 Oct 2017 21:52:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324377 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 324377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 21:52:30 -0000 Author: markj Date: Fri Oct 6 21:52:28 2017 New Revision: 324377 URL: https://svnweb.freebsd.org/changeset/base/324377 Log: Let stack_create(9) take a malloc flags argument. Reviewed by: cem Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12614 Modified: head/share/man/man9/stack.9 head/sys/kern/kern_proc.c head/sys/kern/subr_sleepqueue.c head/sys/kern/subr_stack.c head/sys/sys/stack.h Modified: head/share/man/man9/stack.9 ============================================================================== --- head/share/man/man9/stack.9 Fri Oct 6 20:51:32 2017 (r324376) +++ head/share/man/man9/stack.9 Fri Oct 6 21:52:28 2017 (r324377) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 10, 2015 +.Dd October 6, 2017 .Dt STACK 9 .Os .Sh NAME @@ -42,7 +42,7 @@ In the kernel configuration file: .Cd "options STACK" .Pp .Ft struct stack * -.Fn stack_create "void" +.Fn stack_create "int flags" .Ft void .Fn stack_destroy "struct stack *st" .Ft int @@ -85,8 +85,11 @@ Each stack trace is described by a .Vt "struct stack" . Before a trace may be created or otherwise manipulated, storage for the trace must be allocated with -.Fn stack_create , -which may sleep. +.Fn stack_create . +The +.Ar flags +argument is passed to +.Xr malloc 9 . Memory associated with a trace is freed by calling .Fn stack_destroy . .Pp Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Fri Oct 6 20:51:32 2017 (r324376) +++ head/sys/kern/kern_proc.c Fri Oct 6 21:52:28 2017 (r324377) @@ -2547,7 +2547,7 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) return (error); kkstp = malloc(sizeof(*kkstp), M_TEMP, M_WAITOK); - st = stack_create(); + st = stack_create(M_WAITOK); lwpidarray = NULL; PROC_LOCK(p); Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Fri Oct 6 20:51:32 2017 (r324376) +++ head/sys/kern/subr_sleepqueue.c Fri Oct 6 21:52:28 2017 (r324377) @@ -1163,7 +1163,7 @@ sleepq_sbuf_print_stacks(struct sbuf *sb, void *wchan, M_TEMP, M_WAITOK); for (stack_idx = 0; stack_idx < stacks_to_allocate; stack_idx++) - st[stack_idx] = stack_create(); + st[stack_idx] = stack_create(M_WAITOK); /* Where we will store the td name, tid, etc. */ td_infos = malloc(sizeof(struct sbuf *) * stacks_to_allocate, Modified: head/sys/kern/subr_stack.c ============================================================================== --- head/sys/kern/subr_stack.c Fri Oct 6 20:51:32 2017 (r324376) +++ head/sys/kern/subr_stack.c Fri Oct 6 21:52:28 2017 (r324377) @@ -50,11 +50,11 @@ static int stack_symbol(vm_offset_t pc, char *namebuf, static int stack_symbol_ddb(vm_offset_t pc, const char **name, long *offset); struct stack * -stack_create(void) +stack_create(int flags) { struct stack *st; - st = malloc(sizeof *st, M_STACK, M_WAITOK | M_ZERO); + st = malloc(sizeof(*st), M_STACK, flags | M_ZERO); return (st); } Modified: head/sys/sys/stack.h ============================================================================== --- head/sys/sys/stack.h Fri Oct 6 20:51:32 2017 (r324376) +++ head/sys/sys/stack.h Fri Oct 6 21:52:28 2017 (r324377) @@ -34,7 +34,7 @@ struct sbuf; /* MI Routines. */ -struct stack *stack_create(void); +struct stack *stack_create(int); void stack_destroy(struct stack *); int stack_put(struct stack *, vm_offset_t); void stack_copy(const struct stack *, struct stack *); From owner-svn-src-head@freebsd.org Fri Oct 6 23:05:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E8EBE43C5C; Fri, 6 Oct 2017 23:05:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FD0C7337C; Fri, 6 Oct 2017 23:05:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v96N5ubf015852; Fri, 6 Oct 2017 23:05:56 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v96N5uO3015851; Fri, 6 Oct 2017 23:05:56 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710062305.v96N5uO3015851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 6 Oct 2017 23:05:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324378 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2017 23:05:57 -0000 Author: mjg Date: Fri Oct 6 23:05:55 2017 New Revision: 324378 URL: https://svnweb.freebsd.org/changeset/base/324378 Log: namecache: factor out ~MAKEENTRY lookups from the common path Lookups of the sort are rare compared to regular ones and succesfull ones result in removing entries from the cache. In the current code buckets are rlocked and a trylock dance is performed, which can fail and cause a restart. Fixing it will require a little bit of surgery and in order to keep the code maintaineable the 2 cases have to split. MFC after: 1 week Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Oct 6 21:52:28 2017 (r324377) +++ head/sys/kern/vfs_cache.c Fri Oct 6 23:05:55 2017 (r324378) @@ -1058,7 +1058,6 @@ cache_lookup_unlock(struct rwlock *blp, struct mtx *vl if (blp != NULL) { rw_runlock(blp); - mtx_assert(vlp, MA_NOTOWNED); } else { mtx_unlock(vlp); } @@ -1117,6 +1116,82 @@ cache_lookup_dot(struct vnode *dvp, struct vnode **vpp * not recursively acquired. */ +static __noinline int +cache_lookup_nomakeentry(struct vnode *dvp, struct vnode **vpp, + struct componentname *cnp, struct timespec *tsp, int *ticksp) +{ + struct namecache *ncp; + struct rwlock *blp; + struct mtx *dvlp, *dvlp2; + uint32_t hash; + int error; + + if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') { + counter_u64_add(dotdothits, 1); + dvlp = VP2VNODELOCK(dvp); + dvlp2 = NULL; + mtx_lock(dvlp); +retry_dotdot: + ncp = dvp->v_cache_dd; + if (ncp == NULL) { + SDT_PROBE3(vfs, namecache, lookup, miss, dvp, + "..", NULL); + mtx_unlock(dvlp); + return (0); + } + if ((ncp->nc_flag & NCF_ISDOTDOT) != 0) { + if (ncp->nc_dvp != dvp) + panic("dvp %p v_cache_dd %p\n", dvp, ncp); + if (!cache_zap_locked_vnode_kl2(ncp, + dvp, &dvlp2)) + goto retry_dotdot; + MPASS(dvp->v_cache_dd == NULL); + mtx_unlock(dvlp); + if (dvlp2 != NULL) + mtx_unlock(dvlp2); + cache_free(ncp); + } else { + dvp->v_cache_dd = NULL; + mtx_unlock(dvlp); + if (dvlp2 != NULL) + mtx_unlock(dvlp2); + } + return (0); + } + + hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); + blp = HASH2BUCKETLOCK(hash); +retry: + rw_rlock(blp); + + LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { + counter_u64_add(numchecks, 1); + if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && + !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) + break; + } + + /* We failed to find an entry */ + if (ncp == NULL) { + rw_runlock(blp); + SDT_PROBE3(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr, + NULL); + counter_u64_add(nummisszap, 1); + return (0); + } + + counter_u64_add(numposzaps, 1); + + error = cache_zap_rlocked_bucket(ncp, blp); + if (error != 0) { + zap_and_exit_bucket_fail++; + cache_maybe_yield(); + goto retry; + } + cache_free(ncp); + return (0); +} + int cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct timespec *tsp, int *ticksp) @@ -1132,69 +1207,51 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st cnp->cn_flags &= ~MAKEENTRY; return (0); } + + counter_u64_add(numcalls, 1); + + if (__predict_false(cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.')) + return (cache_lookup_dot(dvp, vpp, cnp, tsp, ticksp)); + + if ((cnp->cn_flags & MAKEENTRY) == 0) + return (cache_lookup_nomakeentry(dvp, vpp, cnp, tsp, ticksp)); + retry: blp = NULL; - dvlp = VP2VNODELOCK(dvp); error = 0; - counter_u64_add(numcalls, 1); - - if (cnp->cn_nameptr[0] == '.') { - if (cnp->cn_namelen == 1) - return (cache_lookup_dot(dvp, vpp, cnp, tsp, ticksp)); - if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') { - counter_u64_add(dotdothits, 1); - dvlp2 = NULL; - mtx_lock(dvlp); -retry_dotdot: - ncp = dvp->v_cache_dd; - if (ncp == NULL) { - SDT_PROBE3(vfs, namecache, lookup, miss, dvp, - "..", NULL); - mtx_unlock(dvlp); - return (0); - } - if ((cnp->cn_flags & MAKEENTRY) == 0) { - if ((ncp->nc_flag & NCF_ISDOTDOT) != 0) { - if (ncp->nc_dvp != dvp) - panic("dvp %p v_cache_dd %p\n", dvp, ncp); - if (!cache_zap_locked_vnode_kl2(ncp, - dvp, &dvlp2)) - goto retry_dotdot; - MPASS(dvp->v_cache_dd == NULL); - mtx_unlock(dvlp); - if (dvlp2 != NULL) - mtx_unlock(dvlp2); - cache_free(ncp); - } else { - dvp->v_cache_dd = NULL; - mtx_unlock(dvlp); - if (dvlp2 != NULL) - mtx_unlock(dvlp2); - } - return (0); - } - if ((ncp->nc_flag & NCF_ISDOTDOT) != 0) { - if (ncp->nc_flag & NCF_NEGATIVE) - *vpp = NULL; - else - *vpp = ncp->nc_vp; - } else - *vpp = ncp->nc_dvp; - /* Return failure if negative entry was found. */ - if (*vpp == NULL) - goto negative_success; - CTR3(KTR_VFS, "cache_lookup(%p, %s) found %p via ..", - dvp, cnp->cn_nameptr, *vpp); - SDT_PROBE3(vfs, namecache, lookup, hit, dvp, "..", - *vpp); - cache_out_ts(ncp, tsp, ticksp); - if ((ncp->nc_flag & (NCF_ISDOTDOT | NCF_DTS)) == - NCF_DTS && tsp != NULL) { - ncp_ts = __containerof(ncp, struct namecache_ts, nc_nc); - *tsp = ncp_ts->nc_dotdottime; - } - goto success; + if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') { + counter_u64_add(dotdothits, 1); + dvlp = VP2VNODELOCK(dvp); + dvlp2 = NULL; + mtx_lock(dvlp); + ncp = dvp->v_cache_dd; + if (ncp == NULL) { + SDT_PROBE3(vfs, namecache, lookup, miss, dvp, + "..", NULL); + mtx_unlock(dvlp); + return (0); } + if ((ncp->nc_flag & NCF_ISDOTDOT) != 0) { + if (ncp->nc_flag & NCF_NEGATIVE) + *vpp = NULL; + else + *vpp = ncp->nc_vp; + } else + *vpp = ncp->nc_dvp; + /* Return failure if negative entry was found. */ + if (*vpp == NULL) + goto negative_success; + CTR3(KTR_VFS, "cache_lookup(%p, %s) found %p via ..", + dvp, cnp->cn_nameptr, *vpp); + SDT_PROBE3(vfs, namecache, lookup, hit, dvp, "..", + *vpp); + cache_out_ts(ncp, tsp, ticksp); + if ((ncp->nc_flag & (NCF_ISDOTDOT | NCF_DTS)) == + NCF_DTS && tsp != NULL) { + ncp_ts = __containerof(ncp, struct namecache_ts, nc_nc); + *tsp = ncp_ts->nc_dotdottime; + } + goto success; } hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); @@ -1210,21 +1267,11 @@ retry_dotdot: /* We failed to find an entry */ if (ncp == NULL) { + rw_runlock(blp); SDT_PROBE3(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr, NULL); - if ((cnp->cn_flags & MAKEENTRY) == 0) { - counter_u64_add(nummisszap, 1); - } else { - counter_u64_add(nummiss, 1); - } - cache_lookup_unlock(blp, dvlp); + counter_u64_add(nummiss, 1); return (0); - } - - /* We don't want to have an entry, so dump it */ - if ((cnp->cn_flags & MAKEENTRY) == 0) { - counter_u64_add(numposzaps, 1); - goto zap_and_exit; } /* We found a "positive" match, return the vnode */ From owner-svn-src-head@freebsd.org Sat Oct 7 01:20:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBD62E2569C; Sat, 7 Oct 2017 01:20:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89F7176F80; Sat, 7 Oct 2017 01:20:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v971KU9o069766; Sat, 7 Oct 2017 01:20:30 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v971KUSU069765; Sat, 7 Oct 2017 01:20:30 GMT (envelope-from np@FreeBSD.org) Message-Id: <201710070120.v971KUSU069765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 7 Oct 2017 01:20:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324379 - head/usr.sbin/cxgbetool X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/usr.sbin/cxgbetool X-SVN-Commit-Revision: 324379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Oct 2017 01:20:31 -0000 Author: np Date: Sat Oct 7 01:20:30 2017 New Revision: 324379 URL: https://svnweb.freebsd.org/changeset/base/324379 Log: cxgbetool(8): Do not create a large file devoid of useful content when the dumpstate ioctl fails. Make the file world-readable while here. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/usr.sbin/cxgbetool/cxgbetool.c Modified: head/usr.sbin/cxgbetool/cxgbetool.c ============================================================================== --- head/usr.sbin/cxgbetool/cxgbetool.c Fri Oct 6 23:05:55 2017 (r324378) +++ head/usr.sbin/cxgbetool/cxgbetool.c Sat Oct 7 01:20:30 2017 (r324379) @@ -1896,13 +1896,6 @@ dumpstate(int argc, const char *argv[]) return (EINVAL); } - fd = open(fname, O_CREAT | O_TRUNC | O_EXCL | O_WRONLY, - S_IRUSR | S_IRGRP); - if (fd < 0) { - warn("open(%s)", fname); - return (errno); - } - dump.wr_flash = 0; memset(&dump.bitmap, 0xff, sizeof(dump.bitmap)); dump.len = 8 * 1024 * 1024; @@ -1913,9 +1906,20 @@ dumpstate(int argc, const char *argv[]) } rc = doit(CHELSIO_T4_CUDBG_DUMP, &dump); + if (rc != 0) + goto done; + + fd = open(fname, O_CREAT | O_TRUNC | O_EXCL | O_WRONLY, + S_IRUSR | S_IRGRP | S_IROTH); + if (fd < 0) { + warn("open(%s)", fname); + rc = errno; + goto done; + } write(fd, dump.data, dump.len); - free(dump.data); close(fd); +done: + free(dump.data); return (rc); } From owner-svn-src-head@freebsd.org Sat Oct 7 16:29:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F0FCE3BC7D; Sat, 7 Oct 2017 16:29:40 +0000 (UTC) (envelope-from guyyur@gmail.com) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA3468226F; Sat, 7 Oct 2017 16:29:39 +0000 (UTC) (envelope-from guyyur@gmail.com) Received: by mail-wm0-x241.google.com with SMTP id q132so13930591wmd.2; Sat, 07 Oct 2017 09:29:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=pn1k5UQcBdW+DkvmPijs0gWcjpUBxFdvuvAldWZgL5c=; b=D9RlLjX85gpF0n4J7VL8xRPpYKEn5sIuA3DHZ9VYRZoDCYr34ZrcNfuCHs6LMLiiKT vWwy3UTTLV8/XOHRHB62OeQeSCJQZws9mZYpK0mAs5R9h/Y26D5T2AzM3i8p3ItF4LHu UU19WIUgqEIIanKpSeVWW4KSp9olTMoaxsZikouiaOel0jyn8vPOXKqLXrI44a8avISK U2L/WSnGH9K1wz+2xpz0MpK3ZW9uqZ2EgWPDv0SDWlNWRMWrIP04QTyPCFAGoMM5IFmL z7308rucGqkQO+LwERVP8wdl/IiHw3q9fUdbrMrpoJUzZVv9u6dnlIvkVIBTMU3pmvlv c3Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=pn1k5UQcBdW+DkvmPijs0gWcjpUBxFdvuvAldWZgL5c=; b=WNe0c+cuWeNFAipM8kxyfp9w/NF6y+45JsghC/+wbEw6QzaLU8DQgnnEQK3J3iNx0O 9bgJHl1V8TsThgjs6FNCxfkJBdXTQ2K9t5XAFFMVfqMBzWQ2jaTK/40heS92vrvNamWs OzS9XlnP1jOgpGQ0CdrlfLERs6cvSOCxhPF64WWXjvUIM+TeM9dBQmmzdV2oEVZl2qKV Wn36xlPagDYs+203xn/+rtlGbpsbfuDMEOLduNTvAViwrmxmELSEDfhhRG0Nml4nGddM VJ11rJRCvrdQHvtCblyw09FpIg2kmsrKkpwpIdf7SORJJxO5PF2Jzxjg3cM6bvXucJvj 5E3w== X-Gm-Message-State: AMCzsaXggFIAqKkDDYzlnIS9T5Nl8V3a14NWQZws+v/T+ljxZI3B5O2d aiO3YTqyy782uWxlQMYghLIpXtEbFJevup+KsGtO1A== X-Google-Smtp-Source: AOwi7QCHqUt2LUU3+q0CVg2T92nb2sVQbhom+yjNUbCdNgW4E2znCDqoQBZ2nc+gqo1snMygL+cdWx99tQ9bIdY8oXc= X-Received: by 10.28.11.133 with SMTP id 127mr3941739wml.81.1507393778225; Sat, 07 Oct 2017 09:29:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.197.141 with HTTP; Sat, 7 Oct 2017 09:29:37 -0700 (PDT) In-Reply-To: <201710061221.v96CLko0046237@repo.freebsd.org> References: <201710061221.v96CLko0046237@repo.freebsd.org> From: Guy Yur Date: Sat, 7 Oct 2017 19:29:37 +0300 Message-ID: Subject: Re: svn commit: r324360 - in head/sys/boot/efi: include libefi loader To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Oct 2017 16:29:40 -0000 On 6 October 2017 at 15:21, Warner Losh wrote: > Author: imp > Date: Fri Oct 6 12:21:46 2017 > New Revision: 324360 > URL: https://svnweb.freebsd.org/changeset/base/324360 > > Log: > Encapsulate ZFS preferences into efi_zfs_is_preferred > > Move the retrieval of the image information into loader's main instead > of doing it in efizfs.c > > Differential Revision: https://reviews.freebsd.org/D12564 > Submitted by: Eric McCorkle > > Modified: > head/sys/boot/efi/include/efizfs.h > head/sys/boot/efi/libefi/efizfs.c > head/sys/boot/efi/loader/main.c > > ... > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" Hi, When setting WITHOUT_ZFS in src.conf the build fails with: /usr/src/sys/boot/efi/loader/main.c:78:1: error: no previous prototype for function 'efi_zfs_is_preferred' [-Werror,-Wmissing-prototypes] efi_zfs_is_preferred(EFI_HANDLE *h) ^ 1 error generated. *** Error code 1 The prototype is under #ifdef EFI_ZFS_BOOT guard but the function is not. Thanks, Guy From owner-svn-src-head@freebsd.org Sat Oct 7 16:48:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A058E3C4A5; Sat, 7 Oct 2017 16:48:44 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0378018CB; Sat, 7 Oct 2017 16:48:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v97Gmg4X073933; Sat, 7 Oct 2017 16:48:42 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v97GmgKF073928; Sat, 7 Oct 2017 16:48:42 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201710071648.v97GmgKF073928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 7 Oct 2017 16:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324383 - in head/sys: arm/allwinner/clkng arm/allwinner/h3 conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/allwinner/clkng arm/allwinner/h3 conf X-SVN-Commit-Revision: 324383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Oct 2017 16:48:44 -0000 Author: manu Date: Sat Oct 7 16:48:42 2017 New Revision: 324383 URL: https://svnweb.freebsd.org/changeset/base/324383 Log: Allwinner: Add clock driver for ccu_sun8i_r SUN8I and SUN50I (H3, H5, A83T and A64) have a second clock controller unit. It controls the clocks for the second gpio controller, the IR controller etc ... Support for A83T is not supported. Tested On: OrangePi One, Pine64 Added: head/sys/arm/allwinner/clkng/ccu_sun8i_r.c (contents, props changed) head/sys/arm/allwinner/clkng/ccu_sun8i_r.h (contents, props changed) Modified: head/sys/arm/allwinner/clkng/aw_ccung.c head/sys/arm/allwinner/h3/files.h3 head/sys/conf/files.arm64 Modified: head/sys/arm/allwinner/clkng/aw_ccung.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_ccung.c Sat Oct 7 09:47:31 2017 (r324382) +++ head/sys/arm/allwinner/clkng/aw_ccung.c Sat Oct 7 16:48:42 2017 (r324383) @@ -64,10 +64,12 @@ __FBSDID("$FreeBSD$"); #if defined(SOC_ALLWINNER_A64) #include +#include #endif #if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) #include +#include #endif #include "clkdev_if.h" @@ -79,26 +81,30 @@ static struct resource_spec aw_ccung_spec[] = { }; #if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) -#define H3_CCU 1 +#define H3_CCU 1 +#define H3_R_CCU 2 #endif #if defined(SOC_ALLWINNER_A31) -#define A31_CCU 2 +#define A31_CCU 3 #endif #if defined(SOC_ALLWINNER_A64) -#define A64_CCU 2 +#define A64_CCU 4 +#define A64_R_CCU 5 #endif static struct ofw_compat_data compat_data[] = { #if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) { "allwinner,sun8i-h3-ccu", H3_CCU }, + { "allwinner,sun8i-h3-r-ccu", H3_R_CCU }, #endif #if defined(SOC_ALLWINNER_A31) { "allwinner,sun6i-a31-ccu", A31_CCU }, #endif #if defined(SOC_ALLWINNER_A64) { "allwinner,sun50i-a64-ccu", A64_CCU }, + { "allwinner,sun50i-a64-r-ccu", A64_R_CCU }, #endif {NULL, 0 } }; @@ -320,6 +326,9 @@ aw_ccung_attach(device_t dev) case H3_CCU: ccu_h3_register_clocks(sc); break; + case H3_R_CCU: + ccu_sun8i_r_register_clocks(sc); + break; #endif #if defined(SOC_ALLWINNER_A31) case A31_CCU: @@ -329,6 +338,9 @@ aw_ccung_attach(device_t dev) #if defined(SOC_ALLWINNER_A64) case A64_CCU: ccu_a64_register_clocks(sc); + break; + case A64_R_CCU: + ccu_sun8i_r_register_clocks(sc); break; #endif } Added: head/sys/arm/allwinner/clkng/ccu_sun8i_r.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Sat Oct 7 16:48:42 2017 (r324383) @@ -0,0 +1,127 @@ +/*- + * Copyright (c) 2017 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include + +/* Non-exported clocks */ +#define CLK_AHB0 1 +#define CLK_APB0 2 + +static struct aw_ccung_reset ccu_sun8i_r_resets[] = { + CCU_RESET(RST_APB0_IR, 0xb0, 1) + CCU_RESET(RST_APB0_TIMER, 0xb0, 2) + CCU_RESET(RST_APB0_RSB, 0xb0, 4) + CCU_RESET(RST_APB0_UART, 0xb0, 6) +}; + +static struct aw_ccung_gate ccu_sun8i_r_gates[] = { + CCU_GATE(CLK_APB0_PIO, "apb0-pio", "apb0", 0x28, 0) + CCU_GATE(CLK_APB0_IR, "apb0-ir", "apb0", 0x28, 1) + CCU_GATE(CLK_APB0_TIMER, "apb0-timer", "apb0", 0x28, 2) + CCU_GATE(CLK_APB0_RSB, "apb0-rsb", "apb0", 0x28, 3) + CCU_GATE(CLK_APB0_UART, "apb0-uart", "apb0", 0x28, 4) + CCU_GATE(CLK_APB0_I2C, "apb0-i2c", "apb0", 0x28, 6) + CCU_GATE(CLK_APB0_TWD, "apb0-twd", "apb0", 0x28, 7) +}; + +static const char *ar100_parents[] = {"osc32k", "osc24M", "pll_periph0", "iosc"}; +PREDIV_CLK(ar100_clk, CLK_AR100, /* id */ + "ar100", ar100_parents, /* name, parents */ + 0x00, /* offset */ + 16, 2, /* mux */ + 4, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* div */ + 8, 5, 0, AW_CLK_FACTOR_HAS_COND, /* prediv */ + 16, 2, 2); /* prediv condition */ + +static const char *ahb0_parents[] = {"ar100"}; +FIXED_CLK(ahb0_clk, + CLK_AHB0, /* id */ + "ahb0", /* name */ + ahb0_parents, /* parent */ + 0, /* freq */ + 1, /* mult */ + 1, /* div */ + 0); /* flags */ + +static const char *apb0_parents[] = {"ahb0"}; +DIV_CLK(apb0_clk, + CLK_APB0, /* id */ + "apb0", apb0_parents, /* name, parents */ + 0x0c, /* offset */ + 0, 2, /* shift, width */ + 0, NULL); /* flags, div table */ + +static struct aw_clk_prediv_mux_def *prediv_mux_clks[] = { + &ar100_clk, +}; + +static struct clk_div_def *div_clks[] = { + &apb0_clk, +}; + +static struct clk_fixed_def *fixed_factor_clks[] = { + &ahb0_clk, +}; + +void +ccu_sun8i_r_register_clocks(struct aw_ccung_softc *sc) +{ + int i; + + sc->resets = ccu_sun8i_r_resets; + sc->nresets = nitems(ccu_sun8i_r_resets); + sc->gates = ccu_sun8i_r_gates; + sc->ngates = nitems(ccu_sun8i_r_gates); + + for (i = 0; i < nitems(prediv_mux_clks); i++) + aw_clk_prediv_mux_register(sc->clkdom, prediv_mux_clks[i]); + for (i = 0; i < nitems(div_clks); i++) + clknode_div_register(sc->clkdom, div_clks[i]); + for (i = 0; i < nitems(fixed_factor_clks); i++) + clknode_fixed_register(sc->clkdom, fixed_factor_clks[i]); +} Added: head/sys/arm/allwinner/clkng/ccu_sun8i_r.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/clkng/ccu_sun8i_r.h Sat Oct 7 16:48:42 2017 (r324383) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2017 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __CCU_SUN8I_R_H__ +#define __CCU_SUN8I_R_H__ + +void ccu_sun8i_r_register_clocks(struct aw_ccung_softc *sc); + +#endif /* __CCU_SUN8I_R_H__ */ Modified: head/sys/arm/allwinner/h3/files.h3 ============================================================================== --- head/sys/arm/allwinner/h3/files.h3 Sat Oct 7 09:47:31 2017 (r324382) +++ head/sys/arm/allwinner/h3/files.h3 Sat Oct 7 16:48:42 2017 (r324383) @@ -1,5 +1,6 @@ # $FreeBSD$ arm/allwinner/clkng/ccu_h3.c standard +arm/allwinner/clkng/ccu_sun8i_r.c standard arm/allwinner/h3/h3_padconf.c standard arm/allwinner/h3/h3_r_padconf.c standard Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Sat Oct 7 09:47:31 2017 (r324382) +++ head/sys/conf/files.arm64 Sat Oct 7 16:48:42 2017 (r324383) @@ -43,6 +43,7 @@ arm/allwinner/clkng/aw_clk_nm.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_prediv_mux.c optional aw_ccu fdt arm/allwinner/clkng/ccu_a64.c optional aw_ccu fdt arm/allwinner/clkng/ccu_h3.c optional aw_ccu fdt +arm/allwinner/clkng/ccu_sun8i_r.c optional aw_ccu fdt arm/allwinner/if_awg.c optional awg fdt arm/annapurna/alpine/alpine_ccu.c optional al_ccu fdt From owner-svn-src-head@freebsd.org Sat Oct 7 17:24:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38651E3D560; Sat, 7 Oct 2017 17:24:25 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1F0C6866B; Sat, 7 Oct 2017 17:24:24 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v97HONDq090426; Sat, 7 Oct 2017 17:24:23 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v97HONMC090422; Sat, 7 Oct 2017 17:24:23 GMT (envelope-from np@FreeBSD.org) Message-Id: <201710071724.v97HONMC090422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 7 Oct 2017 17:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324386 - in head/sys: conf dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys: conf dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware X-SVN-Commit-Revision: 324386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Oct 2017 17:24:25 -0000 Author: np Date: Sat Oct 7 17:24:23 2017 New Revision: 324386 URL: https://svnweb.freebsd.org/changeset/base/324386 Log: cxgbe(4): Update T6, T5, and T4 firmwares to 1.16.63.0. Changes since 1.16.26.0 for all three firmwares are listed below. This list was obtained from the Release Notes of the Chelsio Unified Wire v3.5.05 release for Linux. T6 Firmware ++++++++++++ ================================================================================ Version : 1.16.63.0 Date : 09/29/2017 ================================================================================ Fixes ----- BASE: - Fixed a fw crash when configured traffic rate limit is less than 10kbps. - Fixed traffic rate limiting for smaller traffic rate value. ETH: - Fixed 40G link failure when interface is toggled. - Fixed adapter crash when interface is toggled during traffic. - Fixed 25G link failure when PEER only supports consortium mode autoneg for 25G. - Fixed 100G optics link failure when cable is plugged in after bringing up the interface. - Enable RS FEC as default if speed is 100G. - Fixed DCBX configuration refresh failure. OFLD - Fixed 0B iWARP ingress read failure. - Fixed iWARP SRQ reuse failure. FOiSCSI: - Fixed vlan interface ping failure. - Fixed target discovery failures. - Fixed mutual chap login failure. ================================================================================ Version : 1.16.59.0 Date : 09/05/2017 ================================================================================ FIXES ----- BASE: - Fixed fw crash caused by MC parity error in SO adapters. - Generate Timer0Int interrupt if fw crashes due to unaligned access error. Host driver must look into PCIE_FW register to see if any fw fatal error has encountered. If PCIE_FW doesn't indicate any error then driver must ignore this interrupt. - Fixed receive buffer threshold settings which was resulting in error frames on receive side. ETH: - Fixed an issue in connection traffic shaping when FLOWC_WR->FW_FLOWC_MNEM_SCHEDCLASS is not received in first WR on the connection. - Fixed link failure when speed is changed from 10G-1G-10G due to incorrect flag check. - Fixed improper LED behaviour for blink test and when traffic is running. - Removed storage of previous fec settings from fw. Driver needs to pass the user settings whenever a new module is plugged in as fw resets these when a module is unplugged. OFLD - OVS offload: TP cache is flushed periodically to get the accuate filters stats (hit count). ENHANCEMENTS ------------ BASE: - Ring backbone feature added. New FW_PARAMS_PARAM_DEV_RING_BACKBONE param type added to query and enable ring backbone support. - VNI support added for filtering. New entry_type FW_VI_MAC_TYPE_EXACTMAC_VNI added to FW_VI_MAC_CMD. - Added new API FW_PARAM_PARAM_DEV_MPSBGMAP to read the priority to buffer group mapping for the ports. - FW_PARAMS_PARAM_DEV_TPCHMAP API added to read the port to channel mapping. - HMA (Host memory access) support added. New FW_HMA_CMD and FW_PARAMS_PARAM_DEV_HMA_SIZE added to query and configure the HMA. It enables the memfree support (256 connections) for iwarp. - PTP support enabled. ETH: - Added consortium mode 50G support. - Added the ability to allow only selected speeds to be advertised during auto negotiation. - Increased port capability from 16 to 32 bits to support more speeds. FW_PARAMS_PARAM_PFVF_PORT_CAPS32 added to query whether fw supports 16 or 32 bit port capability. OFLD: - RDMA Write with immediate support added (iwarp 2.0 feature) - FW_TLS_KEYCTX_TX_WR removed and security key management moved to driver. - 256 offloaded connections support for iwarp on SO adapters. iSCSI: - New param FW_PARAMS_PARAM_DEV_PPOD_EDRAM added for iscsi ppod configuration in EDRAM (performance improvement). FOiSCSI: - iSCSI Command offload target support added. FOFCoE: - FCoE support enabled. ================================================================================ Version : 1.16.43.0 Date : 05/05/2017 ================================================================================ FIXES ----- BASE: - Fixed default DCB mode to AUTO. - Fixed DCBX bugs when AUTO mode is configured in config file. - Fixed an issue where even after removing PFC from switch, PFC wasn't getting reset. - Fixed DDR3/DDR4 ECC errors. - Fixed an FLR issue where FLR completion was going to host before FLR processing is finished in fw. ETH: - Fixed bug in writing multi-bytes using i2c interface. - Fixed the link failure when optical cable is inserted into the QSA module after loading the driver. - Fixed false link up when peer interface was brought down. - Enabling RS FEC by default for 100Gbase-SR4 according to 802.3BJ standard. - Fixed bugs related to negotiated fec based local/peer fec ability and request. - Fixed auto-neg failure with few switches. - T6 Performance improvement fixes. OFLD - Fixed an extra credit issue if FW_RI_TYPE_FINI is delayed in fw due to backpressure. - Added a new queue type FW_IQ_TYPE_VF_CQ to handle the FW_PARAMS_PARAM_DMAQ* commands. queue type will be part of the FW_PARAMS_PARAM_DMAQ_IQ_INTIDX value. Used in guest RDMA (RDMA from VM/VF) usecase. - T6 Crypto Coprocessor mode bug fixes. - T6 Crypto TLS-inline mode bug fixes. ENHANCEMENTS ------------ BASE: - Added new API FW_PARAM_PARAM_DEV_MPSBGMAP to read the priority to buffer group mapping for the ports. ETH: - Added broadcom consortium next page support for 25G CR. This can be enabled using flags=an_brcm option in the t6-config.txt file. - Added spider mode support. - Added support for 10G-BaseT converter sfp+ module. - Added support for additional 25G/100G cables. - Added support to enable/disable auto-neg using ethtool. ================================================================================ Version : 1.16.33.0 Date : 02/24/2017 ================================================================================ Fixes ----- BASE: - Fixed DDR4 uncorrectable errors. ETH: - Enabled link auto negotiation (AN) by default in config file. - Added AN and FEC control api. Host driver and application can enable/disable AN and FEC. ENHANCEMENTS ------------ BASE: - Enabled High priorty filter. - Added T6425 adapter support. ETH: - Added new workrequest ETH_TX_PKTS2_WR (see fw api document for more details). ================================================================================ Version : 1.16.29.0 Date : 01/27/2017 ================================================================================ FIXES ----- BASE: - Set multiple fec values only if AN is enabled in config file and when module is connected. - Fixed intermittent DDR3/4 ECC errors. - max number of ethctrl queue in VF set to 2 (reverted the last change because it causes problem in VF drivers). ETH: - Made devlog more verbose by printing cable information in redable form. - Updated AN settings to work with more 25G/100G switches. - Added support for more SFP28/QSFP28 cables. - Fixed an issue of link going down after few hours of idle time. OFLD: - Fixed an issue in TLS which was causing fw crash on running TLS traffic. FOiSCSI: - Fixed the failure of PXE boot OS install on an iscsi lun. ENHANCEMENTS ------------ OFLD: - Added filtering support for NAT. New WR FW_FILTER2_WR and FW_PARAMS_PARAM_DEV_FILTER2_WR added for the same. - Added RDMA guest mode (mode 3 or RDMA from VF) support. ================================================================================ T5 Firmware ++++++++++++ ================================================================================ Version : 1.16.63.0 Date : 09/29/2017 ================================================================================ Fixes ----- BASE: - Fixed offload memory overcommit in case of SO adapter. ETH: - Fixed DCBX configuration refresh failure. OFLD - Fixed 0B iWARP ingress read failure. FOiSCSI: - Fixed vlan interface ping failure. ================================================================================ Version : 1.16.59.0 Date : 09/05/2017 ================================================================================ FIXES ----- BASE: - Fixed an FLR issue which was causing error when VF attached VM was powered on. ETH: - Fixed an issue in connection traffic shaping when FLOWC_WR->FW_FLOWC_MNEM_SCHEDCLASS is not received in first WR on the connection. - Fixed link failure when speed is changed from 10G-1G-10G due to incorrect flag check. - Fixed T580 link failure with few switches which take more time for establishing link. ENHANCEMENTS ------------ BASE: - Ring backbone feature added. New FW_PARAMS_PARAM_DEV_RING_BACKBONE param type added to query and enable ring backbone support. - Added new API FW_PARAM_PARAM_DEV_MPSBGMAP to read the priority to buffer group mapping for the ports. - FW_PARAMS_PARAM_DEV_TPCHMAP API added to read the port to channel mapping. FOiSCSI: - iSCSI Command offload target support added. ================================================================================ Version : 1.16.43.0 Date : 05/05/2017 ================================================================================ FIXES ----- BASE: - Fixed default DCB mode to AUTO. - Fixed DCBX bugs when AUTO mode is configured in config file. - Fixed an issue where even after removing PFC from switch, PFC wasn't getting reset. ETH: - Fixed bug in writing multi-bytes using i2c interface. - Fixed the link failure when optical cable is inserted into the QSA module after loading the driver. OFLD - Fixed an extra credit issue if FW_RI_TYPE_FINI is delayed in fw due to backpressure. - Added a new queue type FW_IQ_TYPE_VF_CQ to handle the FW_PARAMS_PARAM_DMAQ* commands. queue type will be part of the FW_PARAMS_PARAM_DMAQ_IQ_INTIDX value. Used in guest RDMA (RDMA from VM/VF) usecase. ENHANCEMENTS ------------ BASE: - Added new API FW_PARAM_PARAM_DEV_MPSBGMAP to read the priority to buffer group mapping for the ports. ================================================================================ Version : 1.16.33.0 Date : 02/24/2017 ================================================================================ ENHANCEMENTS ------------ ETH: - Added new workrequest ETH_TX_PKTS2_WR (see fw api document for more details). ================================================================================ Version : 1.16.29.0 Date : 01/27/2017 ================================================================================ FIXES ----- BASE: - max number of ethctrl queue in VF set to 2 (reverted the last change because it causes problem in VF drivers). FOiSCSI: - Fixed the failure of PXE boot OS install on an iscsi lun. ENHANCEMENTS ------------ OFLD: - Added filtering support for NAT. New WR FW_FILTER2_WR and FW_PARAMS_PARAM_DEV_FILTER2_WR added for the same. - Added RDMA guest mode (mode 3 or RDMA from VF) support. ================================================================================ T4 Firmware +++++++++++ ================================================================================ Version : 1.16.63.0 Date : 09/29/2017 ================================================================================ Fixes ----- ETH: - Fixed DCBX configuration refresh failure. FOiSCSI: - Fixed vlan interface ping failure. ================================================================================ Version : 1.16.59.0 Date : 09/05/2017 ================================================================================ FIXES ----- ETH: - Fixed an issue in connection traffic shaping when FLOWC_WR->FW_FLOWC_MNEM_SCHEDCLASS is not received in first WR on the connection. ENHANCEMENTS ------------ BASE: - FW_PARAMS_PARAM_DEV_TPCHMAP API added to read the port to channel mapping. ================================================================================ Version : 1.16.43.0 Date : 05/05/2017 ================================================================================ FIXES ----- BASE: - Fixed default DCB mode to AUTO. - Fixed DCBX bugs when AUTO mode is configured in config file. - Fixed an issue where even after removing PFC from switch, PFC wasn't getting reset. ETH: - Fixed bug in writing multi-bytes using i2c interface. OFLD - Fixed an extra credit issue if FW_RI_TYPE_FINI is delayed in fw due to backpressure. - Added a new queue type FW_IQ_TYPE_VF_CQ to handle the FW_PARAMS_PARAM_DMAQ* commands. queue type will be part of the FW_PARAMS_PARAM_DMAQ_IQ_INTIDX value. Used in guest RDMA (RDMA from VM/VF) usecase. ENHANCEMENTS ------------ BASE: - Added new API FW_PARAM_PARAM_DEV_MPSBGMAP to read the priority to buffer group mapping for the ports. Obtained from: Chelsio Communications MFC after: 2 weeks Sponsored by: Chelsio Communications Added: head/sys/dev/cxgbe/firmware/t4fw-1.16.63.0.bin.uu (contents, props changed) head/sys/dev/cxgbe/firmware/t5fw-1.16.63.0.bin.uu (contents, props changed) head/sys/dev/cxgbe/firmware/t6fw-1.16.63.0.bin.uu (contents, props changed) Deleted: head/sys/dev/cxgbe/firmware/t4fw-1.16.59.0.bin.uu head/sys/dev/cxgbe/firmware/t5fw-1.16.59.0.bin.uu head/sys/dev/cxgbe/firmware/t6fw-1.16.59.0.bin.uu Modified: head/sys/conf/files head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt head/sys/modules/cxgbe/t4_firmware/Makefile head/sys/modules/cxgbe/t5_firmware/Makefile head/sys/modules/cxgbe/t6_firmware/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Oct 7 17:20:31 2017 (r324385) +++ head/sys/conf/files Sat Oct 7 17:24:23 2017 (r324386) @@ -1427,7 +1427,7 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.16.59.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.16.63.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t4fw.fw" @@ -1461,7 +1461,7 @@ t5fw.fwo optional cxgbe \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.16.59.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.16.63.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t5fw.fw" @@ -1495,7 +1495,7 @@ t6fw.fwo optional cxgbe \ no-implicit-rule \ clean "t6fw.fwo" t6fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t6fw-1.16.59.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t6fw-1.16.63.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t6fw.fw" Added: head/sys/dev/cxgbe/firmware/t4fw-1.16.63.0.bin.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/firmware/t4fw-1.16.63.0.bin.uu Sat Oct 7 17:24:23 2017 (r324386) @@ -0,0 +1,9567 @@ +/*- + * Copyright (c) 2017 Chelsio Communications, 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. + */ +begin-base64 644 t4fw +AAAEJgEQPwAAAQkEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAABAkEGAQgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAENoZWxzaW8gRlcgUlVOTUVNIERFQlVHPTAgKEJ1aWx0IEZyaSBTZXAgIDggMTA6 +MTg6MzMgUERUIDIwMTcgb24gdm5jNC5hc2ljZGVzaWduZXJzLmNvbTovaG9tZS9maXJtd2FyZS9j +dnMvZnctcmVsZWFzZSksIFZlcnNpb24gVDR4eCAwMS4xMC4zZi4wMAAAAAAAAAAAAAAAABRhxKxg +AMgA4QB78AAQAADhADC4eP///x/84UCAAAAB4QB7cAAAEAAf//4A4QGUcCAAAADhAZwE4QB5AAAC +AEDhAHmAAAYAQAACAAoABgAK4QB5BAAMAACAAAEC4QB7POEAe0ThAHvk4gAAAAABAADhAHuQIAAA +AAAAgADhAHsAAABAAeEAe5wAAEAAREREQuAAAADjAARzREREQOMACAAgAAJcAAAAAB//jhAAAAAA +H/+OFAAAAAAf/44YAAAAAB//jhwf/8AAAAAAAAAAAADAABL/zRP/zZMgEv/NE//NhCAEMwGTIBH/ +zBL/zJIQEf/MEv/MkhAR/8wB9DER/8siCv+SEADkMQAFMQECABL/yALnMQIWABH/x4EQAQFfwCEC +EQHJERH/xBL/xJIQEf/EEv/EkhBgAA8R/78S/8OSEBH/vxL/wpIQgRAR/8HAIJIREv/AkhLAIJIT +Ev+/khCCEALyUGUv9xH/vccvkhAR/7ySEBL/vBP/vJMgwDKTIRP/u5MigiIS/7oT/7qTICMiIRT/ +uQQzAck4E/+4gzADgxQIMxEU/7akM5MhE/+qkyJgAAjCMJMhE/+nkyIS/7GQIJAhkCKQI5AkkCWQ +JpAnkCiQKZAqkCuQLJAtkC6QLyAmECAmEYIiEv+kwDAtNzAtNzQtNzgtNzwjPQFyM+0AAgAS/6HA +MC83AC83EC83IC83MCM9AXIz7QACABL/l8AwKDcwKDc0KDc4KDc8Iz0BcjPtEv+VwDAnNwAnNxAn +NyAnNzAjPQFyM+0S/5AV/5AW/5HAMNcgBWYBYAAZAAAAAAAAAAQ2BQACANMP0w8FMwxuOxQHRxQH +BEN2MeYENgUFMwxvO+0AAgAS/4MV/4EjCgACJwIHBEMEPgUFMwwHRxRvO/ADAgAS/33JLoMghCGF +IrwidDsOhlC0VZYwtDN0M/Rj/+YAZT/iZV/fEv9xwDIDLgUDAgAS/2jAMCg3QCg3RCg3SCg3TCM9 +AXIz7QACABL/ay0nAMARAUkxAEgxAQIAwAAU/2gE0jEV/2eUUBT/ZwTTMRX/ZpRQFP9mBNQxFf9m +lFAU/2UE1TEV/2WUUBD/ZQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/AAA +H/wAAOMACfgf/AAAH/wAAOMACfgf/AAAH/wAAOMACfgf/4AAH/+FsOMACfgf/4WwH/+FsOMAD6gf +/4WwH/+FsOMAD6gf/4WwH/+HWOMAD6gf/4dYH/+OEOMAEVAf/44QH/+v4OMAGAgf/6/gH/+v4OMA +Odgf/8AAH//+7eMAOdggAAAAIAABauMAeMggAAF4IAABfOMAejQgAAF8IAABheMAejggAAGYIAAB +nOMAekQgAAGcIAABpeMAekggAAG4IAABvOMAelQgAAG8IAABxeMAelggAAHYIAAB2OMAemQgAAHc +IAAB4uMAemQgAAH4IAAB+OMAemwgAAH8IAAB/OMAemwgAAIYIAACGOMAemwgAAIcIAACHOMAemwg +AAI4IAACOOMAemwgAAI8IAACPOMAemwgAAJYIAACWOMAemwgAAJcIAACYuMAemwgAAJ4IAACeOMA +enQgAAJ8IAACguMAenQgAAKYIAH5KeMAenwgAwAAIAMXMOMCcRAgAxcwIAMXMOMCiEAgAxcwIAb7 +tOMCiEAgBvvAIAb/MOMGbNAgCAAAIAgS0OMGcEAgCBLQIAksJuMGgxAgCSwwIAks/OMHnHAgCwAA +IAsAAOMHnTwgCwAAIAsAAOMHnTwgCwAAIAt0COMHnTwAAAAAAAAAAAAAAAAgABQWIAAUCCAAF/Ig +ABQIIAAXbSAAFAggABS6IAAXBSAAFoogABQIIAAWOSAAFfIgABWFIAAT9SAAFS8gABQIIAAUCCAA +FAggABTaAAAAAP///////w/8///w////APwgALbmIAC4WiAAuIogALhQIAC4ESAAuAcgALfWIAC3 +zCAAt8AgALdvIAC4iCAAt2UgALc1IAC4iiAAtysgALcZARAYAQAEAAAAAAAAAAAAAAACAgUFCAgL +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 +H/+AsB//rFBnRSMB782riZi63P4QMlR2H/+AAAAAPyggAxBcz////yALBfAQAAAAP////wIAAABA +AAAAGgAAAB/84HQgoAAAH/+naCAAHeAgAB98gAAAAAAAgAD//v//AAAQAABAAAAgADqUIAAi5CAA +AAAgACNIIAsIwP//f///+///D/aAACALCPAgCwkgAAEAAAAEAAAf/6fYIAtRYCALCbAgADSoIAA1 ++CAAMtwgCwtQIAsKECALCqAgADEkIAsK8FMAAAAA////UgAAAFEAAAAgAek0H/+l4AAA//8gBAv4 +H/+piCAAOfgf/6mwIAsLcB//mMQf/6lUIAsNkBQAAACAAAACfFAAAIAAABCAAAAGgACwAAAACgAA +/zSS///wD4AAsQDhAZoAAAIAACALDSAf/5Y4AAB+QCALDWAf/6mEAP/AAAEAAAAoAAAA4AAAACYA +AAAf/48gBgAAAAWAAAAf/6U4KwAAACAAVZggC1OwH/+nBAOAAAAH////BAEACDUAAAADAAAAAD// +/4BAAAAID///H////wAAwAAf/6loPQAAAB//lLAHAAAAgQQBAIEEAAAf/6lAAAA6mMMAAAAAAA// +AEMAAB//psgAAAgABAAAACALVBAf/68UH/+tYB//lBAABgAA4QB6AB//lIAf/6l0H/+Y1B//mMAg +C1RAAAMHgCALVLAIAAAAH/+WoAAgAAAAAAkAAAAwAv/8+H/AAAAAo/+7AKP/ugANAAAA4AMAAIP/ +tgAP////D//4AP8AAAAgC1TwIAsO0CALDwAgC1WAAA8AAAAKAAD//wAPA//AAIP/wAAgC1YAIAtW +cB//qlgf/63Q/2DwAB//rbAf/44gBIAACB//gFAARAAA/x///wDAAAABgMIAAAICAOEAAADhAOAA +AACBAPAAAACBgAAA/3///x//pBT/v/////8AAACAAAAAAIbdH/+aHB/84gAf/48Q7gAAAAAACcwf +/OIMDwAAACALD0Af/6n4AAAIzB//qwQf/5qYH/+UrB//gGAgBv1gAAAwAAAAJxAf/9zwIAtdICAL +XPAf/6pkH/+UpAAA//4f/5i03q2+7yADCCA0AAAAPwAAAB//qzQAAIkGAJkAAB//rNgQAAcCAcCA +AJkAAAAf/6ugAIgACIKAAAEf/60o///wAAMVAAADEQAAAA8D/yAA8BQgAPQAKQAAAAAAiRQgAPjU +IAMLRAAAQAAgAw5wDAAAACABA7gf/63wAAAfkCADC1Qf/6rgH/+r+B//qYz/AP8A8PDw8KqqqqrM +zMzMH/+liAAD//8AACf/IAMLmCALXXAgARQQAA9CQCADXVAf/6ooAAkAAAAASACCAAAAIAEocB// +qdw7AAAIDgAAANAAAAAf/4CgAAAgegAACFAAAB9AH/+plCALHoAgCx6gIAsewAAJAAgf/60kMAAA +AH8AAAAgCyHgAAAP/iALIRAgCyFwIAshsAAA4AD///f/IAsicCADY5wAAIP/IAcDaBWgAAAgBwRg +H/+s6AAACAYAAIjMH/+WUAAEA/8KAAAAIAb/+CAHAZggBwBAH/+ZYIP/twCD/7YgIAsioDMAAAAf +/6zwH/+t5AP/4AB///8AAD/2kAAAIIgD//AAIAtIMCALR/AgC0hQH/+u8B//rOwAD///H/+q8B// +qZAgC2EQH/+Y9CAAcuggBvzoIAAFiB//pGAf/5XMH/+UTB//qMQgCyMgwAQAAB//p4Af/6d0H/+n +jB//raAf/60UIAPlMCALI2AgAw8gH/+ljCAAc8jgAQAAH/+aICALYkAgCyOgH/+aGCAAszAgALAw +IAthwCALYhAf/5ZwIAslsOD//gAgC0rQH/+aJCALMIAf/47kH/+QnB//qYAf/62UIAs88CALPSBI +AAAAIAG8CB//pxQgAb4MH/+VAB//pewf/6TkH/+n1B//pKwAABhAAAAWTB//p+QgBv90H/+lNB// +lIThAC4AH/+n8OEAXgDhAg4A//+//+EADgDhAY4A//++/x//mLwf/6W8IAHDOCABz2DgBQAAA/8A +AB//pPQgAw54H/y//zwAAAAABf//gwAAAB//pOwPPAAAIAtHsCAB76wgAfKoH/+qdCAB9mAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAACBgAAAAAAAAP////////////////////8f//zoH//86B///LAf//ywH//8sB// +/LAf//Y4H//5YB//97wf//e8H//3vCAG03gAAAAAAAAAAAAAAAAAAAAAIAbWwCAG1sAAAAAAAAAA +AAAAAAAAAAAAIAbTeCAG03gf//pUH//6VB//+lQf//pUH//6VB//+lQAAAAAIAHEUAAAAAAAAAAA +AAAAAAAAAAACAQAAAAAAAAAAAAAAAAAABAAAAAAAAACBgAAAAAAAEAUAAAAAAAAEAAAAAAAAAAAA +AAAAAAAAAIEAAAAAAAAYBQAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +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 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Oct 7 17:40:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBCC3E3D896; Sat, 7 Oct 2017 17:40:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 882346C0AC; Sat, 7 Oct 2017 17:40:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v97HeVUw094886; Sat, 7 Oct 2017 17:40:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v97HeV0W094885; Sat, 7 Oct 2017 17:40:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201710071740.v97HeV0W094885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 7 Oct 2017 17:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324388 - head/sys/boot/efi/loader X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/sys/boot/efi/loader X-SVN-Commit-Revision: 324388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Oct 2017 17:40:33 -0000 Author: ngie Date: Sat Oct 7 17:40:31 2017 New Revision: 324388 URL: https://svnweb.freebsd.org/changeset/base/324388 Log: Unbreak building efiboot with MK_ZFS == no Wrap `efi_zfs_is_preferred` with `#ifdef EFI_ZFS_BOOT`. Reported by: Guy Yur Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Sat Oct 7 17:32:39 2017 (r324387) +++ head/sys/boot/efi/loader/main.c Sat Oct 7 17:40:31 2017 (r324388) @@ -74,12 +74,13 @@ EFI_GUID inputid = SIMPLE_TEXT_INPUT_PROTOCOL; static EFI_LOADED_IMAGE *img; +#ifdef EFI_ZFS_BOOT bool efi_zfs_is_preferred(EFI_HANDLE *h) { return (h == img->DeviceHandle); } - +#endif static int has_keyboard(void) From owner-svn-src-head@freebsd.org Sat Oct 7 17:41:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9376BE3DA3D; Sat, 7 Oct 2017 17:41:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22c.google.com (mail-pf0-x22c.google.com [IPv6:2607:f8b0:400e:c00::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 4B79F6C52F; Sat, 7 Oct 2017 17:41:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22c.google.com with SMTP id z11so997694pfk.4; Sat, 07 Oct 2017 10:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=pTsk/Gvesi32od/13sZ3LndyBpXerq1K4SsgMOOr/zw=; b=BtUxxQ+3o7NesH9M5QAYpuCyFaiRdOOrd/EhIgcKXwYQGh19DIAKW9ASJOrnHYpxQP sKt/n964lvk+Cf0pKEdK7jxTUi7RVV4aLCRAICtYRJaAe8oNO/Vy4yk17j3aSYQ/ZxuO 74l+UVf6jU/ObIktd5YkJXi12gExWKiR2unVWziQSF6WwgKFeQrJo/ZY9fWP+AhRPhLE jdpFCpiqf39nK563VD4M5QuawyYYxJ0wF/6hbmxNHSoL1vTek4XBq0LEUdqflxECPuBO BQG05FMKKkJ4Fu+I38NaWgTEJIPQcys/hEh9G79s6zD1oOCW928JggUb9+AkXERbmGOi qEHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=pTsk/Gvesi32od/13sZ3LndyBpXerq1K4SsgMOOr/zw=; b=SacSZ6pFLlWjuoyqFjTDKBqDPasHWIfeJ3U/gbx4AjQO2jch6+18SNy05BwqHNNZpE jzFT1nnUx/kqTszK1YoakiWhGtda7e80WwaJtlw6AY7BgJsVQulnT/sZguWiIHMW8yJT 9NzVg+3sO8A4xktvg000JZd/B7fX3lz1OhzXXKnm13hwGc8crtlgg+kOHkPTLP0VXds5 a+LQxRRjfmdXpEx4vKSBwbKqkpoJWZhljMRugCFb1HV9rFfkuwQvK1/sQaXcUxRd9bdT rBEy6383TKRF9yJffFkIMV5z5K5zB9LA0+VyykgVRvoWQAo8tO+49pYDyoKHMF9+/mSg sndw== X-Gm-Message-State: AMCzsaUiqM5/dZLLJQaBk7pHF9y6VASUMAo73rm0dNLLrUxB4E52OBU5 1i6wExiOU5NDQFlIsLGscfHApCvr X-Google-Smtp-Source: AOwi7QDeMmruuo1+dySR2ofbjmTdknzEMOorT1ytWN2r50UQtbGn+rrvvYjhXg2Kg2qElkvXXC/wBQ== X-Received: by 10.159.198.72 with SMTP id y8mr5219789plt.410.1507398080755; Sat, 07 Oct 2017 10:41:20 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id v69sm9919789pfd.75.2017.10.07.10.41.19 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 07 Oct 2017 10:41:20 -0700 (PDT) Subject: Re: svn commit: r324360 - in head/sys/boot/efi: include libefi loader Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_AFF3218D-9CC1-4A03-B0EA-379ED74F0AFC"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Sat, 7 Oct 2017 10:41:18 -0700 Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <4EAC495A-0CC8-4781-9F04-A5F1B7E293D4@gmail.com> References: <201710061221.v96CLko0046237@repo.freebsd.org> To: Guy Yur X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Oct 2017 17:41:21 -0000 --Apple-Mail=_AFF3218D-9CC1-4A03-B0EA-379ED74F0AFC Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Oct 7, 2017, at 09:29, Guy Yur wrote: > > On 6 October 2017 at 15:21, Warner Losh wrote: >> Author: imp >> Date: Fri Oct 6 12:21:46 2017 >> New Revision: 324360 >> URL: https://svnweb.freebsd.org/changeset/base/324360 >> >> Log: >> Encapsulate ZFS preferences into efi_zfs_is_preferred >> >> Move the retrieval of the image information into loader's main instead >> of doing it in efizfs.c >> >> Differential Revision: https://reviews.freebsd.org/D12564 >> Submitted by: Eric McCorkle >> >> Modified: >> head/sys/boot/efi/include/efizfs.h >> head/sys/boot/efi/libefi/efizfs.c >> head/sys/boot/efi/loader/main.c >> >> ... > > Hi, > > When setting WITHOUT_ZFS in src.conf the build fails with: > > /usr/src/sys/boot/efi/loader/main.c:78:1: error: no previous prototype > for function 'efi_zfs_is_preferred' > [-Werror,-Wmissing-prototypes] > efi_zfs_is_preferred(EFI_HANDLE *h) > ^ > 1 error generated. > *** Error code 1 > > > The prototype is under #ifdef EFI_ZFS_BOOT guard but the function is not. Fixed: r324388. Thanks! -Ngie --Apple-Mail=_AFF3218D-9CC1-4A03-B0EA-379ED74F0AFC 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 iQIcBAEBCgAGBQJZ2RG/AAoJEPWDqSZpMIYVPGIP/RCxIj8Ej1vsDW1lhORxOpiY a471gULrl9YYbxJqU5JtGonT0xuCbDYhTUVg2LIlkIOM85jwU3+9LpYR/z9zjcoG qZM9olbQhPMXcKX7UI/QFoiBbSqF9RGL1/+VRAW5yi1iEIcpfLK77lxJvxk8VlLX YKJjkpEmOGks6+W/Wm8P427Uqr9/73F+LBXTs63SU6Dy9RAtbBlBB2vjbplK+MYF Cogt92QeC9Lo10eMqbxdFG914BoJ0/LUruEx1jGx6REddOd0y0F6FDAJ3A98iBuk oAvLJ4aX1i6WN5fiou2O0Wn2UAZ+B7zBl/Rx3yaPov+EZD5oEClbAmf8BVX+ZTB4 Gu8UPpA05ONXLICwoMpAGqska846kxSf5eGvtP88QKD9sXY3QBh+2+xc9mH6k8fL 61ntVlZx3FnfiYySv8fekpT0BFl6Jzhl+D0D6G9lO1It1LuzTwnPS1WYG7tbLt/h YHyZQLSOsNg0CV91Ht5eupGFBSqOWihA3cOnhV/zF51DPSt2KEY+vPvlovub0N7s 6F8QKYHErkQjU/T04Y6/mzoEYjskWA2HEQIRb7SmP7PMLSLIxThZxMdAR9va3kdI /WZtNpYf6K5L4PeV7z/gFiULd9mQs+y5G8VqMS2ccgcIzKEcFNqdc9ewL8JF93Dw zew4Qy/evcqo0wVvm3Vr =EdHq -----END PGP SIGNATURE----- --Apple-Mail=_AFF3218D-9CC1-4A03-B0EA-379ED74F0AFC-- From owner-svn-src-head@freebsd.org Sat Oct 7 18:59:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3850BE3F338; Sat, 7 Oct 2017 18:59:31 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED9AD80C4E; Sat, 7 Oct 2017 18:59:30 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v97IxTPf029386; Sat, 7 Oct 2017 18:59:29 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v97IxTEx029384; Sat, 7 Oct 2017 18:59:29 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201710071859.v97IxTEx029384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 7 Oct 2017 18:59:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324393 - in head/sys: dev/random sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: dev/random sys X-SVN-Commit-Revision: 324393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Oct 2017 18:59:31 -0000 Author: cem Date: Sat Oct 7 18:59:29 2017 New Revision: 324393 URL: https://svnweb.freebsd.org/changeset/base/324393 Log: random(4): Add missing source descriptions Add source descriptions missed in r260847, r303035. While here, convert the array to C99 initializers. Reviewed by: delphij Approved by: secteam (delphij) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12618 Modified: head/sys/dev/random/random_harvestq.c head/sys/sys/random.h Modified: head/sys/dev/random/random_harvestq.c ============================================================================== --- head/sys/dev/random/random_harvestq.c Sat Oct 7 18:49:39 2017 (r324392) +++ head/sys/dev/random/random_harvestq.c Sat Oct 7 18:59:29 2017 (r324393) @@ -260,26 +260,28 @@ random_print_harvestmask(SYSCTL_HANDLER_ARGS) return (error); } -static const char *(random_source_descr[]) = { - "CACHED", - "ATTACH", - "KEYBOARD", - "MOUSE", - "NET_TUN", - "NET_ETHER", - "NET_NG", - "INTERRUPT", - "SWI", - "FS_ATIME", - "UMA", /* ENVIRONMENTAL_END */ - "PURE_OCTEON", - "PURE_SAFE", - "PURE_GLXSB", - "PURE_UBSEC", - "PURE_HIFN", - "PURE_RDRAND", - "PURE_NEHEMIAH", - "PURE_RNDTEST", +static const char *random_source_descr[ENTROPYSOURCE] = { + [RANDOM_CACHED] = "CACHED", + [RANDOM_ATTACH] = "ATTACH", + [RANDOM_KEYBOARD] = "KEYBOARD", + [RANDOM_MOUSE] = "MOUSE", + [RANDOM_NET_TUN] = "NET_TUN", + [RANDOM_NET_ETHER] = "NET_ETHER", + [RANDOM_NET_NG] = "NET_NG", + [RANDOM_INTERRUPT] = "INTERRUPT", + [RANDOM_SWI] = "SWI", + [RANDOM_FS_ATIME] = "FS_ATIME", + [RANDOM_UMA] = "UMA", /* ENVIRONMENTAL_END */ + [RANDOM_PURE_OCTEON] = "PURE_OCTEON", + [RANDOM_PURE_SAFE] = "PURE_SAFE", + [RANDOM_PURE_GLXSB] = "PURE_GLXSB", + [RANDOM_PURE_UBSEC] = "PURE_UBSEC", + [RANDOM_PURE_HIFN] = "PURE_HIFN", + [RANDOM_PURE_RDRAND] = "PURE_RDRAND", + [RANDOM_PURE_NEHEMIAH] = "PURE_NEHEMIAH", + [RANDOM_PURE_RNDTEST] = "PURE_RNDTEST", + [RANDOM_PURE_VIRTIO] = "PURE_VIRTIO", + [RANDOM_PURE_BROADCOM] = "PURE_BROADCOM", /* "ENTROPYSOURCE" */ }; Modified: head/sys/sys/random.h ============================================================================== --- head/sys/sys/random.h Sat Oct 7 18:49:39 2017 (r324392) +++ head/sys/sys/random.h Sat Oct 7 18:59:29 2017 (r324393) @@ -58,9 +58,9 @@ read_random(void *a __unused, u_int b __unused) #endif /* - * Note: if you add or remove members of random_entropy_source, remember to also update the - * KASSERT regarding what valid members are in random_harvest_internal(), and remember the - * strings in the static array random_source_descr[] in random_harvestq.c. + * Note: if you add or remove members of random_entropy_source, remember to + * also update the strings in the static array random_source_descr[] in + * random_harvestq.c. * * NOTE: complain loudly to markm@ or on the lists if this enum gets more than 32 * distinct values (0-31)! ENTROPYSOURCE may be == 32, but not > 32. From owner-svn-src-head@freebsd.org Sat Oct 7 19:02:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE00DE3F48A; Sat, 7 Oct 2017 19:02:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82532815B7; Sat, 7 Oct 2017 19:02:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v97J23pj031297; Sat, 7 Oct 2017 19:02:03 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v97J23An031294; Sat, 7 Oct 2017 19:02:03 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201710071902.v97J23An031294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 7 Oct 2017 19:02:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324394 - in head/sys: dev/random sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: dev/random sys X-SVN-Commit-Revision: 324394 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Oct 2017 19:02:05 -0000 Author: cem Date: Sat Oct 7 19:02:03 2017 New Revision: 324394 URL: https://svnweb.freebsd.org/changeset/base/324394 Log: random(4): Gather entropy from Pure sources At initialization, hc_source_mask only includes non-Pure sources. The patch changes source registration to enable the registered source in the hc_source_mask bitmask. This mask governs which sources are harvested. This patch also disallows userspace from disabling such sources. PR: 222807 Submitted by: W. Dean Freeman Reviewed by: jmg (earlier version), delphij Approved by: secteam (delphij) Obtained from: HBSD 0054e3e170e083811acc9f3b637f8be8a86c03e7 Security: yes Differential Revision: https://reviews.freebsd.org/D12611 Modified: head/sys/dev/random/random_harvestq.c head/sys/dev/random/randomdev.c head/sys/sys/random.h Modified: head/sys/dev/random/random_harvestq.c ============================================================================== --- head/sys/dev/random/random_harvestq.c Sat Oct 7 18:59:29 2017 (r324393) +++ head/sys/dev/random/random_harvestq.c Sat Oct 7 19:02:03 2017 (r324394) @@ -1,4 +1,6 @@ /*- + * Copyright (c) 2017 Oliver Pinter + * Copyright (c) 2017 W. Dean Freeman * Copyright (c) 2000-2015 Mark R V Murray * Copyright (c) 2013 Arthur Mesh * Copyright (c) 2004 Robert N. M. Watson @@ -240,8 +242,28 @@ read_rate_increment(u_int chunk) } /* ARGSUSED */ -RANDOM_CHECK_UINT(harvestmask, 0, RANDOM_HARVEST_EVERYTHING_MASK); +static int +random_check_uint_harvestmask(SYSCTL_HANDLER_ARGS) +{ + int error; + u_int value, orig_value; + orig_value = value = harvest_context.hc_source_mask; + error = sysctl_handle_int(oidp, &value, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + + if (flsl(value) > ENTROPYSOURCE) + return (EINVAL); + + /* + * Disallow userspace modification of pure entropy sources. + */ + harvest_context.hc_source_mask = (value & ~RANDOM_HARVEST_PURE_MASK) | + (orig_value & RANDOM_HARVEST_PURE_MASK); + return (0); +} + /* ARGSUSED */ static int random_print_harvestmask(SYSCTL_HANDLER_ARGS) @@ -252,7 +274,7 @@ random_print_harvestmask(SYSCTL_HANDLER_ARGS) error = sysctl_wire_old_buffer(req, 0); if (error == 0) { sbuf_new_for_sysctl(&sbuf, NULL, 128, req); - for (i = RANDOM_ENVIRONMENTAL_END; i >= 0; i--) + for (i = ENTROPYSOURCE - 1; i >= 0; i--) sbuf_cat(&sbuf, (harvest_context.hc_source_mask & (1 << i)) ? "1" : "0"); error = sbuf_finish(&sbuf); sbuf_delete(&sbuf); @@ -272,7 +294,7 @@ static const char *random_source_descr[ENTROPYSOURCE] [RANDOM_SWI] = "SWI", [RANDOM_FS_ATIME] = "FS_ATIME", [RANDOM_UMA] = "UMA", /* ENVIRONMENTAL_END */ - [RANDOM_PURE_OCTEON] = "PURE_OCTEON", + [RANDOM_PURE_OCTEON] = "PURE_OCTEON", /* PURE_START */ [RANDOM_PURE_SAFE] = "PURE_SAFE", [RANDOM_PURE_GLXSB] = "PURE_GLXSB", [RANDOM_PURE_UBSEC] = "PURE_UBSEC", @@ -291,15 +313,22 @@ random_print_harvestmask_symbolic(SYSCTL_HANDLER_ARGS) { struct sbuf sbuf; int error, i; + bool first; + first = true; error = sysctl_wire_old_buffer(req, 0); if (error == 0) { sbuf_new_for_sysctl(&sbuf, NULL, 128, req); - for (i = RANDOM_ENVIRONMENTAL_END; i >= 0; i--) { - sbuf_cat(&sbuf, (i == RANDOM_ENVIRONMENTAL_END) ? "" : ","); + for (i = ENTROPYSOURCE - 1; i >= 0; i--) { + if (i >= RANDOM_PURE_START && + (harvest_context.hc_source_mask & (1 << i)) == 0) + continue; + if (!first) + sbuf_cat(&sbuf, ","); sbuf_cat(&sbuf, !(harvest_context.hc_source_mask & (1 << i)) ? "[" : ""); sbuf_cat(&sbuf, random_source_descr[i]); sbuf_cat(&sbuf, !(harvest_context.hc_source_mask & (1 << i)) ? "]" : ""); + first = false; } error = sbuf_finish(&sbuf); sbuf_delete(&sbuf); @@ -321,8 +350,7 @@ random_harvestq_init(void *unused __unused) SYSCTL_ADD_PROC(&random_clist, SYSCTL_CHILDREN(random_sys_o), OID_AUTO, "mask", CTLTYPE_UINT | CTLFLAG_RW, - &harvest_context.hc_source_mask, 0, - random_check_uint_harvestmask, "IU", + NULL, 0, random_check_uint_harvestmask, "IU", "Entropy harvesting mask"); SYSCTL_ADD_PROC(&random_clist, SYSCTL_CHILDREN(random_sys_o), @@ -493,6 +521,20 @@ random_harvest_direct(const void *entropy, u_int size, memcpy(event.he_entropy, entropy, size); random_harvestq_fast_process_event(&event); explicit_bzero(&event, sizeof(event)); +} + +void +random_harvest_register_source(enum random_entropy_source source) +{ + + harvest_context.hc_source_mask |= (1 << source); +} + +void +random_harvest_deregister_source(enum random_entropy_source source) +{ + + harvest_context.hc_source_mask &= ~(1 << source); } MODULE_VERSION(random_harvestq, 1); Modified: head/sys/dev/random/randomdev.c ============================================================================== --- head/sys/dev/random/randomdev.c Sat Oct 7 18:59:29 2017 (r324393) +++ head/sys/dev/random/randomdev.c Sat Oct 7 19:02:03 2017 (r324394) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2017 Oliver Pinter * Copyright (c) 2000-2015 Mark R V Murray * All rights reserved. * @@ -321,6 +322,8 @@ random_source_register(struct random_source *rsource) rrs = malloc(sizeof(*rrs), M_ENTROPY, M_WAITOK); rrs->rrs_source = rsource; + random_harvest_register_source(rsource->rs_source); + printf("random: registering fast source %s\n", rsource->rs_ident); LIST_INSERT_HEAD(&source_list, rrs, rrs_entries); } @@ -331,6 +334,9 @@ random_source_deregister(struct random_source *rsource struct random_sources *rrs = NULL; KASSERT(rsource != NULL, ("invalid input to %s", __func__)); + + random_harvest_deregister_source(rsource->rs_source); + LIST_FOREACH(rrs, &source_list, rrs_entries) if (rrs->rrs_source == rsource) { LIST_REMOVE(rrs, rrs_entries); Modified: head/sys/sys/random.h ============================================================================== --- head/sys/sys/random.h Sat Oct 7 18:59:29 2017 (r324393) +++ head/sys/sys/random.h Sat Oct 7 19:02:03 2017 (r324394) @@ -81,7 +81,8 @@ enum random_entropy_source { RANDOM_UMA, /* Special!! UMA/SLAB Allocator */ RANDOM_ENVIRONMENTAL_END = RANDOM_UMA, /* Fast hardware random-number sources from here on. */ - RANDOM_PURE_OCTEON, + RANDOM_PURE_START, + RANDOM_PURE_OCTEON = RANDOM_PURE_START, RANDOM_PURE_SAFE, RANDOM_PURE_GLXSB, RANDOM_PURE_UBSEC, @@ -95,6 +96,7 @@ enum random_entropy_source { }; #define RANDOM_HARVEST_EVERYTHING_MASK ((1 << (RANDOM_ENVIRONMENTAL_END + 1)) - 1) +#define RANDOM_HARVEST_PURE_MASK (((1 << ENTROPYSOURCE) - 1) & (-1UL << RANDOM_PURE_START)) #define RANDOM_LEGACY_BOOT_ENTROPY_MODULE "/boot/entropy" #define RANDOM_CACHED_BOOT_ENTROPY_MODULE "boot_entropy_cache" @@ -104,10 +106,14 @@ enum random_entropy_source { void random_harvest_queue(const void *, u_int, u_int, enum random_entropy_source); void random_harvest_fast(const void *, u_int, u_int, enum random_entropy_source); void random_harvest_direct(const void *, u_int, u_int, enum random_entropy_source); +void random_harvest_register_source(enum random_entropy_source); +void random_harvest_deregister_source(enum random_entropy_source); #else #define random_harvest_queue(a, b, c, d) do {} while (0) #define random_harvest_fast(a, b, c, d) do {} while (0) #define random_harvest_direct(a, b, c, d) do {} while (0) +#define random_harvest_register_source(a) do {} while (0) +#define random_harvest_deregister_source(a) do {} while (0) #endif #if defined(RANDOM_ENABLE_UMA) From owner-svn-src-head@freebsd.org Sat Oct 7 20:04:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F250E40FEA; Sat, 7 Oct 2017 20:04:20 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 206556AFE7; Sat, 7 Oct 2017 20:04:19 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id v97K49xE062415; Sat, 7 Oct 2017 13:04:13 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201710072004.v97K49xE062415@gw.catspoiler.org> Date: Sat, 7 Oct 2017 13:04:09 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r324313 - head/sys/amd64/amd64 To: kib@FreeBSD.org cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201710051250.v95Co31e048931@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Oct 2017 20:04:20 -0000 On 5 Oct, Konstantin Belousov wrote: > Author: kib > Date: Thu Oct 5 12:50:03 2017 > New Revision: 324313 > URL: https://svnweb.freebsd.org/changeset/base/324313 > > Log: > Avoid a race betweem freeing LDT and context switches. > > cpu_switch.S uses curproc->p_md.md_ldt value as the flag indicating > presence of the process LDT. The flag is checked and then ldt segment > descriptor is copied into the CPU' GDT slot. > > Disallow context switches around clearing of the curproc LDT state by > performing the cleanup in critical section. Ensure that the md_ldt > flag is cleared before md_ldt_sd descriptor content is destroyed by > inserting fence between the operations. > > We depend on the x86 memory model strong ordering guarantees, in > particular, that cpu_switch.S observes the writes to md_ldt and > md_ldt_sd in the expected order. I don't know which of this series of commits is responsible, but I think that it fixed the build of lang/ghc on Ryzen. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221029#c102 From owner-svn-src-head@freebsd.org Sat Oct 7 20:11:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5208CE411D6; Sat, 7 Oct 2017 20:11:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59F786C9AF; Sat, 7 Oct 2017 20:11:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v97KBgsf055098 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 7 Oct 2017 23:11:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v97KBgsf055098 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v97KBgkL055097; Sat, 7 Oct 2017 23:11:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 7 Oct 2017 23:11:42 +0300 From: Konstantin Belousov To: Don Lewis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324313 - head/sys/amd64/amd64 Message-ID: <20171007201142.GE95911@kib.kiev.ua> References: <201710051250.v95Co31e048931@repo.freebsd.org> <201710072004.v97K49xE062415@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201710072004.v97K49xE062415@gw.catspoiler.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Oct 2017 20:11:54 -0000 On Sat, Oct 07, 2017 at 01:04:09PM -0700, Don Lewis wrote: > On 5 Oct, Konstantin Belousov wrote: > > Author: kib > > Date: Thu Oct 5 12:50:03 2017 > > New Revision: 324313 > > URL: https://svnweb.freebsd.org/changeset/base/324313 > > > > Log: > > Avoid a race betweem freeing LDT and context switches. > > > > cpu_switch.S uses curproc->p_md.md_ldt value as the flag indicating > > presence of the process LDT. The flag is checked and then ldt segment > > descriptor is copied into the CPU' GDT slot. > > > > Disallow context switches around clearing of the curproc LDT state by > > performing the cleanup in critical section. Ensure that the md_ldt > > flag is cleared before md_ldt_sd descriptor content is destroyed by > > inserting fence between the operations. > > > > We depend on the x86 memory model strong ordering guarantees, in > > particular, that cpu_switch.S observes the writes to md_ldt and > > md_ldt_sd in the expected order. > > I don't know which of this series of commits is responsible, but I think > that it fixed the build of lang/ghc on Ryzen. > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221029#c102 Does ghc use LDT on amd64 ? This sounds unbelievable. From owner-svn-src-head@freebsd.org Sat Oct 7 20:54:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D15BE42347; Sat, 7 Oct 2017 20:54:18 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1503B75EA3; Sat, 7 Oct 2017 20:54:16 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id v97Ks5nX062548; Sat, 7 Oct 2017 13:54:09 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201710072054.v97Ks5nX062548@gw.catspoiler.org> Date: Sat, 7 Oct 2017 13:54:05 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r324313 - head/sys/amd64/amd64 To: kostikbel@gmail.com cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <20171007201142.GE95911@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Oct 2017 20:54:18 -0000 On 7 Oct, Konstantin Belousov wrote: > On Sat, Oct 07, 2017 at 01:04:09PM -0700, Don Lewis wrote: >> On 5 Oct, Konstantin Belousov wrote: >> > Author: kib >> > Date: Thu Oct 5 12:50:03 2017 >> > New Revision: 324313 >> > URL: https://svnweb.freebsd.org/changeset/base/324313 >> > >> > Log: >> > Avoid a race betweem freeing LDT and context switches. >> > >> > cpu_switch.S uses curproc->p_md.md_ldt value as the flag indicating >> > presence of the process LDT. The flag is checked and then ldt segment >> > descriptor is copied into the CPU' GDT slot. >> > >> > Disallow context switches around clearing of the curproc LDT state by >> > performing the cleanup in critical section. Ensure that the md_ldt >> > flag is cleared before md_ldt_sd descriptor content is destroyed by >> > inserting fence between the operations. >> > >> > We depend on the x86 memory model strong ordering guarantees, in >> > particular, that cpu_switch.S observes the writes to md_ldt and >> > md_ldt_sd in the expected order. >> >> I don't know which of this series of commits is responsible, but I think >> that it fixed the build of lang/ghc on Ryzen. >> >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221029#c102 > > Does ghc use LDT on amd64 ? This sounds unbelievable. I have no idea, but ghc would reliably fail to build on my Ryzen machine up through r323398, and at r324367 it seems to reliably build. From owner-svn-src-head@freebsd.org Sat Oct 7 23:30:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F575E449C3; Sat, 7 Oct 2017 23:30:59 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3B62765A4; Sat, 7 Oct 2017 23:30:58 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v97NUv3H040637; Sat, 7 Oct 2017 23:30:57 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v97NUv7E040636; Sat, 7 Oct 2017 23:30:57 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201710072330.v97NUv7E040636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sat, 7 Oct 2017 23:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324405 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324405 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Oct 2017 23:30:59 -0000 Author: sbruno Date: Sat Oct 7 23:30:57 2017 New Revision: 324405 URL: https://svnweb.freebsd.org/changeset/base/324405 Log: Check so_error early in sendfile() call. Prior to this patch, if a connection was reset by the remote end, sendfile() would just report ENOTCONN instead of ECONNRESET. Submitted by: Jason Eggleston Reviewed by: glebius Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D12575 Modified: head/sys/kern/kern_sendfile.c Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Sat Oct 7 23:10:16 2017 (r324404) +++ head/sys/kern/kern_sendfile.c Sat Oct 7 23:30:57 2017 (r324405) @@ -514,6 +514,11 @@ sendfile_getsock(struct thread *td, int s, struct file *so = (*sock_fp)->f_data; if ((*so)->so_type != SOCK_STREAM) return (EINVAL); + if ((*so)->so_error) { + error = (*so)->so_error; + (*so)->so_error = 0; + return (error); + } if (((*so)->so_state & SS_ISCONNECTED) == 0) return (ENOTCONN); return (0); From owner-svn-src-head@freebsd.org Sat Oct 7 23:33:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33008E44B47; Sat, 7 Oct 2017 23:33:16 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B63C676FAD; Sat, 7 Oct 2017 23:33:15 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v97NXEMB044434; Sat, 7 Oct 2017 23:33:14 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v97NXE6E044433; Sat, 7 Oct 2017 23:33:14 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201710072333.v97NXE6E044433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sat, 7 Oct 2017 23:33:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324406 - head/sys/modules/em X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/modules/em X-SVN-Commit-Revision: 324406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Oct 2017 23:33:16 -0000 Author: sbruno Date: Sat Oct 7 23:33:14 2017 New Revision: 324406 URL: https://svnweb.freebsd.org/changeset/base/324406 Log: Fix symlink if_igb.ko in -current such that its relative and doesn't end up with non-standard DESTDIR information in its symlink. This can happen very trivially if the release scripts are used. Sponsored by: Limelight Networks Modified: head/sys/modules/em/Makefile Modified: head/sys/modules/em/Makefile ============================================================================== --- head/sys/modules/em/Makefile Sat Oct 7 23:30:57 2017 (r324405) +++ head/sys/modules/em/Makefile Sat Oct 7 23:33:14 2017 (r324406) @@ -23,6 +23,6 @@ CFLAGS += -I${SRCTOP}/sys/dev/e1000 #CFLAGS += -DDEVICE_POLLING afterinstall: - ln -sf ${DESTDIR}${KMODDIR}/${KMOD}.ko ${DESTDIR}${KMODDIR}/if_igb.ko + cd ${DESTDIR}${KMODDIR} && ln -sf if_em.ko if_igb.ko .include