From owner-svn-src-head@freebsd.org Sun Oct 28 00:58:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5880610DA880; Sun, 28 Oct 2018 00:58:41 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A0A184F3C; Sun, 28 Oct 2018 00:58:41 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E74E17F18; Sun, 28 Oct 2018 00:58:39 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9S0wdJE066078; Sun, 28 Oct 2018 00:58:39 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9S0wdFx066077; Sun, 28 Oct 2018 00:58:39 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201810280058.w9S0wdFx066077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 28 Oct 2018 00:58:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339830 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 339830 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 00:58:41 -0000 Author: dteske Date: Sun Oct 28 00:58:39 2018 New Revision: 339830 URL: https://svnweb.freebsd.org/changeset/base/339830 Log: Adjust for 80-columns. No functional change. Sponsored by: Smule, Inc. Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Sun Oct 28 00:57:44 2018 (r339829) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Sun Oct 28 00:58:39 2018 (r339830) @@ -347,8 +347,8 @@ dialog_menu_main() '>>> $msg_install' '$msg_install_desc' '$msg_install_help' 'T $msg_pool_type_disks' - '$ZFSBOOT_VDEV_TYPE: $n $disks_grammar' - '$msg_pool_type_disks_help' + '$ZFSBOOT_VDEV_TYPE: $n $disks_grammar' + '$msg_pool_type_disks_help' '- $msg_rescan_devices' '*' '$msg_rescan_devices_help' '- $msg_disk_info' '*' @@ -361,8 +361,8 @@ dialog_menu_main() 'E $msg_encrypt_disks' '$usegeli' '$msg_encrypt_disks_help' 'P $msg_partition_scheme' - '$ZFSBOOT_PARTITION_SCHEME ($ZFSBOOT_BOOT_TYPE)' - '$msg_partition_scheme_help' + '$ZFSBOOT_PARTITION_SCHEME ($ZFSBOOT_BOOT_TYPE)' + '$msg_partition_scheme_help' 'S $msg_swap_size' '$ZFSBOOT_SWAP_SIZE' '$msg_swap_size_help' 'M $msg_swap_mirror' '$swapmirror' From owner-svn-src-head@freebsd.org Sun Oct 28 03:02:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22EF510DFEF5; Sun, 28 Oct 2018 03:02:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C23796C370; Sun, 28 Oct 2018 03:02:10 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F168519849; Sun, 28 Oct 2018 03:02:09 +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 w9S329r8033373; Sun, 28 Oct 2018 03:02:09 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9S329ZG033372; Sun, 28 Oct 2018 03:02:09 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810280302.w9S329ZG033372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 28 Oct 2018 03:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339834 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 339834 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 03:02:11 -0000 Author: imp Date: Sun Oct 28 03:02:09 2018 New Revision: 339834 URL: https://svnweb.freebsd.org/changeset/base/339834 Log: Bump .Dd forgotten in last commit. Modified: head/lib/libc/sys/gettimeofday.2 Modified: head/lib/libc/sys/gettimeofday.2 ============================================================================== --- head/lib/libc/sys/gettimeofday.2 Sun Oct 28 02:58:22 2018 (r339833) +++ head/lib/libc/sys/gettimeofday.2 Sun Oct 28 03:02:09 2018 (r339834) @@ -28,7 +28,7 @@ .\" @(#)gettimeofday.2 8.2 (Berkeley) 5/26/95 .\" $FreeBSD$ .\" -.Dd August 4, 2018 +.Dd October 27, 2018 .Dt GETTIMEOFDAY 2 .Os .Sh NAME From owner-svn-src-head@freebsd.org Sun Oct 28 02:58:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFC7010DFE18; Sun, 28 Oct 2018 02:58:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5EFEF6BDF1; Sun, 28 Oct 2018 02:58:27 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D26F19774; Sun, 28 Oct 2018 02:58:23 +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 w9S2wNIY027637; Sun, 28 Oct 2018 02:58:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9S2wNtD027636; Sun, 28 Oct 2018 02:58:23 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810280258.w9S2wNtD027636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 28 Oct 2018 02:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339833 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 339833 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 02:58:27 -0000 Author: imp Date: Sun Oct 28 02:58:22 2018 New Revision: 339833 URL: https://svnweb.freebsd.org/changeset/base/339833 Log: Note that the kenrel doesn't keep track daylight savings time, nor timezone offset. These values are generally zero. While one still theoreticall could set these values, that's almost never done. Users wishing to have an offset between the time of day clock hardware and UTC use adjkerntz(8) instead. localtime(3) should be used to find these values for the current timezone. Modified: head/lib/libc/sys/gettimeofday.2 Modified: head/lib/libc/sys/gettimeofday.2 ============================================================================== --- head/lib/libc/sys/gettimeofday.2 Sun Oct 28 02:58:15 2018 (r339832) +++ head/lib/libc/sys/gettimeofday.2 Sun Oct 28 02:58:22 2018 (r339833) @@ -89,6 +89,11 @@ structure indicates the local time zone and a flag that, if nonzero, indicates that Daylight Saving time applies locally during the appropriate part of the year. +The kernel generally does not track these values and they +are usually returned as zero. +Use +.Xr localtime 3 +to find the offset for the currently active timezone. .Pp Only the super-user may set the time of day or time zone. If the system is running at securelevel >= 2 (see From owner-svn-src-head@freebsd.org Sun Oct 28 05:41:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6253210E80C9; Sun, 28 Oct 2018 05:41:14 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17CA270CF5; Sun, 28 Oct 2018 05:41:14 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED3171B258; Sun, 28 Oct 2018 05:41:13 +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 w9S5fDqL011888; Sun, 28 Oct 2018 05:41:13 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9S5fDVj011887; Sun, 28 Oct 2018 05:41:13 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201810280541.w9S5fDVj011887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 28 Oct 2018 05:41:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339837 - head/sbin/pfctl X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sbin/pfctl X-SVN-Commit-Revision: 339837 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 05:41:14 -0000 Author: kp Date: Sun Oct 28 05:41:13 2018 New Revision: 339837 URL: https://svnweb.freebsd.org/changeset/base/339837 Log: pfctl: Do not allow whitespace in macro names i.e. "this is" = "a variable" is not valid. It was accepted by the parser, but the variable could not be used afterwards. Obtained from: OpenBSD Modified: head/sbin/pfctl/parse.y Modified: head/sbin/pfctl/parse.y ============================================================================== --- head/sbin/pfctl/parse.y Sun Oct 28 05:37:15 2018 (r339836) +++ head/sbin/pfctl/parse.y Sun Oct 28 05:41:13 2018 (r339837) @@ -758,8 +758,16 @@ numberstring : NUMBER { ; varset : STRING '=' varstring { + char *s = $1; if (pf->opts & PF_OPT_VERBOSE) printf("%s = \"%s\"\n", $1, $3); + while (*s++) { + if (isspace((unsigned char)*s)) { + yyerror("macro name cannot contain " + "whitespace"); + YYERROR; + } + } if (symset($1, $3, 0) == -1) err(1, "cannot store variable %s", $1); free($1); From owner-svn-src-head@freebsd.org Sun Oct 28 05:50:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A01FB10E83DF; Sun, 28 Oct 2018 05:50:05 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FF6771045; Sun, 28 Oct 2018 05:50:05 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 280DE1B3C4; Sun, 28 Oct 2018 05:50:05 +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 w9S5o4bU016580; Sun, 28 Oct 2018 05:50:04 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9S5o4MU016579; Sun, 28 Oct 2018 05:50:04 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201810280550.w9S5o4MU016579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 28 Oct 2018 05:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339838 - head/sbin/pfctl/tests X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sbin/pfctl/tests X-SVN-Commit-Revision: 339838 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 05:50:05 -0000 Author: kp Date: Sun Oct 28 05:50:04 2018 New Revision: 339838 URL: https://svnweb.freebsd.org/changeset/base/339838 Log: pfctl test: Add a test for macro names with a space in it Added: head/sbin/pfctl/tests/macro.sh (contents, props changed) Modified: head/sbin/pfctl/tests/Makefile Modified: head/sbin/pfctl/tests/Makefile ============================================================================== --- head/sbin/pfctl/tests/Makefile Sun Oct 28 05:41:13 2018 (r339837) +++ head/sbin/pfctl/tests/Makefile Sun Oct 28 05:50:04 2018 (r339838) @@ -1,6 +1,7 @@ # $FreeBSD$ -ATF_TESTS_SH= pfctl_test +ATF_TESTS_SH= pfctl_test \ + macro SUBDIR+= files Added: head/sbin/pfctl/tests/macro.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/macro.sh Sun Oct 28 05:50:04 2018 (r339838) @@ -0,0 +1,28 @@ +# $FreeBSD$ + +atf_test_case "space" cleanup +space_head() +{ + atf_set descr "Test macros with spaces" +} + +space_body() +{ + echo \"this is\" = \"a variable\" > pf.conf + cat pf.conf + atf_check -o ignore -e ignore -s exit:1 pfctl -nvf pf.conf + + echo this = \"a variable\" > pf.conf + cat pf.conf + atf_check -o ignore -s exit:0 pfctl -nvf pf.conf +} + +space_cleanup() +{ + rm -f pf.conf +} + +atf_init_test_cases() +{ + atf_add_test_case "space" +} From owner-svn-src-head@freebsd.org Sun Oct 28 05:32:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D83E110E3F71; Sun, 28 Oct 2018 05:32:51 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8008F708F5; Sun, 28 Oct 2018 05:32:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44CDD1B1F1; Sun, 28 Oct 2018 05:32:51 +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 w9S5WpAu010443; Sun, 28 Oct 2018 05:32:51 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9S5WoV4010440; Sun, 28 Oct 2018 05:32:50 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201810280532.w9S5WoV4010440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 28 Oct 2018 05:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339835 - in head: sbin/pfctl share/man/man5 sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head: sbin/pfctl share/man/man5 sys/netpfil/pf X-SVN-Commit-Revision: 339835 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 05:32:52 -0000 Author: kp Date: Sun Oct 28 05:32:50 2018 New Revision: 339835 URL: https://svnweb.freebsd.org/changeset/base/339835 Log: pf: Make ':0' ignore link-local v6 addresses too When users mark an interface to not use aliases they likely also don't want to use the link-local v6 address there. PR: 201695 Submitted by: Russell Yount Differential Revision: https://reviews.freebsd.org/D17633 Modified: head/sbin/pfctl/pfctl_parser.c head/share/man/man5/pf.conf.5 head/sys/netpfil/pf/pf_if.c Modified: head/sbin/pfctl/pfctl_parser.c ============================================================================== --- head/sbin/pfctl/pfctl_parser.c Sun Oct 28 03:02:09 2018 (r339834) +++ head/sbin/pfctl/pfctl_parser.c Sun Oct 28 05:32:50 2018 (r339835) @@ -1366,6 +1366,9 @@ ifa_lookup(const char *ifa_name, int flags) last_if = p->ifname; if ((flags & PFI_AFLAG_NOALIAS) && p->af == AF_INET && got4) continue; + if ((flags & PFI_AFLAG_NOALIAS) && p->af == AF_INET6 && + IN6_IS_ADDR_LINKLOCAL(&p->addr.v.a.addr.v6)) + continue; if ((flags & PFI_AFLAG_NOALIAS) && p->af == AF_INET6 && got6) continue; if (p->af == AF_INET) Modified: head/share/man/man5/pf.conf.5 ============================================================================== --- head/share/man/man5/pf.conf.5 Sun Oct 28 03:02:09 2018 (r339834) +++ head/share/man/man5/pf.conf.5 Sun Oct 28 05:32:50 2018 (r339835) @@ -28,7 +28,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 6, 2016 +.Dd October 27, 2018 .Dt PF.CONF 5 .Os .Sh NAME @@ -1511,7 +1511,7 @@ Do not include interface aliases. Host names may also have the .Ar :0 option appended to restrict the name resolution to the first of each -v4 and v6 address found. +v4 and non-link-local v6 address found. .Pp Host name resolution and interface to address translation are done at ruleset load-time. Modified: head/sys/netpfil/pf/pf_if.c ============================================================================== --- head/sys/netpfil/pf/pf_if.c Sun Oct 28 03:02:09 2018 (r339834) +++ head/sys/netpfil/pf/pf_if.c Sun Oct 28 05:32:50 2018 (r339835) @@ -553,7 +553,8 @@ pfi_instance_add(struct ifnet *ifp, int net, int flags if ((flags & PFI_AFLAG_PEER) && !(ifp->if_flags & IFF_POINTOPOINT)) continue; - if ((flags & PFI_AFLAG_NETWORK) && af == AF_INET6 && + if ((flags & (PFI_AFLAG_NETWORK | PFI_AFLAG_NOALIAS)) && + af == AF_INET6 && IN6_IS_ADDR_LINKLOCAL( &((struct sockaddr_in6 *)ia->ifa_addr)->sin6_addr)) continue; From owner-svn-src-head@freebsd.org Sun Oct 28 02:57:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 156C710DFDF9; Sun, 28 Oct 2018 02:57:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEF006BC47; Sun, 28 Oct 2018 02:57:50 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89E781976F; Sun, 28 Oct 2018 02:57:50 +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 w9S2vojH027513; Sun, 28 Oct 2018 02:57:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9S2vots027512; Sun, 28 Oct 2018 02:57:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810280257.w9S2vots027512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 28 Oct 2018 02:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339831 - head/stand/liblua X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/liblua X-SVN-Commit-Revision: 339831 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 02:57:51 -0000 Author: imp Date: Sun Oct 28 02:57:50 2018 New Revision: 339831 URL: https://svnweb.freebsd.org/changeset/base/339831 Log: Move LUA_ROOT to /boot/lua While this is mostly unused today, this is a better place than /usr/local/lua. Modified: head/stand/liblua/luaconf.h Modified: head/stand/liblua/luaconf.h ============================================================================== --- head/stand/liblua/luaconf.h Sun Oct 28 00:58:39 2018 (r339830) +++ head/stand/liblua/luaconf.h Sun Oct 28 02:57:50 2018 (r339831) @@ -202,9 +202,9 @@ #else /* }{ */ -#define LUA_ROOT "/usr/local/" -#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/" -#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/" +#define LUA_ROOT "/boot/lua/" LUA_VDIR "/" +#define LUA_LDIR LUA_ROOT "share/" +#define LUA_CDIR LUA_ROOT "lib/" #ifndef LUA_PATH_DEFAULT #define LUA_PATH_DEFAULT \ LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ From owner-svn-src-head@freebsd.org Sun Oct 28 02:58:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DBE810DFE03; Sun, 28 Oct 2018 02:58:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0F5E6BD29; Sun, 28 Oct 2018 02:58:15 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A032319773; Sun, 28 Oct 2018 02:58:15 +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 w9S2wFTZ027580; Sun, 28 Oct 2018 02:58:15 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9S2wFa8027579; Sun, 28 Oct 2018 02:58:15 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810280258.w9S2wFa8027579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 28 Oct 2018 02:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339832 - head/lib/libcompat/4.1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libcompat/4.1 X-SVN-Commit-Revision: 339832 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 02:58:16 -0000 Author: imp Date: Sun Oct 28 02:58:15 2018 New Revision: 339832 URL: https://svnweb.freebsd.org/changeset/base/339832 Log: ftime appeared in 7th Edition Unix to replace gtime. Note that the timezone and dst entries are always returned as 0. Modified: head/lib/libcompat/4.1/ftime.3 Modified: head/lib/libcompat/4.1/ftime.3 ============================================================================== --- head/lib/libcompat/4.1/ftime.3 Sun Oct 28 02:57:50 2018 (r339831) +++ head/lib/libcompat/4.1/ftime.3 Sun Oct 28 02:58:15 2018 (r339832) @@ -28,7 +28,7 @@ .\" @(#)ftime.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd August 4, 2018 .Dt FTIME 3 .Os .Sh NAME @@ -67,9 +67,8 @@ struct timeb .Pp The structure contains the time since the epoch in seconds, up to 1000 milliseconds of more-precise interval, -the local time zone (measured in minutes of time westward from Greenwich), -and a flag that, if nonzero, indicates that -Daylight Saving time applies locally during the appropriate part of the year. +The kernel no longer maintains the timezone and dstflag info, so 0 is +always returned for these fields. .Sh SEE ALSO .Xr gettimeofday 2 , .Xr settimeofday 2 , @@ -79,4 +78,4 @@ Daylight Saving time applies locally during the approp The .Nm function appeared in -.Bx 4.2 . +.At v7 . From owner-svn-src-head@freebsd.org Sun Oct 28 10:59:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C3F610862AF; Sun, 28 Oct 2018 10:59:50 +0000 (UTC) (envelope-from tmunro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9D27C51C; Sun, 28 Oct 2018 10:59:50 +0000 (UTC) (envelope-from tmunro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D97571E6B6; Sun, 28 Oct 2018 10:59:49 +0000 (UTC) (envelope-from tmunro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9SAxniU081238; Sun, 28 Oct 2018 10:59:49 GMT (envelope-from tmunro@FreeBSD.org) Received: (from tmunro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9SAxne2081237; Sun, 28 Oct 2018 10:59:49 GMT (envelope-from tmunro@FreeBSD.org) Message-Id: <201810281059.w9SAxne2081237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tmunro set sender to tmunro@FreeBSD.org using -f From: Thomas Munro Date: Sun, 28 Oct 2018 10:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339840 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: tmunro X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 339840 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 10:59:50 -0000 Author: tmunro Date: Sun Oct 28 10:59:49 2018 New Revision: 339840 URL: https://svnweb.freebsd.org/changeset/base/339840 Log: truss: Fix display of shm_open(SHM_ANON, ...). Currently truss(1) shows shm_open(SHM_ANON, ...) as shm_open("(null)", ...). Detect the special value and display it by name. Reviewed by: jhb, allanjude, tuexen Approved by: mjg (mentor) MFC with: r339224 Differential Revision: https://reviews.freebsd.org/D17461 Modified: head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscall.h ============================================================================== --- head/usr.bin/truss/syscall.h Sun Oct 28 07:50:15 2018 (r339839) +++ head/usr.bin/truss/syscall.h Sun Oct 28 10:59:49 2018 (r339840) @@ -151,6 +151,7 @@ enum Argtype { PQuadHex, PUInt, Readlinkres, + ShmName, StringArray, /* Pointers to structures. */ Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Sun Oct 28 07:50:15 2018 (r339839) +++ head/usr.bin/truss/syscalls.c Sun Oct 28 10:59:49 2018 (r339840) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #define _WANT_FREEBSD11_KEVENT #include #include +#include #include #include #include @@ -462,7 +463,7 @@ static struct syscall decoded_syscalls[] = { .args = { { Int, 0 }, { Sockoptlevel, 1 }, { Sockoptname, 2 }, { Ptr | IN, 3 }, { Socklent, 4 } } }, { .name = "shm_open", .ret_type = 1, .nargs = 3, - .args = { { Name | IN, 0 }, { Open, 1 }, { Octal, 2 } } }, + .args = { { ShmName | IN, 0 }, { Open, 1 }, { Octal, 2 } } }, { .name = "shm_unlink", .ret_type = 1, .nargs = 1, .args = { { Name | IN, 0 } } }, { .name = "shutdown", .ret_type = 1, .nargs = 2, @@ -1593,6 +1594,13 @@ print_arg(struct syscall_args *sc, unsigned long *args case Sizet: fprintf(fp, "%zu", (size_t)args[sc->offset]); break; + case ShmName: + /* Handle special SHM_ANON value. */ + if ((char *)args[sc->offset] == SHM_ANON) { + fprintf(fp, "SHM_ANON"); + break; + } + /* FALLTHROUGH */ case Name: { /* NULL-terminated string. */ char *tmp2; From owner-svn-src-head@freebsd.org Sun Oct 28 05:37:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31D8D10E8039; Sun, 28 Oct 2018 05:37:16 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC56870A63; Sun, 28 Oct 2018 05:37:15 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7BC91B222; Sun, 28 Oct 2018 05:37:15 +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 w9S5bF5F010707; Sun, 28 Oct 2018 05:37:15 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9S5bFxY010706; Sun, 28 Oct 2018 05:37:15 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201810280537.w9S5bFxY010706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 28 Oct 2018 05:37:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339836 - 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: 339836 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 05:37:16 -0000 Author: kp Date: Sun Oct 28 05:37:15 2018 New Revision: 339836 URL: https://svnweb.freebsd.org/changeset/base/339836 Log: pf tests: Test ':0' ignoring link-local addresses PR: 201695 Modified: head/tests/sys/netpfil/pf/pass_block.sh Modified: head/tests/sys/netpfil/pf/pass_block.sh ============================================================================== --- head/tests/sys/netpfil/pf/pass_block.sh Sun Oct 28 05:32:50 2018 (r339835) +++ head/tests/sys/netpfil/pf/pass_block.sh Sun Oct 28 05:37:15 2018 (r339836) @@ -84,8 +84,54 @@ v6_cleanup() pft_cleanup } +atf_test_case "noalias" "cleanup" +noalias_head() +{ + atf_set descr 'Test the :0 noalias option' + atf_set require.user root +} + +noalias_body() +{ + pft_init + + epair=$(pft_mkepair) + ifconfig ${epair}a inet6 2001:db8:42::1/64 up no_dad + + pft_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 2001:db8:42::2/64 up no_dad + + linklocaladdr=$(jexec alcatraz ifconfig ${epair}b inet6 \ + | grep %${epair}b \ + | awk '{ print $2; }' \ + | cut -d % -f 1) + + # Sanity check + atf_check -s exit:0 -o ignore ping6 -c 1 -x 1 2001:db8:42::2 + atf_check -s exit:0 -o ignore ping6 -c 1 -x 1 ${linklocaladdr}%${epair}a + + jexec alcatraz pfctl -e + pft_set_rules alcatraz "block out inet6 from (epair0b:0) to any" + + atf_check -s exit:2 -o ignore ping6 -c 1 -x 1 2001:db8:42::2 + + # We should still be able to ping the link-local address + atf_check -s exit:0 -o ignore ping6 -c 1 -x 1 ${linklocaladdr}%${epair}a + + pft_set_rules alcatraz "block out inet6 from (epair0b) to any" + + # We cannot ping to the link-local address + atf_check -s exit:2 -o ignore ping6 -c 1 -x 1 ${linklocaladdr}%${epair}a +} + +noalias_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "v4" atf_add_test_case "v6" + atf_add_test_case "noalias" } From owner-svn-src-head@freebsd.org Sun Oct 28 18:32:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23E0710DC8B7; Sun, 28 Oct 2018 18:32:49 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD01E6A213; Sun, 28 Oct 2018 18:32:48 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD92B231C1; Sun, 28 Oct 2018 18:32:48 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9SIWmdb021231; Sun, 28 Oct 2018 18:32:48 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9SIWmZB021228; Sun, 28 Oct 2018 18:32:48 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201810281832.w9SIWmZB021228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 28 Oct 2018 18:32:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339843 - head/share/examples/jails X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/share/examples/jails X-SVN-Commit-Revision: 339843 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 18:32:49 -0000 Author: dteske Date: Sun Oct 28 18:32:47 2018 New Revision: 339843 URL: https://svnweb.freebsd.org/changeset/base/339843 Log: Fix jail examples in jib, jng, README The provided example jail configs do not work for multiple interfaces. Multiple interfaces need to be specified as a comma separated list or using multiple += lines in jail.conf. In the given example, a space- separated string is used, which doesn't work with multiple interfaces. Also added a note to the README about VIMAGE being built-in by default on amd64 in FreeBSD 12, with appropriate instructions for loading the necessary netgraph ether module (ng_ether) since it is neither built- in nor autoloads. Submitted by: Ryan Moeller Reported by: Ryan Moeller MFC after: 3 days Sponsored by: Smule, Inc. Differential Revision: https://reviews.freebsd.org/D17697 Modified: head/share/examples/jails/README head/share/examples/jails/jib head/share/examples/jails/jng Modified: head/share/examples/jails/README ============================================================================== --- head/share/examples/jails/README Sun Oct 28 18:23:13 2018 (r339842) +++ head/share/examples/jails/README Sun Oct 28 18:32:47 2018 (r339843) @@ -8,6 +8,16 @@ The below 4 samples require a VIMAGE enabled kernel: $ make KERNCONF=VIMAGE kernel $ reboot +FreeBSD 12 has VIMAGE enabled in GENERIC on amd64. +In that case, for jng simply load the ng_ether module first +(ng_bridge and ng_eiface will load on demand): + + # (as root) + # Load the ng_ether module at boot: + $ sysrc kld_list+=ng_ether + # Load ng_ether at once without rebooting: + $ kldload ng_ether + Sample 1: jail.conf(5) $ cp jib jng /usr/sbin/ Modified: head/share/examples/jails/jib ============================================================================== --- head/share/examples/jails/jib Sun Oct 28 18:23:13 2018 (r339842) +++ head/share/examples/jails/jib Sun Oct 28 18:32:47 2018 (r339843) @@ -51,7 +51,7 @@ # # arguments given to `jib addm xxx' in exec.prestart value. # # # vnet; -# vnet.interface = "e0b_xxx e1b_xxx ..."; +# vnet.interface = e0b_xxx, e1b_xxx, ...; # # exec.clean; # exec.system_user = "root"; Modified: head/share/examples/jails/jng ============================================================================== --- head/share/examples/jails/jng Sun Oct 28 18:23:13 2018 (r339842) +++ head/share/examples/jails/jng Sun Oct 28 18:32:47 2018 (r339843) @@ -51,7 +51,7 @@ # # arguments given to `jng bridge xxx' in exec.prestart value. # # # vnet; -# vnet.interface = "ng0_xxx ng1_xxx ..."; +# vnet.interface = ng0_xxx, ng1_xxx, ...; # # exec.clean; # exec.system_user = "root"; From owner-svn-src-head@freebsd.org Sun Oct 28 19:29:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3D5E10DDEFD; Sun, 28 Oct 2018 19:29:07 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A94F6BBFE; Sun, 28 Oct 2018 19:29:07 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BE4A23A14; Sun, 28 Oct 2018 19:29:07 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9SJT7nI049320; Sun, 28 Oct 2018 19:29:07 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9SJT7ws049319; Sun, 28 Oct 2018 19:29:07 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201810281929.w9SJT7ws049319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 28 Oct 2018 19:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339844 - head/usr.sbin/bsdconfig/share X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/usr.sbin/bsdconfig/share X-SVN-Commit-Revision: 339844 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 19:29:08 -0000 Author: dteske Date: Sun Oct 28 19:29:07 2018 New Revision: 339844 URL: https://svnweb.freebsd.org/changeset/base/339844 Log: Fix dialog autosizing to accomodate for hline dialog will conditionally ignore the --hline option if not enough space was available to accomodate for the text width. Traditionally the width of the widget had to be 10 wider than the text. Recent updates to dialog have changed the requirement to be at least 12 wider than the hline text else the hline text is not rendered at the bottom of the widget. Sponsored by: Smule, Inc. Modified: head/usr.sbin/bsdconfig/share/dialog.subr Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Sun Oct 28 18:32:47 2018 (r339843) +++ head/usr.sbin/bsdconfig/share/dialog.subr Sun Oct 28 19:29:07 2018 (r339844) @@ -646,7 +646,7 @@ f_dialog_infobox_size() # Xdialog(1)). # if [ ! "$USE_XDIALOG" ]; then - __n=$(( ${#__hline} + 10 )) + __n=$(( ${#__hline} + 12 )) [ $__n -gt $__width ] && __width=$__n fi From owner-svn-src-head@freebsd.org Sun Oct 28 22:09:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B15810E2D49; Sun, 28 Oct 2018 22:09:19 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 50CFB72762; Sun, 28 Oct 2018 22:09:19 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33727254F8; Sun, 28 Oct 2018 22:09:19 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9SM9J0G034879; Sun, 28 Oct 2018 22:09:19 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9SM9JrZ034878; Sun, 28 Oct 2018 22:09:19 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201810282209.w9SM9JrZ034878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 28 Oct 2018 22:09:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339845 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 339845 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 22:09:19 -0000 Author: dteske Date: Sun Oct 28 22:09:18 2018 New Revision: 339845 URL: https://svnweb.freebsd.org/changeset/base/339845 Log: Sort i18n messages in bsdinstall zfsboot No functional change. Sponsored by: Smule, Inc. Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Sun Oct 28 19:29:07 2018 (r339844) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Sun Oct 28 22:09:18 2018 (r339845) @@ -246,8 +246,8 @@ msg_configure_options="Configure Options:" msg_detailed_disk_info="gpart(8) show %s:\n%s\n\ncamcontrol(8) inquiry %s:\n%s\n\n\ncamcontrol(8) identify %s:\n%s\n" msg_disk_info="Disk Info" msg_disk_info_help="Get detailed information on disk device(s)" -msg_disk_singular="disk" msg_disk_plural="disks" +msg_disk_singular="disk" msg_encrypt_disks="Encrypt Disks?" msg_encrypt_disks_help="Use geli(8) to encrypt all data partitions" msg_error="Error" From owner-svn-src-head@freebsd.org Sun Oct 28 23:54:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE39310E9E10; Sun, 28 Oct 2018 23:54:07 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93FA275BEF; Sun, 28 Oct 2018 23:54:07 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F01F266E6; Sun, 28 Oct 2018 23:54:07 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9SNs7KD090553; Sun, 28 Oct 2018 23:54:07 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9SNs5PW090545; Sun, 28 Oct 2018 23:54:05 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201810282354.w9SNs5PW090545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Sun, 28 Oct 2018 23:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339848 - head/contrib/tzdata X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/contrib/tzdata X-SVN-Commit-Revision: 339848 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 23:54:08 -0000 Author: philip Date: Sun Oct 28 23:54:05 2018 New Revision: 339848 URL: https://svnweb.freebsd.org/changeset/base/339848 Log: Import tzdata 2018g Changes: https://github.com/eggert/tz/blob/2018g/NEWS MFC after: 3 days Modified: head/contrib/tzdata/NEWS head/contrib/tzdata/africa head/contrib/tzdata/europe head/contrib/tzdata/northamerica head/contrib/tzdata/theory.html head/contrib/tzdata/version head/contrib/tzdata/ziguard.awk head/contrib/tzdata/zishrink.awk Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/NEWS ============================================================================== --- head/contrib/tzdata/NEWS Sun Oct 28 23:51:00 2018 (r339847) +++ head/contrib/tzdata/NEWS Sun Oct 28 23:54:05 2018 (r339848) @@ -1,5 +1,40 @@ News for the tz database +Release 2018g - 2018-10-26 22:22:45 -0700 + + Briefly: + Morocco switches to permanent +01 on 2018-10-27. + + Changes to future timestamps + + Morocco switches from +00/+01 to permanent +01 effective 2018-10-27, + so its clocks will not fall back on 2018-10-28 as previously scheduled. + (Thanks to Mohamed Essedik Najd and Brian Inglis.) + + Changes to code + + When generating TZif files with leap seconds, zic no longer uses a + format that trips up older 32-bit clients, fixing a bug introduced + in 2018f. (Reported by Daniel Fischer.) Also, the zic workaround + for QTBUG-53071 now also works for TZif files with leap seconds. + + The translator to rearguard format now rewrites the line + "Rule Japan 1948 1951 - Sep Sat>=8 25:00 0 S" to + "Rule Japan 1948 1951 - Sep Sun>=9 1:00 0 S". + This caters to zic before 2007 and to Oracle TZUpdater 2.2.0 + and earlier. (Reported by Christos Zoulas.) + + Changes to past time zone abbreviations + + Change HDT to HWT/HPT for WWII-era abbreviations in Hawaii. + This reverts to 2011h, as the abbreviation change in 2011i was + likely inadvertent. + + Changes to documentation + + tzfile.5 has new sections on interoperability issues. + + Release 2018f - 2018-10-18 00:14:18 -0700 Briefly: Modified: head/contrib/tzdata/africa ============================================================================== --- head/contrib/tzdata/africa Sun Oct 28 23:51:00 2018 (r339847) +++ head/contrib/tzdata/africa Sun Oct 28 23:54:05 2018 (r339848) @@ -844,94 +844,61 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis # agrees # with the patch. -# From Paul Eggert (2015-06-08): -# For now, guess that later spring and fall transitions will use 2015's rules, -# and guess that Morocco will switch to standard time at 03:00 the last -# Sunday before Ramadan, and back to DST at 02:00 the first Sunday after -# Ramadan. To implement this, transition dates for 2016 through 2037 were -# determined by running the following program under GNU Emacs 24.3, with the -# results integrated by hand into the table below. -# (let ((islamic-year 1437)) -# (require 'cal-islam) -# (while (< islamic-year 1460) -# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) -# (b (calendar-islamic-to-absolute (list 10 1 islamic-year))) -# (sunday 0)) -# (while (/= sunday (mod (setq a (1- a)) 7))) -# (while (/= sunday (mod b 7)) -# (setq b (1+ b))) -# (setq a (calendar-gregorian-from-absolute a)) -# (setq b (calendar-gregorian-from-absolute b)) -# (insert -# (format -# (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 3:00\t0\t-\n" -# "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 2:00\t1:00\tS\n") -# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) -# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) -# (setq islamic-year (+ 1 islamic-year)))) +# From Mohamed Essedik Najd (2018-10-26): +# Today, a Moroccan government council approved the perpetual addition +# of 60 minutes to the regular Moroccan timezone. +# From Brian Inglis (2018-10-26): +# http://www.maroc.ma/fr/actualites/le-conseil-de-gouvernement-adopte-un-projet-de-decret-relatif-lheure-legale-stipulant-le # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S - -Rule Morocco 1939 only - Sep 12 0:00 1:00 S +Rule Morocco 1939 only - Sep 12 0:00 1:00 - Rule Morocco 1939 only - Nov 19 0:00 0 - -Rule Morocco 1940 only - Feb 25 0:00 1:00 S +Rule Morocco 1940 only - Feb 25 0:00 1:00 - Rule Morocco 1945 only - Nov 18 0:00 0 - -Rule Morocco 1950 only - Jun 11 0:00 1:00 S +Rule Morocco 1950 only - Jun 11 0:00 1:00 - Rule Morocco 1950 only - Oct 29 0:00 0 - -Rule Morocco 1967 only - Jun 3 12:00 1:00 S +Rule Morocco 1967 only - Jun 3 12:00 1:00 - Rule Morocco 1967 only - Oct 1 0:00 0 - -Rule Morocco 1974 only - Jun 24 0:00 1:00 S +Rule Morocco 1974 only - Jun 24 0:00 1:00 - Rule Morocco 1974 only - Sep 1 0:00 0 - -Rule Morocco 1976 1977 - May 1 0:00 1:00 S +Rule Morocco 1976 1977 - May 1 0:00 1:00 - Rule Morocco 1976 only - Aug 1 0:00 0 - Rule Morocco 1977 only - Sep 28 0:00 0 - -Rule Morocco 1978 only - Jun 1 0:00 1:00 S +Rule Morocco 1978 only - Jun 1 0:00 1:00 - Rule Morocco 1978 only - Aug 4 0:00 0 - -Rule Morocco 2008 only - Jun 1 0:00 1:00 S +Rule Morocco 2008 only - Jun 1 0:00 1:00 - Rule Morocco 2008 only - Sep 1 0:00 0 - -Rule Morocco 2009 only - Jun 1 0:00 1:00 S +Rule Morocco 2009 only - Jun 1 0:00 1:00 - Rule Morocco 2009 only - Aug 21 0:00 0 - -Rule Morocco 2010 only - May 2 0:00 1:00 S +Rule Morocco 2010 only - May 2 0:00 1:00 - Rule Morocco 2010 only - Aug 8 0:00 0 - -Rule Morocco 2011 only - Apr 3 0:00 1:00 S +Rule Morocco 2011 only - Apr 3 0:00 1:00 - Rule Morocco 2011 only - Jul 31 0:00 0 - -Rule Morocco 2012 2013 - Apr lastSun 2:00 1:00 S +Rule Morocco 2012 2013 - Apr lastSun 2:00 1:00 - Rule Morocco 2012 only - Jul 20 3:00 0 - -Rule Morocco 2012 only - Aug 20 2:00 1:00 S +Rule Morocco 2012 only - Aug 20 2:00 1:00 - Rule Morocco 2012 only - Sep 30 3:00 0 - Rule Morocco 2013 only - Jul 7 3:00 0 - -Rule Morocco 2013 only - Aug 10 2:00 1:00 S -Rule Morocco 2013 max - Oct lastSun 3:00 0 - -Rule Morocco 2014 2021 - Mar lastSun 2:00 1:00 S +Rule Morocco 2013 only - Aug 10 2:00 1:00 - +Rule Morocco 2013 2018 - Oct lastSun 3:00 0 - +Rule Morocco 2014 2018 - Mar lastSun 2:00 1:00 - Rule Morocco 2014 only - Jun 28 3:00 0 - -Rule Morocco 2014 only - Aug 2 2:00 1:00 S +Rule Morocco 2014 only - Aug 2 2:00 1:00 - Rule Morocco 2015 only - Jun 14 3:00 0 - -Rule Morocco 2015 only - Jul 19 2:00 1:00 S +Rule Morocco 2015 only - Jul 19 2:00 1:00 - Rule Morocco 2016 only - Jun 5 3:00 0 - -Rule Morocco 2016 only - Jul 10 2:00 1:00 S +Rule Morocco 2016 only - Jul 10 2:00 1:00 - Rule Morocco 2017 only - May 21 3:00 0 - -Rule Morocco 2017 only - Jul 2 2:00 1:00 S +Rule Morocco 2017 only - Jul 2 2:00 1:00 - Rule Morocco 2018 only - May 13 3:00 0 - -Rule Morocco 2018 only - Jun 17 2:00 1:00 S -Rule Morocco 2019 only - May 5 3:00 0 - -Rule Morocco 2019 only - Jun 9 2:00 1:00 S -Rule Morocco 2020 only - Apr 19 3:00 0 - -Rule Morocco 2020 only - May 24 2:00 1:00 S -Rule Morocco 2021 only - Apr 11 3:00 0 - -Rule Morocco 2021 only - May 16 2:00 1:00 S -Rule Morocco 2022 only - May 8 2:00 1:00 S -Rule Morocco 2023 only - Apr 23 2:00 1:00 S -Rule Morocco 2024 only - Apr 14 2:00 1:00 S -Rule Morocco 2025 only - Apr 6 2:00 1:00 S -Rule Morocco 2026 max - Mar lastSun 2:00 1:00 S -Rule Morocco 2036 only - Oct 19 3:00 0 - -Rule Morocco 2037 only - Oct 4 3:00 0 - +Rule Morocco 2018 only - Jun 17 2:00 1:00 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 - 0:00 Morocco WE%sT 1984 Mar 16 - 1:00 - CET 1986 - 0:00 Morocco WE%sT + 0:00 Morocco +00/+01 1984 Mar 16 + 1:00 - +01 1986 + 0:00 Morocco +00/+01 2018 Oct 27 + 1:00 - +01 # Western Sahara # @@ -946,7 +913,8 @@ Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún -1:00 - -01 1976 Apr 14 - 0:00 Morocco WE%sT + 0:00 Morocco +00/+01 2018 Oct 27 + 1:00 - +01 # Mozambique # Modified: head/contrib/tzdata/europe ============================================================================== --- head/contrib/tzdata/europe Sun Oct 28 23:51:00 2018 (r339847) +++ head/contrib/tzdata/europe Sun Oct 28 23:54:05 2018 (r339848) @@ -3440,7 +3440,8 @@ Rule Spain 1978 only - Oct 1 2:00s 0 - #Rule NatSpain 1937 only - May 22 23:00 1:00 S #Rule NatSpain 1937 1938 - Oct Sat>=1 24:00s 0 - #Rule NatSpain 1938 only - Mar 26 23:00 1:00 S -# The following rules are copied from Morocco from 1967 through 1978. +# The following rules are copied from Morocco from 1967 through 1978, +# except with "S" letters. Rule SpainAfrica 1967 only - Jun 3 12:00 1:00 S Rule SpainAfrica 1967 only - Oct 1 0:00 0 - Rule SpainAfrica 1974 only - Jun 24 0:00 1:00 S Modified: head/contrib/tzdata/northamerica ============================================================================== --- head/contrib/tzdata/northamerica Sun Oct 28 23:51:00 2018 (r339847) +++ head/contrib/tzdata/northamerica Sun Oct 28 23:54:05 2018 (r339848) @@ -439,6 +439,19 @@ Zone America/North_Dakota/Beulah -6:47:07 - LMT 1883 N # western South Dakota, far western Texas (El Paso County, Hudspeth County, # and Pine Springs and Nickel Creek in Culberson County), Utah, Wyoming # +# From Paul Eggert (2018-10-25): +# On 1921-03-04 federal law placed all of Texas into the central time zone. +# However, El Paso ignored the law for decades and continued to observe +# mountain time, on the grounds that that's what they had always done +# and they weren't about to let the federal government tell them what to do. +# Eventually the federal government gave in and changed the law on +# 1970-04-10 to match what El Paso was actually doing. Although +# that's slightly after our 1970 cutoff, there is no need to create a +# separate zone for El Paso since they were ignoring the law anyway. See: +# Long T. El Pasoans were time rebels, fought to stay in Mountain zone. +# El Paso Times. 2018-10-24 06:40 -06. +# https://www.elpasotimes.com/story/news/local/el-paso/2018/10/24/el-pasoans-were-time-rebels-fought-stay-mountain-zone/1744509002/ +# # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER Rule Denver 1920 1921 - Mar lastSun 2:00 1:00 D Rule Denver 1920 only - Oct lastSun 2:00 0 S @@ -708,9 +721,7 @@ Zone America/Adak 12:13:22 - LMT 1867 Oct 19 12:44:35 Zone Pacific/Honolulu -10:31:26 - LMT 1896 Jan 13 12:00 -10:30 - HST 1933 Apr 30 2:00 -10:30 1:00 HDT 1933 May 21 12:00 - -10:30 - HST 1942 Feb 9 2:00 - -10:30 1:00 HDT 1945 Sep 30 2:00 - -10:30 - HST 1947 Jun 8 2:00 + -10:30 US H%sT 1947 Jun 8 2:00 -10:00 - HST # Now we turn to US areas that have diverged from the consensus since 1970. Modified: head/contrib/tzdata/theory.html ============================================================================== --- head/contrib/tzdata/theory.html Sun Oct 28 23:51:00 2018 (r339847) +++ head/contrib/tzdata/theory.html Sun Oct 28 23:54:05 2018 (r339848) @@ -407,7 +407,7 @@ in decreasing order of importance: EST/EDT/EWT/EPT/EDDT Eastern [North America], EET/EEST Eastern European, GST Guam, - HST/HDT Hawaii, + HST/HDT/HWT/HPT Hawaii, HKT/HKST Hong Kong, IST India, IST/GMT Irish, Modified: head/contrib/tzdata/version ============================================================================== --- head/contrib/tzdata/version Sun Oct 28 23:51:00 2018 (r339847) +++ head/contrib/tzdata/version Sun Oct 28 23:54:05 2018 (r339848) @@ -1 +1 @@ -2018f +2018g Modified: head/contrib/tzdata/ziguard.awk ============================================================================== --- head/contrib/tzdata/ziguard.awk Sun Oct 28 23:51:00 2018 (r339847) +++ head/contrib/tzdata/ziguard.awk Sun Oct 28 23:54:05 2018 (r339848) @@ -80,6 +80,13 @@ DATAFORM != "main" { if (comment_out) { sub(/^/, "#") } + + # In rearguard format, change the Japan rule line with "Sat>=8 25:00" + # to "Sun>=9 1:00", to cater to zic before 2007 and to older Java. + if (!vanguard && $1 == "Rule" && $7 == "Sat>=8" && $8 == "25:00") { + sub(/Sat>=8/, "Sun>=9") + sub(/25:00/, " 1:00") + } } # If a Link line is followed by a Zone line for the same data, comment Modified: head/contrib/tzdata/zishrink.awk ============================================================================== --- head/contrib/tzdata/zishrink.awk Sun Oct 28 23:51:00 2018 (r339847) +++ head/contrib/tzdata/zishrink.awk Sun Oct 28 23:54:05 2018 (r339848) @@ -172,11 +172,6 @@ function process_input_line(line, field, end, i, n, st if (line ~ /^R /) return line = substr(line, 1, RSTART) substr(line, RSTART + 5) } - # Replace SpainAfrica rules with Morocco, as they are duplicates. - if (match(line, / SpainAfrica /)) { - if (line ~ /^R /) return - line = substr(line, 1, RSTART) "Morocco" substr(line, RSTART + RLENGTH - 1) - } # Abbreviate times. while (match(line, /[: ]0+[0-9]/)) From owner-svn-src-head@freebsd.org Mon Oct 29 02:58:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9FA410ED924; Mon, 29 Oct 2018 02:58:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 817C67A84C; Mon, 29 Oct 2018 02:58:31 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 628D342C; Mon, 29 Oct 2018 02:58:31 +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 w9T2wV4q082480; Mon, 29 Oct 2018 02:58:31 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9T2wVid082479; Mon, 29 Oct 2018 02:58:31 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201810290258.w9T2wVid082479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 29 Oct 2018 02:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339849 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 339849 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 02:58:32 -0000 Author: kevans Date: Mon Oct 29 02:58:30 2018 New Revision: 339849 URL: https://svnweb.freebsd.org/changeset/base/339849 Log: lualoader: Fix try_include error handling The previous iteration of try_include attempted to be 'friendly' and error() out if we hit an error that wasn't ENOENT. This was semi-OK, but fragile as it relied on pattern matching the error message. Move the responsibility for handling failure to the caller. Following a common lua pattern, we'll return the return value of the underlying require() on success, or false and an error message. Reported by: bcran MFC after: 3 days Modified: head/stand/lua/core.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Sun Oct 28 23:54:05 2018 (r339848) +++ head/stand/lua/core.lua Mon Oct 29 02:58:30 2018 (r339849) @@ -66,23 +66,15 @@ end -- Globals --- try_include will return the loaded module on success, or nil on failure. --- A message will also be printed on failure, with one exception: non-verbose --- loading will suppress 'module not found' errors. +-- try_include will return the loaded module on success, or false and the error +-- message on failure. function try_include(module) local status, ret = pcall(require, module) -- ret is the module if we succeeded. if status then return ret end - -- Otherwise, ret is just a message; filter out ENOENT unless we're - -- doing a verbose load. As a consequence, try_include prior to loading - -- configuration will not display 'module not found'. All other errors - -- in loading will be printed. - if config.verbose or ret:match("^module .+ not found") == nil then - error(ret, 2) - end - return nil + return false, ret end -- Module exports From owner-svn-src-head@freebsd.org Mon Oct 29 14:36:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20BC610DB65E; Mon, 29 Oct 2018 14:36:05 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDF6073684; Mon, 29 Oct 2018 14:36:04 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A8FF7B7F; Mon, 29 Oct 2018 14:36:04 +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 w9TEa4mp041366; Mon, 29 Oct 2018 14:36:04 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TEa4xe041365; Mon, 29 Oct 2018 14:36:04 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201810291436.w9TEa4xe041365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Mon, 29 Oct 2018 14:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339861 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 339861 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 14:36:05 -0000 Author: shurd Date: Mon Oct 29 14:36:03 2018 New Revision: 339861 URL: https://svnweb.freebsd.org/changeset/base/339861 Log: Drain grouptaskqueue of the gtask before detaching it. taskqgroup_detach() would remove the task even if it was running or enqueued, which could lead to panics (see D17404). With this change, taskqgroup_detach() drains the task and sets a new flag which prevents the task from being scheduled again. I've added grouptask_block() and grouptask_unblock() to allow control over the flag from other locations as well. Reviewed by: Jeffrey Pieper MFC after: 1 week Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D17674 Modified: head/sys/kern/subr_gtaskqueue.c head/sys/sys/gtaskqueue.h Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Mon Oct 29 14:06:20 2018 (r339860) +++ head/sys/kern/subr_gtaskqueue.c Mon Oct 29 14:36:03 2018 (r339861) @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_GTASKQUEUE, "gtaskqueue", "Group Task Queues"); static void gtaskqueue_thread_enqueue(void *); static void gtaskqueue_thread_loop(void *arg); +static int task_is_running(struct gtaskqueue *queue, struct gtask *gtask); +static void gtaskqueue_drain_locked(struct gtaskqueue *queue, struct gtask *gtask); TASKQGROUP_DEFINE(softirq, mp_ncpus, 1); TASKQGROUP_DEFINE(config, 1, 1); @@ -183,6 +185,44 @@ gtaskqueue_free(struct gtaskqueue *queue) free(queue, M_GTASKQUEUE); } +/* + * Wait for all to complete, then prevent it from being enqueued + */ +void +grouptask_block(struct grouptask *grouptask) +{ + struct gtaskqueue *queue = grouptask->gt_taskqueue; + struct gtask *gtask = &grouptask->gt_task; + +#ifdef INVARIANTS + if (queue == NULL) { + gtask_dump(gtask); + panic("queue == NULL"); + } +#endif + TQ_LOCK(queue); + gtask->ta_flags |= TASK_NOENQUEUE; + gtaskqueue_drain_locked(queue, gtask); + TQ_UNLOCK(queue); +} + +void +grouptask_unblock(struct grouptask *grouptask) +{ + struct gtaskqueue *queue = grouptask->gt_taskqueue; + struct gtask *gtask = &grouptask->gt_task; + +#ifdef INVARIANTS + if (queue == NULL) { + gtask_dump(gtask); + panic("queue == NULL"); + } +#endif + TQ_LOCK(queue); + gtask->ta_flags &= ~TASK_NOENQUEUE; + TQ_UNLOCK(queue); +} + int grouptaskqueue_enqueue(struct gtaskqueue *queue, struct gtask *gtask) { @@ -197,6 +237,10 @@ grouptaskqueue_enqueue(struct gtaskqueue *queue, struc TQ_UNLOCK(queue); return (0); } + if (gtask->ta_flags & TASK_NOENQUEUE) { + TQ_UNLOCK(queue); + return (EAGAIN); + } STAILQ_INSERT_TAIL(&queue->tq_queue, gtask, ta_link); gtask->ta_flags |= TASK_ENQUEUED; TQ_UNLOCK(queue); @@ -378,6 +422,13 @@ gtaskqueue_cancel(struct gtaskqueue *queue, struct gta return (error); } +static void +gtaskqueue_drain_locked(struct gtaskqueue *queue, struct gtask *gtask) +{ + while ((gtask->ta_flags & TASK_ENQUEUED) || task_is_running(queue, gtask)) + TQ_SLEEP(queue, gtask, &queue->tq_mutex, PWAIT, "-", 0); +} + void gtaskqueue_drain(struct gtaskqueue *queue, struct gtask *gtask) { @@ -386,8 +437,7 @@ gtaskqueue_drain(struct gtaskqueue *queue, struct gtas WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); TQ_LOCK(queue); - while ((gtask->ta_flags & TASK_ENQUEUED) || task_is_running(queue, gtask)) - TQ_SLEEP(queue, gtask, &queue->tq_mutex, PWAIT, "-", 0); + gtaskqueue_drain_locked(queue, gtask); TQ_UNLOCK(queue); } @@ -803,6 +853,7 @@ taskqgroup_detach(struct taskqgroup *qgroup, struct gr { int i; + grouptask_block(gtask); mtx_lock(&qgroup->tqg_lock); for (i = 0; i < qgroup->tqg_cnt; i++) if (qgroup->tqg_queue[i].tgc_taskq == gtask->gt_taskqueue) @@ -813,6 +864,7 @@ taskqgroup_detach(struct taskqgroup *qgroup, struct gr LIST_REMOVE(gtask, gt_list); mtx_unlock(&qgroup->tqg_lock); gtask->gt_taskqueue = NULL; + gtask->gt_task.ta_flags &= ~TASK_NOENQUEUE; } static void Modified: head/sys/sys/gtaskqueue.h ============================================================================== --- head/sys/sys/gtaskqueue.h Mon Oct 29 14:06:20 2018 (r339860) +++ head/sys/sys/gtaskqueue.h Mon Oct 29 14:36:03 2018 (r339861) @@ -52,7 +52,9 @@ int gtaskqueue_cancel(struct gtaskqueue *queue, struct void gtaskqueue_drain(struct gtaskqueue *queue, struct gtask *task); void gtaskqueue_drain_all(struct gtaskqueue *queue); -int grouptaskqueue_enqueue(struct gtaskqueue *queue, struct gtask *task); +void grouptask_block(struct grouptask *grouptask); +void grouptask_unblock(struct grouptask *grouptask); +int grouptaskqueue_enqueue(struct gtaskqueue *queue, struct gtask *task); void taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *grptask, void *uniq, int irq, const char *name); int taskqgroup_attach_cpu(struct taskqgroup *qgroup, struct grouptask *grptask, @@ -67,6 +69,7 @@ void taskqgroup_config_gtask_deinit(struct grouptask * #define TASK_ENQUEUED 0x1 #define TASK_SKIP_WAKEUP 0x2 +#define TASK_NOENQUEUE 0x4 #define GTASK_INIT(task, flags, priority, func, context) do { \ From owner-svn-src-head@freebsd.org Mon Oct 29 17:03:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D037010E044E; Mon, 29 Oct 2018 17:03:21 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 824497962E; Mon, 29 Oct 2018 17:03:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 634EB113D7; Mon, 29 Oct 2018 17:03:21 +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 w9TH3LI8017806; Mon, 29 Oct 2018 17:03:21 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TH3LFv017805; Mon, 29 Oct 2018 17:03:21 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810291703.w9TH3LFv017805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 29 Oct 2018 17:03:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339864 - head/lib/csu/tests X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/lib/csu/tests X-SVN-Commit-Revision: 339864 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 17:03:22 -0000 Author: andrew Date: Mon Oct 29 17:03:20 2018 New Revision: 339864 URL: https://svnweb.freebsd.org/changeset/base/339864 Log: Check __dso_handle is NULL in non-DSO objects. It should only be non-NULL when accessed from a shared object. MFC with: r339738 Sponsored by: DARPA, AFRL Modified: head/lib/csu/tests/fini_test.c Modified: head/lib/csu/tests/fini_test.c ============================================================================== --- head/lib/csu/tests/fini_test.c Mon Oct 29 15:12:15 2018 (r339863) +++ head/lib/csu/tests/fini_test.c Mon Oct 29 17:03:20 2018 (r339864) @@ -119,11 +119,22 @@ ATF_TC_BODY(fini_array_test, tc) } } +extern void *__dso_handle; + +ATF_TC_WITHOUT_HEAD(dso_handle_test); +ATF_TC_BODY(dso_handle_test, tc) +{ + + ATF_REQUIRE_MSG(__dso_handle == NULL, + "Invalid __dso_handle in non-DSO"); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, dtors_test); ATF_TP_ADD_TC(tp, fini_array_test); + ATF_TP_ADD_TC(tp, dso_handle_test); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Mon Oct 29 17:13:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C62310E0855; Mon, 29 Oct 2018 17:13:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE2AF79BE5; Mon, 29 Oct 2018 17:13: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B53F11575; Mon, 29 Oct 2018 17:13: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 w9THDCp9023134; Mon, 29 Oct 2018 17:13:12 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9THDCQx023133; Mon, 29 Oct 2018 17:13:12 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810291713.w9THDCQx023133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 29 Oct 2018 17:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339865 - head/etc/mtree X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/etc/mtree X-SVN-Commit-Revision: 339865 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 17:13:13 -0000 Author: andrew Date: Mon Oct 29 17:13:12 2018 New Revision: 339865 URL: https://svnweb.freebsd.org/changeset/base/339865 Log: Include the csu test directories in BSD.tests.dist MFC with: r339738 Sponsored by: DARPA, AFRL Modified: head/etc/mtree/BSD.tests.dist Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Oct 29 17:03:20 2018 (r339864) +++ head/etc/mtree/BSD.tests.dist Mon Oct 29 17:13:12 2018 (r339865) @@ -270,6 +270,12 @@ test-programs .. .. + csu + dynamic + .. + static + .. + .. libarchive .. libc From owner-svn-src-head@freebsd.org Mon Oct 29 17:55:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7900D10E1A2D; Mon, 29 Oct 2018 17:55:27 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AD997B5D5; Mon, 29 Oct 2018 17:55:27 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BFBF11C2D; Mon, 29 Oct 2018 17:55:27 +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 w9THtQBG043645; Mon, 29 Oct 2018 17:55:26 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9THtQLx043644; Mon, 29 Oct 2018 17:55:26 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810291755.w9THtQLx043644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 29 Oct 2018 17:55:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339866 - head/lib/csu/common X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/lib/csu/common X-SVN-Commit-Revision: 339866 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 17:55:27 -0000 Author: andrew Date: Mon Oct 29 17:55:26 2018 New Revision: 339866 URL: https://svnweb.freebsd.org/changeset/base/339866 Log: Make the .ctors, .dtors, and .jcr markers as static. They shouldn't be accessible from out of the files they are defined in. MFC with: r339738 Sponsored by: DARPA, AFRL Modified: head/lib/csu/common/crtbegin.c head/lib/csu/common/crtend.c Modified: head/lib/csu/common/crtbegin.c ============================================================================== --- head/lib/csu/common/crtbegin.c Mon Oct 29 17:13:12 2018 (r339865) +++ head/lib/csu/common/crtbegin.c Mon Oct 29 17:55:26 2018 (r339866) @@ -45,10 +45,10 @@ void *__dso_handle = 0; #ifdef HAVE_CTORS static void __do_global_dtors_aux(void) __used; -crt_func __CTOR_LIST__[] __section(".ctors") __hidden = { +static crt_func __CTOR_LIST__[] __section(".ctors") = { (crt_func)-1 }; -crt_func __DTOR_LIST__[] __section(".dtors") __hidden = { +static crt_func __DTOR_LIST__[] __section(".dtors") = { (crt_func)-1 }; @@ -81,7 +81,7 @@ asm ( extern void _Jv_RegisterClasses(void *) __weak_symbol; static void register_classes(void) __used; -crt_func __JCR_LIST__[] __section(".jcr") __used __hidden = { }; +static crt_func __JCR_LIST__[] __section(".jcr") __used = { }; #ifndef CTORS_CONSTRUCTORS __attribute__((constructor)) Modified: head/lib/csu/common/crtend.c ============================================================================== --- head/lib/csu/common/crtend.c Mon Oct 29 17:13:12 2018 (r339865) +++ head/lib/csu/common/crtend.c Mon Oct 29 17:55:26 2018 (r339866) @@ -35,10 +35,10 @@ typedef void (*crt_func)(void); */ static void __do_global_ctors_aux(void) __used; -crt_func __CTOR_END__[] __section(".ctors") __used __hidden = { +static crt_func __CTOR_END__[] __section(".ctors") __used = { (crt_func)0 }; -crt_func __DTOR_END__[] __section(".dtors") __used __hidden = { +static crt_func __DTOR_END__[] __section(".dtors") __used = { (crt_func)0 }; From owner-svn-src-head@freebsd.org Mon Oct 29 19:02:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 644C610E324A; Mon, 29 Oct 2018 19:02:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AF577DCAF; Mon, 29 Oct 2018 19:02:37 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1C8B1279B; Mon, 29 Oct 2018 19:02:36 +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 w9TJ2agf080040; Mon, 29 Oct 2018 19:02:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TJ2akS080039; Mon, 29 Oct 2018 19:02:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810291902.w9TJ2akS080039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 29 Oct 2018 19:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339868 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 339868 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 19:02:37 -0000 Author: hselasky Date: Mon Oct 29 19:02:36 2018 New Revision: 339868 URL: https://svnweb.freebsd.org/changeset/base/339868 Log: Implement dma_pool_zalloc() in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/dmapool.h Modified: head/sys/compat/linuxkpi/common/include/linux/dmapool.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/dmapool.h Mon Oct 29 19:01:47 2018 (r339867) +++ head/sys/compat/linuxkpi/common/include/linux/dmapool.h Mon Oct 29 19:02:36 2018 (r339868) @@ -77,6 +77,13 @@ dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags, return (vaddr); } +static inline void * +dma_pool_zalloc(struct dma_pool *pool, gfp_t mem_flags, dma_addr_t *handle) +{ + + return (dma_pool_alloc(pool, mem_flags | __GFP_ZERO, handle)); +} + static inline void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr) { From owner-svn-src-head@freebsd.org Mon Oct 29 19:14:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D34510E362F; Mon, 29 Oct 2018 19:14:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA2FC7E33E; Mon, 29 Oct 2018 19:14:56 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94D441292B; Mon, 29 Oct 2018 19:14:56 +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 w9TJEupG085288; Mon, 29 Oct 2018 19:14:56 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TJEuwP085287; Mon, 29 Oct 2018 19:14:56 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201810291914.w9TJEuwP085287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 29 Oct 2018 19:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339869 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 339869 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 19:14:57 -0000 Author: tuexen Date: Mon Oct 29 19:14:56 2018 New Revision: 339869 URL: https://svnweb.freebsd.org/changeset/base/339869 Log: Fix a nit Reported by: gjb@ MFC after: 3 days Modified: head/share/man/man4/sctp.4 Modified: head/share/man/man4/sctp.4 ============================================================================== --- head/share/man/man4/sctp.4 Mon Oct 29 19:02:36 2018 (r339868) +++ head/share/man/man4/sctp.4 Mon Oct 29 19:14:56 2018 (r339869) @@ -592,8 +592,6 @@ Maximum incoming SCTP buffer size. .It Va sendspace Maximum outgoing SCTP buffer size. .El -.El - .Sh SEE ALSO .Xr accept 2 , .Xr bind 2 , From owner-svn-src-head@freebsd.org Mon Oct 29 19:25:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D223910E8041; Mon, 29 Oct 2018 19:25:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 778457F0E2; Mon, 29 Oct 2018 19: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52F6012AB9; Mon, 29 Oct 2018 19: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 w9TJPVmd090186; Mon, 29 Oct 2018 19:25:31 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TJPVY2090185; Mon, 29 Oct 2018 19:25:31 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201810291925.w9TJPVY2090185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 29 Oct 2018 19:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339870 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 339870 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 19:25:32 -0000 Author: tuexen Date: Mon Oct 29 19:25:30 2018 New Revision: 339870 URL: https://svnweb.freebsd.org/changeset/base/339870 Log: Insert a .El line accidently committed in r339869. Reported by: gjb@ MFC after: 3 days Modified: head/share/man/man4/sctp.4 Modified: head/share/man/man4/sctp.4 ============================================================================== --- head/share/man/man4/sctp.4 Mon Oct 29 19:14:56 2018 (r339869) +++ head/share/man/man4/sctp.4 Mon Oct 29 19:25:30 2018 (r339870) @@ -592,6 +592,7 @@ Maximum incoming SCTP buffer size. .It Va sendspace Maximum outgoing SCTP buffer size. .El +.El .Sh SEE ALSO .Xr accept 2 , .Xr bind 2 , From owner-svn-src-head@freebsd.org Mon Oct 29 20:27:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46EF610E9241; Mon, 29 Oct 2018 20:27:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2487810CD; Mon, 29 Oct 2018 20:27:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 5BE3110AFD2; Mon, 29 Oct 2018 16:27:08 -0400 (EDT) Subject: Re: svn commit: r339826 - in head: sys/amd64/vmm/intel usr.sbin/bhyve To: Yuri Pankov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810272124.w9RLOTpU054208@repo.freebsd.org> From: John Baldwin Message-ID: Date: Mon, 29 Oct 2018 10:24:37 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201810272124.w9RLOTpU054208@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 29 Oct 2018 16:27:08 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 20:27:10 -0000 On 10/27/18 2:24 PM, Yuri Pankov wrote: > Author: yuripv > Date: Sat Oct 27 21:24:28 2018 > New Revision: 339826 > URL: https://svnweb.freebsd.org/changeset/base/339826 > > Log: > Provide basic descriptions for VMX exit reason (from "Intel 64 and IA-32 > Architectures Software Developer’s Manual Volume 3"). Add the document > to SEE ALSO in bhyve.8 (and pet manlint here a bit). > > Reviewed by: jhb, rgrimes, 0mp > Approved by: kib (mentor) > Differential Revision: https://reviews.freebsd.org/D17531 I did ask you to commit the bhyve.8 style fixes separately from the content changes in the review. While it is true we don't currently have active translations of manpages, it is still a good practice to follow to not mix style changes with content changes even in code commits as it obfuscates the content changes. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Oct 29 20:36:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D617810E9761; Mon, 29 Oct 2018 20:36:08 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A7A7816A3; Mon, 29 Oct 2018 20:36:08 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 9279C21F71; Mon, 29 Oct 2018 16:36:02 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 29 Oct 2018 16:36:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=aSXYu5 X3V0fvbzKYAxeRqlQt/r2p6+uuDwEReg/9fpY=; b=F+/licSt6ACGaWD2oZ43d/ pePNm7ReLERAK2KEGDWrLUXko3LjX2Qpt8MTWIqrECK//F0f+75A+ySk8FDUKRzn wRmQSekXEGPd/L5X1nHRqklPTeySjxVemh5HpTzHpOFli4qG9SLx/y1xOefX1+Iu JFehrswJWMGJHczqYkLmQH1ofjwtJVs3mT6Fn9dIc9HZ1vynZxj5Sgd849kSuJ6L 1AYYdaifPrj/voXsFxo7IV2mD2ocBuoynL45y9AA45sJiks9AXIYfqcBMw/1TsBZ CmoSaZcOxFkdLr7Q2nA15AF0ZV5frJIRyhL4EGsFJd3mLXLkvGHjiFVEkzLQOh5Q == X-ME-Sender: X-ME-Proxy: Received: from [192.168.1.2] (unknown [178.34.115.95]) by mail.messagingengine.com (Postfix) with ESMTPA id DED14E49FA; Mon, 29 Oct 2018 16:35:59 -0400 (EDT) Subject: Re: svn commit: r339826 - in head: sys/amd64/vmm/intel usr.sbin/bhyve To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810272124.w9RLOTpU054208@repo.freebsd.org> From: Yuri Pankov Openpgp: preference=signencrypt Autocrypt: addr=yuripv@FreeBSD.org; keydata= xsBNBFu8u6IBCADB11gP0QwnorrHjqAtKLHKHNHskhy0s7jqJKfx0YqXgVBKGLJ9/mjLAz0F CBNvemHSDDTs0mEZ9cBKKi6cmsav6+UQgr//yai6hvXLBJqKchSFO4MhmdvBtsGFq1yKz5Zi uhjmimKyIpgBgvMdbgGbGq6cnSB2uEPmZuJr419SVRODOkXukU+F5WHgaHzDdHAIu1asCt2B +6msxqIqlFWcXyZyTGicTGGvC/PFIsVRUtD1dIJANTC876g7DTb7LZXWiWwJpSJ4GKMXMHVX Ct9BoQ4i3nhKbOxb6Io1wsy+NFyWsTJ9KYrxKKPJP3oG8BWb/cqlFqnE4eNSsiq2q7krABEB AAHNIFl1cmkgUGFua292IDx5dXJpcHZARnJlZUJTRC5vcmc+wsCUBBMBCgA+FiEE+Gq3PsPe LT4tL/9wk4vgf7Eq4WwFAlu9Cn0CGwMFCQWjmoAFCwkIBwMFFQoJCAsFFgMCAQACHgECF4AA CgkQk4vgf7Eq4WxuPQf9HccaDyusO1J+wDQNlp9/uU0cnIfjHAeG80xrAfN9Vnf1wO9T2/WI iYlIdK+KVnhSa/DeBuHq/asfpUbrOleTF0hzG39os+95DzuT9a/j5XeQGuBgNbpVB+10zR3I 5AagSQetHilcZtz65g9GTUuIxb+xDaBehFBjyYXApfNE6yY5IlzDZpM7MOOLLFm2mQwQ8yjS eZ4jA6qW6/QMXRTkmpC9EXIeWDuNgWBwszaFGR6oUIpl0mGmwdJkEKwUazt6OuoDilMNZefZ 0pVFZBhnE46vK+6FDDFZE3BkeHVnqvy2QGL/6uKhSHc0lChCEPHnhqz6v23MwcQ6ktVWzvBJ oM7ATQRbvLuiAQgAyood0Pd96wzY+GQPBYQUNkZZgYL8Di3AzyC94dFe4d/Mt/h4rIBUnFwA g7Ha05WGdW0V5A/RRxDcpwXL9Jf97hiQ5PI2hiAxNEz/DkAUafiGlPfwR5wKqysUyRiKJQ2o ctpvssdsoXXOgeLo1jA6ghda1jg/spjlsPlS5ZTpKx3GWuTybV/VDhmwKWZfGUzPBJeAgDTf BdW4PTFs1IvvC2KBlhnPgcLBUtTlAdXOEj4DLuXw+Fn7K/ckZdOn3aRANmE+wf4+f+UUgtLB NmbP7ZifyUX5RyddsnI+fZmtsUDHxCReNIWQ6TBUJmb21aoBIN6HEHJbY28ZSCmf5owuMwAR AQABwsB8BBgBCgAmFiEE+Gq3PsPeLT4tL/9wk4vgf7Eq4WwFAlu8u6ICGwwFCQWjmoAACgkQ k4vgf7Eq4WyA3AgAqgGTHKMVAS2WuNGuW9uI+YtY6ZbwmGG94fkOZbefgRSfO5Am+HSblA95 IdotvQa8VkFmvVjbnvaM8XmJG5H17m0GF3sVaJUbJ4euDnRrBPCr6KwRQQd83Svxkbdicvo7 J031FrkJZW8zD9DH4QgzJNTKPFrwx9v3DhD/8iyn9tGvnHepy7O24nY5hl6PacrgSgLVeir/ lUbueAC/gP1AWLv3gdw7b83J7rftWauimj/vpFMD8CDSyJNODgQ8DdM0TU4qjABWGMs9r2Rw QehNbYf5f/2QuW/Q5NGaRSNW2HS/cpp62XtTKmxj5wwk6EMbtNE/6WQpumfdmK2UGLjcJQ== Message-ID: <11b17c28-25fb-e578-5cc0-2e6f5fef2140@FreeBSD.org> Date: Mon, 29 Oct 2018 23:35:51 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Mreip84OUE9htVsBeZSfkFXpsmy2bgXXX" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 20:36:09 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Mreip84OUE9htVsBeZSfkFXpsmy2bgXXX Content-Type: multipart/mixed; boundary="wjh5qvIVRbmYLEv8R15fKubObaqvf0GpF"; protected-headers="v1" From: Yuri Pankov To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <11b17c28-25fb-e578-5cc0-2e6f5fef2140@FreeBSD.org> Subject: Re: svn commit: r339826 - in head: sys/amd64/vmm/intel usr.sbin/bhyve References: <201810272124.w9RLOTpU054208@repo.freebsd.org> In-Reply-To: --wjh5qvIVRbmYLEv8R15fKubObaqvf0GpF Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable John Baldwin wrote: > On 10/27/18 2:24 PM, Yuri Pankov wrote: >> Author: yuripv >> Date: Sat Oct 27 21:24:28 2018 >> New Revision: 339826 >> URL: https://svnweb.freebsd.org/changeset/base/339826 >> >> Log: >> Provide basic descriptions for VMX exit reason (from "Intel 64 and I= A-32 >> Architectures Software Developer=E2=80=99s Manual Volume 3"). Add t= he document >> to SEE ALSO in bhyve.8 (and pet manlint here a bit). >> =20 >> Reviewed by: jhb, rgrimes, 0mp >> Approved by: kib (mentor) >> Differential Revision: https://reviews.freebsd.org/D17531 >=20 > I did ask you to commit the bhyve.8 style fixes separately from the con= tent > changes in the review. While it is true we don't currently have active= > translations of manpages, it is still a good practice to follow to not = mix > style changes with content changes even in code commits as it obfuscate= s > the content changes. Understood, will do. I just (incorrectly) assumed your review approval to be "go ahead with this one, but next time don't mix content changes and cleanups", sorry about that. --wjh5qvIVRbmYLEv8R15fKubObaqvf0GpF-- --Mreip84OUE9htVsBeZSfkFXpsmy2bgXXX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE+Gq3PsPeLT4tL/9wk4vgf7Eq4WwFAlvXby4ACgkQk4vgf7Eq 4WyYjAgAq1F9KjxfkTDabiqVcgplW+an0Is3B3F0ARqJBmzXiMvKwrJjw7KBdL8k JKJbK7qXjb2KmX+DlwNKb8aUea6X0TKG+AqSt6PFmzECTgTt6sbfdQLyRzPXDomT v4av0WT53ZpmXcVK4P08GnHb3Thv09e6gGCDXDHS4xD0r/ZSK1L2v8B5NtJhS0Ro aXTpI+jjqDeeH3M3+tO+QVM5hMTs5sRkq+uMBaSx6MpFKVhSSopubZ9LMdixXzog MenUVecoecqgYhywca0TcIFVQktAJfMTeVoXm69BPTolFahqnrP7lee32DDsIGMa FvMeibQpLz7x4F1NXZSTtR/lkKHi9A== =JsOw -----END PGP SIGNATURE----- --Mreip84OUE9htVsBeZSfkFXpsmy2bgXXX-- From owner-svn-src-head@freebsd.org Mon Oct 29 20:53:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60B7010E9CC3; Mon, 29 Oct 2018 20:53:06 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0851282780; Mon, 29 Oct 2018 20:53:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7ECE13924; Mon, 29 Oct 2018 20:53:05 +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 w9TKr5W3036536; Mon, 29 Oct 2018 20:53:05 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TKr58H036535; Mon, 29 Oct 2018 20:53:05 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201810292053.w9TKr58H036535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 29 Oct 2018 20:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339873 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 339873 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 20:53:06 -0000 Author: gjb Date: Mon Oct 29 20:53:05 2018 New Revision: 339873 URL: https://svnweb.freebsd.org/changeset/base/339873 Log: Set OPTIONS_UNSET in the argument list to env(1), and add AVAHI to the list. This fixes the textproc/docproj build seemingly following FLAVORS being added. Specifically, the problem with the dependency chain here is: - textproc/docproj depends on print/cups, which sets AVAHI=on by default; - net/avahi-app depends on devel/gobject-introspection, which requires python3+; - graphics/netpbm depends on graphics/mesa-libs, which can only be built with python2.7; - textproc/docproj depends on a number of graphics ports for font rendering, etc. MFC after: 3 days MFC before: 12.0-BETA3 Sponsored by: The FreeBSD Foundation Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Mon Oct 29 20:21:10 2018 (r339872) +++ head/release/release.sh Mon Oct 29 20:53:05 2018 (r339873) @@ -287,9 +287,9 @@ extra_chroot_setup() { PBUILD_FLAGS="${PBUILD_FLAGS} OSREL=${REVISION}" PBUILD_FLAGS="${PBUILD_FLAGS} WRKDIRPREFIX=/tmp/ports" PBUILD_FLAGS="${PBUILD_FLAGS} DISTDIR=/tmp/distfiles" - chroot ${CHROOTDIR} env ${PBUILD_FLAGS} make -C \ + chroot ${CHROOTDIR} env ${PBUILD_FLAGS} \ + OPTIONS_UNSET="AVAHI FOP IGOR" make -C \ /usr/ports/textproc/docproj \ - OPTIONS_UNSET="FOP IGOR" \ FORCE_PKG_REGISTER=1 \ install clean distclean fi From owner-svn-src-head@freebsd.org Mon Oct 29 21:03:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5779110EA06C; Mon, 29 Oct 2018 21:03:44 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08EA882E40; Mon, 29 Oct 2018 21:03:44 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF10313AD8; Mon, 29 Oct 2018 21:03:43 +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 w9TL3hhh041670; Mon, 29 Oct 2018 21:03:43 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TL3hxT041669; Mon, 29 Oct 2018 21:03:43 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201810292103.w9TL3hxT041669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 29 Oct 2018 21:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339875 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 339875 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 21:03:44 -0000 Author: gjb Date: Mon Oct 29 21:03:43 2018 New Revision: 339875 URL: https://svnweb.freebsd.org/changeset/base/339875 Log: Pass _BRANCH in the reldoc target to ensure the correct src branch is used when generating the hardware.html page. MFC after: 3 days MFC before: 12.0-BETA3 MFC with: r339873 Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Mon Oct 29 21:00:16 2018 (r339874) +++ head/release/Makefile Mon Oct 29 21:03:43 2018 (r339875) @@ -174,6 +174,7 @@ reldoc: cd ${DOCDIR}/en_US.ISO8859-1/htdocs/releases/${REVISION}R && \ env MAN4DIR=${WORLDDIR}/share/man/man4 \ SVN=${SVN} \ + _BRANCH=${BRANCH} \ ${MAKE} all install clean "FORMATS=html txt" \ INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc \ WEBDIR=${DOCDIR} DESTDIR=${.OBJDIR}/rdoc From owner-svn-src-head@freebsd.org Mon Oct 29 21:08:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D991A10EA197; Mon, 29 Oct 2018 21:08:03 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EEC983016; Mon, 29 Oct 2018 21:08:03 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B4AB13ADB; Mon, 29 Oct 2018 21:08:03 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TL83Gb041915; Mon, 29 Oct 2018 21:08:03 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TL83bO041913; Mon, 29 Oct 2018 21:08:03 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201810292108.w9TL83bO041913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 29 Oct 2018 21:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339876 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 339876 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 21:08:04 -0000 Author: arichardson Date: Mon Oct 29 21:08:02 2018 New Revision: 339876 URL: https://svnweb.freebsd.org/changeset/base/339876 Log: rtld: set obj->textsize correctly With lld-generated binaries the first PT_LOAD will usually be a read-only segment unless you pass --no-rosegment. For those binaries the textsize is determined by the next PT_LOAD. To allow both LLD and bfd 2.17 binaries to be parsed correctly use the end of the last PT_LOAD that is marked as executable instead. I noticed that the value was wrong while adding some debug prints for some rtld changes for CHERI binaries. `obj->textsize` only seems to be used by PPC so the effect is untested. However, the value before was definitely wrong and the new result matches the phdrs. Reviewed By: kib Approved By: brooks (mentor) Differential Revision: https://reviews.freebsd.org/D17117 Modified: head/libexec/rtld-elf/map_object.c head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/map_object.c ============================================================================== --- head/libexec/rtld-elf/map_object.c Mon Oct 29 21:03:43 2018 (r339875) +++ head/libexec/rtld-elf/map_object.c Mon Oct 29 21:08:02 2018 (r339876) @@ -93,6 +93,7 @@ map_object(int fd, const char *path, const struct stat Elf_Addr note_end; char *note_map; size_t note_map_len; + Elf_Addr text_end; hdr = get_elf_header(fd, path, sb); if (hdr == NULL) @@ -116,6 +117,7 @@ map_object(int fd, const char *path, const struct stat note_map = NULL; segs = alloca(sizeof(segs[0]) * hdr->e_phnum); stack_flags = RTLD_DEFAULT_STACK_PF_EXEC | PF_R | PF_W; + text_end = 0; while (phdr < phlimit) { switch (phdr->p_type) { @@ -130,6 +132,10 @@ map_object(int fd, const char *path, const struct stat path, nsegs); goto error; } + if ((segs[nsegs]->p_flags & PF_X) == PF_X) { + text_end = MAX(text_end, + round_page(segs[nsegs]->p_vaddr + segs[nsegs]->p_memsz)); + } break; case PT_PHDR: @@ -280,8 +286,7 @@ map_object(int fd, const char *path, const struct stat } obj->mapbase = mapbase; obj->mapsize = mapsize; - obj->textsize = round_page(segs[0]->p_vaddr + segs[0]->p_memsz) - - base_vaddr; + obj->textsize = text_end - base_vaddr; obj->vaddrbase = base_vaddr; obj->relocbase = mapbase - base_vaddr; obj->dynamic = (const Elf_Dyn *) (obj->relocbase + phdyn->p_vaddr); Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Oct 29 21:03:43 2018 (r339875) +++ head/libexec/rtld-elf/rtld.c Mon Oct 29 21:08:02 2018 (r339876) @@ -1390,13 +1390,15 @@ digest_phdr(const Elf_Phdr *phdr, int phnum, caddr_t e if (nsegs == 0) { /* First load segment */ obj->vaddrbase = trunc_page(ph->p_vaddr); obj->mapbase = obj->vaddrbase + obj->relocbase; - obj->textsize = round_page(ph->p_vaddr + ph->p_memsz) - - obj->vaddrbase; } else { /* Last load segment */ obj->mapsize = round_page(ph->p_vaddr + ph->p_memsz) - obj->vaddrbase; } nsegs++; + if ((ph->p_flags & PF_X) == PF_X) { + obj->textsize = MAX(obj->textsize, + round_page(ph->p_vaddr + ph->p_memsz) - obj->vaddrbase); + } break; case PT_DYNAMIC: From owner-svn-src-head@freebsd.org Mon Oct 29 21:08:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E22610EA1BD; Mon, 29 Oct 2018 21:08:16 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51751830F8; Mon, 29 Oct 2018 21:08:16 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D494B13AE3; Mon, 29 Oct 2018 21:08:12 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TL8C3S041974; Mon, 29 Oct 2018 21:08:12 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TL8B5N041969; Mon, 29 Oct 2018 21:08:11 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201810292108.w9TL8B5N041969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 29 Oct 2018 21:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339877 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 339877 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 21:08:17 -0000 Author: arichardson Date: Mon Oct 29 21:08:11 2018 New Revision: 339877 URL: https://svnweb.freebsd.org/changeset/base/339877 Log: rtld-elf: make it compile with WARNS=3 Reviewed By: kib Approved By: brooks (mentor) Differential Revision: https://reviews.freebsd.org/D17150 Modified: head/libexec/rtld-elf/libmap.c head/libexec/rtld-elf/libmap.h head/libexec/rtld-elf/malloc.c head/libexec/rtld-elf/map_object.c head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h Modified: head/libexec/rtld-elf/libmap.c ============================================================================== --- head/libexec/rtld-elf/libmap.c Mon Oct 29 21:08:02 2018 (r339876) +++ head/libexec/rtld-elf/libmap.c Mon Oct 29 21:08:11 2018 (r339877) @@ -199,8 +199,7 @@ lmc_parse(char *lm_p, size_t lm_len) char prog[MAXPATHLEN]; /* allow includedir + full length path */ char line[MAXPATHLEN + 13]; - size_t cnt; - int i; + size_t cnt, i; cnt = 0; p = NULL; @@ -403,7 +402,7 @@ lm_find(const char *p, const char *f) * replacement library, or NULL. */ char * -lm_findn(const char *p, const char *f, const int n) +lm_findn(const char *p, const char *f, const size_t n) { char pathbuf[64], *s, *t; Modified: head/libexec/rtld-elf/libmap.h ============================================================================== --- head/libexec/rtld-elf/libmap.h Mon Oct 29 21:08:02 2018 (r339876) +++ head/libexec/rtld-elf/libmap.h Mon Oct 29 21:08:11 2018 (r339877) @@ -5,4 +5,4 @@ int lm_init (char *); void lm_fini (void); char * lm_find (const char *, const char *); -char * lm_findn (const char *, const char *, const int); +char * lm_findn (const char *, const char *, const size_t); Modified: head/libexec/rtld-elf/malloc.c ============================================================================== --- head/libexec/rtld-elf/malloc.c Mon Oct 29 21:08:02 2018 (r339876) +++ head/libexec/rtld-elf/malloc.c Mon Oct 29 21:08:11 2018 (r339877) @@ -60,15 +60,11 @@ static char *rcsid = "$FreeBSD$"; #include "rtld_printf.h" #include "paths.h" -static void morecore(); -static int findbucket(); - /* * Pre-allocate mmap'ed pages */ #define NPOOLPAGES (128*1024/pagesz) static caddr_t pagepool_start, pagepool_end; -static int morepages(); /* * The overhead on a block is at least 4 bytes. When free, this space @@ -96,6 +92,11 @@ union overhead { #define ov_size ovu.ovu_size }; +static void morecore(int bucket); +static int morepages(int n); +static int findbucket(union overhead *freep, int srchlen); + + #define MAGIC 0xef /* magic # on accounting info */ #define RMAGIC 0x5555 /* magic # on range info */ @@ -156,10 +157,10 @@ void * malloc(nbytes) size_t nbytes; { - register union overhead *op; - register int bucket; - register long n; - register unsigned amt; + union overhead *op; + int bucket; + size_t n; + unsigned amt; /* * First time malloc is called, setup page size and @@ -259,8 +260,8 @@ static void morecore(bucket) int bucket; { - register union overhead *op; - register int sz; /* size of desired block */ + union overhead *op; + int sz; /* size of desired block */ int amt; /* amount to allocate */ int nblks; /* how many blocks we get */ @@ -303,8 +304,8 @@ void free(cp) void *cp; { - register int size; - register union overhead *op; + int size; + union overhead *op; if (cp == NULL) return; @@ -346,8 +347,8 @@ realloc(cp, nbytes) void *cp; size_t nbytes; { - register u_int onb; - register int i; + u_int onb; + int i; union overhead *op; char *res; int was_alloced = 0; @@ -417,8 +418,8 @@ findbucket(freep, srchlen) union overhead *freep; int srchlen; { - register union overhead *p; - register int i, j; + union overhead *p; + int i, j; for (i = 0; i < NBUCKETS; i++) { j = 0; @@ -442,8 +443,8 @@ findbucket(freep, srchlen) mstats(s) char *s; { - register int i, j; - register union overhead *p; + int i, j; + union overhead *p; int totfree = 0, totused = 0; Modified: head/libexec/rtld-elf/map_object.c ============================================================================== --- head/libexec/rtld-elf/map_object.c Mon Oct 29 21:08:02 2018 (r339876) +++ head/libexec/rtld-elf/map_object.c Mon Oct 29 21:08:11 2018 (r339877) @@ -340,7 +340,7 @@ get_elf_header(int fd, const char *path, const struct Elf_Ehdr *hdr; /* Make sure file has enough data for the ELF header */ - if (sbp != NULL && sbp->st_size < sizeof(Elf_Ehdr)) { + if (sbp != NULL && sbp->st_size < (off_t)sizeof(Elf_Ehdr)) { _rtld_error("%s: invalid file format", path); return (NULL); } Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Oct 29 21:08:02 2018 (r339876) +++ head/libexec/rtld-elf/rtld.c Mon Oct 29 21:08:11 2018 (r339877) @@ -70,7 +70,7 @@ __FBSDID("$FreeBSD$"); #include "notes.h" /* Types. */ -typedef void (*func_ptr_type)(); +typedef void (*func_ptr_type)(void); typedef void * (*path_enum_proc) (const char *path, size_t len, void *arg); /* @@ -236,6 +236,13 @@ int _rtld_get_stack_prot(void) __exported; int _rtld_is_dlopened(void *) __exported; void _rtld_error(const char *, ...) __exported; +/* Only here to fix -Wmissing-prototypes warnings */ +int __getosreldate(void); +void __pthread_cxa_finalize(struct dl_phdr_info *a); +func_ptr_type _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp); +Elf_Addr _rtld_bind(Obj_Entry *obj, Elf_Size reloff); + + int npagesizes, osreldate; size_t *pagesizes; @@ -262,7 +269,7 @@ size_t tls_last_offset; /* Static TLS offset of last size_t tls_last_size; /* Static TLS size of last module */ size_t tls_static_space; /* Static TLS space allocated */ size_t tls_static_max_align; -int tls_dtv_generation = 1; /* Used to detect when dtv size changes */ +Elf_Addr tls_dtv_generation = 1; /* Used to detect when dtv size changes */ int tls_max_index = 1; /* Largest module index allocated */ bool ld_library_path_rpath = false; @@ -4846,7 +4853,7 @@ allocate_tls(Obj_Entry *objs, void *oldtls, size_t tcb char *tls; Elf_Addr *dtv, *olddtv; Elf_Addr segbase, oldsegbase, addr; - int i; + size_t i; ralign = tcbalign; if (tls_static_max_align > ralign) Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Mon Oct 29 21:08:02 2018 (r339876) +++ head/libexec/rtld-elf/rtld.h Mon Oct 29 21:08:11 2018 (r339877) @@ -54,7 +54,7 @@ typedef unsigned char bool; extern size_t tls_last_offset; extern size_t tls_last_size; extern size_t tls_static_space; -extern int tls_dtv_generation; +extern Elf_Addr tls_dtv_generation; extern int tls_max_index; extern int npagesizes; From owner-svn-src-head@freebsd.org Mon Oct 29 21:08:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B25D110EA1E2; Mon, 29 Oct 2018 21:08:24 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62299831A0; Mon, 29 Oct 2018 21:08:24 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CE8513AE4; Mon, 29 Oct 2018 21:08:23 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TL8NJc042048; Mon, 29 Oct 2018 21:08:23 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TL8JPO042029; Mon, 29 Oct 2018 21:08:19 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201810292108.w9TL8JPO042029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 29 Oct 2018 21:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339878 - in head/libexec/rtld-elf: . aarch64 amd64 arm i386 mips powerpc powerpc64 riscv sparc64 X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head/libexec/rtld-elf: . aarch64 amd64 arm i386 mips powerpc powerpc64 riscv sparc64 X-SVN-Commit-Revision: 339878 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 21:08:25 -0000 Author: arichardson Date: Mon Oct 29 21:08:19 2018 New Revision: 339878 URL: https://svnweb.freebsd.org/changeset/base/339878 Log: rtld-elf: compile with WANRS=4 warnings other than -Wcast-align Reviewed By: kib Approved By: brooks (mentor) Differential Revision: https://reviews.freebsd.org/D17153 Modified: head/libexec/rtld-elf/Makefile head/libexec/rtld-elf/aarch64/reloc.c head/libexec/rtld-elf/amd64/reloc.c head/libexec/rtld-elf/arm/reloc.c head/libexec/rtld-elf/i386/reloc.c head/libexec/rtld-elf/i386/rtld_machdep.h head/libexec/rtld-elf/libmap.c head/libexec/rtld-elf/malloc.c head/libexec/rtld-elf/map_object.c head/libexec/rtld-elf/mips/reloc.c head/libexec/rtld-elf/mips/rtld_machdep.h head/libexec/rtld-elf/paths.h head/libexec/rtld-elf/powerpc/reloc.c head/libexec/rtld-elf/powerpc/rtld_machdep.h head/libexec/rtld-elf/powerpc64/reloc.c head/libexec/rtld-elf/powerpc64/rtld_machdep.h head/libexec/rtld-elf/riscv/reloc.c head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h head/libexec/rtld-elf/sparc64/reloc.c Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Mon Oct 29 21:08:11 2018 (r339877) +++ head/libexec/rtld-elf/Makefile Mon Oct 29 21:08:19 2018 (r339878) @@ -31,7 +31,9 @@ LDFLAGS+= -nostdlib -e _rtld_start .else LDFLAGS+= -nostdlib -e .rtld_start .endif -WARNS?= 2 + +NO_WCAST_ALIGN= yes +WARNS?= 4 INSTALLFLAGS= -C -b PRECIOUSPROG= BINDIR= /libexec @@ -95,3 +97,8 @@ SUBDIR.${MK_TESTS}+= tests .include ${PROG_FULL}: ${VERSION_MAP} .include + +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 40300 +# Silence -Wshadow false positives in ancient GCC +CFLAGS+= -Wno-shadow +.endif Modified: head/libexec/rtld-elf/aarch64/reloc.c ============================================================================== --- head/libexec/rtld-elf/aarch64/reloc.c Mon Oct 29 21:08:11 2018 (r339877) +++ head/libexec/rtld-elf/aarch64/reloc.c Mon Oct 29 21:08:19 2018 (r339878) @@ -84,7 +84,7 @@ do_copy_relocations(Obj_Entry *dstobj) */ assert(dstobj->mainprog); - relalim = (const Elf_Rela *)((char *)dstobj->rela + + relalim = (const Elf_Rela *)((const char *)dstobj->rela + dstobj->relasize); for (rela = dstobj->rela; rela < relalim; rela++) { if (ELF_R_TYPE(rela->r_info) != R_AARCH64_COPY) @@ -128,6 +128,8 @@ struct tls_data { const Elf_Rela *rela; }; +int64_t rtld_tlsdesc_handle(struct tls_data *tlsdesc, int flags); + static struct tls_data * reloc_tlsdesc_alloc(Obj_Entry *obj, const Elf_Rela *rela) { @@ -205,7 +207,7 @@ reloc_plt(Obj_Entry *obj) const Elf_Rela *relalim; const Elf_Rela *rela; - relalim = (const Elf_Rela *)((char *)obj->pltrela + obj->pltrelasize); + relalim = (const Elf_Rela *)((const char *)obj->pltrela + obj->pltrelasize); for (rela = obj->pltrela; rela < relalim; rela++) { Elf_Addr *where; @@ -243,7 +245,7 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat const Elf_Sym *def; struct tls_data *tlsdesc; - relalim = (const Elf_Rela *)((char *)obj->pltrela + obj->pltrelasize); + relalim = (const Elf_Rela *)((const char *)obj->pltrela + obj->pltrelasize); for (rela = obj->pltrela; rela < relalim; rela++) { Elf_Addr *where, target; @@ -289,7 +291,7 @@ reloc_iresolve(Obj_Entry *obj, struct Struct_RtldLockS if (!obj->irelative) return (0); - relalim = (const Elf_Rela *)((char *)obj->pltrela + obj->pltrelasize); + relalim = (const Elf_Rela *)((const char *)obj->pltrela + obj->pltrelasize); for (rela = obj->pltrela; rela < relalim; rela++) { if (ELF_R_TYPE(rela->r_info) == R_AARCH64_IRELATIVE) { ptr = (Elf_Addr *)(obj->relocbase + rela->r_addend); @@ -316,7 +318,7 @@ reloc_gnu_ifunc(Obj_Entry *obj, int flags, if (!obj->gnu_ifunc) return (0); - relalim = (const Elf_Rela *)((char *)obj->pltrela + obj->pltrelasize); + relalim = (const Elf_Rela *)((const char *)obj->pltrela + obj->pltrelasize); for (rela = obj->pltrela; rela < relalim; rela++) { if (ELF_R_TYPE(rela->r_info) == R_AARCH64_JUMP_SLOT) { where = (Elf_Addr *)(obj->relocbase + rela->r_offset); @@ -338,8 +340,9 @@ reloc_gnu_ifunc(Obj_Entry *obj, int flags, } Elf_Addr -reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const Obj_Entry *defobj, - const Obj_Entry *obj, const Elf_Rel *rel) +reloc_jmpslot(Elf_Addr *where, Elf_Addr target, + const Obj_Entry *defobj __unused, const Obj_Entry *obj __unused, + const Elf_Rel *rel) { assert(ELF_R_TYPE(rel->r_info) == R_AARCH64_JUMP_SLOT || @@ -386,7 +389,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int cache = calloc(obj->dynsymcount, sizeof(SymCache)); /* No need to check for NULL here */ - relalim = (const Elf_Rela *)((caddr_t)obj->rela + obj->relasize); + relalim = (const Elf_Rela *)((const char *)obj->rela + obj->relasize); for (rela = obj->rela; rela < relalim; rela++) { /* * First, resolve symbol for relocations which @@ -471,7 +474,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int * error. */ if (!defobj->tls_done) { - if (!allocate_tls_offset((Obj_Entry*) defobj)) { + if (!allocate_tls_offset( + __DECONST(Obj_Entry *, defobj))) { _rtld_error( "%s: No space available for static " "Thread Local Storage", obj->path); Modified: head/libexec/rtld-elf/amd64/reloc.c ============================================================================== --- head/libexec/rtld-elf/amd64/reloc.c Mon Oct 29 21:08:11 2018 (r339877) +++ head/libexec/rtld-elf/amd64/reloc.c Mon Oct 29 21:08:19 2018 (r339878) @@ -67,7 +67,7 @@ do_copy_relocations(Obj_Entry *dstobj) assert(dstobj->mainprog); /* COPY relocations are invalid elsewhere */ - relalim = (const Elf_Rela *) ((caddr_t) dstobj->rela + dstobj->relasize); + relalim = (const Elf_Rela *)((const char *) dstobj->rela + dstobj->relasize); for (rela = dstobj->rela; rela < relalim; rela++) { if (ELF_R_TYPE(rela->r_info) == R_X86_64_COPY) { void *dstaddr; @@ -80,7 +80,7 @@ do_copy_relocations(Obj_Entry *dstobj) SymLook req; int res; - dstaddr = (void *) (dstobj->relocbase + rela->r_offset); + dstaddr = (void *)(dstobj->relocbase + rela->r_offset); dstsym = dstobj->symtab + ELF_R_SYM(rela->r_info); name = dstobj->strtab + dstsym->st_name; size = dstsym->st_size; @@ -104,7 +104,7 @@ do_copy_relocations(Obj_Entry *dstobj) return -1; } - srcaddr = (const void *) (defobj->relocbase + srcsym->st_value); + srcaddr = (const void *)(defobj->relocbase + srcsym->st_value); memcpy(dstaddr, srcaddr, size); } } @@ -147,7 +147,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int } else cache = NULL; - relalim = (const Elf_Rela *)((caddr_t)obj->rela + obj->relasize); + relalim = (const Elf_Rela *)((const char*)obj->rela + obj->relasize); for (rela = obj->rela; rela < relalim; rela++) { /* * First, resolve symbol for relocations which @@ -254,7 +254,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int * of space, we generate an error. */ if (!defobj->tls_done) { - if (!allocate_tls_offset((Obj_Entry*) defobj)) { + if (!allocate_tls_offset( + __DECONST(Obj_Entry *, defobj))) { _rtld_error("%s: No space available " "for static Thread Local Storage", obj->path); @@ -274,7 +275,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int * of space, we generate an error. */ if (!defobj->tls_done) { - if (!allocate_tls_offset((Obj_Entry*) defobj)) { + if (!allocate_tls_offset( + __DECONST(Obj_Entry *, defobj))) { _rtld_error("%s: No space available " "for static Thread Local Storage", obj->path); @@ -322,7 +324,7 @@ reloc_plt(Obj_Entry *obj) const Elf_Rela *relalim; const Elf_Rela *rela; - relalim = (const Elf_Rela *)((char *)obj->pltrela + obj->pltrelasize); + relalim = (const Elf_Rela *)((const char *)obj->pltrela + obj->pltrelasize); for (rela = obj->pltrela; rela < relalim; rela++) { Elf_Addr *where; @@ -355,7 +357,7 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat if (obj->jmpslots_done) return 0; - relalim = (const Elf_Rela *)((char *)obj->pltrela + obj->pltrelasize); + relalim = (const Elf_Rela *)((const char *)obj->pltrela + obj->pltrelasize); for (rela = obj->pltrela; rela < relalim; rela++) { Elf_Addr *where, target; const Elf_Sym *def; @@ -392,8 +394,9 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat /* Fixup the jump slot at "where" to transfer control to "target". */ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, - const struct Struct_Obj_Entry *obj, const struct Struct_Obj_Entry *refobj, - const Elf_Rel *rel) + const struct Struct_Obj_Entry *obj __unused, + const struct Struct_Obj_Entry *refobj __unused, + const Elf_Rel *rel __unused) { #ifdef dbg dbg("reloc_jmpslot: *%p = %p", where, (void *)target); @@ -411,7 +414,7 @@ reloc_iresolve(Obj_Entry *obj, RtldLockState *lockstat if (!obj->irelative) return (0); - relalim = (const Elf_Rela *)((char *)obj->pltrela + obj->pltrelasize); + relalim = (const Elf_Rela *)((const char *)obj->pltrela + obj->pltrelasize); for (rela = obj->pltrela; rela < relalim; rela++) { Elf_Addr *where, target, *ptr; @@ -441,7 +444,7 @@ reloc_gnu_ifunc(Obj_Entry *obj, int flags, RtldLockSta if (!obj->gnu_ifunc) return (0); - relalim = (const Elf_Rela *)((char *)obj->pltrela + obj->pltrelasize); + relalim = (const Elf_Rela *)((const char *)obj->pltrela + obj->pltrelasize); for (rela = obj->pltrela; rela < relalim; rela++) { Elf_Addr *where, target; const Elf_Sym *def; Modified: head/libexec/rtld-elf/arm/reloc.c ============================================================================== --- head/libexec/rtld-elf/arm/reloc.c Mon Oct 29 21:08:11 2018 (r339877) +++ head/libexec/rtld-elf/arm/reloc.c Mon Oct 29 21:08:19 2018 (r339878) @@ -75,7 +75,7 @@ do_copy_relocations(Obj_Entry *dstobj) assert(dstobj->mainprog); /* COPY relocations are invalid elsewhere */ - rellim = (const Elf_Rel *) ((caddr_t) dstobj->rel + dstobj->relsize); + rellim = (const Elf_Rel *)((const char *) dstobj->rel + dstobj->relsize); for (rel = dstobj->rel; rel < rellim; rel++) { if (ELF_R_TYPE(rel->r_info) == R_ARM_COPY) { void *dstaddr; @@ -88,7 +88,7 @@ do_copy_relocations(Obj_Entry *dstobj) SymLook req; int res; - dstaddr = (void *) (dstobj->relocbase + rel->r_offset); + dstaddr = (void *)(dstobj->relocbase + rel->r_offset); dstsym = dstobj->symtab + ELF_R_SYM(rel->r_info); name = dstobj->strtab + dstsym->st_name; size = dstsym->st_size; @@ -125,8 +125,6 @@ do_copy_relocations(Obj_Entry *dstobj) void _rtld_bind_start(void); void _rtld_relocate_nonplt_self(Elf_Dyn *, Elf_Addr); -int open(); -int _open(); void _rtld_relocate_nonplt_self(Elf_Dyn *dynp, Elf_Addr relocbase) { @@ -145,7 +143,7 @@ _rtld_relocate_nonplt_self(Elf_Dyn *dynp, Elf_Addr rel break; } } - rellim = (const Elf_Rel *)((caddr_t)rel + relsz); + rellim = (const Elf_Rel *)((const char *)rel + relsz); size = (rellim - 1)->r_offset - rel->r_offset; for (; rel < rellim; rel++) { where = (Elf_Addr *)(relocbase + rel->r_offset); @@ -375,7 +373,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int cache = calloc(obj->dynsymcount, sizeof(SymCache)); /* No need to check for NULL here */ - rellim = (const Elf_Rel *)((caddr_t)obj->rel + obj->relsize); + rellim = (const Elf_Rel *)((const char *)obj->rel + obj->relsize); for (rel = obj->rel; rel < rellim; rel++) { if (reloc_nonplt_object(obj, rel, cache, flags, lockstate) < 0) goto done; @@ -396,7 +394,7 @@ reloc_plt(Obj_Entry *obj) const Elf_Rel *rellim; const Elf_Rel *rel; - rellim = (const Elf_Rel *)((char *)obj->pltrel + + rellim = (const Elf_Rel *)((const char *)obj->pltrel + obj->pltrelsize); for (rel = obj->pltrel; rel < rellim; rel++) { Elf_Addr *where; @@ -423,7 +421,7 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat Elf_Addr *where; Elf_Addr target; - rellim = (const Elf_Rel *)((char *)obj->pltrel + obj->pltrelsize); + rellim = (const Elf_Rel *)((const char *)obj->pltrel + obj->pltrelsize); for (rel = obj->pltrel; rel < rellim; rel++) { assert(ELF_R_TYPE(rel->r_info) == R_ARM_JUMP_SLOT); where = (Elf_Addr *)(obj->relocbase + rel->r_offset); @@ -445,7 +443,8 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat } int -reloc_iresolve(Obj_Entry *obj, struct Struct_RtldLockState *lockstate) +reloc_iresolve(Obj_Entry *obj __unused, + struct Struct_RtldLockState *lockstate __unused) { /* XXX not implemented */ @@ -453,8 +452,8 @@ reloc_iresolve(Obj_Entry *obj, struct Struct_RtldLockS } int -reloc_gnu_ifunc(Obj_Entry *obj, int flags, - struct Struct_RtldLockState *lockstate) +reloc_gnu_ifunc(Obj_Entry *obj __unused, int flags __unused, + struct Struct_RtldLockState *lockstate __unused) { /* XXX not implemented */ @@ -462,8 +461,9 @@ reloc_gnu_ifunc(Obj_Entry *obj, int flags, } Elf_Addr -reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const Obj_Entry *defobj, - const Obj_Entry *obj, const Elf_Rel *rel) +reloc_jmpslot(Elf_Addr *where, Elf_Addr target, + const Obj_Entry *defobj __unused, const Obj_Entry *obj __unused, + const Elf_Rel *rel) { assert(ELF_R_TYPE(rel->r_info) == R_ARM_JUMP_SLOT); Modified: head/libexec/rtld-elf/i386/reloc.c ============================================================================== --- head/libexec/rtld-elf/i386/reloc.c Mon Oct 29 21:08:11 2018 (r339877) +++ head/libexec/rtld-elf/i386/reloc.c Mon Oct 29 21:08:19 2018 (r339878) @@ -67,7 +67,7 @@ do_copy_relocations(Obj_Entry *dstobj) assert(dstobj->mainprog); /* COPY relocations are invalid elsewhere */ - rellim = (const Elf_Rel *) ((caddr_t) dstobj->rel + dstobj->relsize); + rellim = (const Elf_Rel *)((const char *)dstobj->rel + dstobj->relsize); for (rel = dstobj->rel; rel < rellim; rel++) { if (ELF_R_TYPE(rel->r_info) == R_386_COPY) { void *dstaddr; @@ -80,7 +80,7 @@ do_copy_relocations(Obj_Entry *dstobj) SymLook req; int res; - dstaddr = (void *) (dstobj->relocbase + rel->r_offset); + dstaddr = (void *)(dstobj->relocbase + rel->r_offset); dstsym = dstobj->symtab + ELF_R_SYM(rel->r_info); name = dstobj->strtab + dstsym->st_name; size = dstsym->st_size; @@ -104,7 +104,7 @@ do_copy_relocations(Obj_Entry *dstobj) return -1; } - srcaddr = (const void *) (defobj->relocbase + srcsym->st_value); + srcaddr = (const void *)(defobj->relocbase + srcsym->st_value); memcpy(dstaddr, srcaddr, size); } } @@ -146,7 +146,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int } else cache = NULL; - rellim = (const Elf_Rel *)((caddr_t) obj->rel + obj->relsize); + rellim = (const Elf_Rel *)((const char *)obj->rel + obj->relsize); for (rel = obj->rel; rel < rellim; rel++) { switch (ELF_R_TYPE(rel->r_info)) { case R_386_32: @@ -239,7 +239,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int * of space, we generate an error. */ if (!defobj->tls_done) { - if (!allocate_tls_offset((Obj_Entry*) defobj)) { + if (!allocate_tls_offset( + __DECONST(Obj_Entry *, defobj))) { _rtld_error("%s: No space available " "for static Thread Local Storage", obj->path); @@ -278,7 +279,7 @@ reloc_plt(Obj_Entry *obj) const Elf_Rel *rellim; const Elf_Rel *rel; - rellim = (const Elf_Rel *)((char *)obj->pltrel + obj->pltrelsize); + rellim = (const Elf_Rel *)((const char *)obj->pltrel + obj->pltrelsize); for (rel = obj->pltrel; rel < rellim; rel++) { Elf_Addr *where/*, val*/; @@ -311,7 +312,7 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat if (obj->jmpslots_done) return 0; - rellim = (const Elf_Rel *)((char *)obj->pltrel + obj->pltrelsize); + rellim = (const Elf_Rel *)((const char *)obj->pltrel + obj->pltrelsize); for (rel = obj->pltrel; rel < rellim; rel++) { Elf_Addr *where, target; const Elf_Sym *def; @@ -349,8 +350,8 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat /* Fixup the jump slot at "where" to transfer control to "target". */ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, - const struct Struct_Obj_Entry *obj, const struct Struct_Obj_Entry *refobj, - const Elf_Rel *rel) + const Obj_Entry *obj __unused, const Obj_Entry *refobj __unused, + const Elf_Rel *rel __unused) { #ifdef dbg dbg("reloc_jmpslot: *%p = %p", where, (void *)target); @@ -369,7 +370,7 @@ reloc_iresolve(Obj_Entry *obj, RtldLockState *lockstat if (!obj->irelative) return (0); - rellim = (const Elf_Rel *)((char *)obj->pltrel + obj->pltrelsize); + rellim = (const Elf_Rel *)((const char *)obj->pltrel + obj->pltrelsize); for (rel = obj->pltrel; rel < rellim; rel++) { switch (ELF_R_TYPE(rel->r_info)) { case R_386_IRELATIVE: @@ -393,7 +394,7 @@ reloc_gnu_ifunc(Obj_Entry *obj, int flags, RtldLockSta if (!obj->gnu_ifunc) return (0); - rellim = (const Elf_Rel *)((char *)obj->pltrel + obj->pltrelsize); + rellim = (const Elf_Rel *)((const char *)obj->pltrel + obj->pltrelsize); for (rel = obj->pltrel; rel < rellim; rel++) { Elf_Addr *where, target; const Elf_Sym *def; Modified: head/libexec/rtld-elf/i386/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/i386/rtld_machdep.h Mon Oct 29 21:08:11 2018 (r339877) +++ head/libexec/rtld-elf/i386/rtld_machdep.h Mon Oct 29 21:08:19 2018 (r339878) @@ -58,7 +58,7 @@ extern uint32_t cpu_feature2; extern uint32_t cpu_stdext_feature; extern uint32_t cpu_stdext_feature2; #define call_ifunc_resolver(ptr) \ - (((Elf_Addr (*)(uint32_t, uint32_t, uint32_t, uint32_t))ptr)( \ + (((Elf_Addr (*)(uint32_t, uint32_t, uint32_t, uint32_t))(ptr))( \ cpu_feature, cpu_feature2, cpu_stdext_feature, cpu_stdext_feature2)) #define round(size, align) \ Modified: head/libexec/rtld-elf/libmap.c ============================================================================== --- head/libexec/rtld-elf/libmap.c Mon Oct 29 21:08:11 2018 (r339877) +++ head/libexec/rtld-elf/libmap.c Mon Oct 29 21:08:19 2018 (r339878) @@ -44,8 +44,8 @@ struct lmc { static int lm_count; static void lmc_parse(char *, size_t); -static void lmc_parse_file(char *); -static void lmc_parse_dir(char *); +static void lmc_parse_file(const char *); +static void lmc_parse_dir(const char *); static void lm_add(const char *, const char *, const char *); static void lm_free(struct lm_list *); static char *lml_find(struct lm_list *, const char *); @@ -96,7 +96,7 @@ lm_init(char *libmap_override) } static void -lmc_parse_file(char *path) +lmc_parse_file(const char *path) { struct lmc *p; char *lm_map; @@ -149,7 +149,7 @@ lmc_parse_file(char *path) } static void -lmc_parse_dir(char *idir) +lmc_parse_dir(const char *idir) { DIR *d; struct dirent *dp; Modified: head/libexec/rtld-elf/malloc.c ============================================================================== --- head/libexec/rtld-elf/malloc.c Mon Oct 29 21:08:11 2018 (r339877) +++ head/libexec/rtld-elf/malloc.c Mon Oct 29 21:08:19 2018 (r339878) @@ -154,13 +154,12 @@ botch(s) extern size_t *pagesizes; void * -malloc(nbytes) - size_t nbytes; +malloc(size_t nbytes) { union overhead *op; int bucket; - size_t n; - unsigned amt; + ssize_t n; + size_t amt; /* * First time malloc is called, setup page size and Modified: head/libexec/rtld-elf/map_object.c ============================================================================== --- head/libexec/rtld-elf/map_object.c Mon Oct 29 21:08:11 2018 (r339877) +++ head/libexec/rtld-elf/map_object.c Mon Oct 29 21:08:19 2018 (r339878) @@ -104,7 +104,7 @@ map_object(int fd, const char *path, const struct stat * * We expect that the loadable segments are ordered by load address. */ - phdr = (Elf_Phdr *) ((char *)hdr + hdr->e_phoff); + phdr = (Elf_Phdr *)((char *)hdr + hdr->e_phoff); phsize = hdr->e_phnum * sizeof (phdr[0]); phlimit = phdr + hdr->e_phnum; nsegs = -1; @@ -289,11 +289,11 @@ map_object(int fd, const char *path, const struct stat obj->textsize = text_end - base_vaddr; obj->vaddrbase = base_vaddr; obj->relocbase = mapbase - base_vaddr; - obj->dynamic = (const Elf_Dyn *) (obj->relocbase + phdyn->p_vaddr); + obj->dynamic = (const Elf_Dyn *)(obj->relocbase + phdyn->p_vaddr); if (hdr->e_entry != 0) - obj->entry = (caddr_t) (obj->relocbase + hdr->e_entry); + obj->entry = (caddr_t)(obj->relocbase + hdr->e_entry); if (phdr_vaddr != 0) { - obj->phdr = (const Elf_Phdr *) (obj->relocbase + phdr_vaddr); + obj->phdr = (const Elf_Phdr *)(obj->relocbase + phdr_vaddr); } else { obj->phdr = malloc(phsize); if (obj->phdr == NULL) { @@ -301,12 +301,12 @@ map_object(int fd, const char *path, const struct stat _rtld_error("%s: cannot allocate program header", path); goto error1; } - memcpy((char *)obj->phdr, (char *)hdr + hdr->e_phoff, phsize); + memcpy(__DECONST(char *, obj->phdr), (char *)hdr + hdr->e_phoff, phsize); obj->phdr_alloc = true; } obj->phsize = phsize; if (phinterp != NULL) - obj->interp = (const char *) (obj->relocbase + phinterp->p_vaddr); + obj->interp = (const char *)(obj->relocbase + phinterp->p_vaddr); if (phtls != NULL) { tls_dtv_generation++; obj->tlsindex = ++tls_max_index; @@ -430,13 +430,13 @@ obj_free(Obj_Entry *obj) if (obj->origin_path) free(obj->origin_path); if (obj->z_origin) - free(obj->rpath); + free(__DECONST(void*, obj->rpath)); if (obj->priv) free(obj->priv); if (obj->path) free(obj->path); if (obj->phdr_alloc) - free((void *)obj->phdr); + free(__DECONST(void *, obj->phdr)); free(obj); } Modified: head/libexec/rtld-elf/mips/reloc.c ============================================================================== --- head/libexec/rtld-elf/mips/reloc.c Mon Oct 29 21:08:11 2018 (r339877) +++ head/libexec/rtld-elf/mips/reloc.c Mon Oct 29 21:08:19 2018 (r339878) @@ -126,7 +126,7 @@ do_copy_relocations(Obj_Entry *dstobj) */ assert(dstobj->mainprog); - rellim = (const Elf_Rel *)((caddr_t)dstobj->rel + dstobj->relsize); + rellim = (const Elf_Rel *)((const char *)dstobj->rel + dstobj->relsize); for (rel = dstobj->rel; rel < rellim; rel++) { if (ELF_R_TYPE(rel->r_info) != R_MIPS_COPY) continue; @@ -265,7 +265,7 @@ _rtld_relocate_nonplt_self(Elf_Dyn *dynp, Elf_Addr rel ++got; } - rellim = (const Elf_Rel *)((caddr_t)rel + relsz); + rellim = (const Elf_Rel *)((const char *)rel + relsz); for (; rel < rellim; rel++) { Elf_Word r_symndx, r_type; @@ -469,7 +469,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int } got = obj->pltgot; - rellim = (const Elf_Rel *)((caddr_t)obj->rel + obj->relsize); + rellim = (const Elf_Rel *)((const char *)obj->rel + obj->relsize); for (rel = obj->rel; rel < rellim; rel++) { Elf_Word r_symndx, r_type; void *where; @@ -657,7 +657,7 @@ reloc_plt(Obj_Entry *obj) const Elf_Rel *rellim; const Elf_Rel *rel; - rellim = (const Elf_Rel *)((char *)obj->pltrel + obj->pltrelsize); + rellim = (const Elf_Rel *)((const char *)obj->pltrel + obj->pltrelsize); for (rel = obj->pltrel; rel < rellim; rel++) { Elf_Addr *where; @@ -687,7 +687,7 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat const Elf_Rel *rel; const Elf_Sym *def; - rellim = (const Elf_Rel *)((char *)obj->pltrel + obj->pltrelsize); + rellim = (const Elf_Rel *)((const char *)obj->pltrel + obj->pltrelsize); for (rel = obj->pltrel; rel < rellim; rel++) { Elf_Addr *where; @@ -714,7 +714,8 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat } int -reloc_iresolve(Obj_Entry *obj, struct Struct_RtldLockState *lockstate) +reloc_iresolve(Obj_Entry *obj __unused, + struct Struct_RtldLockState *lockstate __unused) { /* XXX not implemented */ @@ -722,8 +723,8 @@ reloc_iresolve(Obj_Entry *obj, struct Struct_RtldLockS } int -reloc_gnu_ifunc(Obj_Entry *obj, int flags, - struct Struct_RtldLockState *lockstate) +reloc_gnu_ifunc(Obj_Entry *obj __unused, int flags __unused, + struct Struct_RtldLockState *lockstate __unused) { /* XXX not implemented */ @@ -731,8 +732,9 @@ reloc_gnu_ifunc(Obj_Entry *obj, int flags, } Elf_Addr -reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const Obj_Entry *defobj, - const Obj_Entry *obj, const Elf_Rel *rel) +reloc_jmpslot(Elf_Addr *where, Elf_Addr target, + const Obj_Entry *defobj __unused, const Obj_Entry *obj __unused, + const Elf_Rel *rel) { assert(ELF_R_TYPE(rel->r_info) == R_MIPS_JUMP_SLOT); Modified: head/libexec/rtld-elf/mips/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/mips/rtld_machdep.h Mon Oct 29 21:08:11 2018 (r339877) +++ head/libexec/rtld-elf/mips/rtld_machdep.h Mon Oct 29 21:08:19 2018 (r339878) @@ -43,6 +43,9 @@ struct Struct_Obj_Entry; Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const struct Struct_Obj_Entry *defobj, const struct Struct_Obj_Entry *obj, const Elf_Rel *rel); +Elf_Addr _mips_rtld_bind(struct Struct_Obj_Entry *obj, Elf_Size reloff); +void *_mips_get_tls(void); + #define make_function_pointer(def, defobj) \ ((defobj)->relocbase + (def)->st_value) Modified: head/libexec/rtld-elf/paths.h ============================================================================== --- head/libexec/rtld-elf/paths.h Mon Oct 29 21:08:11 2018 (r339877) +++ head/libexec/rtld-elf/paths.h Mon Oct 29 21:08:19 2018 (r339878) @@ -69,10 +69,10 @@ #define SOFT_STANDARD_LIBRARY_PATH "/usr/libsoft" #define LD_SOFT_ "LD_SOFT_" -extern char *ld_elf_hints_default; -extern char *ld_path_libmap_conf; -extern char *ld_path_rtld; -extern char *ld_standard_library_path; -extern char *ld_env_prefix; +extern const char *ld_elf_hints_default; +extern const char *ld_path_libmap_conf; +extern const char *ld_path_rtld; +extern const char *ld_standard_library_path; +extern const char *ld_env_prefix; #endif /* PATHS_H */ Modified: head/libexec/rtld-elf/powerpc/reloc.c ============================================================================== --- head/libexec/rtld-elf/powerpc/reloc.c Mon Oct 29 21:08:11 2018 (r339877) +++ head/libexec/rtld-elf/powerpc/reloc.c Mon Oct 29 21:08:19 2018 (r339878) @@ -71,7 +71,7 @@ do_copy_relocations(Obj_Entry *dstobj) */ assert(dstobj->mainprog); - relalim = (const Elf_Rela *) ((caddr_t) dstobj->rela + + relalim = (const Elf_Rela *)((const char *) dstobj->rela + dstobj->relasize); for (rela = dstobj->rela; rela < relalim; rela++) { void *dstaddr; @@ -88,7 +88,7 @@ do_copy_relocations(Obj_Entry *dstobj) continue; } - dstaddr = (void *) (dstobj->relocbase + rela->r_offset); + dstaddr = (void *)(dstobj->relocbase + rela->r_offset); dstsym = dstobj->symtab + ELF_R_SYM(rela->r_info); name = dstobj->strtab + dstsym->st_name; size = dstsym->st_size; @@ -113,7 +113,7 @@ do_copy_relocations(Obj_Entry *dstobj) return (-1); } - srcaddr = (const void *) (defobj->relocbase+srcsym->st_value); + srcaddr = (const void *)(defobj->relocbase+srcsym->st_value); memcpy(dstaddr, srcaddr, size); dbg("copy_reloc: src=%p,dst=%p,size=%d\n",srcaddr,dstaddr,size); } @@ -149,7 +149,7 @@ reloc_non_plt_self(Elf_Dyn *dynp, Elf_Addr relocbase) /* * Relocate these values */ - relalim = (const Elf_Rela *)((caddr_t)rela + relasz); + relalim = (const Elf_Rela *)((const char *)rela + relasz); for (; rela < relalim; rela++) { where = (Elf_Addr *)(relocbase + rela->r_offset); *where = (Elf_Addr)(relocbase + rela->r_addend); @@ -161,8 +161,8 @@ reloc_non_plt_self(Elf_Dyn *dynp, Elf_Addr relocbase) * Relocate a non-PLT object with addend. */ static int -reloc_nonplt_object(Obj_Entry *obj_rtld, Obj_Entry *obj, const Elf_Rela *rela, - SymCache *cache, int flags, RtldLockState *lockstate) +reloc_nonplt_object(Obj_Entry *obj_rtld __unused, Obj_Entry *obj, + const Elf_Rela *rela, SymCache *cache, int flags, RtldLockState *lockstate) { Elf_Addr *where = (Elf_Addr *)(obj->relocbase + rela->r_offset); const Elf_Sym *def; @@ -249,7 +249,8 @@ reloc_nonplt_object(Obj_Entry *obj_rtld, Obj_Entry *ob * error. */ if (!defobj->tls_done) { - if (!allocate_tls_offset((Obj_Entry*) defobj)) { + if (!allocate_tls_offset( + __DECONST(Obj_Entry *, defobj))) { _rtld_error("%s: No space available for static " "Thread Local Storage", obj->path); return (-1); @@ -315,7 +316,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int * "The PowerPC family uses only the Elf32_Rela relocation * entries with explicit addends." */ - relalim = (const Elf_Rela *)((caddr_t)obj->rela + obj->relasize); + relalim = (const Elf_Rela *)((const char *)obj->rela + obj->relasize); for (rela = obj->rela; rela < relalim; rela++) { if (reloc_nonplt_object(obj_rtld, obj, rela, cache, flags, lockstate) < 0) @@ -398,7 +399,7 @@ reloc_plt(Obj_Entry *obj) if (obj->pltrelasize != 0) { - relalim = (const Elf_Rela *)((char *)obj->pltrela + + relalim = (const Elf_Rela *)((const char *)obj->pltrela + obj->pltrelasize); for (rela = obj->pltrela; rela < relalim; rela++) { assert(ELF_R_TYPE(rela->r_info) == R_PPC_JMP_SLOT); @@ -433,7 +434,8 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat Elf_Addr *where; Elf_Addr target; - relalim = (const Elf_Rela *)((char *)obj->pltrela + obj->pltrelasize); + relalim = (const Elf_Rela *)((const char *)obj->pltrela + + obj->pltrelasize); for (rela = obj->pltrela; rela < relalim; rela++) { assert(ELF_R_TYPE(rela->r_info) == R_PPC_JMP_SLOT); where = (Elf_Addr *)(obj->relocbase + rela->r_offset); @@ -469,8 +471,8 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat * trampoline call and jump table. */ Elf_Addr -reloc_jmpslot(Elf_Addr *wherep, Elf_Addr target, const Obj_Entry *defobj, - const Obj_Entry *obj, const Elf_Rel *rel) +reloc_jmpslot(Elf_Addr *wherep, Elf_Addr target, + const Obj_Entry *defobj __unused, const Obj_Entry *obj, const Elf_Rel *rel) { Elf_Addr offset; const Elf_Rela *rela = (const Elf_Rela *) rel; @@ -529,7 +531,8 @@ out: } int -reloc_iresolve(Obj_Entry *obj, struct Struct_RtldLockState *lockstate) +reloc_iresolve(Obj_Entry *obj __unused, + struct Struct_RtldLockState *lockstate __unused) { /* XXX not implemented */ @@ -537,8 +540,8 @@ reloc_iresolve(Obj_Entry *obj, struct Struct_RtldLockS } int -reloc_gnu_ifunc(Obj_Entry *obj, int flags, - struct Struct_RtldLockState *lockstate) +reloc_gnu_ifunc(Obj_Entry *obj __unused, int flags __unused, + struct Struct_RtldLockState *lockstate __unused) { /* XXX not implemented */ @@ -650,7 +653,7 @@ allocate_initial_tls(Obj_Entry *list) tls_static_space = tls_last_offset + tls_last_size + RTLD_STATIC_TLS_EXTRA; - tp = (Elf_Addr **) ((char *) allocate_tls(list, NULL, TLS_TCB_SIZE, 8) + tp = (Elf_Addr **)((char *) allocate_tls(list, NULL, TLS_TCB_SIZE, 8) + TLS_TP_OFFSET + TLS_TCB_SIZE); /* Modified: head/libexec/rtld-elf/powerpc/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/powerpc/rtld_machdep.h Mon Oct 29 21:08:11 2018 (r339877) +++ head/libexec/rtld-elf/powerpc/rtld_machdep.h Mon Oct 29 21:08:19 2018 (r339878) @@ -42,6 +42,7 @@ struct Struct_Obj_Entry; Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const struct Struct_Obj_Entry *defobj, const struct Struct_Obj_Entry *obj, const Elf_Rel *rel); +void reloc_non_plt_self(Elf_Dyn *dynp, Elf_Addr relocbase); #define make_function_pointer(def, defobj) \ ((defobj)->relocbase + (def)->st_value) Modified: head/libexec/rtld-elf/powerpc64/reloc.c ============================================================================== --- head/libexec/rtld-elf/powerpc64/reloc.c Mon Oct 29 21:08:11 2018 (r339877) +++ head/libexec/rtld-elf/powerpc64/reloc.c Mon Oct 29 21:08:19 2018 (r339878) @@ -67,7 +67,7 @@ do_copy_relocations(Obj_Entry *dstobj) */ assert(dstobj->mainprog); - relalim = (const Elf_Rela *) ((caddr_t) dstobj->rela + + relalim = (const Elf_Rela *)((const char *) dstobj->rela + dstobj->relasize); for (rela = dstobj->rela; rela < relalim; rela++) { void *dstaddr; @@ -84,7 +84,7 @@ do_copy_relocations(Obj_Entry *dstobj) continue; } - dstaddr = (void *) (dstobj->relocbase + rela->r_offset); + dstaddr = (void *)(dstobj->relocbase + rela->r_offset); dstsym = dstobj->symtab + ELF_R_SYM(rela->r_info); name = dstobj->strtab + dstsym->st_name; size = dstsym->st_size; @@ -109,7 +109,7 @@ do_copy_relocations(Obj_Entry *dstobj) return (-1); } - srcaddr = (const void *) (defobj->relocbase+srcsym->st_value); + srcaddr = (const void *)(defobj->relocbase+srcsym->st_value); memcpy(dstaddr, srcaddr, size); dbg("copy_reloc: src=%p,dst=%p,size=%zd\n",srcaddr,dstaddr,size); } @@ -145,7 +145,7 @@ reloc_non_plt_self(Elf_Dyn *dynp, Elf_Addr relocbase) /* * Relocate these values */ - relalim = (const Elf_Rela *)((caddr_t)rela + relasz); + relalim = (const Elf_Rela *)((const char *)rela + relasz); for (; rela < relalim; rela++) { where = (Elf_Addr *)(relocbase + rela->r_offset); *where = (Elf_Addr)(relocbase + rela->r_addend); @@ -157,8 +157,8 @@ reloc_non_plt_self(Elf_Dyn *dynp, Elf_Addr relocbase) * Relocate a non-PLT object with addend. */ static int -reloc_nonplt_object(Obj_Entry *obj_rtld, Obj_Entry *obj, const Elf_Rela *rela, - SymCache *cache, int flags, RtldLockState *lockstate) +reloc_nonplt_object(Obj_Entry *obj_rtld __unused, Obj_Entry *obj, + const Elf_Rela *rela, SymCache *cache, int flags, RtldLockState *lockstate) { Elf_Addr *where = (Elf_Addr *)(obj->relocbase + rela->r_offset); const Elf_Sym *def; @@ -246,7 +246,8 @@ reloc_nonplt_object(Obj_Entry *obj_rtld, Obj_Entry *ob * error. */ if (!defobj->tls_done) { - if (!allocate_tls_offset((Obj_Entry*) defobj)) { + if (!allocate_tls_offset( + __DECONST(Obj_Entry *, defobj))) { _rtld_error("%s: No space available for static " "Thread Local Storage", obj->path); return (-1); @@ -315,7 +316,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int * "The PowerPC family uses only the Elf32_Rela relocation * entries with explicit addends." */ - relalim = (const Elf_Rela *)((caddr_t)obj->rela + obj->relasize); + relalim = (const Elf_Rela *)((const char *)obj->rela + obj->relasize); for (rela = obj->rela; rela < relalim; rela++) { if (reloc_nonplt_object(obj_rtld, obj, rela, cache, flags, lockstate) < 0) @@ -370,7 +371,7 @@ reloc_plt(Obj_Entry *obj) const Elf_Rela *rela; if (obj->pltrelasize != 0) { - relalim = (const Elf_Rela *)((char *)obj->pltrela + + relalim = (const Elf_Rela *)((const char *)obj->pltrela + obj->pltrelasize); for (rela = obj->pltrela; rela < relalim; rela++) { assert(ELF_R_TYPE(rela->r_info) == R_PPC_JMP_SLOT); @@ -398,7 +399,8 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat Elf_Addr *where; Elf_Addr target; - relalim = (const Elf_Rela *)((char *)obj->pltrela + obj->pltrelasize); + relalim = (const Elf_Rela *)((const char *)obj->pltrela + + obj->pltrelasize); for (rela = obj->pltrela; rela < relalim; rela++) { assert(ELF_R_TYPE(rela->r_info) == R_PPC_JMP_SLOT); where = (Elf_Addr *)(obj->relocbase + rela->r_offset); @@ -435,7 +437,7 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat */ Elf_Addr reloc_jmpslot(Elf_Addr *wherep, Elf_Addr target, const Obj_Entry *defobj, - const Obj_Entry *obj, const Elf_Rel *rel) + const Obj_Entry *obj __unused, const Elf_Rel *rel __unused) { /* @@ -494,7 +496,8 @@ out: } int -reloc_iresolve(Obj_Entry *obj, struct Struct_RtldLockState *lockstate) +reloc_iresolve(Obj_Entry *obj __unused, + struct Struct_RtldLockState *lockstate __unused) { /* XXX not implemented */ @@ -502,8 +505,8 @@ reloc_iresolve(Obj_Entry *obj, struct Struct_RtldLockS } int -reloc_gnu_ifunc(Obj_Entry *obj, int flags, - struct Struct_RtldLockState *lockstate) +reloc_gnu_ifunc(Obj_Entry *obj __unused, int flags __unused, + struct Struct_RtldLockState *lockstate __unused) { /* XXX not implemented */ @@ -555,7 +558,7 @@ allocate_initial_tls(Obj_Entry *list) tls_static_space = tls_last_offset + tls_last_size + RTLD_STATIC_TLS_EXTRA; - tp = (Elf_Addr **) ((char *)allocate_tls(list, NULL, TLS_TCB_SIZE, 16) + tp = (Elf_Addr **)((char *)allocate_tls(list, NULL, TLS_TCB_SIZE, 16) + TLS_TP_OFFSET + TLS_TCB_SIZE); __asm __volatile("mr 13,%0" :: "r"(tp)); Modified: head/libexec/rtld-elf/powerpc64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/powerpc64/rtld_machdep.h Mon Oct 29 21:08:11 2018 (r339877) +++ head/libexec/rtld-elf/powerpc64/rtld_machdep.h Mon Oct 29 21:08:19 2018 (r339878) @@ -42,6 +42,7 @@ struct Struct_Obj_Entry; Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const struct Struct_Obj_Entry *defobj, const struct Struct_Obj_Entry *obj, const Elf_Rel *rel); +void reloc_non_plt_self(Elf_Dyn *dynp, Elf_Addr relocbase); #define make_function_pointer(def, defobj) \ ((defobj)->relocbase + (def)->st_value) Modified: head/libexec/rtld-elf/riscv/reloc.c ============================================================================== --- head/libexec/rtld-elf/riscv/reloc.c Mon Oct 29 21:08:11 2018 (r339877) +++ head/libexec/rtld-elf/riscv/reloc.c Mon Oct 29 21:08:19 2018 (r339878) @@ -105,7 +105,7 @@ do_copy_relocations(Obj_Entry *dstobj) */ assert(dstobj->mainprog); - relalim = (const Elf_Rela *)((char *)dstobj->rela + + relalim = (const Elf_Rela *)((const char *)dstobj->rela + dstobj->relasize); for (rela = dstobj->rela; rela < relalim; rela++) { if (ELF_R_TYPE(rela->r_info) != R_RISCV_COPY) @@ -152,7 +152,8 @@ reloc_plt(Obj_Entry *obj) const Elf_Rela *relalim; const Elf_Rela *rela; - relalim = (const Elf_Rela *)((char *)obj->pltrela + obj->pltrelasize); + relalim = (const Elf_Rela *)((const char *)obj->pltrela + + obj->pltrelasize); for (rela = obj->pltrela; rela < relalim; rela++) { Elf_Addr *where; @@ -176,7 +177,8 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat const Elf_Rela *rela; const Elf_Sym *def; - relalim = (const Elf_Rela *)((char *)obj->pltrela + obj->pltrelasize); + relalim = (const Elf_Rela *)((const char *)obj->pltrela + + obj->pltrelasize); for (rela = obj->pltrela; rela < relalim; rela++) { Elf_Addr *where; @@ -203,7 +205,8 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat } int -reloc_iresolve(Obj_Entry *obj, struct Struct_RtldLockState *lockstate) +reloc_iresolve(Obj_Entry *obj __unused, + struct Struct_RtldLockState *lockstate __unused) { /* XXX not implemented */ @@ -211,8 +214,8 @@ reloc_iresolve(Obj_Entry *obj, struct Struct_RtldLockS } int -reloc_gnu_ifunc(Obj_Entry *obj, int flags, - struct Struct_RtldLockState *lockstate) +reloc_gnu_ifunc(Obj_Entry *obj __unused, int flags __unused, + struct Struct_RtldLockState *lockstate __unused) { /* XXX not implemented */ @@ -220,8 +223,9 @@ reloc_gnu_ifunc(Obj_Entry *obj, int flags, } Elf_Addr -reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const Obj_Entry *defobj, - const Obj_Entry *obj, const Elf_Rel *rel) +reloc_jmpslot(Elf_Addr *where, Elf_Addr target, + const Obj_Entry *defobj __unused, const Obj_Entry *obj __unused, + const Elf_Rel *rel) { assert(ELF_R_TYPE(rel->r_info) == R_RISCV_JUMP_SLOT); @@ -260,7 +264,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int cache = calloc(obj->dynsymcount, sizeof(SymCache)); /* No need to check for NULL here */ - relalim = (const Elf_Rela *)((caddr_t)obj->rela + obj->relasize); + relalim = (const Elf_Rela *)((const char *)obj->rela + obj->relasize); for (rela = obj->rela; rela < relalim; rela++) { where = (Elf_Addr *)(obj->relocbase + rela->r_offset); symnum = ELF_R_SYM(rela->r_info); @@ -315,7 +319,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int * error. */ if (!defobj->tls_done) { - if (!allocate_tls_offset((Obj_Entry*) defobj)) { + if (!allocate_tls_offset( + __DECONST(Obj_Entry *, defobj))) { _rtld_error( "%s: No space available for static " "Thread Local Storage", obj->path); @@ -341,7 +346,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int * error. */ if (!defobj->tls_done) { - if (!allocate_tls_offset((Obj_Entry*) defobj)) { + if (!allocate_tls_offset( + __DECONST(Obj_Entry *, defobj))) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Oct 29 21:08:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C890010EA217; Mon, 29 Oct 2018 21:08:30 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 781CA8323E; Mon, 29 Oct 2018 21:08:30 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A8E513AEB; Mon, 29 Oct 2018 21:08:30 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TL8Ulf042111; Mon, 29 Oct 2018 21:08:30 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TL8SOJ042101; Mon, 29 Oct 2018 21:08:28 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201810292108.w9TL8SOJ042101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 29 Oct 2018 21:08:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339879 - in head/libexec/rtld-elf: . riscv X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head/libexec/rtld-elf: . riscv X-SVN-Commit-Revision: 339879 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 21:08:31 -0000 Author: arichardson Date: Mon Oct 29 21:08:28 2018 New Revision: 339879 URL: https://svnweb.freebsd.org/changeset/base/339879 Log: rtld-elf: fix more warnings to allow compiling with WARNS=6 Reviewed By: kib Approved By: brooks (mentor) Differential Revision: https://reviews.freebsd.org/D17154 Modified: head/libexec/rtld-elf/Makefile head/libexec/rtld-elf/libmap.c head/libexec/rtld-elf/malloc.c head/libexec/rtld-elf/map_object.c head/libexec/rtld-elf/riscv/reloc.c head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld_lock.c head/libexec/rtld-elf/rtld_printf.c Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Mon Oct 29 21:08:19 2018 (r339878) +++ head/libexec/rtld-elf/Makefile Mon Oct 29 21:08:28 2018 (r339879) @@ -33,7 +33,7 @@ LDFLAGS+= -nostdlib -e .rtld_start .endif NO_WCAST_ALIGN= yes -WARNS?= 4 +WARNS?= 6 INSTALLFLAGS= -C -b PRECIOUSPROG= BINDIR= /libexec @@ -98,7 +98,12 @@ SUBDIR.${MK_TESTS}+= tests ${PROG_FULL}: ${VERSION_MAP} .include -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 40300 +.if ${COMPILER_TYPE} == "gcc" +# GCC warns about redeclarations even though they have __exported +# and are therefore not identical to the ones from the system headers. +CFLAGS+= -Wno-redundant-decls +.if ${COMPILER_VERSION} < 40300 # Silence -Wshadow false positives in ancient GCC CFLAGS+= -Wno-shadow +.endif .endif Modified: head/libexec/rtld-elf/libmap.c ============================================================================== --- head/libexec/rtld-elf/libmap.c Mon Oct 29 21:08:19 2018 (r339878) +++ head/libexec/rtld-elf/libmap.c Mon Oct 29 21:08:28 2018 (r339879) @@ -25,7 +25,7 @@ struct lm { TAILQ_ENTRY(lm) lm_link; }; -TAILQ_HEAD(lmp_list, lmp) lmp_head = TAILQ_HEAD_INITIALIZER(lmp_head); +static TAILQ_HEAD(lmp_list, lmp) lmp_head = TAILQ_HEAD_INITIALIZER(lmp_head); struct lmp { char *p; enum { T_EXACT=0, T_BASENAME, T_DIRECTORY } type; Modified: head/libexec/rtld-elf/malloc.c ============================================================================== --- head/libexec/rtld-elf/malloc.c Mon Oct 29 21:08:19 2018 (r339878) +++ head/libexec/rtld-elf/malloc.c Mon Oct 29 21:08:28 2018 (r339879) @@ -151,7 +151,6 @@ botch(s) * must contain at least one page size. The page sizes must be stored in * increasing order. */ -extern size_t *pagesizes; void * malloc(size_t nbytes) @@ -256,8 +255,7 @@ calloc(size_t num, size_t size) * Allocate more memory to the indicated bucket. */ static void -morecore(bucket) - int bucket; +morecore(int bucket) { union overhead *op; int sz; /* size of desired block */ @@ -300,8 +298,7 @@ morecore(bucket) } void -free(cp) - void *cp; +free(void * cp) { int size; union overhead *op; @@ -339,12 +336,10 @@ free(cp) * is extern so the caller can modify it). If that fails we just copy * however many bytes was given to realloc() and hope it's not huge. */ -int realloc_srchlen = 4; /* 4 should be plenty, -1 =>'s whole list */ +static int realloc_srchlen = 4; /* 4 should be plenty, -1 =>'s whole list */ void * -realloc(cp, nbytes) - void *cp; - size_t nbytes; +realloc(void *cp, size_t nbytes) { u_int onb; int i; @@ -413,9 +408,7 @@ realloc(cp, nbytes) * Return bucket number, or -1 if not found. */ static int -findbucket(freep, srchlen) - union overhead *freep; - int srchlen; +findbucket(union overhead *freep, int srchlen) { union overhead *p; int i, j; @@ -439,8 +432,7 @@ findbucket(freep, srchlen) * for each size category, the second showing the number of mallocs - * frees for each size category. */ -mstats(s) - char *s; +mstats(char * s) { int i, j; union overhead *p; @@ -466,8 +458,7 @@ mstats(s) static int -morepages(n) -int n; +morepages(int n) { int fd = -1; int offset; Modified: head/libexec/rtld-elf/map_object.c ============================================================================== --- head/libexec/rtld-elf/map_object.c Mon Oct 29 21:08:19 2018 (r339878) +++ head/libexec/rtld-elf/map_object.c Mon Oct 29 21:08:28 2018 (r339879) @@ -115,6 +115,7 @@ map_object(int fd, const char *path, const struct stat note_start = 0; note_end = 0; note_map = NULL; + note_map_len = 0; segs = alloca(sizeof(segs[0]) * hdr->e_phnum); stack_flags = RTLD_DEFAULT_STACK_PF_EXEC | PF_R | PF_W; text_end = 0; Modified: head/libexec/rtld-elf/riscv/reloc.c ============================================================================== --- head/libexec/rtld-elf/riscv/reloc.c Mon Oct 29 21:08:19 2018 (r339878) +++ head/libexec/rtld-elf/riscv/reloc.c Mon Oct 29 21:08:28 2018 (r339879) @@ -50,8 +50,6 @@ __FBSDID("$FreeBSD$"); #define RELOC_ALIGNED_P(x) \ (((uintptr_t)(x) & (sizeof(void *) - 1)) == 0) -void _exit(int); - uint64_t set_gp(Obj_Entry *obj) { Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Oct 29 21:08:19 2018 (r339878) +++ head/libexec/rtld-elf/rtld.c Mon Oct 29 21:08:28 2018 (r339879) @@ -73,6 +73,14 @@ __FBSDID("$FreeBSD$"); typedef void (*func_ptr_type)(void); typedef void * (*path_enum_proc) (const char *path, size_t len, void *arg); + +/* Variables that cannot be static: */ +extern struct r_debug r_debug; /* For GDB */ +extern int _thread_autoinit_dummy_decl; +extern char* __progname; +extern void (*__cleanup)(void); + + /* * Function declarations. */ @@ -243,7 +251,8 @@ func_ptr_type _rtld(Elf_Addr *sp, func_ptr_type *exit_ Elf_Addr _rtld_bind(Obj_Entry *obj, Elf_Size reloff); -int npagesizes, osreldate; +int npagesizes; +static int osreldate; size_t *pagesizes; static int stack_prot = PROT_READ | PROT_WRITE | RTLD_DEFAULT_STACK_EXEC; @@ -268,11 +277,11 @@ char **main_argv; size_t tls_last_offset; /* Static TLS offset of last module */ size_t tls_last_size; /* Static TLS size of last module */ size_t tls_static_space; /* Static TLS space allocated */ -size_t tls_static_max_align; +static size_t tls_static_max_align; Elf_Addr tls_dtv_generation = 1; /* Used to detect when dtv size changes */ int tls_max_index = 1; /* Largest module index allocated */ -bool ld_library_path_rpath = false; +static bool ld_library_path_rpath = false; /* * Globals for path names, and such Modified: head/libexec/rtld-elf/rtld_lock.c ============================================================================== --- head/libexec/rtld-elf/rtld_lock.c Mon Oct 29 21:08:19 2018 (r339878) +++ head/libexec/rtld-elf/rtld_lock.c Mon Oct 29 21:08:28 2018 (r339879) @@ -184,7 +184,7 @@ thread_mask_clear(int mask) } #define RTLD_LOCK_CNT 3 -struct rtld_lock { +static struct rtld_lock { void *handle; int mask; } rtld_locks[RTLD_LOCK_CNT]; Modified: head/libexec/rtld-elf/rtld_printf.c ============================================================================== --- head/libexec/rtld-elf/rtld_printf.c Mon Oct 29 21:08:19 2018 (r339878) +++ head/libexec/rtld-elf/rtld_printf.c Mon Oct 29 21:08:28 2018 (r339879) @@ -187,6 +187,7 @@ reswitch: switch (ch = (u_char)*fmt++) { padc = '0'; goto reswitch; } + /* FALLTHROUGH */ case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': for (n = 0;; ++fmt) { @@ -324,6 +325,7 @@ reswitch: switch (ch = (u_char)*fmt++) { goto handle_nosign; case 'X': upper = 1; + /* FALLTHROUGH */ case 'x': base = 16; goto handle_nosign; From owner-svn-src-head@freebsd.org Mon Oct 29 21:08:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2B0710EA253; Mon, 29 Oct 2018 21:08:38 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4FEB83306; Mon, 29 Oct 2018 21:08:38 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5163E13AEC; Mon, 29 Oct 2018 21:08:35 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TL8ZKJ042162; Mon, 29 Oct 2018 21:08:35 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TL8ZYw042161; Mon, 29 Oct 2018 21:08:35 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201810292108.w9TL8ZYw042161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 29 Oct 2018 21:08:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339880 - head/lib/libpmc/pmu-events X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/lib/libpmc/pmu-events X-SVN-Commit-Revision: 339880 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 21:08:39 -0000 Author: arichardson Date: Mon Oct 29 21:08:34 2018 New Revision: 339880 URL: https://svnweb.freebsd.org/changeset/base/339880 Log: Fix get_maxfds() in jevents If RLIM_INFINITY == -1ULL (such as on macOS) the min() call will result in a value of less than 1 being returned. This causes nftw() to fail with EINVAL. While touching this file also fix includes to work on Linux/macOS and don't declare snprintf since it may have different attributes in the system headers there. Reviewed By: mmacy Approved By: brooks (mentor) Differential Revision: https://reviews.freebsd.org/D17682 Modified: head/lib/libpmc/pmu-events/jevents.c Modified: head/lib/libpmc/pmu-events/jevents.c ============================================================================== --- head/lib/libpmc/pmu-events/jevents.c Mon Oct 29 21:08:28 2018 (r339879) +++ head/lib/libpmc/pmu-events/jevents.c Mon Oct 29 21:08:34 2018 (r339880) @@ -34,7 +34,7 @@ */ -#include +#include #include #include #include @@ -54,8 +54,6 @@ #include "json.h" #include "jevents.h" -int snprintf(char * __restrict, size_t, const char * __restrict, - ...) __printflike(3, 4); _Noreturn void _Exit(int); int verbose; @@ -859,8 +857,11 @@ static int get_maxfds(void) { struct rlimit rlim; - if (getrlimit(RLIMIT_NOFILE, &rlim) == 0) - return min((int)rlim.rlim_max / 2, 512); + if (getrlimit(RLIMIT_NOFILE, &rlim) == 0) { + if (rlim.rlim_max == RLIM_INFINITY) + return 512; + return min((unsigned)rlim.rlim_max / 2, 512); + } return 512; } @@ -1121,8 +1122,8 @@ int main(int argc, char *argv[]) mapfile = NULL; rc = nftw(ldirname, preprocess_arch_std_files, maxfds, 0); if (rc && verbose) { - pr_info("%s: Error preprocessing arch standard files %s\n", - prog, ldirname); + pr_info("%s: Error preprocessing arch standard files %s: %s\n", + prog, ldirname, strerror(errno)); goto empty_map; } else if (rc < 0) { /* Make build fail */ From owner-svn-src-head@freebsd.org Mon Oct 29 21:16:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F6B910EA773; Mon, 29 Oct 2018 21:16:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54DB883DD6; Mon, 29 Oct 2018 21:16:27 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 366CE13CAE; Mon, 29 Oct 2018 21:16:27 +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 w9TLGRLP047105; Mon, 29 Oct 2018 21:16:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TLGQ2T047103; Mon, 29 Oct 2018 21:16:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810292116.w9TLGQ2T047103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 29 Oct 2018 21:16:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339883 - in head: share/man/man4 sys/netinet/netdump X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man4 sys/netinet/netdump X-SVN-Commit-Revision: 339883 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 21:16:28 -0000 Author: markj Date: Mon Oct 29 21:16:26 2018 New Revision: 339883 URL: https://svnweb.freebsd.org/changeset/base/339883 Log: Expose some netdump configuration parameters through sysctl. Reviewed by: cem MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D17755 Modified: head/share/man/man4/netdump.4 head/sys/netinet/netdump/netdump_client.c Modified: head/share/man/man4/netdump.4 ============================================================================== --- head/share/man/man4/netdump.4 Mon Oct 29 21:14:48 2018 (r339882) +++ head/share/man/man4/netdump.4 Mon Oct 29 21:16:26 2018 (r339883) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2018 +.Dd October 29, 2018 .Dt NETDUMP 4 .Os .Sh NAME @@ -130,6 +130,19 @@ a path of will cause the server to attempt to store dumps from the client in .Pa /var/crash/foo . The server will not automatically create the relative directory. +.It Va net.netdump.polls +The client will poll the configured network interface while waiting for +acknowledgements. +This parameter controls the maximum number of poll attempts before giving +up, which typically results in a re-transmit. +Each poll attempt takes 0.5ms. +.It Va net.netdump.retries +The number of times the client will re-transmit a packet before aborting +a dump due to a lack of acknowledgement. +The default may be too small in environments with lots of packet loss. +.It Va net.netdump.arp_retries +The number of times the client will attempt to learn the MAC address of +the configured gateway or server before giving up and aborting the dump. .El .Sh SEE ALSO .Xr decryptcore 8 , Modified: head/sys/netinet/netdump/netdump_client.c ============================================================================== --- head/sys/netinet/netdump/netdump_client.c Mon Oct 29 21:14:48 2018 (r339882) +++ head/sys/netinet/netdump/netdump_client.c Mon Oct 29 21:16:26 2018 (r339883) @@ -117,18 +117,6 @@ static int restore_gw_addr; static uint64_t rcvd_acks; CTASSERT(sizeof(rcvd_acks) * NBBY == NETDUMP_MAX_IN_FLIGHT); -/* - * Times to poll the NIC (0.5ms each poll) before assuming packetloss - * occurred (default to 1s). - */ -static int nd_polls = 2000; - -/* Times to retransmit lost packets. */ -static int nd_retries = 10; - -/* Number of ARP retries. */ -static int nd_arp_retries = 3; - /* Configuration parameters. */ static struct netdump_conf nd_conf; #define nd_server nd_conf.ndc_server @@ -157,6 +145,18 @@ static char nd_path[MAXPATHLEN]; SYSCTL_STRING(_net_netdump, OID_AUTO, path, CTLFLAG_RW, nd_path, sizeof(nd_path), "Server path for output files"); +static int nd_polls = 2000; +SYSCTL_INT(_net_netdump, OID_AUTO, polls, CTLFLAG_RWTUN, + &nd_polls, 0, + "Number of times to poll before assuming packet loss (0.5ms per poll)"); +static int nd_retries = 10; +SYSCTL_INT(_net_netdump, OID_AUTO, retries, CTLFLAG_RWTUN, + &nd_retries, 0, + "Number of retransmit attempts before giving up"); +static int nd_arp_retries = 3; +SYSCTL_INT(_net_netdump, OID_AUTO, arp_retries, CTLFLAG_RWTUN, + &nd_arp_retries, 0, + "Number of ARP attempts before giving up"); /* * Checks for netdump support on a network interface From owner-svn-src-head@freebsd.org Mon Oct 29 21:46:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0020810EB1B3; Mon, 29 Oct 2018 21:46:05 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A100F84E17; Mon, 29 Oct 2018 21:46:05 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B31C141AD; Mon, 29 Oct 2018 21:46:05 +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 w9TLk50S062602; Mon, 29 Oct 2018 21:46:05 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TLk5hL062601; Mon, 29 Oct 2018 21:46:05 GMT (envelope-from np@FreeBSD.org) Message-Id: <201810292146.w9TLk5hL062601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Oct 2018 21:46:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339886 - head/contrib/ofed/librdmacm/examples X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/contrib/ofed/librdmacm/examples X-SVN-Commit-Revision: 339886 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 21:46:06 -0000 Author: np Date: Mon Oct 29 21:46:05 2018 New Revision: 339886 URL: https://svnweb.freebsd.org/changeset/base/339886 Log: rping(1): Make sure the socket address defaults to something reasonable when running as the server. Submitted by: Krishnamraju Eraparaju @ Chelsio Reviewed by: hselasky@, np@ MFC after: 1 month Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D17707 Modified: head/contrib/ofed/librdmacm/examples/rping.c Modified: head/contrib/ofed/librdmacm/examples/rping.c ============================================================================== --- head/contrib/ofed/librdmacm/examples/rping.c Mon Oct 29 21:36:10 2018 (r339885) +++ head/contrib/ofed/librdmacm/examples/rping.c Mon Oct 29 21:46:05 2018 (r339886) @@ -1177,9 +1177,13 @@ int main(int argc, char *argv[]) cb->server = -1; cb->state = IDLE; cb->size = 64; - cb->sin.ss_family = PF_INET; cb->port = htobe16(7174); sem_init(&cb->sem, 0, 0); + + /* initialize sockaddr structure with defaults */ + ret = get_addr("0.0.0.0", (struct sockaddr *) &cb->sin); + if (ret) + goto out; opterr = 0; while ((op=getopt(argc, argv, "a:I:Pp:C:S:t:scvVd")) != -1) { From owner-svn-src-head@freebsd.org Mon Oct 29 22:10:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA40210EB8CB; Mon, 29 Oct 2018 22:10:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 621DB85BE9; Mon, 29 Oct 2018 22:10:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 435431451F; Mon, 29 Oct 2018 22:10:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TMArnx073133; Mon, 29 Oct 2018 22:10:53 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TMArJi073132; Mon, 29 Oct 2018 22:10:53 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201810292210.w9TMArJi073132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 29 Oct 2018 22:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339889 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 339889 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 22:10:53 -0000 Author: glebius Date: Mon Oct 29 22:10:52 2018 New Revision: 339889 URL: https://svnweb.freebsd.org/changeset/base/339889 Log: Add a note that epoch(9) may change, to untie our hands for any future MFCs. Modified: head/share/man/man9/epoch.9 Modified: head/share/man/man9/epoch.9 ============================================================================== --- head/share/man/man9/epoch.9 Mon Oct 29 22:08:45 2018 (r339888) +++ head/share/man/man9/epoch.9 Mon Oct 29 22:10:52 2018 (r339889) @@ -185,6 +185,10 @@ free would have to follow a call to .Fn epoch_wait . .Sh ERRORS None. +.Sh NOTES +The +.Nm +kernel programming interface is under development and is subject to change. .El .Sh SEE ALSO .Xr locking 9 , From owner-svn-src-head@freebsd.org Mon Oct 29 22:24:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C19010EC260; Mon, 29 Oct 2018 22:24:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04C60888D4; Mon, 29 Oct 2018 22:24:32 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCFC514861; Mon, 29 Oct 2018 22:24:31 +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 w9TMOV0P086801; Mon, 29 Oct 2018 22:24:31 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TMOVEL086800; Mon, 29 Oct 2018 22:24:31 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201810292224.w9TMOVEL086800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 29 Oct 2018 22:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339890 - head/sys/dev/cxgbe/crypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/crypto X-SVN-Commit-Revision: 339890 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 22:24:32 -0000 Author: jhb Date: Mon Oct 29 22:24:31 2018 New Revision: 339890 URL: https://svnweb.freebsd.org/changeset/base/339890 Log: Add support for "plain" (non-HMAC) SHA digests. MFC after: 2 months Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_crypto.c Mon Oct 29 22:10:52 2018 (r339889) +++ head/sys/dev/cxgbe/crypto/t4_crypto.c Mon Oct 29 22:24:31 2018 (r339890) @@ -61,6 +61,8 @@ __FBSDID("$FreeBSD$"); * | key context header | * +-------------------------------+ * | AES key | ----- For requests with AES + * +-------------------------------+ + * | Hash state | ----- For hash-only requests * +-------------------------------+ - * | IPAD (16-byte aligned) | \ * +-------------------------------+ +---- For requests with HMAC @@ -72,7 +74,7 @@ __FBSDID("$FreeBSD$"); * +-------------------------------+ +---- Destination buffer for * | PHYS_DSGL entries | / non-hash-only requests * +-------------------------------+ - - * | 16 dummy bytes | ----- Only for hash-only requests + * | 16 dummy bytes | ----- Only for HMAC/hash-only requests * +-------------------------------+ * | IV | ----- If immediate IV * +-------------------------------+ @@ -160,7 +162,7 @@ struct ccr_session_blkcipher { struct ccr_session { bool active; int pending; - enum { HMAC, BLKCIPHER, AUTHENC, GCM } mode; + enum { HASH, HMAC, BLKCIPHER, AUTHENC, GCM } mode; union { struct ccr_session_hmac hmac; struct ccr_session_gmac gmac; @@ -200,6 +202,7 @@ struct ccr_softc { /* Statistics. */ uint64_t stats_blkcipher_encrypt; uint64_t stats_blkcipher_decrypt; + uint64_t stats_hash; uint64_t stats_hmac; uint64_t stats_authenc_encrypt; uint64_t stats_authenc_decrypt; @@ -420,7 +423,7 @@ ccr_populate_wreq(struct ccr_softc *sc, struct chcr_wr } static int -ccr_hmac(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) +ccr_hash(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) { struct chcr_wr *crwr; struct wrqe *wr; @@ -428,8 +431,8 @@ ccr_hmac(struct ccr_softc *sc, struct ccr_session *s, struct cryptodesc *crd; char *dst; u_int hash_size_in_response, kctx_flits, kctx_len, transhdr_len, wr_len; - u_int imm_len, iopad_size; - int error, sgl_nsegs, sgl_len; + u_int hmac_ctrl, imm_len, iopad_size; + int error, sgl_nsegs, sgl_len, use_opad; crd = crp->crp_desc; @@ -439,6 +442,14 @@ ccr_hmac(struct ccr_softc *sc, struct ccr_session *s, axf = s->hmac.auth_hash; + if (s->mode == HMAC) { + use_opad = 1; + hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NO_TRUNC; + } else { + use_opad = 0; + hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NOP; + } + /* PADs must be 128-bit aligned. */ iopad_size = roundup2(s->hmac.partial_digest_len, 16); @@ -446,7 +457,9 @@ ccr_hmac(struct ccr_softc *sc, struct ccr_session *s, * The 'key' part of the context includes the aligned IPAD and * OPAD. */ - kctx_len = iopad_size * 2; + kctx_len = iopad_size; + if (use_opad) + kctx_len += iopad_size; hash_size_in_response = axf->hashsize; transhdr_len = HASH_TRANSHDR_SIZE(kctx_len); @@ -503,19 +516,21 @@ ccr_hmac(struct ccr_softc *sc, struct ccr_session *s, V_SCMD_PROTO_VERSION(CHCR_SCMD_PROTO_VERSION_GENERIC) | V_SCMD_CIPH_MODE(CHCR_SCMD_CIPHER_MODE_NOP) | V_SCMD_AUTH_MODE(s->hmac.auth_mode) | - V_SCMD_HMAC_CTRL(CHCR_SCMD_HMAC_CTRL_NO_TRUNC)); + V_SCMD_HMAC_CTRL(hmac_ctrl)); crwr->sec_cpl.ivgen_hdrlen = htobe32( V_SCMD_LAST_FRAG(0) | V_SCMD_MORE_FRAGS(crd->crd_len == 0 ? 1 : 0) | V_SCMD_MAC_ONLY(1)); memcpy(crwr->key_ctx.key, s->hmac.ipad, s->hmac.partial_digest_len); - memcpy(crwr->key_ctx.key + iopad_size, s->hmac.opad, - s->hmac.partial_digest_len); + if (use_opad) + memcpy(crwr->key_ctx.key + iopad_size, s->hmac.opad, + s->hmac.partial_digest_len); /* XXX: F_KEY_CONTEXT_SALT_PRESENT set, but 'salt' not set. */ kctx_flits = (sizeof(struct _key_ctx) + kctx_len) / 16; crwr->key_ctx.ctx_hdr = htobe32(V_KEY_CONTEXT_CTX_LEN(kctx_flits) | - V_KEY_CONTEXT_OPAD_PRESENT(1) | V_KEY_CONTEXT_SALT_PRESENT(1) | + V_KEY_CONTEXT_OPAD_PRESENT(use_opad) | + V_KEY_CONTEXT_SALT_PRESENT(1) | V_KEY_CONTEXT_CK_SIZE(CHCR_KEYCTX_NO_KEY) | V_KEY_CONTEXT_MK_SIZE(s->hmac.mk_size) | V_KEY_CONTEXT_VALID(1)); @@ -537,7 +552,7 @@ ccr_hmac(struct ccr_softc *sc, struct ccr_session *s, } static int -ccr_hmac_done(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp, +ccr_hash_done(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp, const struct cpl_fw6_pld *cpl, int error) { struct cryptodesc *crd; @@ -1591,6 +1606,8 @@ ccr_sysctls(struct ccr_softc *sc) NULL, "statistics"); children = SYSCTL_CHILDREN(oid); + SYSCTL_ADD_U64(ctx, children, OID_AUTO, "hash", CTLFLAG_RD, + &sc->stats_hash, 0, "Hash requests submitted"); SYSCTL_ADD_U64(ctx, children, OID_AUTO, "hmac", CTLFLAG_RD, &sc->stats_hmac, 0, "HMAC requests submitted"); SYSCTL_ADD_U64(ctx, children, OID_AUTO, "cipher_encrypt", CTLFLAG_RD, @@ -1666,6 +1683,11 @@ ccr_attach(device_t dev) sc->sg_iv_aad = sglist_build(sc->iv_aad_buf, MAX_AAD_LEN, M_WAITOK); ccr_sysctls(sc); + crypto_register(cid, CRYPTO_SHA1, 0, 0); + crypto_register(cid, CRYPTO_SHA2_224, 0, 0); + crypto_register(cid, CRYPTO_SHA2_256, 0, 0); + crypto_register(cid, CRYPTO_SHA2_384, 0, 0); + crypto_register(cid, CRYPTO_SHA2_512, 0, 0); crypto_register(cid, CRYPTO_SHA1_HMAC, 0, 0); crypto_register(cid, CRYPTO_SHA2_224_HMAC, 0, 0); crypto_register(cid, CRYPTO_SHA2_256_HMAC, 0, 0); @@ -1714,22 +1736,27 @@ ccr_copy_partial_hash(void *dst, int cri_alg, union au u32 = (uint32_t *)dst; u64 = (uint64_t *)dst; switch (cri_alg) { + case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: for (i = 0; i < SHA1_HASH_LEN / 4; i++) u32[i] = htobe32(auth_ctx->sha1ctx.h.b32[i]); break; + case CRYPTO_SHA2_224: case CRYPTO_SHA2_224_HMAC: for (i = 0; i < SHA2_256_HASH_LEN / 4; i++) u32[i] = htobe32(auth_ctx->sha224ctx.state[i]); break; + case CRYPTO_SHA2_256: case CRYPTO_SHA2_256_HMAC: for (i = 0; i < SHA2_256_HASH_LEN / 4; i++) u32[i] = htobe32(auth_ctx->sha256ctx.state[i]); break; + case CRYPTO_SHA2_384: case CRYPTO_SHA2_384_HMAC: for (i = 0; i < SHA2_512_HASH_LEN / 8; i++) u64[i] = htobe64(auth_ctx->sha384ctx.state[i]); break; + case CRYPTO_SHA2_512: case CRYPTO_SHA2_512_HMAC: for (i = 0; i < SHA2_512_HASH_LEN / 8; i++) u64[i] = htobe64(auth_ctx->sha512ctx.state[i]); @@ -1738,6 +1765,17 @@ ccr_copy_partial_hash(void *dst, int cri_alg, union au } static void +ccr_init_hash_digest(struct ccr_session *s, int cri_alg) +{ + union authctx auth_ctx; + struct auth_hash *axf; + + axf = s->hmac.auth_hash; + axf->Init(&auth_ctx); + ccr_copy_partial_hash(s->hmac.ipad, cri_alg, &auth_ctx); +} + +static void ccr_init_hmac_digest(struct ccr_session *s, int cri_alg, char *key, int klen) { @@ -1885,12 +1923,13 @@ ccr_newsession(device_t dev, crypto_session_t cses, st unsigned int auth_mode, cipher_mode, iv_len, mk_size; unsigned int partial_digest_len; int error; - bool gcm_hash; + bool gcm_hash, hmac; if (cri == NULL) return (EINVAL); gcm_hash = false; + hmac = false; cipher = NULL; hash = NULL; auth_hash = NULL; @@ -1901,6 +1940,11 @@ ccr_newsession(device_t dev, crypto_session_t cses, st partial_digest_len = 0; for (c = cri; c != NULL; c = c->cri_next) { switch (c->cri_alg) { + case CRYPTO_SHA1: + case CRYPTO_SHA2_224: + case CRYPTO_SHA2_256: + case CRYPTO_SHA2_384: + case CRYPTO_SHA2_512: case CRYPTO_SHA1_HMAC: case CRYPTO_SHA2_224_HMAC: case CRYPTO_SHA2_256_HMAC: @@ -1913,30 +1957,35 @@ ccr_newsession(device_t dev, crypto_session_t cses, st return (EINVAL); hash = c; switch (c->cri_alg) { + case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: auth_hash = &auth_hash_hmac_sha1; auth_mode = CHCR_SCMD_AUTH_MODE_SHA1; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_160; partial_digest_len = SHA1_HASH_LEN; break; + case CRYPTO_SHA2_224: case CRYPTO_SHA2_224_HMAC: auth_hash = &auth_hash_hmac_sha2_224; auth_mode = CHCR_SCMD_AUTH_MODE_SHA224; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_256; partial_digest_len = SHA2_256_HASH_LEN; break; + case CRYPTO_SHA2_256: case CRYPTO_SHA2_256_HMAC: auth_hash = &auth_hash_hmac_sha2_256; auth_mode = CHCR_SCMD_AUTH_MODE_SHA256; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_256; partial_digest_len = SHA2_256_HASH_LEN; break; + case CRYPTO_SHA2_384: case CRYPTO_SHA2_384_HMAC: auth_hash = &auth_hash_hmac_sha2_384; auth_mode = CHCR_SCMD_AUTH_MODE_SHA512_384; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_512; partial_digest_len = SHA2_512_HASH_LEN; break; + case CRYPTO_SHA2_512: case CRYPTO_SHA2_512_HMAC: auth_hash = &auth_hash_hmac_sha2_512; auth_mode = CHCR_SCMD_AUTH_MODE_SHA512_512; @@ -1951,6 +2000,15 @@ ccr_newsession(device_t dev, crypto_session_t cses, st mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_128; break; } + switch (c->cri_alg) { + case CRYPTO_SHA1_HMAC: + case CRYPTO_SHA2_224_HMAC: + case CRYPTO_SHA2_256_HMAC: + case CRYPTO_SHA2_384_HMAC: + case CRYPTO_SHA2_512_HMAC: + hmac = true; + break; + } break; case CRYPTO_AES_CBC: case CRYPTO_AES_ICM: @@ -1992,8 +2050,12 @@ ccr_newsession(device_t dev, crypto_session_t cses, st return (EINVAL); if (hash == NULL && cipher == NULL) return (EINVAL); - if (hash != NULL && hash->cri_key == NULL) - return (EINVAL); + if (hash != NULL) { + if ((hmac || gcm_hash) && hash->cri_key == NULL) + return (EINVAL); + if (!(hmac || gcm_hash) && hash->cri_key != NULL) + return (EINVAL); + } sc = device_get_softc(dev); mtx_lock(&sc->lock); @@ -2008,9 +2070,12 @@ ccr_newsession(device_t dev, crypto_session_t cses, st s->mode = GCM; else if (hash != NULL && cipher != NULL) s->mode = AUTHENC; - else if (hash != NULL) - s->mode = HMAC; - else { + else if (hash != NULL) { + if (hmac) + s->mode = HMAC; + else + s->mode = HASH; + } else { MPASS(cipher != NULL); s->mode = BLKCIPHER; } @@ -2029,8 +2094,11 @@ ccr_newsession(device_t dev, crypto_session_t cses, st s->hmac.hash_len = auth_hash->hashsize; else s->hmac.hash_len = hash->cri_mlen; - ccr_init_hmac_digest(s, hash->cri_alg, hash->cri_key, - hash->cri_klen); + if (hmac) + ccr_init_hmac_digest(s, hash->cri_alg, hash->cri_key, + hash->cri_klen); + else + ccr_init_hash_digest(s, hash->cri_alg); } if (cipher != NULL) { s->blkcipher.cipher_mode = cipher_mode; @@ -2085,11 +2153,16 @@ ccr_process(device_t dev, struct cryptop *crp, int hin } switch (s->mode) { + case HASH: + error = ccr_hash(sc, s, crp); + if (error == 0) + sc->stats_hash++; + break; case HMAC: if (crd->crd_flags & CRD_F_KEY_EXPLICIT) ccr_init_hmac_digest(s, crd->crd_alg, crd->crd_key, crd->crd_klen); - error = ccr_hmac(sc, s, crp); + error = ccr_hash(sc, s, crp); if (error == 0) sc->stats_hmac++; break; @@ -2240,8 +2313,9 @@ do_cpl6_fw_pld(struct sge_iq *iq, const struct rss_hea sc->stats_inflight--; switch (s->mode) { + case HASH: case HMAC: - error = ccr_hmac_done(sc, s, crp, cpl, error); + error = ccr_hash_done(sc, s, crp, cpl, error); break; case BLKCIPHER: error = ccr_blkcipher_done(sc, s, crp, cpl, error); From owner-svn-src-head@freebsd.org Mon Oct 29 22:35:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F290010EC54C; Mon, 29 Oct 2018 22:35:46 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5A8088EC1; Mon, 29 Oct 2018 22:35:46 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 822F514A27; Mon, 29 Oct 2018 22:35:46 +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 w9TMZk3i091924; Mon, 29 Oct 2018 22:35:46 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TMZk6v091923; Mon, 29 Oct 2018 22:35:46 GMT (envelope-from np@FreeBSD.org) Message-Id: <201810292235.w9TMZk6v091923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Oct 2018 22:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339891 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 339891 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 22:35:47 -0000 Author: np Date: Mon Oct 29 22:35:46 2018 New Revision: 339891 URL: https://svnweb.freebsd.org/changeset/base/339891 Log: cxgbe/iw_cxgbe: Install the socket upcall before calling soconnect to ensure that it always runs when soisconnected does. Submitted by: Krishnamraju Eraparaju @ Chelsio MFC after: 1 month Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Oct 29 22:24:31 2018 (r339890) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Oct 29 22:35:46 2018 (r339891) @@ -2601,22 +2601,24 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_ goto fail; setiwsockopt(ep->com.so); + init_iwarp_socket(ep->com.so, &ep->com); err = -soconnect(ep->com.so, (struct sockaddr *)&ep->com.remote_addr, ep->com.thread); - if (!err) { - init_iwarp_socket(ep->com.so, &ep->com); - goto out; - } else + if (err) goto fail_free_so; + CTR2(KTR_IW_CXGBE, "%s:ccE, ep %p", __func__, ep); + return 0; fail_free_so: + uninit_iwarp_socket(ep->com.so); + ep->com.state = DEAD; sock_release(ep->com.so); fail: deref_cm_id(&ep->com); c4iw_put_ep(&ep->com); ep = NULL; out: - CTR2(KTR_IW_CXGBE, "%s:ccE ret:%d", __func__, err); + CTR2(KTR_IW_CXGBE, "%s:ccE Error %d", __func__, err); return err; } From owner-svn-src-head@freebsd.org Mon Oct 29 23:43:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DC9810ED7D8; Mon, 29 Oct 2018 23:43:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C54378AE25; Mon, 29 Oct 2018 23:43:17 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A669E15578; Mon, 29 Oct 2018 23:43:17 +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 w9TNhHN5027872; Mon, 29 Oct 2018 23:43:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TNhHFf027871; Mon, 29 Oct 2018 23:43:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201810292343.w9TNhHFf027871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Oct 2018 23:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339892 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 339892 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 23:43:18 -0000 Author: kib Date: Mon Oct 29 23:43:17 2018 New Revision: 339892 URL: https://svnweb.freebsd.org/changeset/base/339892 Log: Clarify explanation of VFCF_SBDRY. Requested by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/sys/mount.h Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Mon Oct 29 22:35:46 2018 (r339891) +++ head/sys/sys/mount.h Mon Oct 29 23:43:17 2018 (r339892) @@ -554,7 +554,8 @@ struct ovfsconf { #define VFCF_UNICODE 0x00200000 /* stores file names as Unicode */ #define VFCF_JAIL 0x00400000 /* can be mounted from within a jail */ #define VFCF_DELEGADMIN 0x00800000 /* supports delegated administration */ -#define VFCF_SBDRY 0x01000000 /* defer stop requests */ +#define VFCF_SBDRY 0x01000000 /* Stop at Boundary: defer stop requests + to kernel->user (AST) transition */ typedef uint32_t fsctlop_t; From owner-svn-src-head@freebsd.org Mon Oct 29 23:45:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F9A210ED8CC; Mon, 29 Oct 2018 23:45:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 249578AFD4; Mon, 29 Oct 2018 23:45:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EED2A15579; Mon, 29 Oct 2018 23:45:17 +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 w9TNjHFd028051; Mon, 29 Oct 2018 23:45:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TNjHg7028050; Mon, 29 Oct 2018 23:45:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201810292345.w9TNjHg7028050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Oct 2018 23:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339893 - 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: 339893 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 23:45:18 -0000 Author: kib Date: Mon Oct 29 23:45:17 2018 New Revision: 339893 URL: https://svnweb.freebsd.org/changeset/base/339893 Log: Style. Wrap long lines, use +4 spaces for continuation indent. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Mon Oct 29 23:43:17 2018 (r339892) +++ head/sys/amd64/amd64/machdep.c Mon Oct 29 23:45:17 2018 (r339893) @@ -2683,25 +2683,31 @@ DEFINE_IFUNC(, void *, memset, (void *, int, size_t), { return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ? - memset_erms : memset_std); + memset_erms : memset_std); } -void *memmove_std(void * _Nonnull dst, const void * _Nonnull src, size_t len); -void *memmove_erms(void * _Nonnull dst, const void * _Nonnull src, size_t len); -DEFINE_IFUNC(, void *, memmove, (void * _Nonnull, const void * _Nonnull, size_t), static) +void *memmove_std(void * _Nonnull dst, const void * _Nonnull src, + size_t len); +void *memmove_erms(void * _Nonnull dst, const void * _Nonnull src, + size_t len); +DEFINE_IFUNC(, void *, memmove, (void * _Nonnull, const void * _Nonnull, + size_t), static) { return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ? - memmove_erms : memmove_std); + memmove_erms : memmove_std); } -void *memcpy_std(void * _Nonnull dst, const void * _Nonnull src, size_t len); -void *memcpy_erms(void * _Nonnull dst, const void * _Nonnull src, size_t len); -DEFINE_IFUNC(, void *, memcpy, (void * _Nonnull, const void * _Nonnull, size_t), static) +void *memcpy_std(void * _Nonnull dst, const void * _Nonnull src, + size_t len); +void *memcpy_erms(void * _Nonnull dst, const void * _Nonnull src, + size_t len); +DEFINE_IFUNC(, void *, memcpy, (void * _Nonnull, const void * _Nonnull,size_t), + static) { return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ? - memcpy_erms : memcpy_std); + memcpy_erms : memcpy_std); } void pagezero_std(void *addr); @@ -2710,5 +2716,5 @@ DEFINE_IFUNC(, void , pagezero, (void *), static) { return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ? - pagezero_erms : pagezero_std); + pagezero_erms : pagezero_std); } From owner-svn-src-head@freebsd.org Mon Oct 29 23:48:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95A0C10ED994; Mon, 29 Oct 2018 23:48:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484E58B164; Mon, 29 Oct 2018 23:48:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CEB21557A; Mon, 29 Oct 2018 23:48:21 +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 w9TNmKuO028216; Mon, 29 Oct 2018 23:48:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TNmKvh028215; Mon, 29 Oct 2018 23:48:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201810292348.w9TNmKvh028215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 29 Oct 2018 23:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339894 - head/usr.bin/procstat X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.bin/procstat X-SVN-Commit-Revision: 339894 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 23:48:21 -0000 Author: jhb Date: Mon Oct 29 23:48:20 2018 New Revision: 339894 URL: https://svnweb.freebsd.org/changeset/base/339894 Log: Teach procstat -x about the AT_EHDRFLAGS ELF auxiliary vector. Submitted by: Shawn Webb Reviewed by: brooks Obtained from: HardenedBSD (bb71e9889d1362df01c2e5162e84cd7a4fc029c8) MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D17067 Modified: head/usr.bin/procstat/procstat_auxv.c Modified: head/usr.bin/procstat/procstat_auxv.c ============================================================================== --- head/usr.bin/procstat/procstat_auxv.c Mon Oct 29 23:45:17 2018 (r339893) +++ head/usr.bin/procstat/procstat_auxv.c Mon Oct 29 23:48:20 2018 (r339894) @@ -179,6 +179,12 @@ procstat_auxv(struct procstat *procstat, struct kinfo_ prefix, "AT_TIMEKEEP", auxv[i].a_un.a_ptr); break; #endif +#ifdef AT_EHDRFLAGS + case AT_EHDRFLAGS: + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_EHDRFLAGS/%#lx}\n", + prefix, "AT_EHDRFLAGS", (u_long)auxv[i].a_un.a_val); + break; +#endif default: xo_emit("{dw:/%s}{Lw:/%16ld/%ld}{:UNKNOWN/%#lx}\n", prefix, auxv[i].a_type, auxv[i].a_un.a_val); From owner-svn-src-head@freebsd.org Mon Oct 29 23:52:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FFBA10EDBA1; Mon, 29 Oct 2018 23:52:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 524998B5C5; Mon, 29 Oct 2018 23:52:32 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 345EE15711; Mon, 29 Oct 2018 23:52:32 +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 w9TNqVeO033077; Mon, 29 Oct 2018 23:52:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TNqVBV033076; Mon, 29 Oct 2018 23:52:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201810292352.w9TNqVBV033076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Oct 2018 23:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339895 - 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: 339895 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 23:52:32 -0000 Author: kib Date: Mon Oct 29 23:52:31 2018 New Revision: 339895 URL: https://svnweb.freebsd.org/changeset/base/339895 Log: amd64: Use ifuncs to select suitable implementation of set_pcb_flags(). There is no reason to check for PCB_FULL_IRET if FSGSBASE instructions are not supported. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Mon Oct 29 23:48:20 2018 (r339894) +++ head/sys/amd64/amd64/machdep.c Mon Oct 29 23:52:31 2018 (r339895) @@ -2616,15 +2616,14 @@ set_pcb_flags_raw(struct pcb *pcb, const u_int flags) * the PCB_FULL_IRET flag is set. We disable interrupts to sync with * context switches. */ -void -set_pcb_flags(struct pcb *pcb, const u_int flags) +static void +set_pcb_flags_fsgsbase(struct pcb *pcb, const u_int flags) { register_t r; if (curpcb == pcb && (flags & PCB_FULL_IRET) != 0 && - (pcb->pcb_flags & PCB_FULL_IRET) == 0 && - (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) { + (pcb->pcb_flags & PCB_FULL_IRET) == 0) { r = intr_disable(); if ((pcb->pcb_flags & PCB_FULL_IRET) == 0) { if (rfs() == _ufssel) @@ -2637,6 +2636,13 @@ set_pcb_flags(struct pcb *pcb, const u_int flags) } else { set_pcb_flags_raw(pcb, flags); } +} + +DEFINE_IFUNC(, void, set_pcb_flags, (struct pcb *, const u_int), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0 ? + set_pcb_flags_fsgsbase : set_pcb_flags_raw); } void From owner-svn-src-head@freebsd.org Mon Oct 29 23:56:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0D3410EDDC7; Mon, 29 Oct 2018 23:56:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6774B8B8C5; Mon, 29 Oct 2018 23:56:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4432915716; Mon, 29 Oct 2018 23:56: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 w9TNuexa033319; Mon, 29 Oct 2018 23:56:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TNue0Y033318; Mon, 29 Oct 2018 23:56:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201810292356.w9TNue0Y033318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Oct 2018 23:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339896 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 339896 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 23:56:40 -0000 Author: kib Date: Mon Oct 29 23:56:39 2018 New Revision: 339896 URL: https://svnweb.freebsd.org/changeset/base/339896 Log: Initialize ifunc calling machinery earlier. In particular, do it before the first call to allocate_initial_tls(), which contains MD parts to set the initial thread' TLS pointer. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Oct 29 23:52:31 2018 (r339895) +++ head/libexec/rtld-elf/rtld.c Mon Oct 29 23:56:39 2018 (r339896) @@ -709,6 +709,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr exit (0); } + ifunc_init(aux); + /* * Setup TLS for main thread. This must be done after the * relocations are processed, since tls initialization section @@ -730,7 +732,6 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr r_debug_state(NULL, &obj_main->linkmap); /* say hello to gdb! */ map_stacks_exec(NULL); - ifunc_init(aux); dbg("resolving ifuncs"); if (resolve_objects_ifunc(obj_main, From owner-svn-src-head@freebsd.org Mon Oct 29 23:59:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 477CD10EE039; Mon, 29 Oct 2018 23:59:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E804C8BA61; Mon, 29 Oct 2018 23:59: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE32315717; Mon, 29 Oct 2018 23:59: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 w9TNxQjb033477; Mon, 29 Oct 2018 23:59:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TNxQiY033476; Mon, 29 Oct 2018 23:59:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201810292359.w9TNxQiY033476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Oct 2018 23:59:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339897 - head/libexec/rtld-elf/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf/amd64 X-SVN-Commit-Revision: 339897 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 23:59:27 -0000 Author: kib Date: Mon Oct 29 23:59:26 2018 New Revision: 339897 URL: https://svnweb.freebsd.org/changeset/base/339897 Log: Remove rtld use of libc amd64_set_fsbase(). One less non-trivial dependency of rtld on libc. Also, amd64_set_fsbase() is to be converted to ifunc, which I do not want to support inside rtld. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/amd64/reloc.c Modified: head/libexec/rtld-elf/amd64/reloc.c ============================================================================== --- head/libexec/rtld-elf/amd64/reloc.c Mon Oct 29 23:56:39 2018 (r339896) +++ head/libexec/rtld-elf/amd64/reloc.c Mon Oct 29 23:59:26 2018 (r339897) @@ -35,8 +35,9 @@ #include #include -#include #include +#include +#include #include #include @@ -495,17 +496,26 @@ pre_init(void) } +int __getosreldate(void); + void allocate_initial_tls(Obj_Entry *objs) { - /* - * Fix the size of the static TLS block by using the maximum - * offset allocated so far and adding a bit for dynamic modules to - * use. - */ - tls_static_space = tls_last_offset + RTLD_STATIC_TLS_EXTRA; - amd64_set_fsbase(allocate_tls(objs, 0, - 3*sizeof(Elf_Addr), sizeof(Elf_Addr))); + void *addr; + + /* + * Fix the size of the static TLS block by using the maximum + * offset allocated so far and adding a bit for dynamic + * modules to use. + */ + tls_static_space = tls_last_offset + RTLD_STATIC_TLS_EXTRA; + + addr = allocate_tls(objs, 0, 3 * sizeof(Elf_Addr), sizeof(Elf_Addr)); + if (__getosreldate() >= P_OSREL_WRFSBASE && + (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) + wrfsbase((uintptr_t)addr); + else + sysarch(AMD64_SET_FSBASE, &addr); } void *__tls_get_addr(tls_index *ti) From owner-svn-src-head@freebsd.org Tue Oct 30 00:11:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1214A10EE53A; Tue, 30 Oct 2018 00:11:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B37038C148; Tue, 30 Oct 2018 00:11: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94C90158F3; Tue, 30 Oct 2018 00:11: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 w9U0BV9o038862; Tue, 30 Oct 2018 00:11:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9U0BUui038857; Tue, 30 Oct 2018 00:11:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201810300011.w9U0BUui038857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 30 Oct 2018 00:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339898 - head/lib/libc/amd64/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/amd64/sys X-SVN-Commit-Revision: 339898 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 00:11:32 -0000 Author: kib Date: Tue Oct 30 00:11:30 2018 New Revision: 339898 URL: https://svnweb.freebsd.org/changeset/base/339898 Log: Convert amd64_get/set_fs/gsbase to ifunc. Note that this is the first use of ifuncs in our userspace. Sponsored by: The FreeBSD Foundation MFC after: 1 month Deleted: head/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.c head/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.h Modified: head/lib/libc/amd64/sys/Makefile.inc head/lib/libc/amd64/sys/amd64_get_fsbase.c head/lib/libc/amd64/sys/amd64_get_gsbase.c head/lib/libc/amd64/sys/amd64_set_fsbase.c head/lib/libc/amd64/sys/amd64_set_gsbase.c Modified: head/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- head/lib/libc/amd64/sys/Makefile.inc Mon Oct 29 23:59:26 2018 (r339897) +++ head/lib/libc/amd64/sys/Makefile.inc Tue Oct 30 00:11:30 2018 (r339898) @@ -2,7 +2,6 @@ # $FreeBSD$ SRCS+= \ - amd64_detect_rdfsgsbase.c \ amd64_get_fsbase.c \ amd64_get_gsbase.c \ amd64_set_fsbase.c \ Modified: head/lib/libc/amd64/sys/amd64_get_fsbase.c ============================================================================== --- head/lib/libc/amd64/sys/amd64_get_fsbase.c Mon Oct 29 23:59:26 2018 (r339897) +++ head/lib/libc/amd64/sys/amd64_get_fsbase.c Tue Oct 30 00:11:30 2018 (r339898) @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2003 Peter Wemm - * Copyright (c) 2017 The FreeBSD Foundation + * Copyright (c) 2017, 2018 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Konstantin Belousov @@ -33,18 +33,35 @@ #include __FBSDID("$FreeBSD$"); -#include +#define IN_RTLD 1 +#include +#undef IN_RTLD #include +#include #include -#include "amd64_detect_rdfsgsbase.h" +#include +#include "libc_private.h" -int -amd64_get_fsbase(void **addr) +static int +amd64_get_fsbase_cpu(void **addr) { - if (amd64_detect_rdfsgsbase() == RDFSGS_SUPPORTED) { - *addr = (void *)rdfsbase(); - return (0); - } + *addr = (void *)rdfsbase(); + return (0); +} + +static int +amd64_get_fsbase_syscall(void **addr) +{ + return (sysarch(AMD64_GET_FSBASE, addr)); +} + +DEFINE_UIFUNC(, int, amd64_get_fsbase, (void **), static) +{ + + if (__getosreldate() >= P_OSREL_WRFSBASE && + (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) + return (amd64_get_fsbase_cpu); + return (amd64_get_fsbase_syscall); } Modified: head/lib/libc/amd64/sys/amd64_get_gsbase.c ============================================================================== --- head/lib/libc/amd64/sys/amd64_get_gsbase.c Mon Oct 29 23:59:26 2018 (r339897) +++ head/lib/libc/amd64/sys/amd64_get_gsbase.c Tue Oct 30 00:11:30 2018 (r339898) @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2003 Peter Wemm - * Copyright (c) 2017 The FreeBSD Foundation + * Copyright (c) 2017, 2018 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Konstantin Belousov @@ -33,18 +33,35 @@ #include __FBSDID("$FreeBSD$"); -#include +#define IN_RTLD 1 +#include +#undef IN_RTLD #include +#include #include -#include "amd64_detect_rdfsgsbase.h" +#include +#include "libc_private.h" -int -amd64_get_gsbase(void **addr) +static int +amd64_get_gsbase_cpu(void **addr) { - if (amd64_detect_rdfsgsbase() == RDFSGS_SUPPORTED) { - *addr = (void *)rdgsbase(); - return (0); - } + *addr = (void *)rdgsbase(); + return (0); +} + +static int +amd64_get_gsbase_syscall(void **addr) +{ + return (sysarch(AMD64_GET_GSBASE, addr)); +} + +DEFINE_UIFUNC(, int, amd64_get_gsbase, (void **), static) +{ + + if (__getosreldate() >= P_OSREL_WRFSBASE && + (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) + return (amd64_get_gsbase_cpu); + return (amd64_get_gsbase_syscall); } Modified: head/lib/libc/amd64/sys/amd64_set_fsbase.c ============================================================================== --- head/lib/libc/amd64/sys/amd64_set_fsbase.c Mon Oct 29 23:59:26 2018 (r339897) +++ head/lib/libc/amd64/sys/amd64_set_fsbase.c Tue Oct 30 00:11:30 2018 (r339898) @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2003 Peter Wemm - * Copyright (c) 2017 The FreeBSD Foundation + * Copyright (c) 2017, 2018 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Konstantin Belousov @@ -33,18 +33,35 @@ #include __FBSDID("$FreeBSD$"); -#include +#define IN_RTLD 1 +#include +#undef IN_RTLD #include +#include #include -#include "amd64_detect_rdfsgsbase.h" +#include +#include "libc_private.h" -int -amd64_set_fsbase(void *addr) +static int +amd64_set_fsbase_cpu(void *addr) { - if (amd64_detect_rdfsgsbase() == RDFSGS_SUPPORTED) { - wrfsbase((uintptr_t)addr); - return (0); - } + wrfsbase((uintptr_t)addr); + return (0); +} + +static int +amd64_set_fsbase_syscall(void *addr) +{ + return (sysarch(AMD64_SET_FSBASE, &addr)); +} + +DEFINE_UIFUNC(, int, amd64_set_fsbase, (void *), static) +{ + + if (__getosreldate() >= P_OSREL_WRFSBASE && + (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) + return (amd64_set_fsbase_cpu); + return (amd64_set_fsbase_syscall); } Modified: head/lib/libc/amd64/sys/amd64_set_gsbase.c ============================================================================== --- head/lib/libc/amd64/sys/amd64_set_gsbase.c Mon Oct 29 23:59:26 2018 (r339897) +++ head/lib/libc/amd64/sys/amd64_set_gsbase.c Tue Oct 30 00:11:30 2018 (r339898) @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2003 Peter Wemm - * Copyright (c) 2017 The FreeBSD Foundation + * Copyright (c) 2017, 2018 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Konstantin Belousov @@ -33,18 +33,35 @@ #include __FBSDID("$FreeBSD$"); -#include +#define IN_RTLD 1 +#include +#undef IN_RTLD #include +#include #include -#include "amd64_detect_rdfsgsbase.h" +#include +#include "libc_private.h" -int -amd64_set_gsbase(void *addr) +static int +amd64_set_gsbase_cpu(void *addr) { - if (amd64_detect_rdfsgsbase() == RDFSGS_SUPPORTED) { - wrgsbase((uintptr_t)addr); - return (0); - } + wrgsbase((uintptr_t)addr); + return (0); +} + +static int +amd64_set_gsbase_syscall(void *addr) +{ + return (sysarch(AMD64_SET_GSBASE, &addr)); +} + +DEFINE_UIFUNC(, int, amd64_set_gsbase, (void *), static) +{ + + if (__getosreldate() >= P_OSREL_WRFSBASE && + (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) + return (amd64_set_gsbase_cpu); + return (amd64_set_gsbase_syscall); } From owner-svn-src-head@freebsd.org Tue Oct 30 00:19:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA5AB10EE669; Tue, 30 Oct 2018 00:19:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BFFE8C41D; Tue, 30 Oct 2018 00:19:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B69115A58; Tue, 30 Oct 2018 00:19:45 +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 w9U0Jjql043819; Tue, 30 Oct 2018 00:19:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9U0Jj3m043818; Tue, 30 Oct 2018 00:19:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201810300019.w9U0Jj3m043818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 30 Oct 2018 00:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339899 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 339899 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 00:19:45 -0000 Author: jhb Date: Tue Oct 30 00:19:44 2018 New Revision: 339899 URL: https://svnweb.freebsd.org/changeset/base/339899 Log: Make battery emptying rate available as sysctl variable. Curiously, the in-kernel routines always use the design voltage to convert from mA to mW, but acpiconf in userland uses the current voltage. As a result, this can report a different mW rate than acpiconf. Submitted by: Manuel Stühn MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D17077 Modified: head/sys/dev/acpica/acpi_battery.c Modified: head/sys/dev/acpica/acpi_battery.c ============================================================================== --- head/sys/dev/acpica/acpi_battery.c Tue Oct 30 00:11:30 2018 (r339898) +++ head/sys/dev/acpica/acpi_battery.c Tue Oct 30 00:19:44 2018 (r339899) @@ -487,6 +487,11 @@ acpi_battery_init(void) "remaining time in minutes"); SYSCTL_ADD_PROC(&acpi_battery_sysctl_ctx, SYSCTL_CHILDREN(acpi_battery_sysctl_tree), + OID_AUTO, "rate", CTLTYPE_INT | CTLFLAG_RD, + &acpi_battery_battinfo.rate, 0, acpi_battery_sysctl, "I", + "present rate in mW"); + SYSCTL_ADD_PROC(&acpi_battery_sysctl_ctx, + SYSCTL_CHILDREN(acpi_battery_sysctl_tree), OID_AUTO, "state", CTLTYPE_INT | CTLFLAG_RD, &acpi_battery_battinfo.state, 0, acpi_battery_sysctl, "I", "current status flags"); From owner-svn-src-head@freebsd.org Tue Oct 30 00:22:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEEED10EE8BB; Tue, 30 Oct 2018 00:22:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0D9E8C816; Tue, 30 Oct 2018 00:22:15 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67AEC15BF6; Tue, 30 Oct 2018 00:22:15 +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 w9U0MFJF048635; Tue, 30 Oct 2018 00:22:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9U0MF7v048634; Tue, 30 Oct 2018 00:22:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810300022.w9U0MF7v048634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 30 Oct 2018 00:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339900 - head/sys/geom/concat X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/geom/concat X-SVN-Commit-Revision: 339900 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 00:22:16 -0000 Author: markj Date: Tue Oct 30 00:22:14 2018 New Revision: 339900 URL: https://svnweb.freebsd.org/changeset/base/339900 Log: Have gconcat advertise delete support if one of its disks does. This follows the example set by other multi-disk GEOM classes. PR: 232676 Tested by: noah.bergbauer@tum.de MFC after: 1 month Modified: head/sys/geom/concat/g_concat.c head/sys/geom/concat/g_concat.h Modified: head/sys/geom/concat/g_concat.c ============================================================================== --- head/sys/geom/concat/g_concat.c Tue Oct 30 00:19:44 2018 (r339899) +++ head/sys/geom/concat/g_concat.c Tue Oct 30 00:22:14 2018 (r339900) @@ -206,6 +206,27 @@ fail: } static void +g_concat_candelete(struct bio *bp) +{ + struct g_concat_softc *sc; + struct g_concat_disk *disk; + int i, *val; + + val = (int *)bp->bio_data; + *val = 0; + + sc = bp->bio_to->geom->softc; + for (i = 0; i < sc->sc_ndisks; i++) { + disk = &sc->sc_disks[i]; + if (!disk->d_removed && disk->d_candelete) { + *val = 1; + break; + } + } + g_io_deliver(bp, 0); +} + +static void g_concat_kernel_dump(struct bio *bp) { struct g_concat_softc *sc; @@ -327,6 +348,9 @@ g_concat_start(struct bio *bp) if (strcmp("GEOM::kerneldump", bp->bio_attribute) == 0) { g_concat_kernel_dump(bp); return; + } else if (strcmp("GEOM::candelete", bp->bio_attribute) == 0) { + g_concat_candelete(bp); + return; } /* To which provider it should be delivered? */ /* FALLTHROUGH */ @@ -408,6 +432,7 @@ g_concat_check_and_run(struct g_concat_softc *sc) struct g_provider *dp, *pp; u_int no, sectorsize = 0; off_t start; + int error; g_topology_assert(); if (g_concat_nvalid(sc) != sc->sc_ndisks) @@ -425,6 +450,16 @@ g_concat_check_and_run(struct g_concat_softc *sc) if (sc->sc_type == G_CONCAT_TYPE_AUTOMATIC) disk->d_end -= dp->sectorsize; start = disk->d_end; + error = g_access(disk->d_consumer, 1, 0, 0); + if (error == 0) { + error = g_getattr("GEOM::candelete", disk->d_consumer, + &disk->d_candelete); + if (error != 0) + disk->d_candelete = 0; + (void)g_access(disk->d_consumer, -1, 0, 0); + } else + G_CONCAT_DEBUG(1, "Failed to access disk %s, error %d.", + dp->name, error); if (no == 0) sectorsize = dp->sectorsize; else Modified: head/sys/geom/concat/g_concat.h ============================================================================== --- head/sys/geom/concat/g_concat.h Tue Oct 30 00:19:44 2018 (r339899) +++ head/sys/geom/concat/g_concat.h Tue Oct 30 00:22:14 2018 (r339900) @@ -74,6 +74,7 @@ struct g_concat_disk { struct g_concat_softc *d_softc; off_t d_start; off_t d_end; + int d_candelete; int d_removed; }; From owner-svn-src-head@freebsd.org Tue Oct 30 00:23:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B838A10EE960; Tue, 30 Oct 2018 00:23:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 625298C9C1; Tue, 30 Oct 2018 00:23:38 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3FEC715C0D; Tue, 30 Oct 2018 00:23:38 +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 w9U0Nclm048741; Tue, 30 Oct 2018 00:23:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9U0NcOb048740; Tue, 30 Oct 2018 00:23:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201810300023.w9U0NcOb048740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 30 Oct 2018 00:23:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339901 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 339901 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 00:23:39 -0000 Author: jhb Date: Tue Oct 30 00:23:37 2018 New Revision: 339901 URL: https://svnweb.freebsd.org/changeset/base/339901 Log: Permit local kernel modules to be built as part of a kernel build. Add support for "local" modules. By default, these modules are located in LOCALBASE/sys/modules (where LOCALBASE defaults to /usr/local). Individual modules can be built along with a kernel by defining LOCAL_MODULES to the list of modules. Each is assumed to be a subdirectory containing a valid Makefile. If LOCAL_MODULES is not specified, all of the modules present in LOCALBASE/sys/modules are built and installed along with the kernel. This means that a port that installs a kernel module can choose to install its source along with a suitable Makefile to /usr/local/sys/modules/. Future kernel builds will then include that kernel module using the kernel configuration's opt_*.h headers and install it into /boot/kernel along with other kernel-specific modules. This is not trying to solve the issue of folks running GENERIC release kernels, but is instead aimed at folks who build their own kernels. For those folks this ensures that kernel modules from ports will always be using the right KBI, etc. This includes folks running any KBI-breaking kernel configs (such as PAE). There are still some kinks to be worked out with cross-building (we probably shouldn't include local modules in cross-built kernels by default), but this is a sufficient starting point. Reviewed by: imp MFC after: 3 months Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16966 Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Oct 30 00:22:14 2018 (r339900) +++ head/sys/conf/kern.post.mk Tue Oct 30 00:23:37 2018 (r339901) @@ -35,24 +35,41 @@ KERN_DEBUGDIR?= ${DEBUGDIR} .MAIN: all +.if !defined(NO_MODULES) +# Default prefix used for modules installed from ports +LOCALBASE?= /usr/local + +LOCAL_MODULES_DIR?= ${LOCALBASE}/sys/modules + +# Default to installing all modules installed by ports unless overridden +# by the user. +.if !defined(LOCAL_MODULES) +LOCAL_MODULES!= ls ${LOCAL_MODULES_DIR} +.endif +.endif + .for target in all clean cleandepend cleandir clobber depend install \ ${_obj} reinstall tags ${target}: kernel-${target} -.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists($S/modules) +.if !defined(NO_MODULES) ${target}: modules-${target} modules-${target}: +.if !defined(MODULES_WITH_WORLD) && exists($S/modules) cd $S/modules; ${MKMODULESENV} ${MAKE} \ ${target:S/^reinstall$/install/:S/^clobber$/cleandir/} .endif +.for module in ${LOCAL_MODULES} + cd ${LOCAL_MODULES_DIR}/${module}; ${MKMODULESENV} ${MAKE} \ + ${target:S/^reinstall$/install/:S/^clobber$/cleandir/} .endfor +.endif +.endfor # Handle ports (as defined by the user) that build kernel modules .if !defined(NO_MODULES) && defined(PORTS_MODULES) # # The ports tree needs some environment variables defined to match the new kernel # -# Ports search for some dependencies in PATH, so add the location of the installed files -LOCALBASE?= /usr/local # SRC_BASE is how the ports tree refers to the location of the base source files .if !defined(SRC_BASE) SRC_BASE= ${SYSDIR:H:tA} @@ -64,6 +81,9 @@ OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_versi ${MAKEOBJDIRPREFIX}${SRC_BASE}/include/osreldate.h .endif # Keep the related ports builds in the obj directory so that they are only rebuilt once per kernel build +# +# Ports search for some dependencies in PATH, so add the location of the +# installed files WRKDIRPREFIX?= ${.OBJDIR} PORTSMODULESENV=\ env \ @@ -110,7 +130,7 @@ kernel-clobber: kernel-obj: -.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists($S/modules) +.if !defined(NO_MODULES) modules: modules-all .if !defined(NO_MODULES_OBJ) From owner-svn-src-head@freebsd.org Tue Oct 30 00:47:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8786210EED9B; Tue, 30 Oct 2018 00:47:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37B7D8D2DA; Tue, 30 Oct 2018 00:47:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BB2415F31; Tue, 30 Oct 2018 00:47:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9U0leCk059214; Tue, 30 Oct 2018 00:47:40 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9U0leix059213; Tue, 30 Oct 2018 00:47:40 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201810300047.w9U0leix059213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 30 Oct 2018 00:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339902 - head/sys/powerpc/mpc85xx X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/mpc85xx X-SVN-Commit-Revision: 339902 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 00:47:41 -0000 Author: jhibbits Date: Tue Oct 30 00:47:40 2018 New Revision: 339902 URL: https://svnweb.freebsd.org/changeset/base/339902 Log: powerpc/mpc85xx: Reset the PCIe bus on attach It seems if a Radeon card is already initialized by u-boot, it won't be reinitialized by the kernel, and the DRM module will fail to attach. This steals the reset code from mips/octopci.c to blindly reset the bus on attach. This was tested on a AmigaOne X5000/20, such that it can be booted from the local video console, and get a video console in FreeBSD. Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx.c Tue Oct 30 00:23:37 2018 (r339901) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c Tue Oct 30 00:47:40 2018 (r339902) @@ -562,7 +562,7 @@ fsl_pcib_init(struct fsl_pcib_softc *sc, int bus, int int new_pribus, new_secbus, new_subbus; int slot, func, maxfunc; uint16_t vendor, device; - uint8_t command, hdrtype, subclass; + uint8_t brctl, command, hdrtype, subclass; secbus = bus; for (slot = 0; slot <= maxslot; slot++) { @@ -605,6 +605,17 @@ fsl_pcib_init(struct fsl_pcib_softc *sc, int bus, int /* Allow all DEVTYPE 1 devices */ if (hdrtype != PCIM_HDRTYPE_BRIDGE) continue; + + brctl = fsl_pcib_read_config(sc->sc_dev, bus, slot, func, + PCIR_BRIDGECTL_1, 1); + brctl |= PCIB_BCR_SECBUS_RESET; + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_BRIDGECTL_1, brctl, 1); + DELAY(100000); + brctl &= ~PCIB_BCR_SECBUS_RESET; + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_BRIDGECTL_1, brctl, 1); + DELAY(100000); secbus++; From owner-svn-src-head@freebsd.org Tue Oct 30 02:37:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9631410CEB68; Tue, 30 Oct 2018 02:37:24 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8E36D9A6; Tue, 30 Oct 2018 02:37:24 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E32317588; Tue, 30 Oct 2018 02:37:24 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9U2bOxT015541; Tue, 30 Oct 2018 02:37:24 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9U2bNeq015539; Tue, 30 Oct 2018 02:37:23 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201810300237.w9U2bNeq015539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Tue, 30 Oct 2018 02:37:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339904 - in head: contrib/netbsd-tests/lib/libc/time lib/libc/tests X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: in head: contrib/netbsd-tests/lib/libc/time lib/libc/tests X-SVN-Commit-Revision: 339904 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 02:37:24 -0000 Author: yuripv Date: Tue Oct 30 02:37:23 2018 New Revision: 339904 URL: https://svnweb.freebsd.org/changeset/base/339904 Log: Connect libc/tests/time to the build, adding test cases for strptime() issues fixed recently, and disabling the failing ones (mostly due to TZ parsing differences with NetBSD). Reviewed by: ngie Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D17546 Modified: head/contrib/netbsd-tests/lib/libc/time/t_mktime.c head/contrib/netbsd-tests/lib/libc/time/t_strptime.c head/lib/libc/tests/Makefile Modified: head/contrib/netbsd-tests/lib/libc/time/t_mktime.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/time/t_mktime.c Tue Oct 30 01:39:22 2018 (r339903) +++ head/contrib/netbsd-tests/lib/libc/time/t_mktime.c Tue Oct 30 02:37:23 2018 (r339904) @@ -64,6 +64,9 @@ ATF_TC_HEAD(mktime_negyear, tc) ATF_TC_BODY(mktime_negyear, tc) { +#ifdef __FreeBSD__ + atf_tc_expect_fail("needs work"); +#endif struct tm tms; time_t t; Modified: head/contrib/netbsd-tests/lib/libc/time/t_strptime.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/time/t_strptime.c Tue Oct 30 01:39:22 2018 (r339903) +++ head/contrib/netbsd-tests/lib/libc/time/t_strptime.c Tue Oct 30 02:37:23 2018 (r339904) @@ -103,6 +103,7 @@ static struct { const char *name; long offs; } zt[] = { +#ifndef __FreeBSD__ { "Z", 0 }, { "UT", 0 }, { "UTC", 0 }, @@ -173,6 +174,7 @@ static struct { { "EST4EDT", -14400 }, { "Bogus", -1 }, +#endif }; static void @@ -188,9 +190,11 @@ ztest1(const char *name, const char *fmt, long value) value = 0; switch (value) { +#ifndef __FreeBSD__ case -2: value = -timezone; break; +#endif case -1: if (fmt[1] == 'Z') value = 0; @@ -210,9 +214,11 @@ static void ztest(const char *fmt) { setenv("TZ", "US/Eastern", 1); +#ifndef __FreeBSD__ ztest1("GMT", fmt, 0); ztest1("UTC", fmt, 0); ztest1("US/Eastern", fmt, -18000); +#endif for (size_t i = 0; i < __arraycount(zt); i++) ztest1(zt[i].name, fmt, zt[i].offs); } @@ -228,10 +234,6 @@ ATF_TC_HEAD(common, tc) ATF_TC_BODY(common, tc) { -#ifdef __FreeBSD__ - atf_tc_expect_fail("There are various issues with strptime on FreeBSD"); -#endif - h_pass("Tue Jan 20 23:27:46 1998", "%a %b %d %T %Y", 24, 46, 27, 23, 20, 0, 98, 2, 19); h_pass("Tue Jan 20 23:27:46 1998", "%a %b %d %H:%M:%S %Y", @@ -305,6 +307,10 @@ ATF_TC_BODY(day, tc) #else h_pass("SaturDay", "%OA", 8, -1, -1, -1, -1, -1, -1, 6, -1); #endif + +#ifdef __FreeBSD__ + h_fail("00", "%d"); +#endif } ATF_TC(hour); @@ -313,7 +319,11 @@ ATF_TC_HEAD(hour, tc) { atf_tc_set_md_var(tc, "descr", +#ifdef __FreeBSD__ + "Checks strptime(3) hour conversions [HIkl]"); +#else "Checks strptime(3) hour conversions [IH]"); +#endif } ATF_TC_BODY(hour, tc) @@ -321,6 +331,10 @@ ATF_TC_BODY(hour, tc) h_fail("00", "%I"); h_fail("13", "%I"); +#ifdef __FreeBSD__ + h_fail("00", "%l"); + h_fail("13", "%l"); +#endif h_pass("00", "%H", 2, -1, -1, 0, -1, -1, -1, -1, -1); h_pass("12", "%H", 2, -1, -1, 12, -1, -1, -1, -1, -1); @@ -413,7 +427,18 @@ ATF_TC_BODY(seconds, tc) h_pass("0", "%S", 1, 0, -1, -1, -1, -1, -1, -1, -1); h_pass("59", "%S", 2, 59, -1, -1, -1, -1, -1, -1, -1); h_pass("60", "%S", 2, 60, -1, -1, -1, -1, -1, -1, -1); +#ifdef __FreeBSD__ + /* + * (Much) older versions of the standard (up to the Issue 6) allowed for + * [0;61] range in %S conversion for double-leap seconds, and it's + * apparently what NetBSD and glibc are expecting, however current + * version defines allowed values to be [0;60], and that is what our + * strptime() implementation expects. + */ + h_fail("61", "%S"); +#else h_pass("61", "%S", 2, 61, -1, -1, -1, -1, -1, -1, -1); +#endif h_fail("62", "%S"); } @@ -434,7 +459,9 @@ ATF_TC_BODY(year, tc) h_pass("x2084y", "x%C%yy", 6, -1, -1, -1, -1, -1, 184, -1, -1); h_pass("x8420y", "x%y%Cy", 6, -1, -1, -1, -1, -1, 184, -1, -1); h_pass("%20845", "%%%C%y5", 6, -1, -1, -1, -1, -1, 184, -1, -1); +#ifndef __FreeBSD__ h_fail("%", "%E%"); +#endif h_pass("1980", "%Y", 4, -1, -1, -1, -1, -1, 80, -1, -1); h_pass("1980", "%EY", 4, -1, -1, -1, -1, -1, 80, -1, -1); @@ -467,7 +494,7 @@ ATF_TC_HEAD(Zone, tc) ATF_TC_BODY(Zone, tc) { - ztest("%z"); + ztest("%Z"); } ATF_TP_ADD_TCS(tp) Modified: head/lib/libc/tests/Makefile ============================================================================== --- head/lib/libc/tests/Makefile Tue Oct 30 01:39:22 2018 (r339903) +++ head/lib/libc/tests/Makefile Tue Oct 30 02:37:23 2018 (r339904) @@ -20,6 +20,7 @@ TESTS_SUBDIRS+= stdlib TESTS_SUBDIRS+= string TESTS_SUBDIRS+= sys TESTS_SUBDIRS+= termios +TESTS_SUBDIRS+= time TESTS_SUBDIRS+= tls TESTS_SUBDIRS+= ttyio From owner-svn-src-head@freebsd.org Tue Oct 30 09:36:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 728ED10DCE7E; Tue, 30 Oct 2018 09:36:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1CFB57A0E5; Tue, 30 Oct 2018 09:36:32 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE4DB1BA48; Tue, 30 Oct 2018 09:36:31 +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 w9U9aV6F031030; Tue, 30 Oct 2018 09:36:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9U9aVR0031029; Tue, 30 Oct 2018 09:36:31 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810300936.w9U9aVR0031029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 30 Oct 2018 09:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339907 - head/lib/csu/tests X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/lib/csu/tests X-SVN-Commit-Revision: 339907 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 09:36:32 -0000 Author: andrew Date: Tue Oct 30 09:36:31 2018 New Revision: 339907 URL: https://svnweb.freebsd.org/changeset/base/339907 Log: The jcr argument to _Jv_RegisterClasses is used, stop marking it otherwise. MFC with: r339738 Sponsored by: DARPA, AFRL Modified: head/lib/csu/tests/init_test.c Modified: head/lib/csu/tests/init_test.c ============================================================================== --- head/lib/csu/tests/init_test.c Tue Oct 30 08:36:36 2018 (r339906) +++ head/lib/csu/tests/init_test.c Tue Oct 30 09:36:31 2018 (r339907) @@ -51,7 +51,7 @@ void _Jv_RegisterClasses(const func_ptr *); __section(".jcr") __used static func_ptr jcr_func = (func_ptr)1; void -_Jv_RegisterClasses(const func_ptr *jcr __unused) +_Jv_RegisterClasses(const func_ptr *jcr) { jcr_run = 1; From owner-svn-src-head@freebsd.org Tue Oct 30 09:43:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5724110DD12C; Tue, 30 Oct 2018 09:43:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F13C57A563; Tue, 30 Oct 2018 09:43:27 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC8FD1BBFE; Tue, 30 Oct 2018 09:43:27 +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 w9U9hRR0036010; Tue, 30 Oct 2018 09:43:27 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9U9hQxA036004; Tue, 30 Oct 2018 09:43:26 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810300943.w9U9hQxA036004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 30 Oct 2018 09:43:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339908 - in head: etc/mtree lib/csu/tests lib/csu/tests/dso lib/csu/tests/dynamiclib X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head: etc/mtree lib/csu/tests lib/csu/tests/dso lib/csu/tests/dynamiclib X-SVN-Commit-Revision: 339908 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 09:43:28 -0000 Author: andrew Date: Tue Oct 30 09:43:26 2018 New Revision: 339908 URL: https://svnweb.freebsd.org/changeset/base/339908 Log: Run the csu tests on a DSO. This builds the tests into a shared library, then runs these from the base test programs. With this we can check crtbeginS.o and crtendS.o are working as expected. MFC with: r339738 Sponsored by: DARPA, AFRL Added: head/lib/csu/tests/dso/ head/lib/csu/tests/dso/Makefile (contents, props changed) head/lib/csu/tests/dynamiclib/ head/lib/csu/tests/dynamiclib/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/lib/csu/tests/Makefile head/lib/csu/tests/cxx_constructors.cc head/lib/csu/tests/fini_test.c head/lib/csu/tests/init_test.c Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Tue Oct 30 09:36:31 2018 (r339907) +++ head/etc/mtree/BSD.tests.dist Tue Oct 30 09:43:26 2018 (r339908) @@ -273,6 +273,8 @@ csu dynamic .. + dynamiclib + .. static .. .. Modified: head/lib/csu/tests/Makefile ============================================================================== --- head/lib/csu/tests/Makefile Tue Oct 30 09:36:31 2018 (r339907) +++ head/lib/csu/tests/Makefile Tue Oct 30 09:43:26 2018 (r339908) @@ -1,6 +1,8 @@ # $FreeBSD$ +SUBDIR= dso TESTS_SUBDIRS= dynamic +TESTS_SUBDIRS+= dynamiclib TESTS_SUBDIRS+= static .include Modified: head/lib/csu/tests/cxx_constructors.cc ============================================================================== --- head/lib/csu/tests/cxx_constructors.cc Tue Oct 30 09:36:31 2018 (r339907) +++ head/lib/csu/tests/cxx_constructors.cc Tue Oct 30 09:43:26 2018 (r339908) @@ -39,10 +39,18 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef DSO_LIB #include +#endif -static volatile int constructor_run; -static bool run_destructor_test = false; +extern volatile int constructor_run; +extern bool run_destructor_test; + +#ifndef DSO_BASE +volatile int constructor_run; +bool run_destructor_test = false; +#endif + struct Foo { Foo() { constructor_run = 1; @@ -53,8 +61,12 @@ struct Foo { } }; extern Foo foo; + +#ifndef DSO_BASE Foo foo; +#endif +#ifndef DSO_LIB ATF_TEST_CASE_WITHOUT_HEAD(cxx_constructor); ATF_TEST_CASE_BODY(cxx_constructor) { @@ -90,3 +102,4 @@ ATF_INIT_TEST_CASES(tcs) ATF_ADD_TEST_CASE(tcs, cxx_constructor); ATF_ADD_TEST_CASE(tcs, cxx_destructor); } +#endif Added: head/lib/csu/tests/dso/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/tests/dso/Makefile Tue Oct 30 09:43:26 2018 (r339908) @@ -0,0 +1,25 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR:H} +SHLIB= h_csu +SHLIB_NAME= libh_csu.so +SHLIB_MAJOR= 1 + +WITHOUT_STATIC= +WITHOUT_PROFILE= +WITHOUT_PIC= + +CFLAGS+= -DDSO_LIB + +.include "../Makefile.tests" +SRCS= +.for src in ${ATF_TESTS_C} +SRCS+= ${src}.c +.endfor +.for src in ${ATF_TESTS_CXX} +SRCS+= ${src}.cc +.endfor + +LIBDIR= ${TESTSBASE}/lib/csu/dynamiclib/ + +.include Added: head/lib/csu/tests/dynamiclib/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/tests/dynamiclib/Makefile Tue Oct 30 09:43:26 2018 (r339908) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR:H} +CFLAGS+= -DDSO_BASE +DPADD+= ${.OBJDIR:H}/dso/libh_csu.so +LDFLAGS+= -Wl,-rpath,${TESTSDIR} -L${.OBJDIR:H}/dso +LDADD+= -lh_csu + +.include "../Makefile.tests" + +.for test in ${ATF_TESTS_C} +ATF_TESTS_CXX+= ${test} +SRCS.${test}= ${test}.c +.endfor +ATF_TESTS_C:= + +.include Modified: head/lib/csu/tests/fini_test.c ============================================================================== --- head/lib/csu/tests/fini_test.c Tue Oct 30 09:36:31 2018 (r339907) +++ head/lib/csu/tests/fini_test.c Tue Oct 30 09:43:26 2018 (r339908) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -43,10 +44,16 @@ __FBSDID("$FreeBSD$"); #include +extern bool run_dtors_test; +extern bool run_fini_array_test; +void dso_handle_check(void); + + +#ifndef DSO_BASE typedef void (*func_ptr)(void); -static bool run_dtors_test = false; -static bool run_fini_array_test = false; +bool run_dtors_test = false; +bool run_fini_array_test = false; static void dtors_handler(void) @@ -57,7 +64,9 @@ dtors_handler(void) } __section(".dtors") __used static func_ptr dtors_func = &dtors_handler; +#endif +#ifndef DSO_LIB ATF_TC_WITHOUT_HEAD(dtors_test); ATF_TC_BODY(dtors_test, tc) { @@ -85,7 +94,9 @@ ATF_TC_BODY(dtors_test, tc) break; } } +#endif +#ifndef DSO_BASE static void fini_array_handler(void) { @@ -95,7 +106,9 @@ fini_array_handler(void) } __section(".fini_array") __used static func_ptr fini_array_func = &fini_array_handler; +#endif +#ifndef DSO_LIB ATF_TC_WITHOUT_HEAD(fini_array_test); ATF_TC_BODY(fini_array_test, tc) { @@ -118,15 +131,32 @@ ATF_TC_BODY(fini_array_test, tc) break; } } +#endif +#ifndef DSO_BASE extern void *__dso_handle; +void +dso_handle_check(void) +{ + void *dso = __dso_handle; + +#ifdef DSO_LIB + ATF_REQUIRE_MSG(dso != NULL, + "Null __dso_handle in DSO"); +#else + ATF_REQUIRE_MSG(dso == NULL, + "Invalid __dso_handle in non-DSO"); +#endif +} +#endif + +#ifndef DSO_LIB ATF_TC_WITHOUT_HEAD(dso_handle_test); ATF_TC_BODY(dso_handle_test, tc) { - ATF_REQUIRE_MSG(__dso_handle == NULL, - "Invalid __dso_handle in non-DSO"); + dso_handle_check(); } ATF_TP_ADD_TCS(tp) @@ -138,3 +168,4 @@ ATF_TP_ADD_TCS(tp) return (atf_no_error()); } +#endif Modified: head/lib/csu/tests/init_test.c ============================================================================== --- head/lib/csu/tests/init_test.c Tue Oct 30 09:36:31 2018 (r339907) +++ head/lib/csu/tests/init_test.c Tue Oct 30 09:43:26 2018 (r339908) @@ -32,23 +32,36 @@ #include __FBSDID("$FreeBSD$"); +#ifndef DSO_LIB #include +#endif #include typedef void (*func_ptr)(void); -static volatile int jcr_run; -static const func_ptr *jcr_ptr; -static volatile int ctors_run; -static volatile int preinit_array_run; -static volatile int preinit_array_state = -1; -static volatile int init_array_run; -static volatile int init_array_state = -1; +extern volatile int jcr_run; +extern const func_ptr *jcr_ptr; +extern const void *jcr_func_ptr; +extern volatile int ctors_run; +extern volatile int preinit_array_run; +extern volatile int preinit_array_state; +extern volatile int init_array_run; +extern volatile int init_array_state; +#ifndef DSO_BASE +volatile int jcr_run; +const func_ptr *jcr_ptr; +volatile int ctors_run; +volatile int preinit_array_run; +volatile int preinit_array_state = -1; +volatile int init_array_run; +volatile int init_array_state = -1; + void _Jv_RegisterClasses(const func_ptr *); -__section(".jcr") __used static func_ptr jcr_func = (func_ptr)1; +__section(".jcr") __used func_ptr static jcr_func = (func_ptr)1; +const void *jcr_func_ptr = &jcr_func; void _Jv_RegisterClasses(const func_ptr *jcr) @@ -57,16 +70,20 @@ _Jv_RegisterClasses(const func_ptr *jcr) jcr_run = 1; jcr_ptr = jcr; } +#endif +#ifndef DSO_LIB ATF_TC_WITHOUT_HEAD(jcr_test); ATF_TC_BODY(jcr_test, tc) { ATF_REQUIRE_MSG(jcr_run == 1, ".jcr not run"); - ATF_REQUIRE_MSG(jcr_ptr == &jcr_func, + ATF_REQUIRE_MSG(jcr_ptr == jcr_func_ptr, "Incorrect pointer passed to _Jv_RegisterClasses"); } +#endif +#ifndef DSO_BASE static void ctors_handler(void) { @@ -75,7 +92,9 @@ ctors_handler(void) } __section(".ctors") __used static func_ptr ctors_func = &ctors_handler; +#endif +#ifndef DSO_LIB ATF_TC_WITHOUT_HEAD(ctors_test); ATF_TC_BODY(ctors_test, tc) { @@ -86,7 +105,9 @@ ATF_TC_BODY(ctors_test, tc) ATF_REQUIRE_MSG(ctors_run == 0, ".ctors run"); #endif } +#endif +#ifndef DSO_BASE static void preinit_array_handler(void) { @@ -96,16 +117,25 @@ preinit_array_handler(void) } __section(".preinit_array") __used static func_ptr preinit_array_func = &preinit_array_handler; +#endif +#ifndef DSO_LIB ATF_TC_WITHOUT_HEAD(preinit_array_test); ATF_TC_BODY(preinit_array_test, tc) { +#ifdef DSO_BASE + /* Check .preinit_array wasn't run in a DSO */ + ATF_REQUIRE_MSG(preinit_array_run == 0, ".preinit_array run in DSO"); +#else ATF_REQUIRE_MSG(preinit_array_run == 1, ".preinit_array not run"); ATF_REQUIRE_MSG(preinit_array_state == 0, ".preinit_array was not run before .init_array"); +#endif } +#endif +#ifndef DSO_BASE static void init_array_handler(void) { @@ -115,14 +145,18 @@ init_array_handler(void) } __section(".init_array") __used static func_ptr init_array_func = &init_array_handler; +#endif +#ifndef DSO_LIB ATF_TC_WITHOUT_HEAD(init_array_test); ATF_TC_BODY(init_array_test, tc) { ATF_REQUIRE_MSG(init_array_run == 1, ".init_array not run"); +#ifndef DSO_BASE ATF_REQUIRE_MSG(init_array_state == 1, ".init_array was not run after .preinit_array"); +#endif } ATF_TP_ADD_TCS(tp) @@ -135,3 +169,4 @@ ATF_TP_ADD_TCS(tp) return (atf_no_error()); } +#endif From owner-svn-src-head@freebsd.org Tue Oct 30 09:53:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5527B10DD70C; Tue, 30 Oct 2018 09:53:58 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 056707AC71; Tue, 30 Oct 2018 09:53:58 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D96111BD92; Tue, 30 Oct 2018 09:53:57 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9U9rvMQ041117; Tue, 30 Oct 2018 09:53:57 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9U9rvOI041116; Tue, 30 Oct 2018 09:53:57 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201810300953.w9U9rvOI041116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 30 Oct 2018 09:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339909 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 339909 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 09:53:58 -0000 Author: araujo Date: Tue Oct 30 09:53:57 2018 New Revision: 339909 URL: https://svnweb.freebsd.org/changeset/base/339909 Log: Allow changing lagg(4) MTU. Previously, changing the MTU would require destroying the lagg and creating a new one. Now it is allowed to change the MTU of the lagg interface and the MTU of the ports will be set to match. If any port cannot set the new MTU, all ports are reverted to the original MTU of the lagg. Additionally, when adding ports, the MTU of a port will be automatically set to the MTU of the lagg. As always, the MTU of the lagg is initially determined by the MTU of the first port added. If adding an interface as a port for some reason fails, that interface is reverted to its original MTU. Submitted by: Ryan Moeller Reviewed by: mav Relnotes: Yes Sponsored by: iXsystems Inc. Differential Revision: https://reviews.freebsd.org/D17576 Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Tue Oct 30 09:43:26 2018 (r339908) +++ head/sys/net/if_lagg.c Tue Oct 30 09:53:57 2018 (r339909) @@ -633,11 +633,18 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * { struct lagg_softc *sc_ptr; struct lagg_port *lp, *tlp; - int error, i; + struct ifreq ifr; + int error, i, oldmtu; uint64_t *pval; LAGG_XLOCK_ASSERT(sc); + if (sc->sc_ifp == ifp) { + if_printf(sc->sc_ifp, + "cannot add a lagg to itself as a port\n"); + return (EINVAL); + } + /* Limit the maximal number of lagg ports */ if (sc->sc_count >= LAGG_MAX_PORTS) return (ENOSPC); @@ -656,12 +663,25 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * return (EPROTONOSUPPORT); /* Allow the first Ethernet member to define the MTU */ - if (CK_SLIST_EMPTY(&sc->sc_ports)) + oldmtu = -1; + if (CK_SLIST_EMPTY(&sc->sc_ports)) { sc->sc_ifp->if_mtu = ifp->if_mtu; - else if (sc->sc_ifp->if_mtu != ifp->if_mtu) { - if_printf(sc->sc_ifp, "invalid MTU for %s\n", - ifp->if_xname); - return (EINVAL); + } else if (sc->sc_ifp->if_mtu != ifp->if_mtu) { + if (ifp->if_ioctl == NULL) { + if_printf(sc->sc_ifp, "cannot change MTU for %s\n", + ifp->if_xname); + return (EINVAL); + } + oldmtu = ifp->if_mtu; + strlcpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name)); + ifr.ifr_mtu = sc->sc_ifp->if_mtu; + error = (*ifp->if_ioctl)(ifp, SIOCSIFMTU, (caddr_t)&ifr); + if (error != 0) { + if_printf(sc->sc_ifp, "invalid MTU for %s\n", + ifp->if_xname); + return (error); + } + ifr.ifr_mtu = oldmtu; } lp = malloc(sizeof(struct lagg_port), M_DEVBUF, M_WAITOK|M_ZERO); @@ -673,6 +693,9 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * if (ifp == sc_ptr->sc_ifp) { LAGG_LIST_UNLOCK(); free(lp, M_DEVBUF); + if (oldmtu != -1) + (*ifp->if_ioctl)(ifp, SIOCSIFMTU, + (caddr_t)&ifr); return (EINVAL); /* XXX disable stacking for the moment, its untested */ #ifdef LAGG_PORT_STACKING @@ -681,6 +704,9 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * LAGG_MAX_STACKING) { LAGG_LIST_UNLOCK(); free(lp, M_DEVBUF); + if (oldmtu != -1) + (*ifp->if_ioctl)(ifp, SIOCSIFMTU, + (caddr_t)&ifr); return (E2BIG); } #endif @@ -746,6 +772,8 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * if ((error = lagg_proto_addport(sc, lp)) != 0) { /* Remove the port, without calling pr_delport. */ lagg_port_destroy(lp, 0); + if (oldmtu != -1) + (*ifp->if_ioctl)(ifp, SIOCSIFMTU, (caddr_t)&ifr); return (error); } @@ -1464,8 +1492,31 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data break; case SIOCSIFMTU: - /* Do not allow the MTU to be directly changed */ - error = EINVAL; + LAGG_XLOCK(sc); + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + if (lp->lp_ioctl != NULL) + error = (*lp->lp_ioctl)(lp->lp_ifp, cmd, data); + else + error = EINVAL; + if (error != 0) { + if_printf(ifp, + "failed to change MTU to %d on port %s, " + "reverting all ports to original MTU (%d)\n", + ifr->ifr_mtu, lp->lp_ifp->if_xname, ifp->if_mtu); + break; + } + } + if (error == 0) { + ifp->if_mtu = ifr->ifr_mtu; + } else { + /* set every port back to the original MTU */ + ifr->ifr_mtu = ifp->if_mtu; + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + if (lp->lp_ioctl != NULL) + (*lp->lp_ioctl)(lp->lp_ifp, cmd, data); + } + } + LAGG_XUNLOCK(sc); break; default: From owner-svn-src-head@freebsd.org Tue Oct 30 10:02:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B55AE10DDD78; Tue, 30 Oct 2018 10:02:24 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A1377B30F; Tue, 30 Oct 2018 10:02:24 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AB2C1BF29; Tue, 30 Oct 2018 10:02:24 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9UA2OYs046377; Tue, 30 Oct 2018 10:02:24 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UA2OSo046376; Tue, 30 Oct 2018 10:02:24 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201810301002.w9UA2OSo046376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 30 Oct 2018 10:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339911 - head/sys/amd64/vmm/amd X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/sys/amd64/vmm/amd X-SVN-Commit-Revision: 339911 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 10:02:24 -0000 Author: araujo Date: Tue Oct 30 10:02:23 2018 New Revision: 339911 URL: https://svnweb.freebsd.org/changeset/base/339911 Log: Emulate machine check related MSR_EXTFEATURES to allow guest OSes to boot on AMD FX Series. PR: 224476 Submitted by: Keita Uchida Reviewed by: rgrimes Sponsored by: iXsystems Inc. Differential Revision: https://reviews.freebsd.org/D17713 Modified: head/sys/amd64/vmm/amd/svm_msr.c Modified: head/sys/amd64/vmm/amd/svm_msr.c ============================================================================== --- head/sys/amd64/vmm/amd/svm_msr.c Tue Oct 30 10:01:15 2018 (r339910) +++ head/sys/amd64/vmm/amd/svm_msr.c Tue Oct 30 10:02:23 2018 (r339911) @@ -127,6 +127,9 @@ svm_rdmsr(struct svm_softc *sc, int vcpu, u_int num, u case MSR_AMDK8_IPM: *result = 0; break; + case MSR_EXTFEATURES: + *result = 0; + break; default: error = EINVAL; break; @@ -162,6 +165,8 @@ svm_wrmsr(struct svm_softc *sc, int vcpu, u_int num, u /* * Ignore writes to microcode update register. */ + break; + case MSR_EXTFEATURES: break; default: error = EINVAL; From owner-svn-src-head@freebsd.org Tue Oct 30 10:16:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B296810DE59D; Tue, 30 Oct 2018 10:16:22 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65DBD7BD90; Tue, 30 Oct 2018 10:16:22 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 488761C0F4; Tue, 30 Oct 2018 10:16:22 +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 w9UAGMxW051595; Tue, 30 Oct 2018 10:16:22 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UAGMOx051594; Tue, 30 Oct 2018 10:16:22 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810301016.w9UAGMOx051594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 30 Oct 2018 10:16:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339912 - head/lib/csu/tests X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/lib/csu/tests X-SVN-Commit-Revision: 339912 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 10:16:22 -0000 Author: andrew Date: Tue Oct 30 10:16:21 2018 New Revision: 339912 URL: https://svnweb.freebsd.org/changeset/base/339912 Log: Fix the location of the static keyword. MFC with: r339738 Sponsored by: DARPA, AFRL Modified: head/lib/csu/tests/init_test.c Modified: head/lib/csu/tests/init_test.c ============================================================================== --- head/lib/csu/tests/init_test.c Tue Oct 30 10:02:23 2018 (r339911) +++ head/lib/csu/tests/init_test.c Tue Oct 30 10:16:21 2018 (r339912) @@ -60,7 +60,7 @@ volatile int init_array_state = -1; void _Jv_RegisterClasses(const func_ptr *); -__section(".jcr") __used func_ptr static jcr_func = (func_ptr)1; +__section(".jcr") __used static func_ptr jcr_func = (func_ptr)1; const void *jcr_func_ptr = &jcr_func; void From owner-svn-src-head@freebsd.org Tue Oct 30 10:17:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B64710DE68D; Tue, 30 Oct 2018 10:17:44 +0000 (UTC) (envelope-from Michael.Tuexen@macmic.franken.de) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7D3A7BF5B; Tue, 30 Oct 2018 10:17:43 +0000 (UTC) (envelope-from Michael.Tuexen@macmic.franken.de) Received: from [10.0.1.118] (unknown [212.201.121.94]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 88BE3721E280C; Tue, 30 Oct 2018 11:17:40 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.0 \(3445.100.39\)) Subject: Re: svn commit: r339876 - head/libexec/rtld-elf From: Michael Tuexen In-Reply-To: <201810292108.w9TL83bO041913@repo.freebsd.org> Date: Tue, 30 Oct 2018 11:17:39 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201810292108.w9TL83bO041913@repo.freebsd.org> To: Alex Richardson X-Mailer: Apple Mail (2.3445.100.39) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 10:17:44 -0000 > On 29. Oct 2018, at 22:08, Alex Richardson = wrote: >=20 > Author: arichardson > Date: Mon Oct 29 21:08:02 2018 > New Revision: 339876 > URL: https://svnweb.freebsd.org/changeset/base/339876 >=20 > Log: > rtld: set obj->textsize correctly >=20 > With lld-generated binaries the first PT_LOAD will usually be a = read-only > segment unless you pass --no-rosegment. For those binaries the = textsize is > determined by the next PT_LOAD. To allow both LLD and bfd 2.17 = binaries to > be parsed correctly use the end of the last PT_LOAD that is marked as > executable instead. >=20 > I noticed that the value was wrong while adding some debug prints for = some rtld > changes for CHERI binaries. `obj->textsize` only seems to be used by = PPC so the > effect is untested. However, the value before was definitely wrong = and the new > result matches the phdrs. I build kernel and world with a revision later than this on a PPC. = Buildword ends up with a world where almost all binaries are segfaulting.... = Especially gdb (but svn, ls or so all segfault). Best regards Michael >=20 > Reviewed By: kib > Approved By: brooks (mentor) > Differential Revision: https://reviews.freebsd.org/D17117 >=20 > Modified: > head/libexec/rtld-elf/map_object.c > head/libexec/rtld-elf/rtld.c >=20 > Modified: head/libexec/rtld-elf/map_object.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/libexec/rtld-elf/map_object.c Mon Oct 29 21:03:43 2018 = (r339875) > +++ head/libexec/rtld-elf/map_object.c Mon Oct 29 21:08:02 2018 = (r339876) > @@ -93,6 +93,7 @@ map_object(int fd, const char *path, const struct = stat > Elf_Addr note_end; > char *note_map; > size_t note_map_len; > + Elf_Addr text_end; >=20 > hdr =3D get_elf_header(fd, path, sb); > if (hdr =3D=3D NULL) > @@ -116,6 +117,7 @@ map_object(int fd, const char *path, const struct = stat > note_map =3D NULL; > segs =3D alloca(sizeof(segs[0]) * hdr->e_phnum); > stack_flags =3D RTLD_DEFAULT_STACK_PF_EXEC | PF_R | PF_W; > + text_end =3D 0; > while (phdr < phlimit) { > switch (phdr->p_type) { >=20 > @@ -130,6 +132,10 @@ map_object(int fd, const char *path, const struct = stat > path, nsegs); > goto error; > } > + if ((segs[nsegs]->p_flags & PF_X) =3D=3D PF_X) { > + text_end =3D MAX(text_end, > + round_page(segs[nsegs]->p_vaddr + = segs[nsegs]->p_memsz)); > + } > break; >=20 > case PT_PHDR: > @@ -280,8 +286,7 @@ map_object(int fd, const char *path, const struct = stat > } > obj->mapbase =3D mapbase; > obj->mapsize =3D mapsize; > - obj->textsize =3D round_page(segs[0]->p_vaddr + segs[0]->p_memsz) = - > - base_vaddr; > + obj->textsize =3D text_end - base_vaddr; > obj->vaddrbase =3D base_vaddr; > obj->relocbase =3D mapbase - base_vaddr; > obj->dynamic =3D (const Elf_Dyn *) (obj->relocbase + = phdyn->p_vaddr); >=20 > Modified: head/libexec/rtld-elf/rtld.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/libexec/rtld-elf/rtld.c Mon Oct 29 21:03:43 2018 = (r339875) > +++ head/libexec/rtld-elf/rtld.c Mon Oct 29 21:08:02 2018 = (r339876) > @@ -1390,13 +1390,15 @@ digest_phdr(const Elf_Phdr *phdr, int phnum, = caddr_t e > if (nsegs =3D=3D 0) { /* First load segment */ > obj->vaddrbase =3D trunc_page(ph->p_vaddr); > obj->mapbase =3D obj->vaddrbase + obj->relocbase; > - obj->textsize =3D round_page(ph->p_vaddr + ph->p_memsz) = - > - obj->vaddrbase; > } else { /* Last load segment */ > obj->mapsize =3D round_page(ph->p_vaddr + ph->p_memsz) - > obj->vaddrbase; > } > nsegs++; > + if ((ph->p_flags & PF_X) =3D=3D PF_X) { > + obj->textsize =3D MAX(obj->textsize, > + round_page(ph->p_vaddr + ph->p_memsz) - = obj->vaddrbase); > + } > break; >=20 > case PT_DYNAMIC: >=20 From owner-svn-src-head@freebsd.org Tue Oct 30 11:19:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C7EE10E002D; Tue, 30 Oct 2018 11:19:48 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02C347E0A3; Tue, 30 Oct 2018 11:19:48 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D87B11CA8D; Tue, 30 Oct 2018 11:19:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9UBJli2083034; Tue, 30 Oct 2018 11:19:47 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UBJlMv083033; Tue, 30 Oct 2018 11:19:47 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810301119.w9UBJlMv083033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 30 Oct 2018 11:19:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339913 - head/lib/csu/tests X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/lib/csu/tests X-SVN-Commit-Revision: 339913 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 11:19:48 -0000 Author: andrew Date: Tue Oct 30 11:19:47 2018 New Revision: 339913 URL: https://svnweb.freebsd.org/changeset/base/339913 Log: Disable the .preinit_array test in DSOs, ld.bfd fails to link objects with the section. MFC with: r339738 Sponsored by: DARPA, AFRL Modified: head/lib/csu/tests/init_test.c Modified: head/lib/csu/tests/init_test.c ============================================================================== --- head/lib/csu/tests/init_test.c Tue Oct 30 10:16:21 2018 (r339912) +++ head/lib/csu/tests/init_test.c Tue Oct 30 11:19:47 2018 (r339913) @@ -107,7 +107,7 @@ ATF_TC_BODY(ctors_test, tc) } #endif -#ifndef DSO_BASE +#if !defined(DSO_BASE) && !defined(DSO_LIB) static void preinit_array_handler(void) { From owner-svn-src-head@freebsd.org Tue Oct 30 11:51:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F1C310E0BC2; Tue, 30 Oct 2018 11:51:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 152517FA78; Tue, 30 Oct 2018 11:51:10 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC0AE1D095; Tue, 30 Oct 2018 11:51:09 +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 w9UBp9u1000122; Tue, 30 Oct 2018 11:51:09 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UBp9jO000121; Tue, 30 Oct 2018 11:51:09 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201810301151.w9UBp9jO000121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 30 Oct 2018 11:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339914 - head/sys/powerpc/powermac X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/powerpc/powermac X-SVN-Commit-Revision: 339914 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 11:51:10 -0000 Author: tuexen Date: Tue Oct 30 11:51:09 2018 New Revision: 339914 URL: https://svnweb.freebsd.org/changeset/base/339914 Log: Bump the number of fans supported from 8 to 12. The number of fans on a PowerMac7,3 with liquid cooling is 9. Reviewed by: andreast@ MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D17754 Modified: head/sys/powerpc/powermac/fcu.c Modified: head/sys/powerpc/powermac/fcu.c ============================================================================== --- head/sys/powerpc/powermac/fcu.c Tue Oct 30 11:19:47 2018 (r339913) +++ head/sys/powerpc/powermac/fcu.c Tue Oct 30 11:51:09 2018 (r339914) @@ -451,9 +451,9 @@ fcu_fill_fan_prop(device_t dev) { phandle_t child; struct fcu_softc *sc; - u_int id[8]; - char location[96]; - char type[64]; + u_int id[12]; + char location[144]; + char type[96]; int i = 0, j, len = 0, prop_len, prev_len = 0; sc = device_get_softc(dev); From owner-svn-src-head@freebsd.org Tue Oct 30 14:44:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC8D510EA772; Tue, 30 Oct 2018 14:44:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7152587483; Tue, 30 Oct 2018 14:44:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 526741ECF3; Tue, 30 Oct 2018 14:44:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9UEiEtL092895; Tue, 30 Oct 2018 14:44:14 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UEiCmr092889; Tue, 30 Oct 2018 14:44:12 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810301444.w9UEiCmr092889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 30 Oct 2018 14:44:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339916 - in head/lib/csu: . arm mips powerpc riscv sparc64 tests X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/lib/csu: . arm mips powerpc riscv sparc64 tests X-SVN-Commit-Revision: 339916 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 14:44:15 -0000 Author: andrew Date: Tue Oct 30 14:44:12 2018 New Revision: 339916 URL: https://svnweb.freebsd.org/changeset/base/339916 Log: Build the csu tests on all architectures. The tests haven't been run them, but this is enough to build them so I can get feedback on if the various crt.h headers are correct. MFC with: r339738 Sponsored by: DARPA, AFRL Added: head/lib/csu/arm/crt.h (contents, props changed) head/lib/csu/mips/crt.h (contents, props changed) head/lib/csu/powerpc/crt.h (contents, props changed) head/lib/csu/riscv/crt.h (contents, props changed) head/lib/csu/sparc64/crt.h (contents, props changed) Modified: head/lib/csu/Makefile head/lib/csu/tests/Makefile.tests Modified: head/lib/csu/Makefile ============================================================================== --- head/lib/csu/Makefile Tue Oct 30 14:25:16 2018 (r339915) +++ head/lib/csu/Makefile Tue Oct 30 14:44:12 2018 (r339916) @@ -8,10 +8,7 @@ SUBDIR+= ${MACHINE_ARCH} SUBDIR+= ${MACHINE_CPUARCH} .endif -.if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \ - ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc64" HAS_TESTS= SUBDIR.${MK_TESTS}+= tests -.endif .include Added: head/lib/csu/arm/crt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/arm/crt.h Tue Oct 30 14:44:12 2018 (r339916) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +/* Empty so we can include this unconditionally */ Added: head/lib/csu/mips/crt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/mips/crt.h Tue Oct 30 14:44:12 2018 (r339916) @@ -0,0 +1,31 @@ +/*- + * SPDX-License-Identifier: BSD-1-Clause + * + * Copyright 2018 Andrew Turner + * + * 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. + * + * 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 _CRT_H_ +#define _CRT_H_ + +#define HAVE_CTORS + +#endif Added: head/lib/csu/powerpc/crt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/powerpc/crt.h Tue Oct 30 14:44:12 2018 (r339916) @@ -0,0 +1,33 @@ +/*- + * SPDX-License-Identifier: BSD-1-Clause + * + * Copyright 2018 Andrew Turner + * + * 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. + * + * 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 _CRT_H_ +#define _CRT_H_ + +#define HAVE_CTORS +#define CTORS_CONSTRUCTORS +#define INIT_CALL_SEQ(func) "bl " __STRING(func) "; nop" + +#endif Added: head/lib/csu/riscv/crt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/riscv/crt.h Tue Oct 30 14:44:12 2018 (r339916) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +/* Empty so we can include this unconditionally */ Added: head/lib/csu/sparc64/crt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/sparc64/crt.h Tue Oct 30 14:44:12 2018 (r339916) @@ -0,0 +1,31 @@ +/*- + * SPDX-License-Identifier: BSD-1-Clause + * + * Copyright 2018 Andrew Turner + * + * 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. + * + * 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 _CRT_H_ +#define _CRT_H_ + +#define HAVE_CTORS + +#endif Modified: head/lib/csu/tests/Makefile.tests ============================================================================== --- head/lib/csu/tests/Makefile.tests Tue Oct 30 14:25:16 2018 (r339915) +++ head/lib/csu/tests/Makefile.tests Tue Oct 30 14:44:12 2018 (r339916) @@ -4,7 +4,7 @@ ATF_TESTS_C+= init_test ATF_TESTS_C+= fini_test ATF_TESTS_CXX+= cxx_constructors -WARNS?= 5 +WARNS?= 3 .if exists(${.CURDIR:H:H}/${MACHINE_ARCH}) CFLAGS+= -I${.CURDIR:H:H}/${MACHINE_ARCH} From owner-svn-src-head@freebsd.org Tue Oct 30 14:54:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C639F10EABAA; Tue, 30 Oct 2018 14:54:16 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7895669D87; Tue, 30 Oct 2018 14:54:16 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 403261EE8C; Tue, 30 Oct 2018 14:54:16 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9UEsGQ9098000; Tue, 30 Oct 2018 14:54:16 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UEsGeB097999; Tue, 30 Oct 2018 14:54:16 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201810301454.w9UEsGeB097999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 30 Oct 2018 14:54:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339917 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 339917 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 14:54:16 -0000 Author: vangyzen Date: Tue Oct 30 14:54:15 2018 New Revision: 339917 URL: https://svnweb.freebsd.org/changeset/base/339917 Log: Always stop the scheduler when entering kdb Set curthread->td_stopsched when entering kdb via any vector. Previously, it was only set when entering via panic, so when entering kdb another way, mutexes and such were still "live", and an attempt to lock an already locked mutex would panic. Reviewed by: kib, cem Discussed with: jhb Tested by: pho MFC after: 2 months Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D17687 Modified: head/sys/kern/subr_kdb.c Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Tue Oct 30 14:44:12 2018 (r339916) +++ head/sys/kern/subr_kdb.c Tue Oct 30 14:54:15 2018 (r339917) @@ -652,9 +652,7 @@ kdb_trap(int type, int code, struct trapframe *tf) struct kdb_dbbe *be; register_t intr; int handled; -#ifdef SMP int did_stop_cpus; -#endif be = kdb_dbbe; if (be == NULL || be->dbbe_trap == NULL) @@ -666,16 +664,17 @@ kdb_trap(int type, int code, struct trapframe *tf) intr = intr_disable(); -#ifdef SMP if (!SCHEDULER_STOPPED()) { +#ifdef SMP other_cpus = all_cpus; CPU_NAND(&other_cpus, &stopped_cpus); CPU_CLR(PCPU_GET(cpuid), &other_cpus); stop_cpus_hard(other_cpus); +#endif + curthread->td_stopsched = 1; did_stop_cpus = 1; } else did_stop_cpus = 0; -#endif kdb_active++; @@ -703,12 +702,13 @@ kdb_trap(int type, int code, struct trapframe *tf) kdb_active--; -#ifdef SMP if (did_stop_cpus) { + curthread->td_stopsched = 0; +#ifdef SMP CPU_AND(&other_cpus, &stopped_cpus); restart_cpus(other_cpus); - } #endif + } intr_restore(intr); From owner-svn-src-head@freebsd.org Tue Oct 30 15:33:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F097810EB983; Tue, 30 Oct 2018 15:32:59 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-yw1-f42.google.com (mail-yw1-f42.google.com [209.85.161.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 946006B46B; Tue, 30 Oct 2018 15:32:59 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-yw1-f42.google.com with SMTP id j202-v6so5066040ywa.13; Tue, 30 Oct 2018 08:32:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lczByhvdLZBbZ0ECfMsYkRoa9DZDp2Yx2OHT+J+VxMI=; b=slmNSDmptevPnxC6WpSqBpyIDG6daH4MOpxT/Br3sQruWV6uLJDhwxGjtq3nn/NTsd IxlUAXmieu9vj2+Nrh7EfhhKAr969p+8WllEjbbuFhcT/MwFdIA5W1wDBvvRyj/uPFhj JWeQ0FmsHjFbpG7qn5s9vn10CiahAHJ0etUq9z31fipbOM1qYu7Z+yZxabBdwNiXEbOM 7AfUuB5Dn1/0+jaKI+fgzypDzewImrV354wL3PtM+h5A8hyZy34LYhnBma8yFI/vfJp2 /351AAKggihCERfXl2X9BXr8jeMhRmTtqwxQqQ9Y4lrOWW1HZby4W7LCfLfuBRJcbMkQ E41A== X-Gm-Message-State: AGRZ1gLAcBKSGsEM9KDgldgr4npIAeL7pZhfjqP5b4ikCDSytPVlqK3M j2tsO6yYyYaS0e0r5GaiBR3CtT7GXQ8= X-Google-Smtp-Source: AJdET5dRO5DHVacPb/OSbtse6GZqxcViGAJuqB3GrfqHciIbkDHdVkcKGoUxnUmMmONWfFgaEvsKPA== X-Received: by 2002:a81:3a89:: with SMTP id h131-v6mr2938948ywa.210.1540913572470; Tue, 30 Oct 2018 08:32:52 -0700 (PDT) Received: from mail-yw1-f49.google.com (mail-yw1-f49.google.com. [209.85.161.49]) by smtp.gmail.com with ESMTPSA id g5-v6sm7103494ywa.39.2018.10.30.08.32.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Oct 2018 08:32:52 -0700 (PDT) Received: by mail-yw1-f49.google.com with SMTP id c126-v6so5071191ywd.8; Tue, 30 Oct 2018 08:32:52 -0700 (PDT) X-Received: by 2002:a81:417:: with SMTP id 23-v6mr2896422ywe.203.1540913571909; Tue, 30 Oct 2018 08:32:51 -0700 (PDT) MIME-Version: 1.0 References: <201810292108.w9TL83bO041913@repo.freebsd.org> In-Reply-To: From: Alexander Richardson Date: Tue, 30 Oct 2018 15:32:40 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r339876 - head/libexec/rtld-elf To: Michael.Tuexen@macmic.franken.de Cc: src-committers , 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 15:33:00 -0000 On Tue, 30 Oct 2018 at 10:17, Michael Tuexen wrote: > > > On 29. Oct 2018, at 22:08, Alex Richardson wrote: > > > > Author: arichardson > > Date: Mon Oct 29 21:08:02 2018 > > New Revision: 339876 > > URL: https://svnweb.freebsd.org/changeset/base/339876 > > > > Log: > > rtld: set obj->textsize correctly > > > > With lld-generated binaries the first PT_LOAD will usually be a read-only > > segment unless you pass --no-rosegment. For those binaries the textsize is > > determined by the next PT_LOAD. To allow both LLD and bfd 2.17 binaries to > > be parsed correctly use the end of the last PT_LOAD that is marked as > > executable instead. > > > > I noticed that the value was wrong while adding some debug prints for some rtld > > changes for CHERI binaries. `obj->textsize` only seems to be used by PPC so the > > effect is untested. However, the value before was definitely wrong and the new > > result matches the phdrs. > I build kernel and world with a revision later than this on a PPC. Buildword > ends up with a world where almost all binaries are segfaulting.... Especially gdb > (but svn, ls or so all segfault). > > Best regards > Michael This is rather surprising since if anything the range of the icache flush should increase rather than decrease after this change. I can only see this causing a behaviour change if we actually need to flush more than just the executable segments. Is it possible that some binary/library contains a non-executable segment as the first PT_LOAD? Or is there some linker script that adds custom PHDRS? Alex > > > > Reviewed By: kib > > Approved By: brooks (mentor) > > Differential Revision: https://reviews.freebsd.org/D17117 > > > > Modified: > > head/libexec/rtld-elf/map_object.c > > head/libexec/rtld-elf/rtld.c > > > > Modified: head/libexec/rtld-elf/map_object.c > > ============================================================================== > > --- head/libexec/rtld-elf/map_object.c Mon Oct 29 21:03:43 2018 (r339875) > > +++ head/libexec/rtld-elf/map_object.c Mon Oct 29 21:08:02 2018 (r339876) > > @@ -93,6 +93,7 @@ map_object(int fd, const char *path, const struct stat > > Elf_Addr note_end; > > char *note_map; > > size_t note_map_len; > > + Elf_Addr text_end; > > > > hdr = get_elf_header(fd, path, sb); > > if (hdr == NULL) > > @@ -116,6 +117,7 @@ map_object(int fd, const char *path, const struct stat > > note_map = NULL; > > segs = alloca(sizeof(segs[0]) * hdr->e_phnum); > > stack_flags = RTLD_DEFAULT_STACK_PF_EXEC | PF_R | PF_W; > > + text_end = 0; > > while (phdr < phlimit) { > > switch (phdr->p_type) { > > > > @@ -130,6 +132,10 @@ map_object(int fd, const char *path, const struct stat > > path, nsegs); > > goto error; > > } > > + if ((segs[nsegs]->p_flags & PF_X) == PF_X) { > > + text_end = MAX(text_end, > > + round_page(segs[nsegs]->p_vaddr + segs[nsegs]->p_memsz)); > > + } > > break; > > > > case PT_PHDR: > > @@ -280,8 +286,7 @@ map_object(int fd, const char *path, const struct stat > > } > > obj->mapbase = mapbase; > > obj->mapsize = mapsize; > > - obj->textsize = round_page(segs[0]->p_vaddr + segs[0]->p_memsz) - > > - base_vaddr; > > + obj->textsize = text_end - base_vaddr; > > obj->vaddrbase = base_vaddr; > > obj->relocbase = mapbase - base_vaddr; > > obj->dynamic = (const Elf_Dyn *) (obj->relocbase + phdyn->p_vaddr); > > > > Modified: head/libexec/rtld-elf/rtld.c > > ============================================================================== > > --- head/libexec/rtld-elf/rtld.c Mon Oct 29 21:03:43 2018 (r339875) > > +++ head/libexec/rtld-elf/rtld.c Mon Oct 29 21:08:02 2018 (r339876) > > @@ -1390,13 +1390,15 @@ digest_phdr(const Elf_Phdr *phdr, int phnum, caddr_t e > > if (nsegs == 0) { /* First load segment */ > > obj->vaddrbase = trunc_page(ph->p_vaddr); > > obj->mapbase = obj->vaddrbase + obj->relocbase; > > - obj->textsize = round_page(ph->p_vaddr + ph->p_memsz) - > > - obj->vaddrbase; > > } else { /* Last load segment */ > > obj->mapsize = round_page(ph->p_vaddr + ph->p_memsz) - > > obj->vaddrbase; > > } > > nsegs++; > > + if ((ph->p_flags & PF_X) == PF_X) { > > + obj->textsize = MAX(obj->textsize, > > + round_page(ph->p_vaddr + ph->p_memsz) - obj->vaddrbase); > > + } > > break; > > > > case PT_DYNAMIC: > > > From owner-svn-src-head@freebsd.org Tue Oct 30 15:39:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBA4610EBAC2; Tue, 30 Oct 2018 15:39:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90E0F6B6AB; Tue, 30 Oct 2018 15:39:34 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C4581F510; Tue, 30 Oct 2018 15:39:34 +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 w9UFdYEP018796; Tue, 30 Oct 2018 15:39:34 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UFdYpK018793; Tue, 30 Oct 2018 15:39:34 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201810301539.w9UFdYpK018793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 30 Oct 2018 15:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339919 - head/usr.sbin/nscd X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.sbin/nscd X-SVN-Commit-Revision: 339919 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 15:39:35 -0000 Author: trasz Date: Tue Oct 30 15:39:33 2018 New Revision: 339919 URL: https://svnweb.freebsd.org/changeset/base/339919 Log: Make "nscd -t" work. Reviewed by: des@ MFC after: 2 weeks Sponsored by: Chalmers University of Technology Differential Revision: https://reviews.freebsd.org/D17563 Modified: head/usr.sbin/nscd/debug.c head/usr.sbin/nscd/debug.h Modified: head/usr.sbin/nscd/debug.c ============================================================================== --- head/usr.sbin/nscd/debug.c Tue Oct 30 15:11:34 2018 (r339918) +++ head/usr.sbin/nscd/debug.c Tue Oct 30 15:39:33 2018 (r339919) @@ -131,7 +131,7 @@ nscd_trace_out(const char *s, const char *f, int l) for (i = 0; i < trace_level; ++i) printf("\t"); - printf("<= %s\n", s); + printf("<= %s, %s: %d\n", s, f, l); } } Modified: head/usr.sbin/nscd/debug.h ============================================================================== --- head/usr.sbin/nscd/debug.h Tue Oct 30 15:11:34 2018 (r339918) +++ head/usr.sbin/nscd/debug.h Tue Oct 30 15:39:33 2018 (r339919) @@ -31,8 +31,7 @@ #define TRACE_WANTED 32 -/* #ifndef NDEBUG */ -#if 0 +#ifndef NDEBUG #define TRACE_IN(x) nscd_trace_in(#x, __FILE__, __LINE__) #define TRACE_POINT() nscd_trace_point(__FILE__, __LINE__) #define TRACE_MSG(x) nscd_trace_msg(x, __FILE__, __LINE__) From owner-svn-src-head@freebsd.org Tue Oct 30 15:43:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4F9A10EBD21; Tue, 30 Oct 2018 15:43:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A4596BB44; Tue, 30 Oct 2018 15:43:07 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B7D71F6CD; Tue, 30 Oct 2018 15:43:07 +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 w9UFh72W023744; Tue, 30 Oct 2018 15:43:07 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UFh727023743; Tue, 30 Oct 2018 15:43:07 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201810301543.w9UFh727023743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 30 Oct 2018 15:43:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339920 - head/contrib/tzcode/stdtime X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/contrib/tzcode/stdtime X-SVN-Commit-Revision: 339920 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 15:43:07 -0000 Author: trasz Date: Tue Oct 30 15:43:06 2018 New Revision: 339920 URL: https://svnweb.freebsd.org/changeset/base/339920 Log: Remove useless call to access(2) from tzcode. Quoting OpenBSD: > Remove doaccess variable and access(2) call since this interfers with > applications like zdump(8) because pledge(2) doesn't allow access(2) to > /usr/share/zoneinfo. > > millert@ better described why this call can go away: > > "This looks like an attempt to do access checks based on the real uid instead > of the effective uid. Basically for setuid programs we don't want to allow a > user to set TZ to a path they should not be able to otherwise access. > > However, we already have a check for issetugid() above so I think the doaccess > bits can just be removed and we can rely on open()." > > After discussion with tb@, deraadt@ and millert@, this was also OK'ed by them Reviewed by: imp Obtained from: OpenBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17701 Modified: head/contrib/tzcode/stdtime/localtime.c Modified: head/contrib/tzcode/stdtime/localtime.c ============================================================================== --- head/contrib/tzcode/stdtime/localtime.c Tue Oct 30 15:39:33 2018 (r339919) +++ head/contrib/tzcode/stdtime/localtime.c Tue Oct 30 15:43:06 2018 (r339920) @@ -398,7 +398,6 @@ register const int doextend; if (name == NULL && (name = TZDEFAULT) == NULL) return -1; { - int doaccess; struct stat stab; /* ** Section 4.9.1 of the C standard says that @@ -415,8 +414,7 @@ register const int doextend; if (name[0] == ':') ++name; - doaccess = name[0] == '/'; - if (!doaccess) { + if (name[0] != '/') { if ((p = TZDIR) == NULL) { free(fullname); return -1; @@ -428,16 +426,7 @@ register const int doextend; (void) strcpy(fullname, p); (void) strcat(fullname, "/"); (void) strcat(fullname, name); - /* - ** Set doaccess if '.' (as in "../") shows up in name. - */ - if (strchr(name, '.') != NULL) - doaccess = TRUE; name = fullname; - } - if (doaccess && access(name, R_OK) != 0) { - free(fullname); - return -1; } if ((fid = _open(name, OPEN_MODE)) == -1) { free(fullname); From owner-svn-src-head@freebsd.org Tue Oct 30 15:44:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FC7C10EBDBC; Tue, 30 Oct 2018 15:44:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA3ED6BCB0; Tue, 30 Oct 2018 15:44:16 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C3FF1F6D3; Tue, 30 Oct 2018 15:44:16 +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 w9UFiGXX023855; Tue, 30 Oct 2018 15:44:16 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UFiGHA023854; Tue, 30 Oct 2018 15:44:16 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201810301544.w9UFiGHA023854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 30 Oct 2018 15:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339921 - head/contrib/tzcode/stdtime X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/contrib/tzcode/stdtime X-SVN-Commit-Revision: 339921 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 15:44:17 -0000 Author: trasz Date: Tue Oct 30 15:44:16 2018 New Revision: 339921 URL: https://svnweb.freebsd.org/changeset/base/339921 Log: Remove no longer relevant comment, as suggested by imp@. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/contrib/tzcode/stdtime/localtime.c Modified: head/contrib/tzcode/stdtime/localtime.c ============================================================================== --- head/contrib/tzcode/stdtime/localtime.c Tue Oct 30 15:43:06 2018 (r339920) +++ head/contrib/tzcode/stdtime/localtime.c Tue Oct 30 15:44:16 2018 (r339921) @@ -390,7 +390,6 @@ register const int doextend; res = -1; sp->goback = sp->goahead = FALSE; - /* XXX The following is from OpenBSD, and I'm not sure it is correct */ if (name != NULL && issetugid() != 0) if ((name[0] == ':' && name[1] == '/') || name[0] == '/' || strchr(name, '.')) From owner-svn-src-head@freebsd.org Tue Oct 30 15:46:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A279A10EBED0; Tue, 30 Oct 2018 15:46:31 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D9636BF53; Tue, 30 Oct 2018 15:46:31 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29F531F6D6; Tue, 30 Oct 2018 15:46:31 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9UFkU4v024136; Tue, 30 Oct 2018 15:46:30 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UFkUbh024132; Tue, 30 Oct 2018 15:46:30 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201810301546.w9UFkUbh024132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 30 Oct 2018 15:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339922 - in head: share/man/man5 share/mk sys/conf tools/build/options X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head: share/man/man5 share/mk sys/conf tools/build/options X-SVN-Commit-Revision: 339922 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 15:46:31 -0000 Author: bz Date: Tue Oct 30 15:46:30 2018 New Revision: 339922 URL: https://svnweb.freebsd.org/changeset/base/339922 Log: Introduce an EXPERIMENTAL option for both src.conf(5) and the kernel. In the last decade(s) we have seen both short term or long term projects committed to the tree which were considered or even marked "experimental". While out-of-tree development has become easier than it used to be in CVS times, there still is a need to have the code shipping with HEAD but not enabled by default. While people may think about VIMAGE as one of the recent larger, long term projects, early protocol implementations (before they are standardised) are others. (Free)BSD historically was one of the operating systems which would have running code at early stages and help develop and influence standardisation and the industry. Give developers an opportunity to be more pro-active for early adoption or running large scale code changes stumbling over each others but not the user's feet. I have not added the option to NOTES in order to avoid breaking supported option builds, which require constant compile testing. Discussed with: people in the corridor Added: head/tools/build/options/WITH_EXPERIMENTAL (contents, props changed) Modified: head/share/man/man5/src.conf.5 head/share/mk/src.opts.mk head/sys/conf/options Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue Oct 30 15:44:16 2018 (r339921) +++ head/share/man/man5/src.conf.5 Tue Oct 30 15:46:30 2018 (r339922) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd October 25, 2018 +.Dd October 30, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -659,6 +659,8 @@ An alternate bootstrap tool chain must be provided. .It Va WITHOUT_EXAMPLES Set to avoid installing examples to .Pa /usr/share/examples/ . +.It Va WITH_EXPERIMENTAL +Set to include experimental features in the build. .It Va WITH_EXTRA_TCP_STACKS Set to build extra TCP stack modules. .It Va WITHOUT_FDT Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Tue Oct 30 15:44:16 2018 (r339921) +++ head/share/mk/src.opts.mk Tue Oct 30 15:46:30 2018 (r339922) @@ -197,6 +197,7 @@ __DEFAULT_NO_OPTIONS = \ BSD_GREP \ CLANG_EXTRAS \ DTRACE_TESTS \ + EXPERIMENTAL \ GNU_GREP_COMPAT \ HESIOD \ LIBSOFT \ Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Oct 30 15:44:16 2018 (r339921) +++ head/sys/conf/options Tue Oct 30 15:46:30 2018 (r339922) @@ -95,6 +95,7 @@ _COMPAT_LINUX32 opt_compat.h # XXX: make sure opt_comp COMPILING_LINT opt_global.h CY_PCI_FASTINTR DEADLKRES opt_watchdog.h +EXPERIMENTAL opt_global.h EXT_RESOURCES opt_global.h DIRECTIO FILEMON opt_dontuse.h Added: head/tools/build/options/WITH_EXPERIMENTAL ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_EXPERIMENTAL Tue Oct 30 15:46:30 2018 (r339922) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to include experimental features in the build. From owner-svn-src-head@freebsd.org Tue Oct 30 15:51:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CCED10EC101; Tue, 30 Oct 2018 15:51:13 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it1-x129.google.com (mail-it1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 307376C203; Tue, 30 Oct 2018 15:51:13 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it1-x129.google.com with SMTP id e74-v6so14263621ita.2; Tue, 30 Oct 2018 08:51:13 -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:in-reply-to:user-agent; bh=TTyCi66JHO1YteAEwLiBFFwX3lWJuIwKdIv4J98LG38=; b=nQIKHvp3lRHqFO41RXL+yQlaYhPaPFSnVCKRHgblepj+oOm+DiHDqTWx2hJcxgtqg8 wfwIY+yZTD330wI0KmqOUVa1zU6KNL1cVouO7QyBlYj5MfN2SxJB7Vf6JVu4zxdjdm+h Z0Dx/ikX952yTI8QxidiIWdYzulZY4bCFQig3kuIbyTPFsgV6XJetT+66nT5z90Ci66m X8fYxlHHPHyD4nC+5WUEoo9M9majTsp0SCh90MuWW3IZxe6cDJmCiIUE0PjNzccwefAw ljpIf96gDU1iBwTon4tJ5EPqo/KGuOAahNu2GqsB8K9W7hhB7BCIUi1OgcZhQCS9onNi d1xg== 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:in-reply-to:user-agent; bh=TTyCi66JHO1YteAEwLiBFFwX3lWJuIwKdIv4J98LG38=; b=R4jEWsHLBBLZvbfXsX01r/gUksVO/gFT0JlHcdk66VXGyFVZvp97b+OhFKuxUtxAaG 4aE3Wud+zRoMNJRAQHDIaoeorwYS87GudWYGLng6sbRitVLG6Rz47MLtkeq8khRPKdO2 Qpna24x4hfPwWB+3GWZGFZIG5t4csfKcfLd21zpR+bqVEmsxw0Rr8Ix2T+3lCgUHX1PH vycDErYOOhzlQ9wrwerrxC/bNmEVAHtFZbjagJRYWoq1OnjQtnv+beIrD3ebmDoGnV4C 5RjQUraudEKTb6+6W3O3nHRL004ff9Z7ElcgrJmGdg3uaRszge+rBMYdzDUT0bABuILu f2OQ== X-Gm-Message-State: AGRZ1gIlyGSIwZjQSJ+XejVfc8Ej2FlI0fqzdY+k9/1Kkyc4B+ilqan9 OTAmxzHF+xtQP9vfoNzWxwXvXMkuI4k= X-Google-Smtp-Source: AJdET5dijz3Otl1siu9XTyQmfaRtgnxDltiYc090ZgHee351K34ka7KqlfI00wQG4MQ45zqaexc62A== X-Received: by 2002:a05:660c:190:: with SMTP id v16mr1728944itj.92.1540914672099; Tue, 30 Oct 2018 08:51:12 -0700 (PDT) Received: from raichu (toroon0560w-lp130-08-67-71-176-199.dsl.bell.ca. [67.71.176.199]) by smtp.gmail.com with ESMTPSA id d8sm7061548itk.38.2018.10.30.08.51.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Oct 2018 08:51:11 -0700 (PDT) Sender: Mark Johnston Date: Tue, 30 Oct 2018 11:51:09 -0400 From: Mark Johnston To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339901 - head/sys/conf Message-ID: <20181030155109.GC39423@raichu> References: <201810300023.w9U0NcOb048740@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201810300023.w9U0NcOb048740@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 15:51:13 -0000 On Tue, Oct 30, 2018 at 12:23:38AM +0000, John Baldwin wrote: > Author: jhb > Date: Tue Oct 30 00:23:37 2018 > New Revision: 339901 > URL: https://svnweb.freebsd.org/changeset/base/339901 > > Log: > Permit local kernel modules to be built as part of a kernel build. > > Add support for "local" modules. By default, these modules are > located in LOCALBASE/sys/modules (where LOCALBASE defaults to > /usr/local). Individual modules can be built along with a kernel by > defining LOCAL_MODULES to the list of modules. Each is assumed to be > a subdirectory containing a valid Makefile. If LOCAL_MODULES is not > specified, all of the modules present in LOCALBASE/sys/modules are > built and installed along with the kernel. > > This means that a port that installs a kernel module can choose to > install its source along with a suitable Makefile to > /usr/local/sys/modules/. Future kernel builds will then include > that kernel module using the kernel configuration's opt_*.h headers > and install it into /boot/kernel along with other kernel-specific > modules. > > This is not trying to solve the issue of folks running GENERIC release > kernels, but is instead aimed at folks who build their own kernels. > For those folks this ensures that kernel modules from ports will > always be using the right KBI, etc. This includes folks running any > KBI-breaking kernel configs (such as PAE). > > There are still some kinks to be worked out with cross-building (we > probably shouldn't include local modules in cross-built kernels by > default), but this is a sufficient starting point. > > Reviewed by: imp > MFC after: 3 months > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D16966 > > Modified: > head/sys/conf/kern.post.mk > > Modified: head/sys/conf/kern.post.mk > ============================================================================== > --- head/sys/conf/kern.post.mk Tue Oct 30 00:22:14 2018 (r339900) > +++ head/sys/conf/kern.post.mk Tue Oct 30 00:23:37 2018 (r339901) > @@ -35,24 +35,41 @@ KERN_DEBUGDIR?= ${DEBUGDIR} > > .MAIN: all > > +.if !defined(NO_MODULES) > +# Default prefix used for modules installed from ports > +LOCALBASE?= /usr/local > + > +LOCAL_MODULES_DIR?= ${LOCALBASE}/sys/modules > + > +# Default to installing all modules installed by ports unless overridden > +# by the user. > +.if !defined(LOCAL_MODULES) > +LOCAL_MODULES!= ls ${LOCAL_MODULES_DIR} > +.endif > +.endif During a buildkernel I now get several instances of: ls: /usr/local/sys/modules: No such file or directory make[2]: "/usr/home/markj/src/freebsd-dev/sys/conf/kern.post.mk" line 47: warning: "ls /usr/local/sys/modules" returned non-zero status Perhaps /usr/local/sys/modules should be specified in the BSD.usr.dist mtree file? From owner-svn-src-head@freebsd.org Tue Oct 30 15:55:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57D6D10EC870; Tue, 30 Oct 2018 15:55:11 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2CA86C884; Tue, 30 Oct 2018 15:55:10 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w9UFt8fg062309; Tue, 30 Oct 2018 08:55:08 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w9UFt8eI062308; Tue, 30 Oct 2018 08:55:08 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201810301555.w9UFt8eI062308@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r339901 - head/sys/conf In-Reply-To: <20181030155109.GC39423@raichu> To: Mark Johnston Date: Tue, 30 Oct 2018 08:55:08 -0700 (PDT) CC: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 15:55:11 -0000 > On Tue, Oct 30, 2018 at 12:23:38AM +0000, John Baldwin wrote: > > Author: jhb > > Date: Tue Oct 30 00:23:37 2018 > > New Revision: 339901 > > URL: https://svnweb.freebsd.org/changeset/base/339901 > > > > Log: > > Permit local kernel modules to be built as part of a kernel build. > > > > Add support for "local" modules. By default, these modules are > > located in LOCALBASE/sys/modules (where LOCALBASE defaults to > > /usr/local). Individual modules can be built along with a kernel by > > defining LOCAL_MODULES to the list of modules. Each is assumed to be > > a subdirectory containing a valid Makefile. If LOCAL_MODULES is not > > specified, all of the modules present in LOCALBASE/sys/modules are > > built and installed along with the kernel. > > > > This means that a port that installs a kernel module can choose to > > install its source along with a suitable Makefile to > > /usr/local/sys/modules/. Future kernel builds will then include > > that kernel module using the kernel configuration's opt_*.h headers > > and install it into /boot/kernel along with other kernel-specific > > modules. > > > > This is not trying to solve the issue of folks running GENERIC release > > kernels, but is instead aimed at folks who build their own kernels. > > For those folks this ensures that kernel modules from ports will > > always be using the right KBI, etc. This includes folks running any > > KBI-breaking kernel configs (such as PAE). > > > > There are still some kinks to be worked out with cross-building (we > > probably shouldn't include local modules in cross-built kernels by > > default), but this is a sufficient starting point. > > > > Reviewed by: imp > > MFC after: 3 months > > Relnotes: yes > > Differential Revision: https://reviews.freebsd.org/D16966 > > > > Modified: > > head/sys/conf/kern.post.mk > > > > Modified: head/sys/conf/kern.post.mk > > ============================================================================== > > --- head/sys/conf/kern.post.mk Tue Oct 30 00:22:14 2018 (r339900) > > +++ head/sys/conf/kern.post.mk Tue Oct 30 00:23:37 2018 (r339901) > > @@ -35,24 +35,41 @@ KERN_DEBUGDIR?= ${DEBUGDIR} > > > > .MAIN: all > > > > +.if !defined(NO_MODULES) > > +# Default prefix used for modules installed from ports > > +LOCALBASE?= /usr/local > > + .if exists (${LOCALBASE}/sys/modules) > > +LOCAL_MODULES_DIR?= ${LOCALBASE}/sys/modules .endif > > + > > +# Default to installing all modules installed by ports unless overridden > > +# by the user. > > +.if !defined(LOCAL_MODULES) > > +LOCAL_MODULES!= ls ${LOCAL_MODULES_DIR} > > +.endif > > +.endif > > During a buildkernel I now get several instances of: > > ls: /usr/local/sys/modules: No such file or directory > make[2]: "/usr/home/markj/src/freebsd-dev/sys/conf/kern.post.mk" line 47: warning: "ls /usr/local/sys/modules" returned non-zero status > > Perhaps /usr/local/sys/modules should be specified in the BSD.usr.dist > mtree file? > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Oct 30 16:03:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9DBF10ECB33; Tue, 30 Oct 2018 16:03:39 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47E0E6D0BC; Tue, 30 Oct 2018 16:03:39 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f174.google.com with SMTP id f3-v6so11900040ljk.9; Tue, 30 Oct 2018 09:03:39 -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:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=whZ02xIAzOEjRsUncuG77XWEWjoj1azS9mHWzU2IdIY=; b=pRcw18fARfRzqiUz/AYD3OWTfS5iZ9UGgMYczrBKZSnF3zSe7jSXY3mMNt2+8681HE UDQQ69iRuVoAd9uMNycWQEw0otZIw30bwLp9d9nVEjLp6BE1mdi5LA9HpaCWdXimOvHF DWsRIRT47MgqfpFj0MaMI11A+SRAAbu04H3yEsP9iXYVs5DCF5GpNotXtAzJX07oZ+7A F5QfRv4p6X3FBFCfLQmgwCWz9y60dl8AOm+6BER/JRAKupPmroiHR7plNWQFqLzSyARg ij0N7A5t/LzJ8UfEdUeG1DiYASGLDEPi4z3hyecB/8cl+urLFFbmrMxOH73aBMZ/Exqn f7Mw== X-Gm-Message-State: AGRZ1gJ0ZasX1DlGsq/AAOYc+jdYw+RLWfoEAAajdS+Ac2rdXG/p7hv3 pjVkU70dmJM+ihvexJLFFgF7EylU X-Google-Smtp-Source: AJdET5dd+mzXW6VOSJI23dTtnbvpNl3YjK2nH1wNT5NJJaldpZYwXMdbB98+nm+oNFQuUhy/DW8LlA== X-Received: by 2002:a2e:9a14:: with SMTP id o20-v6mr12691549lji.17.1540915411221; Tue, 30 Oct 2018 09:03:31 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id t15-v6sm3588203lji.75.2018.10.30.09.03.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Oct 2018 09:03:30 -0700 (PDT) Subject: Re: svn commit: r339917 - head/sys/kern To: Eric van Gyzen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810301454.w9UEsGeB097999@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <81c706c9-9bea-0044-4e8c-406ca6ab5f1d@FreeBSD.org> Date: Tue, 30 Oct 2018 18:03:29 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201810301454.w9UEsGeB097999@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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 16:03:40 -0000 On 30/10/2018 16:54, Eric van Gyzen wrote: > Author: vangyzen > Date: Tue Oct 30 14:54:15 2018 > New Revision: 339917 > URL: https://svnweb.freebsd.org/changeset/base/339917 > > Log: > Always stop the scheduler when entering kdb > > Set curthread->td_stopsched when entering kdb via any vector. > Previously, it was only set when entering via panic, so when > entering kdb another way, mutexes and such were still "live", > and an attempt to lock an already locked mutex would panic. > > Reviewed by: kib, cem > Discussed with: jhb > Tested by: pho > MFC after: 2 months > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D17687 My recollection from way back then is that the previous behavior was on purpose. The idea was that the kdb code and code hat services it should be written specifically to avoid taking locks used by general code. I am not sure if that approach had any practical benefits, just sharing the memory. -- Andriy Gapon From owner-svn-src-head@freebsd.org Tue Oct 30 16:23:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0711510ED21F; Tue, 30 Oct 2018 16:23:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F94F6E312; Tue, 30 Oct 2018 16:23:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id E4E9510AFCD; Tue, 30 Oct 2018 12:23:08 -0400 (EDT) Subject: Re: svn commit: r339901 - head/sys/conf To: rgrimes@freebsd.org, Mark Johnston References: <201810301555.w9UFt8eI062308@pdx.rh.CN85.dnsmgr.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: <52b0bc50-c142-ddc1-cdb7-70e5b1b0d29d@FreeBSD.org> Date: Tue, 30 Oct 2018 09:23:08 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201810301555.w9UFt8eI062308@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 30 Oct 2018 12:23:09 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 16:23:11 -0000 On 10/30/18 8:55 AM, Rodney W. Grimes wrote: >> On Tue, Oct 30, 2018 at 12:23:38AM +0000, John Baldwin wrote: >>> Author: jhb >>> Date: Tue Oct 30 00:23:37 2018 >>> New Revision: 339901 >>> URL: https://svnweb.freebsd.org/changeset/base/339901 >>> >>> Log: >>> Permit local kernel modules to be built as part of a kernel build. >>> >>> Add support for "local" modules. By default, these modules are >>> located in LOCALBASE/sys/modules (where LOCALBASE defaults to >>> /usr/local). Individual modules can be built along with a kernel by >>> defining LOCAL_MODULES to the list of modules. Each is assumed to be >>> a subdirectory containing a valid Makefile. If LOCAL_MODULES is not >>> specified, all of the modules present in LOCALBASE/sys/modules are >>> built and installed along with the kernel. >>> >>> This means that a port that installs a kernel module can choose to >>> install its source along with a suitable Makefile to >>> /usr/local/sys/modules/. Future kernel builds will then include >>> that kernel module using the kernel configuration's opt_*.h headers >>> and install it into /boot/kernel along with other kernel-specific >>> modules. >>> >>> This is not trying to solve the issue of folks running GENERIC release >>> kernels, but is instead aimed at folks who build their own kernels. >>> For those folks this ensures that kernel modules from ports will >>> always be using the right KBI, etc. This includes folks running any >>> KBI-breaking kernel configs (such as PAE). >>> >>> There are still some kinks to be worked out with cross-building (we >>> probably shouldn't include local modules in cross-built kernels by >>> default), but this is a sufficient starting point. >>> >>> Reviewed by: imp >>> MFC after: 3 months >>> Relnotes: yes >>> Differential Revision: https://reviews.freebsd.org/D16966 >>> >>> Modified: >>> head/sys/conf/kern.post.mk >>> >>> Modified: head/sys/conf/kern.post.mk >>> ============================================================================== >>> --- head/sys/conf/kern.post.mk Tue Oct 30 00:22:14 2018 (r339900) >>> +++ head/sys/conf/kern.post.mk Tue Oct 30 00:23:37 2018 (r339901) >>> @@ -35,24 +35,41 @@ KERN_DEBUGDIR?= ${DEBUGDIR} >>> >>> .MAIN: all >>> >>> +.if !defined(NO_MODULES) >>> +# Default prefix used for modules installed from ports >>> +LOCALBASE?= /usr/local >>> + > > .if exists (${LOCALBASE}/sys/modules) >>> +LOCAL_MODULES_DIR?= ${LOCALBASE}/sys/modules > .endif > >>> + >>> +# Default to installing all modules installed by ports unless overridden >>> +# by the user. >>> +.if !defined(LOCAL_MODULES) >>> +LOCAL_MODULES!= ls ${LOCAL_MODULES_DIR} >>> +.endif >>> +.endif >> >> During a buildkernel I now get several instances of: >> >> ls: /usr/local/sys/modules: No such file or directory >> make[2]: "/usr/home/markj/src/freebsd-dev/sys/conf/kern.post.mk" line 47: warning: "ls /usr/local/sys/modules" returned non-zero status >> >> Perhaps /usr/local/sys/modules should be specified in the BSD.usr.dist >> mtree file? I think I prefer Rod's fix. I'll apply it in a bit. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Oct 30 16:32:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6505D10ED594; Tue, 30 Oct 2018 16:32:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 140A76E9F9; Tue, 30 Oct 2018 16:32:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E97101FEF8; Tue, 30 Oct 2018 16:32:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9UGWqIa050617; Tue, 30 Oct 2018 16:32:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UGWqfV050616; Tue, 30 Oct 2018 16:32:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810301632.w9UGWqfV050616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 30 Oct 2018 16:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339923 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 339923 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 16:32:53 -0000 Author: hselasky Date: Tue Oct 30 16:32:52 2018 New Revision: 339923 URL: https://svnweb.freebsd.org/changeset/base/339923 Log: Implement __KERNEL_DIV_ROUND_UP() function macro in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Tue Oct 30 15:46:30 2018 (r339922) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Tue Oct 30 16:32:52 2018 (r339923) @@ -131,6 +131,7 @@ #undef PTR_ALIGN #define PTR_ALIGN(p, a) ((__typeof(p))ALIGN((uintptr_t)(p), (a))) #define DIV_ROUND_UP(x, n) howmany(x, n) +#define __KERNEL_DIV_ROUND_UP(x, n) howmany(x, n) #define DIV_ROUND_UP_ULL(x, n) DIV_ROUND_UP((unsigned long long)(x), (n)) #define FIELD_SIZEOF(t, f) sizeof(((t *)0)->f) From owner-svn-src-head@freebsd.org Tue Oct 30 16:40:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46A8810ED7AA; Tue, 30 Oct 2018 16:40:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB6CD6ED42; Tue, 30 Oct 2018 16:40:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 781F710AFD2; Tue, 30 Oct 2018 12:40:31 -0400 (EDT) Subject: Re: svn commit: r339901 - head/sys/conf From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810300023.w9U0NcOb048740@repo.freebsd.org> Message-ID: <0ed999f2-75d8-aabf-0e95-7c130b6b4777@FreeBSD.org> Date: Tue, 30 Oct 2018 09:40:30 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201810300023.w9U0NcOb048740@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 30 Oct 2018 12:40:32 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 16:40:33 -0000 On 10/29/18 5:23 PM, John Baldwin wrote: > Author: jhb > Date: Tue Oct 30 00:23:37 2018 > New Revision: 339901 > URL: https://svnweb.freebsd.org/changeset/base/339901 > > Log: > Permit local kernel modules to be built as part of a kernel build. > > Add support for "local" modules. By default, these modules are > located in LOCALBASE/sys/modules (where LOCALBASE defaults to > /usr/local). Individual modules can be built along with a kernel by > defining LOCAL_MODULES to the list of modules. Each is assumed to be > a subdirectory containing a valid Makefile. If LOCAL_MODULES is not > specified, all of the modules present in LOCALBASE/sys/modules are > built and installed along with the kernel. > > This means that a port that installs a kernel module can choose to > install its source along with a suitable Makefile to > /usr/local/sys/modules/. Future kernel builds will then include > that kernel module using the kernel configuration's opt_*.h headers > and install it into /boot/kernel along with other kernel-specific > modules. > > This is not trying to solve the issue of folks running GENERIC release > kernels, but is instead aimed at folks who build their own kernels. > For those folks this ensures that kernel modules from ports will > always be using the right KBI, etc. This includes folks running any > KBI-breaking kernel configs (such as PAE). > > There are still some kinks to be worked out with cross-building (we > probably shouldn't include local modules in cross-built kernels by > default), but this is a sufficient starting point. The intention is that if, say, the drm-kmod ports install a valid module Makefile to /usr/local/sys/modules/drm/Makefile, then subsequent kernel builds will automatically pull in that module. Also, since "local" modules are built after in-tree modules, if a ports module has the same filename (foo.ko), it will be installed over top of the in-tree one in /boot/kernel effectively replacing it. Note that as with subdirectories in sys/modules, a Makefile could just be a bsd.subdir.mk that installs multiple modules. I do think that as a further step we might consider having certain ports stop installing binary kernel modules altogether and only ship source (especially ports with strong KBI ties to the kernel such as virtualbox or drm). Probably these ports would then use a post-install step to compile against whatever source tree is present on the host and install the module to /boot/modules. Anyone compiling custom kernels wouldn't use that module though after the next kernel recompile as the next kernel would include a kernel-specific version in /boot/kernel that would take precedence over the version in /boot/modules. However, that version in /boot/modules would still be needed for folks running release kernels that never compile a kernel. Further thought is probably required for the "stock kernel" case to make sure we are really happy with that approach. Cross-building kernels is also a further consideration. The current patch always opts-in to building local modules unless you explicitly out out by setting LOCAL_MODULES to an empty string or LOCALBASE to something that doesn't exist. This means that if you have a port/package installed that ships kernel module sources and do a 'make tinderbox', we will try to build that module on all architectures that build modules. This is probably not what we want. I did want this feature to default to enabled for native kernels so that installing a port will Just Work(tm) without requiring kernel config changes to enable modules and I'd like to keep that. Some thoughts I'm considering for cross-builds are: 1) Change the buildkernel and installkernel targets in Makefile.inc1 to explicitly pass LOCALBASE=/nonexistent as a parameter to make if TARGET_ARCH != MACHINE_ARCH or TARGET != MACHINE. A user could explicitly request local modules for a kernel build by setting LOCALBASE explicitly when invoking buildkernel/installkernel. (You could also point LOCALBASE to a sysroot to honor ports installed in a sysroot. For example, I mount my SD card for my RPi on my laptop and cross-build my kernel+world and then install onto the SD card via DESTDIR, so I could use LOCALBASE=/mnt/usr/local with buildkernel/installkernel to honor ports installed for my RPi during my cross-builds.) 2) Have make tinderbox explicitly set LOCALBASE so that even native kernels on a host don't try to build kernel modules from ports. If we didn't do this by default users could always explicitly set LOCALBASE to disable them. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Oct 30 16:42:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 383B010ED97F; Tue, 30 Oct 2018 16:42:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC8776F116; Tue, 30 Oct 2018 16:42:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCD252008F; Tue, 30 Oct 2018 16:42:57 +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 w9UGgvRc056074; Tue, 30 Oct 2018 16:42:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UGgvAV056072; Tue, 30 Oct 2018 16:42:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810301642.w9UGgvAV056072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 30 Oct 2018 16:42:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339924 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src modules/linuxkpi X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src modules/linuxkpi X-SVN-Commit-Revision: 339924 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 16:42:58 -0000 Author: hselasky Date: Tue Oct 30 16:42:56 2018 New Revision: 339924 URL: https://svnweb.freebsd.org/changeset/base/339924 Log: Implement the dump_stack() function in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h head/sys/compat/linuxkpi/common/src/linux_compat.c head/sys/modules/linuxkpi/Makefile Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Tue Oct 30 16:32:52 2018 (r339923) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Tue Oct 30 16:42:56 2018 (r339924) @@ -138,6 +138,9 @@ #define printk(...) printf(__VA_ARGS__) #define vprintk(f, a) vprintf(f, a) +extern void linux_dump_stack(void); +#define dump_stack() linux_dump_stack() + struct va_format { const char *fmt; va_list *va; Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Tue Oct 30 16:32:52 2018 (r339923) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Tue Oct 30 16:42:56 2018 (r339924) @@ -30,6 +30,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_stack.h" + #include #include #include @@ -46,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -2205,6 +2208,18 @@ __unregister_chrdev(unsigned int major, unsigned int b if (cdevp != NULL) cdev_del(cdevp); } +} + +void +linux_dump_stack(void) +{ +#ifdef STACK + struct stack st; + + stack_zero(&st); + stack_save(&st); + stack_print(&st); +#endif } #if defined(__i386__) || defined(__amd64__) Modified: head/sys/modules/linuxkpi/Makefile ============================================================================== --- head/sys/modules/linuxkpi/Makefile Tue Oct 30 16:32:52 2018 (r339923) +++ head/sys/modules/linuxkpi/Makefile Tue Oct 30 16:42:56 2018 (r339924) @@ -24,7 +24,8 @@ SRCS+= bus_if.h \ pci_if.h \ vnode_if.h \ usb_if.h \ - opt_usb.h + opt_usb.h \ + opt_stack.h CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi/common/include CFLAGS+= -I${SRCTOP}/sys/contrib/ck/include From owner-svn-src-head@freebsd.org Tue Oct 30 17:31:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D088C10EF3F7 for ; Tue, 30 Oct 2018 17:31:46 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2r.ore.mailhop.org (outbound2r.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3D370F1B for ; Tue, 30 Oct 2018 17:31:46 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1540920699; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=QdVl1J1Hec8pmm4tyHs+3yIkSDFyG63aOOJUNbTstgECwnOcDZzeu1Tzood2Sqa3bPA4x+JqwkHiZ JwCYyDriX2lwaM8PFn75Rf6T2pYE9bizVdub/dUBo0hQogI+xHySwhtNllOmOMTrzOSRytsyVQn4Py 0V+axlrLEoDs15GGId59VD/8OCB/fvjg4Ja43BJuiM9De+CkOKB7XV02E20NWcQTbvSljIochu90km PNCpvj5THFvP+OA9ixPrtXtp85bMnf0hL47Hyn8xjA0GE1yTXb3COrPLMbCh50ieukU48fnI6cpBWq JfBKdSRKFIfIxWg3FEGNuLjqv5ZwKEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=uwhVL21vKrvUJAUZAdPiLqpMYnPB9VpJXZGz/KJnGyY=; b=CQkfawKlCV9ETltXXyMeu+rbde1gvmeS3J3LiLEPcWDqFJwvNIOgP4kKw5CChYC16dPBuN8Ot3//V 7J07Cdt6lXnWp6x3YmCdg4hhFJ55r6SmQFNLh2eTmhkFcuVZ9/R1PWGeUA9/waOyuP6uJTZunGMXmG eJMX9lGCs6qGjACc9pPbg2TYX4OGnJMEM2tUeL4sL49ct9+PhFYgb4Jg2/zdNjhGBuEGfytn1fgn1b zsWGvKop9F8XJ+hBb1LVuqexjYhH6mI4gfZp6z0nhMmkn9kWAS8Iou+wsvPVyRtM1Yiuuf1y2w+vfP doF84yyhLu8R2qlSVO902N8IeKd0njg== ARC-Authentication-Results: i=1; outbound2.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=uwhVL21vKrvUJAUZAdPiLqpMYnPB9VpJXZGz/KJnGyY=; b=pdMFuYLk9eV2g6NCFnkpEiZKSjZKZrCP8S8onNoa7l21NQbpWHfkYi5uCVWdmuYqEYo+D8echoyj6 ghMLhvZN1CSjExL1BrNpXVxNc2fyIot5mT/YYgSh4YyCEJ12tjBmYvMP5Ir8PBYTJ34ZhSPGYllV6d JnWgMF3tualaRYTLi9BYDzNY4bH3AGUBzxbhZNvisgVRHXUir5DTgojVjsPyAG5WTmN5KFX6rha5DV yG67KMaSCk9B6p3ttnubDIbkRshS1Y8RWnCaDlwwy8csUjCC5hsXjnepv69pzXIWS3MSiETCvEbHys 1nqzvlwU3f26aT5bvidiIg6NG+GZNng== X-MHO-RoutePath: aGlwcGll X-MHO-User: a751cee6-dc69-11e8-a630-335f030b21f2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id a751cee6-dc69-11e8-a630-335f030b21f2; Tue, 30 Oct 2018 17:31:37 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w9UHVaCB065148; Tue, 30 Oct 2018 11:31:36 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1540920696.22340.158.camel@freebsd.org> Subject: Re: svn commit: r339901 - head/sys/conf From: Ian Lepore To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 30 Oct 2018 11:31:36 -0600 In-Reply-To: <0ed999f2-75d8-aabf-0e95-7c130b6b4777@FreeBSD.org> References: <201810300023.w9U0NcOb048740@repo.freebsd.org> <0ed999f2-75d8-aabf-0e95-7c130b6b4777@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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 17:31:47 -0000 On Tue, 2018-10-30 at 09:40 -0700, John Baldwin wrote: > On 10/29/18 5:23 PM, John Baldwin wrote: > > > > Author: jhb > > Date: Tue Oct 30 00:23:37 2018 > > New Revision: 339901 > > URL: https://svnweb.freebsd.org/changeset/base/339901 > > > > Log: > >   Permit local kernel modules to be built as part of a kernel build. > >    > >   Add support for "local" modules.  By default, these modules are > >   located in LOCALBASE/sys/modules (where LOCALBASE defaults to > >   /usr/local).  Individual modules can be built along with a kernel by > >   defining LOCAL_MODULES to the list of modules.  Each is assumed to be > >   a subdirectory containing a valid Makefile.  If LOCAL_MODULES is not > >   specified, all of the modules present in LOCALBASE/sys/modules are > >   built and installed along with the kernel. > >    > >   This means that a port that installs a kernel module can choose to > >   install its source along with a suitable Makefile to > >   /usr/local/sys/modules/.  Future kernel builds will then include > >   that kernel module using the kernel configuration's opt_*.h headers > >   and install it into /boot/kernel along with other kernel-specific > >   modules. > >    > >   This is not trying to solve the issue of folks running GENERIC release > >   kernels, but is instead aimed at folks who build their own kernels. > >   For those folks this ensures that kernel modules from ports will > >   always be using the right KBI, etc.  This includes folks running any > >   KBI-breaking kernel configs (such as PAE). > >    > >   There are still some kinks to be worked out with cross-building (we > >   probably shouldn't include local modules in cross-built kernels by > >   default), but this is a sufficient starting point. > The intention is that if, say, the drm-kmod ports install a valid module > Makefile to /usr/local/sys/modules/drm/Makefile, then subsequent kernel > builds will automatically pull in that module.  Also, since "local" > modules are built after in-tree modules, if a ports module has the same > filename (foo.ko), it will be installed over top of the in-tree one > in /boot/kernel effectively replacing it.  Note that as with subdirectories > in sys/modules, a Makefile could just be a bsd.subdir.mk that installs > multiple modules. > > I do think that as a further step we might consider having certain ports > stop installing binary kernel modules altogether and only ship source > (especially ports with strong KBI ties to the kernel such as virtualbox > or drm).  Probably these ports would then use a post-install step to > compile against whatever source tree is present on the host and install > the module to /boot/modules.  Anyone compiling custom kernels wouldn't > use that module though after the next kernel recompile as the next kernel > would include a kernel-specific version in /boot/kernel that would take > precedence over the version in /boot/modules.  However, that version in > /boot/modules would still be needed for folks running release kernels that > never compile a kernel.  Further thought is probably required for the > "stock kernel" case to make sure we are really happy with that approach. > > Cross-building kernels is also a further consideration.  The current > patch always opts-in to building local modules unless you explicitly > out out by setting LOCAL_MODULES to an empty string or LOCALBASE to > something that doesn't exist.  This means that if you have a port/package > installed that ships kernel module sources and do a 'make tinderbox', > we will try to build that module on all architectures that build modules. > This is probably not what we want.  I did want this feature to default > to enabled for native kernels so that installing a port will Just Work(tm) > without requiring kernel config changes to enable modules and I'd like > to keep that.  Some thoughts I'm considering for cross-builds are: > > 1) Change the buildkernel and installkernel targets in Makefile.inc1 >    to explicitly pass LOCALBASE=/nonexistent as a parameter to make >    if TARGET_ARCH != MACHINE_ARCH or TARGET != MACHINE.  A user could >    explicitly request local modules for a kernel build by setting >    LOCALBASE explicitly when invoking buildkernel/installkernel. > Or something like .if ${TARGET_ARCH} != ${MACHINE_ARCH} LOCALBASE?= /usr/local/${TARGET_ARCH} .endif Then it's analogous under /usr/local to the /usr/src/${TARGET_ARCH} hierarchy that's used for cross-building base. This is how Warner set up the ports crossbuild mechanisms years ago that we still use at $work. -- Ian From owner-svn-src-head@freebsd.org Tue Oct 30 17:57:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B572F10EFAA5; Tue, 30 Oct 2018 17:57:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F32571C09; Tue, 30 Oct 2018 17:57:42 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F88420C7D; Tue, 30 Oct 2018 17:57:42 +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 w9UHvgwE091852; Tue, 30 Oct 2018 17:57:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UHvfZ2091847; Tue, 30 Oct 2018 17:57:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810301757.w9UHvfZ2091847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 30 Oct 2018 17:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339925 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 339925 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 17:57:43 -0000 Author: markj Date: Tue Oct 30 17:57:40 2018 New Revision: 339925 URL: https://svnweb.freebsd.org/changeset/base/339925 Log: Fix some problems that manifest when NUMA domain 0 is empty. - In uma_prealloc(), we need to check for an empty domain before the first allocation attempt, not after. Fix this by switching uma_prealloc() to use a vm_domainset iterator, which addresses the secondary issue of using a signed domain identifier in round-robin iteration. - Don't automatically create a page daemon for domain 0. - In domainset_empty_vm(), recompute ds_cnt and ds_order after excluding empty domains; otherwise we may frequently specify an empty domain when calling in to the page allocator, wasting CPU time. Convert DOMAINSET_PREF() policies for empty domains to round-robin. - When freeing bootstrap pages, don't count them towards the per-domain total page counts for now: some vm_phys segments are created before the SRAT is parsed and are thus always identified as being in domain 0 even when they are not. Then, when bootstrap pages are freed, they are added to a domain that we had previously thought was empty. Until this is corrected, we simply exclude them from the per-domain page count. Reported and tested by: Rajesh Kumar Reviewed by: gallatin MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17704 Modified: head/sys/kern/kern_cpuset.c head/sys/vm/uma_core.c head/sys/vm/vm_init.c head/sys/vm/vm_kern.c head/sys/vm/vm_page.c head/sys/vm/vm_pageout.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Tue Oct 30 16:42:56 2018 (r339924) +++ head/sys/kern/kern_cpuset.c Tue Oct 30 17:57:40 2018 (r339925) @@ -492,20 +492,29 @@ _domainset_create(struct domainset *domain, struct dom } /* - * Are any of the domains in the mask empty? If so, silently - * remove them. If only empty domains are present, we must - * return failure. + * Are any of the domains in the mask empty? If so, silently + * remove them and update the domainset accordingly. If only empty + * domains are present, we must return failure. */ static bool domainset_empty_vm(struct domainset *domain) { - int i, max; + int i, j, max; max = DOMAINSET_FLS(&domain->ds_mask) + 1; - for (i = 0; i < max; i++) { - if (DOMAINSET_ISSET(i, &domain->ds_mask) && - VM_DOMAIN_EMPTY(i)) + for (i = 0; i < max; i++) + if (DOMAINSET_ISSET(i, &domain->ds_mask) && VM_DOMAIN_EMPTY(i)) DOMAINSET_CLR(i, &domain->ds_mask); + domain->ds_cnt = DOMAINSET_COUNT(&domain->ds_mask); + max = DOMAINSET_FLS(&domain->ds_mask) + 1; + for (i = j = 0; i < max; i++) { + if (DOMAINSET_ISSET(i, &domain->ds_mask)) + domain->ds_order[j++] = i; + else if (domain->ds_policy == DOMAINSET_POLICY_PREFER && + domain->ds_prefer == i && domain->ds_cnt > 1) { + domain->ds_policy = DOMAINSET_POLICY_ROUNDROBIN; + domain->ds_prefer = -1; + } } return (DOMAINSET_EMPTY(&domain->ds_mask)); @@ -1378,7 +1387,7 @@ cpuset_setithread(lwpid_t id, int cpu) /* * Initialize static domainsets after NUMA information is available. This is - * called very early during boot. + * called before memory allocators are initialized. */ void domainset_init(void) @@ -1407,7 +1416,7 @@ domainset_init(void) void domainset_zero(void) { - struct domainset *dset; + struct domainset *dset, *tmp; mtx_init(&cpuset_lock, "cpuset", NULL, MTX_SPIN | MTX_RECURSE); @@ -1422,8 +1431,9 @@ domainset_zero(void) kernel_object->domain.dr_policy = _domainset_create(&domainset2, NULL); /* Remove empty domains from the global policies. */ - LIST_FOREACH(dset, &cpuset_domains, ds_link) - (void)domainset_empty_vm(dset); + LIST_FOREACH_SAFE(dset, &cpuset_domains, ds_link, tmp) + if (domainset_empty_vm(dset)) + LIST_REMOVE(dset, ds_link); } /* Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Oct 30 16:42:56 2018 (r339924) +++ head/sys/vm/uma_core.c Tue Oct 30 17:57:40 2018 (r339925) @@ -3608,29 +3608,30 @@ uma_zone_reserve_kva(uma_zone_t zone, int count) void uma_prealloc(uma_zone_t zone, int items) { + struct vm_domainset_iter di; uma_domain_t dom; uma_slab_t slab; uma_keg_t keg; - int domain, slabs; + int domain, flags, slabs; keg = zone_first_keg(zone); if (keg == NULL) return; KEG_LOCK(keg); slabs = items / keg->uk_ipers; - domain = 0; if (slabs * keg->uk_ipers < items) slabs++; + flags = M_WAITOK; + vm_domainset_iter_policy_ref_init(&di, &keg->uk_dr, &domain, &flags); while (slabs-- > 0) { - slab = keg_alloc_slab(keg, zone, domain, M_WAITOK); + slab = keg_alloc_slab(keg, zone, domain, flags); if (slab == NULL) return; MPASS(slab->us_keg == keg); dom = &keg->uk_domain[slab->us_domain]; LIST_INSERT_HEAD(&dom->ud_free_slab, slab, us_link); - do { - domain = (domain + 1) % vm_ndomains; - } while (VM_DOMAIN_EMPTY(domain)); + if (vm_domainset_iter_policy(&di, &domain) != 0) + break; } KEG_UNLOCK(keg); } Modified: head/sys/vm/vm_init.c ============================================================================== --- head/sys/vm/vm_init.c Tue Oct 30 16:42:56 2018 (r339924) +++ head/sys/vm/vm_init.c Tue Oct 30 17:57:40 2018 (r339925) @@ -123,11 +123,17 @@ vm_mem_init(void *dummy) domainset_init(); /* - * Initializes resident memory structures. From here on, all physical + * Initialize resident memory structures. From here on, all physical * memory is accounted for, and we use only virtual addresses. */ vm_set_page_size(); virtual_avail = vm_page_startup(virtual_avail); + + /* + * Set an initial domain policy for thread0 so that allocations + * can work. + */ + domainset_zero(); #ifdef UMA_MD_SMALL_ALLOC /* Announce page availability to UMA. */ Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Tue Oct 30 16:42:56 2018 (r339924) +++ head/sys/vm/vm_kern.c Tue Oct 30 17:57:40 2018 (r339925) @@ -800,7 +800,6 @@ kmem_bootstrap_free(vm_offset_t start, vm_size_t size) vmd = vm_pagequeue_domain(m); vm_domain_free_lock(vmd); vm_phys_free_pages(m, 0); - vmd->vmd_page_count++; vm_domain_free_unlock(vmd); vm_domain_freecnt_inc(vmd, 1); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Oct 30 16:42:56 2018 (r339924) +++ head/sys/vm/vm_page.c Tue Oct 30 17:57:40 2018 (r339925) @@ -855,11 +855,6 @@ vm_page_startup(vm_offset_t vaddr) */ vm_reserv_init(); #endif - /* - * Set an initial domain policy for thread0 so that allocations - * can work. - */ - domainset_zero(); return (vaddr); } Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Tue Oct 30 16:42:56 2018 (r339924) +++ head/sys/vm/vm_pageout.c Tue Oct 30 17:57:40 2018 (r339925) @@ -2072,41 +2072,41 @@ vm_pageout_init(void) static void vm_pageout(void) { - int error; - int i; + struct proc *p; + struct thread *td; + int error, first, i; + p = curproc; + td = curthread; + swap_pager_swap_init(); - snprintf(curthread->td_name, sizeof(curthread->td_name), "dom0"); - error = kthread_add(vm_pageout_laundry_worker, NULL, curproc, NULL, - 0, 0, "laundry: dom0"); - if (error != 0) - panic("starting laundry for domain 0, error %d", error); - for (i = 1; i < vm_ndomains; i++) { + for (first = -1, i = 0; i < vm_ndomains; i++) { if (VM_DOMAIN_EMPTY(i)) { if (bootverbose) printf("domain %d empty; skipping pageout\n", i); continue; } - - error = kthread_add(vm_pageout_worker, (void *)(uintptr_t)i, - curproc, NULL, 0, 0, "dom%d", i); - if (error != 0) { - panic("starting pageout for domain %d, error %d\n", - i, error); + if (first == -1) + first = i; + else { + error = kthread_add(vm_pageout_worker, + (void *)(uintptr_t)i, p, NULL, 0, 0, "dom%d", i); + if (error != 0) + panic("starting pageout for domain %d: %d\n", + i, error); } error = kthread_add(vm_pageout_laundry_worker, - (void *)(uintptr_t)i, curproc, NULL, 0, 0, - "laundry: dom%d", i); + (void *)(uintptr_t)i, p, NULL, 0, 0, "laundry: dom%d", i); if (error != 0) - panic("starting laundry for domain %d, error %d", - i, error); + panic("starting laundry for domain %d: %d", i, error); } - error = kthread_add(uma_reclaim_worker, NULL, curproc, NULL, - 0, 0, "uma"); + error = kthread_add(uma_reclaim_worker, NULL, p, NULL, 0, 0, "uma"); if (error != 0) panic("starting uma_reclaim helper, error %d\n", error); - vm_pageout_worker((void *)(uintptr_t)0); + + snprintf(td->td_name, sizeof(td->td_name), "dom%d", first); + vm_pageout_worker((void *)(uintptr_t)first); } /* From owner-svn-src-head@freebsd.org Tue Oct 30 18:04:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5847E10EFD1B; Tue, 30 Oct 2018 18:04:04 +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 B3789720DB; Tue, 30 Oct 2018 18:04:03 +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 w9UI3qUH046034 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 30 Oct 2018 20:03:55 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w9UI3qUH046034 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w9UI3qNm046033; Tue, 30 Oct 2018 20:03:52 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 30 Oct 2018 20:03:52 +0200 From: Konstantin Belousov To: Alexander Richardson Cc: Michael.Tuexen@macmic.franken.de, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339876 - head/libexec/rtld-elf Message-ID: <20181030180352.GO5335@kib.kiev.ua> References: <201810292108.w9TL83bO041913@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 18:04:04 -0000 On Tue, Oct 30, 2018 at 03:32:40PM +0000, Alexander Richardson wrote: > On Tue, 30 Oct 2018 at 10:17, Michael Tuexen > wrote: > > > > > On 29. Oct 2018, at 22:08, Alex Richardson wrote: > > > > > > Author: arichardson > > > Date: Mon Oct 29 21:08:02 2018 > > > New Revision: 339876 > > > URL: https://svnweb.freebsd.org/changeset/base/339876 > > > > > > Log: > > > rtld: set obj->textsize correctly > > > > > > With lld-generated binaries the first PT_LOAD will usually be a read-only > > > segment unless you pass --no-rosegment. For those binaries the textsize is > > > determined by the next PT_LOAD. To allow both LLD and bfd 2.17 binaries to > > > be parsed correctly use the end of the last PT_LOAD that is marked as > > > executable instead. > > > > > > I noticed that the value was wrong while adding some debug prints for some rtld > > > changes for CHERI binaries. `obj->textsize` only seems to be used by PPC so the > > > effect is untested. However, the value before was definitely wrong and the new > > > result matches the phdrs. > > I build kernel and world with a revision later than this on a PPC. Buildword > > ends up with a world where almost all binaries are segfaulting.... Especially gdb > > (but svn, ls or so all segfault). > > > > Best regards > > Michael > > This is rather surprising since if anything the range of the icache > flush should increase rather than decrease after this change. > > I can only see this causing a behaviour change if we actually need to > flush more than just the executable segments. > Is it possible that some binary/library contains a non-executable > segment as the first PT_LOAD? > Or is there some linker script that adds custom PHDRS? > Could it be that there is a hole between start of the object mapping and the last PT_LOADable segment eligible for execution ? From owner-svn-src-head@freebsd.org Tue Oct 30 18:19:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFFAE10F0701 for ; Tue, 30 Oct 2018 18:19:54 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic306-21.consmr.mail.ne1.yahoo.com (sonic306-21.consmr.mail.ne1.yahoo.com [66.163.189.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 867C872C8B for ; Tue, 30 Oct 2018 18:19:54 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: Gx9CLW0VM1njsdgV._D1tPGRmcQwxPd0Epv3WkbJSkXSPirPbo0ffHK0sLYsqZC jrgtlDKMe.jVFmt62Xxk46nykyVfCZrAb7ZFhf4cXRUfbylZEUgpqTM8Ipkmox7DPQbs9sd6pMFN 7L3aXml8RfJ53ZGc93HWfBIFtCe8MgZYWZdVhIXuQCi4Eul2PK44PUBoW_QpG0fQeA1cACqumcJ2 s_1NJ7F9xtCKL6hIkPVL9DFp89hroJNTteA_rXdSYUARfbVnpQWo5g1Jwc6qM.u.zJlJ33apSdEv mJrvWV2ew0_zsX4IXNmnH08aGmYb0y1vVVpUQ43USeIEhHSZ0J7ltOdPIk5oa9gRIp7npUp2wKnC qH64BOWD9YTSuCQ8ZJ_Vc04PEN7qGNnfCvNfHdvsckO_LofR21UFof7j9aeBaxwQB8VB.cmz27iq ywAvtf7E8dC3otDOS5L6f.xr3AgO3aw6I69kXkgiP9TwzUmTxNxqP3dNQYp8Z6A90hygdhk4Ka.p gzxq6w4leSGzL1MhWbBG1_fbF601VljeZKAHFcwJxFpryrIVoYc_GHseoscVkufkMH.30QbuewL5 4lk2X_VJaQNxQmB2sj9YI2Zmyh25HUq9ztTIkkIFGtCF51fE0KRRdWbOHzJVJyNjuttcKej4.d9d mE2cDMgcCz8gbd4eW5Kj2j3SN81bQmictDBqubHU_QYaoxVi8fO7EmDHdOFM0ZydWLfy6Z8GeOsw fCWaJIBuc8i2W6xIdqy3895aZVYZ91NzHHqpCVzwNyt470L_OudD2nX4LUgQOIgZ1VZ2pN2gBNC_ Q0k2ZkEyM_F6m6wsZvsn1ikVk3WRJeN10.gUnBNBc8F.Y505JQMM_VrL3LRMScpTDd7u6CHqwWxo 6ot1bF98RsZCb2FZ3olqHh8Mk.Obw6hpKXH9ZwN.NNelbs7.rTOZoTzcf_LcRyXVbIcWvhuWy80a ijMbJohnrPeYkojFvbWFtsXSX.6XwTRq.lZ0Ts9lhdDb2KyYOlaU8rU3nAjWBbovjRqa.Y3FplkO W_gbUMazsAQxqQh3zKQQNoUgLLoHoigT12GR0Uk3yFUjKgw-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Tue, 30 Oct 2018 18:19:48 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp425.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 9f69bd3e36dabfc4d8d7d509a60435cf; Tue, 30 Oct 2018 18:19:47 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r339876 - head/libexec/rtld-elf Message-Id: <7DC6D9C4-C153-4BCE-851C-22C890AB0D73@yahoo.com> Date: Tue, 30 Oct 2018 11:19:46 -0700 To: arichardson@freebsd.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 18:19:55 -0000 Alexander Richardson arichardson at freebsd.org wrote on Tue Oct 30 15:33:00 UTC 2018 : > On Tue, 30 Oct 2018 at 10:17, Michael Tuexen > wrote: > > > > > On 29. Oct 2018, at 22:08, Alex Richardson wrote: > > > > > > Author: arichardson > > > Date: Mon Oct 29 21:08:02 2018 > > > New Revision: 339876 > > > URL: https://svnweb.freebsd.org/changeset/base/339876 > > > > > > Log: > > > rtld: set obj->textsize correctly > > > > > > With lld-generated binaries the first PT_LOAD will usually be a = read-only > > > segment unless you pass --no-rosegment. For those binaries the = textsize is > > > determined by the next PT_LOAD. To allow both LLD and bfd 2.17 = binaries to > > > be parsed correctly use the end of the last PT_LOAD that is = marked as > > > executable instead. > > > > > > I noticed that the value was wrong while adding some debug prints = for some rtld > > > changes for CHERI binaries. `obj->textsize` only seems to be used = by PPC so the > > > effect is untested. However, the value before was definitely = wrong and the new > > > result matches the phdrs. > > I build kernel and world with a revision later than this on a PPC. = Buildword > > ends up with a world where almost all binaries are segfaulting.... = Especially gdb > > (but svn, ls or so all segfault). > > > > Best regards > > Michael >=20 > This is rather surprising since if anything the range of the icache > flush should increase rather than decrease after this change. >=20 > I can only see this causing a behaviour change if we actually need to > flush more than just the executable segments. > Is it possible that some binary/library contains a non-executable > segment as the first PT_LOAD? > Or is there some linker script that adds custom PHDRS? The following is based on using devel/powerpc64-xtoolchain-gcc to buildworld buildkernel on/for powerpc64. (I experiment with using fairly modern tools to target powerpc64 and powerpc.) The build context is head -r339076 based, both for what did the build and for what it was building. I report from both elfdump and objdump output because each seems to have some oddities in what it outputs. I start with elfdump (which leaves sh_flags blank and shows a section header with sh_name empty that objdump does not list at all): # elfdump -pc /bin/ls | less program header: entry: 0 p_type: PT_PHDR p_offset: 64 p_vaddr: 0x10000040 p_paddr: 0x10000040 p_filesz: 392 p_memsz: 392 p_flags: PF_R p_align: 8 entry: 1 p_type: PT_INTERP p_offset: 456 p_vaddr: 0x100001c8 p_paddr: 0x100001c8 p_filesz: 21 p_memsz: 21 p_flags: PF_R p_align: 1 entry: 2 p_type: PT_LOAD p_offset: 0 p_vaddr: 0x10000000 p_paddr: 0x10000000 p_filesz: 37132 p_memsz: 37132 p_flags: PF_X|PF_R p_align: 65536 entry: 3 p_type: PT_LOAD p_offset: 37136 p_vaddr: 0x10019110 p_paddr: 0x10019110 p_filesz: 3808 p_memsz: 4328 p_flags: PF_W|PF_R p_align: 65536 entry: 4 p_type: PT_DYNAMIC p_offset: 37176 p_vaddr: 0x10019138 p_paddr: 0x10019138 p_filesz: 448 p_memsz: 448 p_flags: PF_W|PF_R p_align: 8 entry: 5 p_type: PT_NOTE p_offset: 480 p_vaddr: 0x100001e0 p_paddr: 0x100001e0 p_filesz: 48 p_memsz: 48 p_flags: PF_R p_align: 4 entry: 6 p_type: PT_LOAD p_offset: 0 p_vaddr: 0 p_paddr: 0 p_filesz: 0 p_memsz: 0 p_flags: PF_W|PF_R p_align: 16 section header: entry: 0 sh_name:=20 sh_type: SHT_NULL sh_flags:=20 sh_addr: 0 sh_offset: 0 sh_size: 0 sh_link: 0 sh_info: 0 sh_addralign: 0 sh_entsize: 0 entry: 1 sh_name: .interp sh_type: SHT_PROGBITS sh_flags:=20 sh_addr: 0x100001c8 sh_offset: 456 sh_size: 21 sh_link: 0 sh_info: 0 sh_addralign: 1 sh_entsize: 0 entry: 2 sh_name: .note.tag sh_type: SHT_NOTE sh_flags:=20 sh_addr: 0x100001e0 sh_offset: 480 sh_size: 48 sh_link: 0 sh_info: 0 sh_addralign: 4 sh_entsize: 0 entry: 3 sh_name: .hash sh_type: SHT_HASH sh_flags:=20 sh_addr: 0x10000210 sh_offset: 528 sh_size: 636 sh_link: 4 sh_info: 0 sh_addralign: 8 sh_entsize: 4 entry: 4 sh_name: .dynsym sh_type: SHT_DYNSYM sh_flags:=20 sh_addr: 0x10000490 sh_offset: 1168 sh_size: 2160 sh_link: 5 sh_info: 1 sh_addralign: 8 sh_entsize: 24 entry: 5 sh_name: .dynstr sh_type: SHT_STRTAB sh_flags:=20 sh_addr: 0x10000d00 sh_offset: 3328 sh_size: 858 sh_link: 0 sh_info: 0 sh_addralign: 1 sh_entsize: 0 entry: 6 sh_name: .gnu.version sh_type: SHT_SUNW(GNU)_versym sh_flags:=20 sh_addr: 0x1000105a sh_offset: 4186 sh_size: 180 sh_link: 4 sh_info: 0 sh_addralign: 2 sh_entsize: 2 entry: 7 sh_name: .gnu.version_r sh_type: SHT_SUNW(GNU)_verneed sh_flags:=20 sh_addr: 0x10001110 sh_offset: 4368 sh_size: 80 sh_link: 5 sh_info: 1 sh_addralign: 8 sh_entsize: 0 entry: 8 sh_name: .rela.dyn sh_type: SHT_RELA sh_flags:=20 sh_addr: 0x10001160 sh_offset: 4448 sh_size: 408 sh_link: 4 sh_info: 0 sh_addralign: 8 sh_entsize: 24 entry: 9 sh_name: .rela.plt sh_type: SHT_RELA sh_flags:=20 sh_addr: 0x100012f8 sh_offset: 4856 sh_size: 1776 sh_link: 4 sh_info: 21 sh_addralign: 8 sh_entsize: 24 entry: 10 sh_name: .init sh_type: SHT_PROGBITS sh_flags:=20 sh_addr: 0x100019f0 sh_offset: 6640 sh_size: 44 sh_link: 0 sh_info: 0 sh_addralign: 16 sh_entsize: 0 entry: 11 sh_name: .text sh_type: SHT_PROGBITS sh_flags:=20 sh_addr: 0x10001a20 sh_offset: 6688 sh_size: 29188 sh_link: 0 sh_info: 0 sh_addralign: 32 sh_entsize: 0 entry: 12 sh_name: .fini sh_type: SHT_PROGBITS sh_flags:=20 sh_addr: 0x10008c30 sh_offset: 35888 sh_size: 36 sh_link: 0 sh_info: 0 sh_addralign: 16 sh_entsize: 0 entry: 13 sh_name: .rodata sh_type: SHT_PROGBITS sh_flags:=20 sh_addr: 0x10008c58 sh_offset: 35928 sh_size: 1200 sh_link: 0 sh_info: 0 sh_addralign: 8 sh_entsize: 0 entry: 14 sh_name: .eh_frame sh_type: SHT_PROGBITS sh_flags:=20 sh_addr: 0x10009108 sh_offset: 37128 sh_size: 4 sh_link: 0 sh_info: 0 sh_addralign: 4 sh_entsize: 0 entry: 15 sh_name: .ctors sh_type: SHT_PROGBITS sh_flags:=20 sh_addr: 0x10019110 sh_offset: 37136 sh_size: 16 sh_link: 0 sh_info: 0 sh_addralign: 8 sh_entsize: 0 entry: 16 sh_name: .dtors sh_type: SHT_PROGBITS sh_flags:=20 sh_addr: 0x10019120 sh_offset: 37152 sh_size: 16 sh_link: 0 sh_info: 0 sh_addralign: 8 sh_entsize: 0 entry: 17 sh_name: .jcr sh_type: SHT_PROGBITS sh_flags:=20 sh_addr: 0x10019130 sh_offset: 37168 sh_size: 8 sh_link: 0 sh_info: 0 sh_addralign: 8 sh_entsize: 0 entry: 18 sh_name: .dynamic sh_type: SHT_DYNAMIC sh_flags:=20 sh_addr: 0x10019138 sh_offset: 37176 sh_size: 448 sh_link: 5 sh_info: 0 sh_addralign: 8 sh_entsize: 16 entry: 19 sh_name: .opd sh_type: SHT_PROGBITS sh_flags:=20 sh_addr: 0x100192f8 sh_offset: 37624 sh_size: 1128 sh_link: 0 sh_info: 0 sh_addralign: 8 sh_entsize: 0 entry: 20 sh_name: .got sh_type: SHT_PROGBITS sh_flags:=20 sh_addr: 0x10019800 sh_offset: 38912 sh_size: 152 sh_link: 0 sh_info: 0 sh_addralign: 256 sh_entsize: 8 entry: 21 sh_name: .plt sh_type: SHT_NOBITS sh_flags:=20 sh_addr: 0x10019898 sh_offset: 39064 sh_size: 1800 sh_link: 0 sh_info: 0 sh_addralign: 8 sh_entsize: 24 entry: 22 sh_name: .data sh_type: SHT_PROGBITS sh_flags:=20 sh_addr: 0x10019fa0 sh_offset: 40864 sh_size: 80 sh_link: 0 sh_info: 0 sh_addralign: 8 sh_entsize: 0 entry: 23 sh_name: .bss sh_type: SHT_NOBITS sh_flags:=20 sh_addr: 0x10019ff0 sh_offset: 40944 sh_size: 520 sh_link: 0 sh_info: 0 sh_addralign: 8 sh_entsize: 0 entry: 24 sh_name: .comment sh_type: SHT_PROGBITS sh_flags:=20 sh_addr: 0 sh_offset: 40944 sh_size: 693 sh_link: 0 sh_info: 0 sh_addralign: 1 sh_entsize: 1 entry: 25 sh_name: .gnu_debuglink sh_type: SHT_PROGBITS sh_flags:=20 sh_addr: 0 sh_offset: 41640 sh_size: 16 sh_link: 0 sh_info: 0 sh_addralign: 4 sh_entsize: 0 entry: 26 sh_name: .shstrtab sh_type: SHT_STRTAB sh_flags:=20 sh_addr: 0 sh_offset: 41656 sh_size: 208 sh_link: 0 sh_info: 0 sh_addralign: 1 sh_entsize: 0 As for objdump on the same file (section one less than elfdump listed, no empty sh_name section listed): # objdump -ph /bin/ls | less /bin/ls: file format elf64-powerpc-freebsd Program Header: PHDR off 0x0000000000000040 vaddr 0x0000000010000040 paddr = 0x0000000010000040 align 2**3 filesz 0x0000000000000188 memsz 0x0000000000000188 flags r-- INTERP off 0x00000000000001c8 vaddr 0x00000000100001c8 paddr = 0x00000000100001c8 align 2**0 filesz 0x0000000000000015 memsz 0x0000000000000015 flags r-- LOAD off 0x0000000000000000 vaddr 0x0000000010000000 paddr = 0x0000000010000000 align 2**16 filesz 0x000000000000910c memsz 0x000000000000910c flags r-x LOAD off 0x0000000000009110 vaddr 0x0000000010019110 paddr = 0x0000000010019110 align 2**16 filesz 0x0000000000000ee0 memsz 0x00000000000010e8 flags rw- DYNAMIC off 0x0000000000009138 vaddr 0x0000000010019138 paddr = 0x0000000010019138 align 2**3 filesz 0x00000000000001c0 memsz 0x00000000000001c0 flags rw- NOTE off 0x00000000000001e0 vaddr 0x00000000100001e0 paddr = 0x00000000100001e0 align 2**2 filesz 0x0000000000000030 memsz 0x0000000000000030 flags r-- STACK off 0x0000000000000000 vaddr 0x0000000000000000 paddr = 0x0000000000000000 align 2**4 filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw- Dynamic Section: NEEDED libutil.so.9 NEEDED libncursesw.so.8 NEEDED libc.so.7 INIT 0x0000000010019328 FINI 0x0000000010019340 HASH 0x0000000010000210 STRTAB 0x0000000010000d00 SYMTAB 0x0000000010000490 STRSZ 0x000000000000035a SYMENT 0x0000000000000018 DEBUG 0x0000000000000000 PLTGOT 0x0000000010019898 PLTRELSZ 0x00000000000006f0 PLTREL 0x0000000000000007 JMPREL 0x00000000100012f8 0x70000000 0x00000000100089b4 RELA 0x0000000010001160 RELASZ 0x0000000000000198 RELAENT 0x0000000000000018 VERNEED 0x0000000010001110 VERNEEDNUM 0x0000000000000001 VERSYM 0x000000001000105a Version References: required from libc.so.7: 0x077a28b3 0x00 05 FBSD_1.3 0x077a28b1 0x00 04 FBSD_1.1 0x077a28b5 0x00 03 FBSD_1.5 0x077a28b0 0x00 02 FBSD_1.0 private flags =3D 0x1: [abiv1] Sections: Idx Name Size VMA LMA File off = Algn 0 .interp 00000015 00000000100001c8 00000000100001c8 000001c8 = 2**0 CONTENTS, ALLOC, LOAD, READONLY, DATA 1 .note.tag 00000030 00000000100001e0 00000000100001e0 000001e0 = 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 2 .hash 0000027c 0000000010000210 0000000010000210 00000210 = 2**3 CONTENTS, ALLOC, LOAD, READONLY, DATA 3 .dynsym 00000870 0000000010000490 0000000010000490 00000490 = 2**3 CONTENTS, ALLOC, LOAD, READONLY, DATA 4 .dynstr 0000035a 0000000010000d00 0000000010000d00 00000d00 = 2**0 CONTENTS, ALLOC, LOAD, READONLY, DATA 5 .gnu.version 000000b4 000000001000105a 000000001000105a 0000105a = 2**1 CONTENTS, ALLOC, LOAD, READONLY, DATA 6 .gnu.version_r 00000050 0000000010001110 0000000010001110 = 00001110 2**3 CONTENTS, ALLOC, LOAD, READONLY, DATA 7 .rela.dyn 00000198 0000000010001160 0000000010001160 00001160 = 2**3 CONTENTS, ALLOC, LOAD, READONLY, DATA 8 .rela.plt 000006f0 00000000100012f8 00000000100012f8 000012f8 = 2**3 CONTENTS, ALLOC, LOAD, READONLY, DATA 9 .init 0000002c 00000000100019f0 00000000100019f0 000019f0 = 2**4 CONTENTS, ALLOC, LOAD, READONLY, CODE 10 .text 00007204 0000000010001a20 0000000010001a20 00001a20 = 2**5 CONTENTS, ALLOC, LOAD, READONLY, CODE 11 .fini 00000024 0000000010008c30 0000000010008c30 00008c30 = 2**4 CONTENTS, ALLOC, LOAD, READONLY, CODE 12 .rodata 000004b0 0000000010008c58 0000000010008c58 00008c58 = 2**3 CONTENTS, ALLOC, LOAD, READONLY, DATA 13 .eh_frame 00000004 0000000010009108 0000000010009108 00009108 = 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 14 .ctors 00000010 0000000010019110 0000000010019110 00009110 = 2**3 CONTENTS, ALLOC, LOAD, DATA 15 .dtors 00000010 0000000010019120 0000000010019120 00009120 = 2**3 CONTENTS, ALLOC, LOAD, DATA 16 .jcr 00000008 0000000010019130 0000000010019130 00009130 = 2**3 CONTENTS, ALLOC, LOAD, DATA 17 .dynamic 000001c0 0000000010019138 0000000010019138 00009138 = 2**3 CONTENTS, ALLOC, LOAD, DATA 18 .opd 00000468 00000000100192f8 00000000100192f8 000092f8 = 2**3 CONTENTS, ALLOC, LOAD, DATA 19 .got 00000098 0000000010019800 0000000010019800 00009800 = 2**8 CONTENTS, ALLOC, LOAD, DATA 20 .plt 00000708 0000000010019898 0000000010019898 00009898 = 2**3 ALLOC 21 .data 00000050 0000000010019fa0 0000000010019fa0 00009fa0 = 2**3 CONTENTS, ALLOC, LOAD, DATA 22 .bss 00000208 0000000010019ff0 0000000010019ff0 00009ff0 = 2**3 ALLOC 23 .comment 000002b5 0000000000000000 0000000000000000 00009ff0 = 2**0 CONTENTS, READONLY 24 .gnu_debuglink 00000010 0000000000000000 0000000000000000 = 0000a2a8 2**2 CONTENTS, READONLY =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Tue Oct 30 18:20:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8522710F0747; Tue, 30 Oct 2018 18:20:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B61972CD1; Tue, 30 Oct 2018 18:20:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 188B220FEA; Tue, 30 Oct 2018 18:20:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9UIKYmm002389; Tue, 30 Oct 2018 18:20:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UIKYAq002388; Tue, 30 Oct 2018 18:20:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201810301820.w9UIKYAq002388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 30 Oct 2018 18:20:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339926 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 339926 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 18:20:35 -0000 Author: jhb Date: Tue Oct 30 18:20:34 2018 New Revision: 339926 URL: https://svnweb.freebsd.org/changeset/base/339926 Log: Only invoke 'ls' if the local modules directory exists. This avoids a spurious make warning if /usr/local/sys/modules doesn't exist. Submitted by: rgrimes Reported by: markj Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Oct 30 17:57:40 2018 (r339925) +++ head/sys/conf/kern.post.mk Tue Oct 30 18:20:34 2018 (r339926) @@ -43,7 +43,7 @@ LOCAL_MODULES_DIR?= ${LOCALBASE}/sys/modules # Default to installing all modules installed by ports unless overridden # by the user. -.if !defined(LOCAL_MODULES) +.if !defined(LOCAL_MODULES) && exists($LOCAL_MODULES_DIR) LOCAL_MODULES!= ls ${LOCAL_MODULES_DIR} .endif .endif From owner-svn-src-head@freebsd.org Tue Oct 30 18:26:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1333310F0AC4; Tue, 30 Oct 2018 18:26:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B81257339D; Tue, 30 Oct 2018 18:26:39 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94BE42117E; Tue, 30 Oct 2018 18:26:39 +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 w9UIQdmj007583; Tue, 30 Oct 2018 18:26:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UIQYJN007560; Tue, 30 Oct 2018 18:26:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810301826.w9UIQYJN007560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 30 Oct 2018 18:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339927 - in head: . share/man/man9 sys/dev/hwpmc sys/i386/i386 sys/kern sys/sys sys/vm sys/x86/iommu sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: . share/man/man9 sys/dev/hwpmc sys/i386/i386 sys/kern sys/sys sys/vm sys/x86/iommu sys/x86/x86 X-SVN-Commit-Revision: 339927 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 18:26:40 -0000 Author: markj Date: Tue Oct 30 18:26:34 2018 New Revision: 339927 URL: https://svnweb.freebsd.org/changeset/base/339927 Log: Add malloc_domainset(9) and _domainset variants to other allocator KPIs. Remove malloc_domain(9) and most other _domain KPIs added in r327900. The new functions allow the caller to specify a general NUMA domain selection policy, rather than specifically requesting an allocation from a specific domain. The latter policy tends to interact poorly with M_WAITOK, resulting in situations where a caller is blocked indefinitely because the specified domain is depleted. Most existing consumers of the _domain KPIs are converted to instead use a DOMAINSET_PREF() policy, in which we fall back to other domains to satisfy the allocation request. This change also defines a set of DOMAINSET_FIXED() policies, which only permit allocations from the specified domain. Discussed with: gallatin, jeff Reported and tested by: pho (previous version) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17418 Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile head/share/man/man9/contigmalloc.9 head/share/man/man9/domainset.9 head/share/man/man9/malloc.9 head/sys/dev/hwpmc/hwpmc_logging.c head/sys/dev/hwpmc/hwpmc_mod.c head/sys/i386/i386/pmap.c head/sys/kern/kern_cpuset.c head/sys/kern/kern_malloc.c head/sys/kern/kern_mbuf.c head/sys/kern/kern_pmc.c head/sys/kern/subr_busdma_bufalloc.c head/sys/sys/domainset.h head/sys/sys/malloc.h head/sys/vm/uma_core.c head/sys/vm/vm_extern.h head/sys/vm/vm_kern.c head/sys/x86/iommu/busdma_dmar.c head/sys/x86/x86/busdma_bounce.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Oct 30 18:20:34 2018 (r339926) +++ head/ObsoleteFiles.inc Tue Oct 30 18:26:34 2018 (r339927) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20181030: malloc_domain(9) KPI change +OLD_FILES+=share/man/man9/malloc_domain.9.gz # 20181026: joy(4) removal OLD_FILES+=usr/share/man/man4/joy.4.gz # 20181025: OpenSSL libraries version bump to avoid conflict with ports Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Oct 30 18:20:34 2018 (r339926) +++ head/share/man/man9/Makefile Tue Oct 30 18:26:34 2018 (r339927) @@ -812,7 +812,8 @@ MLINKS+=condvar.9 cv_broadcast.9 \ MLINKS+=config_intrhook.9 config_intrhook_disestablish.9 \ config_intrhook.9 config_intrhook_establish.9 \ config_intrhook.9 config_intrhook_oneshot.9 -MLINKS+=contigmalloc.9 contigfree.9 +MLINKS+=contigmalloc.9 contigmalloc_domainset.9 \ + contigmalloc.9 contigfree.9 MLINKS+=casuword.9 casueword.9 \ casuword.9 casueword32.9 \ casuword.9 casuword32.9 @@ -1289,7 +1290,7 @@ MLINKS+=make_dev.9 destroy_dev.9 \ make_dev.9 make_dev_p.9 \ make_dev.9 make_dev_s.9 MLINKS+=malloc.9 free.9 \ - malloc.9 malloc_domain.9 \ + malloc.9 malloc_domainset.9 \ malloc.9 free_domain.9 \ malloc.9 mallocarray.9 \ malloc.9 MALLOC_DECLARE.9 \ Modified: head/share/man/man9/contigmalloc.9 ============================================================================== --- head/share/man/man9/contigmalloc.9 Tue Oct 30 18:20:34 2018 (r339926) +++ head/share/man/man9/contigmalloc.9 Tue Oct 30 18:26:34 2018 (r339927) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 29, 2015 +.Dd October 30, 2018 .Dt CONTIGMALLOC 9 .Os .Sh NAME @@ -50,6 +50,19 @@ .Fa "unsigned long size" .Fa "struct malloc_type *type" .Fc +.In sys/param.h +.In sys/domainset.h +.Ft "void *" +.Fo contigmalloc_domainset +.Fa "unsigned long size" +.Fa "struct malloc_type *type" +.Fa "struct domainset *ds" +.Fa "int flags" +.Fa "vm_paddr_t low" +.Fa "vm_paddr_t high" +.Fa "unsigned long alignment" +.Fa "vm_paddr_t boundary" +.Fc .Sh DESCRIPTION The .Fn contigmalloc @@ -70,6 +83,15 @@ address range of bytes allocated from the kernel virtual address (KVA) map. .Pp The +.Fn contigmalloc_domainset +variant allows the caller to additionally specify a +.Xr numa 4 +domain selection policy. +See +.Xr domainset 9 +for some example policies. +.Pp +The .Fa flags parameter modifies .Fn contigmalloc Ns 's @@ -90,7 +112,9 @@ Other flags (if present) are ignored. The .Fn contigfree function deallocates memory allocated by a previous call to -.Fn contigmalloc . +.Fn contigmalloc +or +.Fn contigmalloc_domainset . .Sh IMPLEMENTATION NOTES The .Fn contigmalloc Modified: head/share/man/man9/domainset.9 ============================================================================== --- head/share/man/man9/domainset.9 Tue Oct 30 18:20:34 2018 (r339926) +++ head/share/man/man9/domainset.9 Tue Oct 30 18:26:34 2018 (r339927) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 20, 2018 +.Dd October 30, 2018 .Dt DOMAINSET 9 .Os .Sh NAME @@ -43,7 +43,11 @@ struct domainset { }; .Ed .Pp +.Ft struct domainset * +.Fn DOMAINSET_FIXED domain +.Ft struct domainset * .Fn DOMAINSET_RR +.Ft struct domainset * .Fn DOMAINSET_PREF domain .Ft struct domainset * .Fn domainset_create "const struct domainset *key" @@ -98,11 +102,26 @@ efficiency higher and is preferential to round-robin f .El .Pp The +.Fn DOMAINSET_FIXED , .Fn DOMAINSET_RR and .Fn DOMAINSET_PREF -provide pointers to global pre-defined policies for use when the +macros provide pointers to global pre-defined policies for use when the desired policy is known at compile time. +.Fn DOMAINSET_FIXED +is a policy which only permits allocations from the specified domain. +.Fn DOMAINSET_RR +provides round-robin selection among all domains in the system. +The +.Fn DOMAINSET_PREF +policies attempt allocation from the specified domain, but unlike +.Fn DOMAINSET_FIXED +will fall back to other domains to satisfy the request. +These policies should be used in preference to +.Fn DOMAINSET_FIXED +to avoid blocking indefinitely on a +.Dv M_WAITOK +request. The .Fn domainset_create function takes a partially filled in domainset as a key and returns a Modified: head/share/man/man9/malloc.9 ============================================================================== --- head/share/man/man9/malloc.9 Tue Oct 30 18:20:34 2018 (r339926) +++ head/share/man/man9/malloc.9 Tue Oct 30 18:26:34 2018 (r339927) @@ -29,7 +29,7 @@ .\" $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $ .\" $FreeBSD$ .\" -.Dd June 13, 2018 +.Dd October 30, 2018 .Dt MALLOC 9 .Os .Sh NAME @@ -46,13 +46,9 @@ .Ft void * .Fn malloc "size_t size" "struct malloc_type *type" "int flags" .Ft void * -.Fn malloc_domain "size_t size" "struct malloc_type *type" "int domain" "int flags" -.Ft void * .Fn mallocarray "size_t nmemb" "size_t size" "struct malloc_type *type" "int flags" .Ft void .Fn free "void *addr" "struct malloc_type *type" -.Ft void -.Fn free_domain "void *addr" "struct malloc_type *type" .Ft void * .Fn realloc "void *addr" "size_t size" "struct malloc_type *type" "int flags" .Ft void * @@ -62,6 +58,12 @@ .In sys/malloc.h .In sys/kernel.h .Fn MALLOC_DEFINE type shortdesc longdesc +.In sys/param.h +.In sys/domainset.h +.Ft void * +.Fn malloc_domainset "size_t size" "struct malloc_type *type" "struct domainset *ds" "int flags" +.Ft void +.Fn free_domain "void *addr" "struct malloc_type *type" .Sh DESCRIPTION The .Fn malloc @@ -70,12 +72,15 @@ object whose size is specified by .Fa size . .Pp The -.Fn malloc_domain -variant allocates the object from the specified memory domain. Memory allocated -with this function should be returned with -.Fn free_domain . +.Fn malloc_domainset +variant allocates memory from a specific +.Xr numa 4 +domain using the specified domain selection policy. See -.Xr numa 9 for more details. +.Xr domainset 9 +for some example policies. +Memory allocated with this function should be returned with +.Fn free_domain . .Pp The .Fn mallocarray @@ -310,7 +315,9 @@ functions. Failing consistency checks will cause a panic or a system console message. .Sh SEE ALSO +.Xr numa 4 , .Xr vmstat 8 , .Xr contigmalloc 9 , +.Xr domainset 9 , .Xr memguard 9 , .Xr vnode 9 Modified: head/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_logging.c Tue Oct 30 18:20:34 2018 (r339926) +++ head/sys/dev/hwpmc/hwpmc_logging.c Tue Oct 30 18:26:34 2018 (r339927) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1231,8 +1232,8 @@ pmclog_process_userlog(struct pmc_owner *po, struct pm void pmclog_initialize() { - int domain; struct pmclog_buffer *plb; + int domain, ncpus, total; if (pmclog_buffer_size <= 0 || pmclog_buffer_size > 16*1024) { (void) printf("hwpmc: tunable logbuffersize=%d must be " @@ -1253,16 +1254,17 @@ pmclog_initialize() pmclog_buffer_size = PMC_LOG_BUFFER_SIZE; } for (domain = 0; domain < vm_ndomains; domain++) { - int ncpus = pmc_dom_hdrs[domain]->pdbh_ncpus; - int total = ncpus*pmc_nlogbuffers_pcpu; + ncpus = pmc_dom_hdrs[domain]->pdbh_ncpus; + total = ncpus * pmc_nlogbuffers_pcpu; - plb = malloc_domain(sizeof(struct pmclog_buffer)*total, M_PMC, domain, M_WAITOK|M_ZERO); + plb = malloc_domainset(sizeof(struct pmclog_buffer) * total, + M_PMC, DOMAINSET_PREF(domain), M_WAITOK | M_ZERO); pmc_dom_hdrs[domain]->pdbh_plbs = plb; - for (int i = 0; i < total; i++, plb++) { + for (; total > 0; total--, plb++) { void *buf; - buf = malloc_domain(1024 * pmclog_buffer_size, M_PMC, domain, - M_WAITOK|M_ZERO); + buf = malloc_domainset(1024 * pmclog_buffer_size, M_PMC, + DOMAINSET_PREF(domain), M_WAITOK | M_ZERO); PMCLOG_INIT_BUFFER_DESCRIPTOR(plb, buf, domain); pmc_plb_rele_unlocked(plb); } Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Tue Oct 30 18:20:34 2018 (r339926) +++ head/sys/dev/hwpmc/hwpmc_mod.c Tue Oct 30 18:26:34 2018 (r339927) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -78,14 +79,6 @@ __FBSDID("$FreeBSD$"); #include "hwpmc_soft.h" -#ifdef NUMA -#define NDOMAINS vm_ndomains -#else -#define NDOMAINS 1 -#define malloc_domain(size, type, domain, flags) malloc((size), (type), (flags)) -#define free_domain(addr, type) free(addr, type) -#endif - #define PMC_EPOCH_ENTER() struct epoch_tracker pmc_et; epoch_enter_preempt(global_epoch_preempt, &pmc_et) #define PMC_EPOCH_EXIT() epoch_exit_preempt(global_epoch_preempt, &pmc_et) @@ -5643,15 +5636,16 @@ pmc_initialize(void) continue; pc = pcpu_find(cpu); domain = pc->pc_domain; - sb = malloc_domain(sizeof(struct pmc_samplebuffer) + - pmc_nsamples * sizeof(struct pmc_sample), M_PMC, domain, - M_WAITOK|M_ZERO); + sb = malloc_domainset(sizeof(struct pmc_samplebuffer) + + pmc_nsamples * sizeof(struct pmc_sample), M_PMC, + DOMAINSET_PREF(domain), M_WAITOK | M_ZERO); KASSERT(pmc_pcpu[cpu] != NULL, ("[pmc,%d] cpu=%d Null per-cpu data", __LINE__, cpu)); - sb->ps_callchains = malloc_domain(pmc_callchaindepth * pmc_nsamples * - sizeof(uintptr_t), M_PMC, domain, M_WAITOK|M_ZERO); + sb->ps_callchains = malloc_domainset(pmc_callchaindepth * + pmc_nsamples * sizeof(uintptr_t), M_PMC, + DOMAINSET_PREF(domain), M_WAITOK | M_ZERO); for (n = 0, ps = sb->ps_samples; n < pmc_nsamples; n++, ps++) ps->ps_pc = sb->ps_callchains + @@ -5659,35 +5653,27 @@ pmc_initialize(void) pmc_pcpu[cpu]->pc_sb[PMC_HR] = sb; - sb = malloc_domain(sizeof(struct pmc_samplebuffer) + - pmc_nsamples * sizeof(struct pmc_sample), M_PMC, domain, - M_WAITOK|M_ZERO); + sb = malloc_domainset(sizeof(struct pmc_samplebuffer) + + pmc_nsamples * sizeof(struct pmc_sample), M_PMC, + DOMAINSET_PREF(domain), M_WAITOK | M_ZERO); - KASSERT(pmc_pcpu[cpu] != NULL, - ("[pmc,%d] cpu=%d Null per-cpu data", __LINE__, cpu)); - - sb->ps_callchains = malloc_domain(pmc_callchaindepth * pmc_nsamples * - sizeof(uintptr_t), M_PMC, domain, M_WAITOK|M_ZERO); - + sb->ps_callchains = malloc_domainset(pmc_callchaindepth * + pmc_nsamples * sizeof(uintptr_t), M_PMC, + DOMAINSET_PREF(domain), M_WAITOK | M_ZERO); for (n = 0, ps = sb->ps_samples; n < pmc_nsamples; n++, ps++) ps->ps_pc = sb->ps_callchains + (n * pmc_callchaindepth); pmc_pcpu[cpu]->pc_sb[PMC_SR] = sb; - sb = malloc_domain(sizeof(struct pmc_samplebuffer) + - pmc_nsamples * sizeof(struct pmc_sample), M_PMC, domain, - M_WAITOK|M_ZERO); - - KASSERT(pmc_pcpu[cpu] != NULL, - ("[pmc,%d] cpu=%d Null per-cpu data", __LINE__, cpu)); - - sb->ps_callchains = malloc_domain(pmc_callchaindepth * pmc_nsamples * - sizeof(uintptr_t), M_PMC, domain, M_WAITOK|M_ZERO); - + sb = malloc_domainset(sizeof(struct pmc_samplebuffer) + + pmc_nsamples * sizeof(struct pmc_sample), M_PMC, + DOMAINSET_PREF(domain), M_WAITOK | M_ZERO); + sb->ps_callchains = malloc_domainset(pmc_callchaindepth * + pmc_nsamples * sizeof(uintptr_t), M_PMC, + DOMAINSET_PREF(domain), M_WAITOK | M_ZERO); for (n = 0, ps = sb->ps_samples; n < pmc_nsamples; n++, ps++) - ps->ps_pc = sb->ps_callchains + - (n * pmc_callchaindepth); + ps->ps_pc = sb->ps_callchains + n * pmc_callchaindepth; pmc_pcpu[cpu]->pc_sb[PMC_UR] = sb; } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Tue Oct 30 18:20:34 2018 (r339926) +++ head/sys/i386/i386/pmap.c Tue Oct 30 18:26:34 2018 (r339927) @@ -864,8 +864,8 @@ pmap_pdpt_allocf(uma_zone_t zone, vm_size_t bytes, int /* Inform UMA that this allocator uses kernel_map/object. */ *flags = UMA_SLAB_KERNEL; - return ((void *)kmem_alloc_contig_domain(domain, bytes, wait, 0x0ULL, - 0xffffffffULL, 1, 0, VM_MEMATTR_DEFAULT)); + return ((void *)kmem_alloc_contig_domainset(DOMAINSET_FIXED(domain), + bytes, wait, 0x0ULL, 0xffffffffULL, 1, 0, VM_MEMATTR_DEFAULT)); } #endif Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Tue Oct 30 18:20:34 2018 (r339926) +++ head/sys/kern/kern_cpuset.c Tue Oct 30 18:26:34 2018 (r339927) @@ -119,6 +119,7 @@ __FBSDID("$FreeBSD$"); */ LIST_HEAD(domainlist, domainset); +struct domainset __read_mostly domainset_fixed[MAXMEMDOM]; struct domainset __read_mostly domainset_prefer[MAXMEMDOM]; struct domainset __read_mostly domainset_roundrobin; @@ -1402,6 +1403,12 @@ domainset_init(void) _domainset_create(dset, NULL); for (i = 0; i < vm_ndomains; i++) { + dset = &domainset_fixed[i]; + DOMAINSET_ZERO(&dset->ds_mask); + DOMAINSET_SET(i, &dset->ds_mask); + dset->ds_policy = DOMAINSET_POLICY_ROUNDROBIN; + _domainset_create(dset, NULL); + dset = &domainset_prefer[i]; DOMAINSET_COPY(&all_domains, &dset->ds_mask); dset->ds_policy = DOMAINSET_POLICY_PREFER; Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Tue Oct 30 18:20:34 2018 (r339926) +++ head/sys/kern/kern_malloc.c Tue Oct 30 18:26:34 2018 (r339927) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -453,13 +454,13 @@ contigmalloc(unsigned long size, struct malloc_type *t } void * -contigmalloc_domain(unsigned long size, struct malloc_type *type, - int domain, int flags, vm_paddr_t low, vm_paddr_t high, +contigmalloc_domainset(unsigned long size, struct malloc_type *type, + struct domainset *ds, int flags, vm_paddr_t low, vm_paddr_t high, unsigned long alignment, vm_paddr_t boundary) { void *ret; - ret = (void *)kmem_alloc_contig_domain(domain, size, flags, low, high, + ret = (void *)kmem_alloc_contig_domainset(ds, size, flags, low, high, alignment, boundary, VM_MEMATTR_DEFAULT); if (ret != NULL) malloc_type_allocated(type, round_page(size)); @@ -595,9 +596,8 @@ void * return ((void *) va); } -void * -malloc_domain(size_t size, struct malloc_type *mtp, int domain, - int flags) +static void * +malloc_domain(size_t size, struct malloc_type *mtp, int domain, int flags) { int indx; caddr_t va; @@ -638,6 +638,24 @@ malloc_domain(size_t size, struct malloc_type *mtp, in va = redzone_setup(va, osize); #endif return ((void *) va); +} + +void * +malloc_domainset(size_t size, struct malloc_type *mtp, struct domainset *ds, + int flags) +{ + struct vm_domainset_iter di; + void *ret; + int domain; + + vm_domainset_iter_policy_init(&di, ds, &domain, &flags); + do { + ret = malloc_domain(size, mtp, domain, flags); + if (ret != NULL) + break; + } while (vm_domainset_iter_policy(&di, &domain) == 0); + + return (ret); } void * Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Tue Oct 30 18:20:34 2018 (r339926) +++ head/sys/kern/kern_mbuf.c Tue Oct 30 18:26:34 2018 (r339927) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -590,8 +591,9 @@ mbuf_jumbo_alloc(uma_zone_t zone, vm_size_t bytes, int /* Inform UMA that this allocator uses kernel_map/object. */ *flags = UMA_SLAB_KERNEL; - return ((void *)kmem_alloc_contig_domain(domain, bytes, wait, - (vm_paddr_t)0, ~(vm_paddr_t)0, 1, 0, VM_MEMATTR_DEFAULT)); + return ((void *)kmem_alloc_contig_domainset(DOMAINSET_FIXED(domain), + bytes, wait, (vm_paddr_t)0, ~(vm_paddr_t)0, 1, 0, + VM_MEMATTR_DEFAULT)); } /* Modified: head/sys/kern/kern_pmc.c ============================================================================== --- head/sys/kern/kern_pmc.c Tue Oct 30 18:20:34 2018 (r339926) +++ head/sys/kern/kern_pmc.c Tue Oct 30 18:26:34 2018 (r339927) @@ -35,8 +35,9 @@ __FBSDID("$FreeBSD$"); #include "opt_hwpmc_hooks.h" -#include +#include #include +#include #include #include #include @@ -330,22 +331,6 @@ pmc_soft_ev_release(struct pmc_soft *ps) mtx_unlock_spin(&pmc_softs_mtx); } -#ifdef NUMA -#define NDOMAINS vm_ndomains - -static int -getdomain(int cpu) -{ - struct pcpu *pc; - - pc = pcpu_find(cpu); - return (pc->pc_domain); -} -#else -#define NDOMAINS 1 -#define malloc_domain(size, type, domain, flags) malloc((size), (type), (flags)) -#define getdomain(cpu) 0 -#endif /* * Initialise hwpmc. */ @@ -362,14 +347,16 @@ init_hwpmc(void *dummy __unused) } pmc_softs = malloc(pmc_softevents * sizeof(*pmc_softs), M_PMCHOOKS, M_WAITOK | M_ZERO); - for (domain = 0; domain < NDOMAINS; domain++) { - pmc_dom_hdrs[domain] = malloc_domain(sizeof(struct pmc_domain_buffer_header), M_PMC, domain, - M_WAITOK|M_ZERO); + + for (domain = 0; domain < vm_ndomains; domain++) { + pmc_dom_hdrs[domain] = malloc_domainset( + sizeof(struct pmc_domain_buffer_header), M_PMC, + DOMAINSET_PREF(domain), M_WAITOK | M_ZERO); mtx_init(&pmc_dom_hdrs[domain]->pdbh_mtx, "pmc_bufferlist_mtx", "pmc-leaf", MTX_SPIN); TAILQ_INIT(&pmc_dom_hdrs[domain]->pdbh_head); } CPU_FOREACH(cpu) { - domain = getdomain(cpu); + domain = pcpu_find(cpu)->pc_domain; KASSERT(pmc_dom_hdrs[domain] != NULL, ("no mem allocated for domain: %d", domain)); pmc_dom_hdrs[domain]->pdbh_ncpus++; } Modified: head/sys/kern/subr_busdma_bufalloc.c ============================================================================== --- head/sys/kern/subr_busdma_bufalloc.c Tue Oct 30 18:20:34 2018 (r339926) +++ head/sys/kern/subr_busdma_bufalloc.c Tue Oct 30 18:26:34 2018 (r339927) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -152,18 +153,15 @@ void * busdma_bufalloc_alloc_uncacheable(uma_zone_t zone, vm_size_t size, int domain, uint8_t *pflag, int wait) { -#ifdef VM_MEMATTR_UNCACHEABLE +#ifdef VM_MEMATTR_UNCACHEABLE /* Inform UMA that this allocator uses kernel_arena/object. */ *pflag = UMA_SLAB_KERNEL; - return ((void *)kmem_alloc_attr_domain(domain, size, wait, 0, - BUS_SPACE_MAXADDR, VM_MEMATTR_UNCACHEABLE)); - + return ((void *)kmem_alloc_attr_domainset(DOMAINSET_FIXED(domain), size, + wait, 0, BUS_SPACE_MAXADDR, VM_MEMATTR_UNCACHEABLE)); #else - panic("VM_MEMATTR_UNCACHEABLE unavailable"); - #endif /* VM_MEMATTR_UNCACHEABLE */ } Modified: head/sys/sys/domainset.h ============================================================================== --- head/sys/sys/domainset.h Tue Oct 30 18:20:34 2018 (r339926) +++ head/sys/sys/domainset.h Tue Oct 30 18:26:34 2018 (r339927) @@ -96,7 +96,8 @@ struct domainset { domainid_t ds_order[MAXMEMDOM]; /* nth domain table. */ }; -extern struct domainset domainset_prefer[MAXMEMDOM]; +extern struct domainset domainset_fixed[MAXMEMDOM], domainset_prefer[MAXMEMDOM]; +#define DOMAINSET_FIXED(domain) (&domainset_fixed[(domain)]) #define DOMAINSET_PREF(domain) (&domainset_prefer[(domain)]) extern struct domainset domainset_roundrobin; #define DOMAINSET_RR() (&domainset_roundrobin) Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Tue Oct 30 18:20:34 2018 (r339926) +++ head/sys/sys/malloc.h Tue Oct 30 18:26:34 2018 (r339927) @@ -160,6 +160,7 @@ MALLOC_DECLARE(M_TEMP); */ MALLOC_DECLARE(M_IOV); +struct domainset; extern struct mtx malloc_mtx; /* @@ -172,8 +173,8 @@ void *contigmalloc(unsigned long size, struct malloc_t vm_paddr_t low, vm_paddr_t high, unsigned long alignment, vm_paddr_t boundary) __malloc_like __result_use_check __alloc_size(1) __alloc_align(6); -void *contigmalloc_domain(unsigned long size, struct malloc_type *type, - int domain, int flags, vm_paddr_t low, vm_paddr_t high, +void *contigmalloc_domainset(unsigned long size, struct malloc_type *type, + struct domainset *ds, int flags, vm_paddr_t low, vm_paddr_t high, unsigned long alignment, vm_paddr_t boundary) __malloc_like __result_use_check __alloc_size(1) __alloc_align(6); void free(void *addr, struct malloc_type *type); @@ -230,8 +231,9 @@ void *malloc(size_t size, struct malloc_type *type, in _malloc_item; \ }) -void *malloc_domain(size_t size, struct malloc_type *type, int domain, - int flags) __malloc_like __result_use_check __alloc_size(1); +void *malloc_domainset(size_t size, struct malloc_type *type, + struct domainset *ds, int flags) __malloc_like __result_use_check + __alloc_size(1); void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type, int flags) __malloc_like __result_use_check __alloc_size2(1, 2); Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Oct 30 18:20:34 2018 (r339926) +++ head/sys/vm/uma_core.c Tue Oct 30 18:26:34 2018 (r339927) @@ -1172,7 +1172,7 @@ page_alloc(uma_zone_t zone, vm_size_t bytes, int domai void *p; /* Returned page */ *pflag = UMA_SLAB_KERNEL; - p = (void *) kmem_malloc_domain(domain, bytes, wait); + p = (void *)kmem_malloc_domainset(DOMAINSET_FIXED(domain), bytes, wait); return (p); } @@ -3718,6 +3718,7 @@ uma_zone_exhausted_nolock(uma_zone_t zone) void * uma_large_malloc_domain(vm_size_t size, int domain, int wait) { + struct domainset *policy; vm_offset_t addr; uma_slab_t slab; @@ -3729,10 +3730,9 @@ uma_large_malloc_domain(vm_size_t size, int domain, in slab = zone_alloc_item(slabzone, NULL, domain, wait); if (slab == NULL) return (NULL); - if (domain == UMA_ANYDOMAIN) - addr = kmem_malloc(size, wait); - else - addr = kmem_malloc_domain(domain, size, wait); + policy = (domain == UMA_ANYDOMAIN) ? DOMAINSET_RR() : + DOMAINSET_FIXED(domain); + addr = kmem_malloc_domainset(policy, size, wait); if (addr != 0) { vsetslab(addr, slab); slab->us_data = (void *)addr; Modified: head/sys/vm/vm_extern.h ============================================================================== --- head/sys/vm/vm_extern.h Tue Oct 30 18:20:34 2018 (r339926) +++ head/sys/vm/vm_extern.h Tue Oct 30 18:26:34 2018 (r339927) @@ -44,6 +44,7 @@ struct vmem; #ifdef _KERNEL struct cdev; struct cdevsw; +struct domainset; /* These operate on kernel virtual addresses only. */ vm_offset_t kva_alloc(vm_size_t); @@ -56,16 +57,17 @@ void kmap_free_wakeup(vm_map_t, vm_offset_t, vm_size_t /* These operate on virtual addresses backed by memory. */ vm_offset_t kmem_alloc_attr(vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr); -vm_offset_t kmem_alloc_attr_domain(int domain, vm_size_t size, int flags, - vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr); +vm_offset_t kmem_alloc_attr_domainset(struct domainset *ds, vm_size_t size, + int flags, vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr); vm_offset_t kmem_alloc_contig(vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr); -vm_offset_t kmem_alloc_contig_domain(int domain, vm_size_t size, int flags, - vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, - vm_memattr_t memattr); +vm_offset_t kmem_alloc_contig_domainset(struct domainset *ds, vm_size_t size, + int flags, vm_paddr_t low, vm_paddr_t high, u_long alignment, + vm_paddr_t boundary, vm_memattr_t memattr); vm_offset_t kmem_malloc(vm_size_t size, int flags); -vm_offset_t kmem_malloc_domain(int domain, vm_size_t size, int flags); +vm_offset_t kmem_malloc_domainset(struct domainset *ds, vm_size_t size, + int flags); void kmem_free(vm_offset_t addr, vm_size_t size); /* This provides memory for previously allocated address space. */ Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Tue Oct 30 18:20:34 2018 (r339926) +++ head/sys/vm/vm_kern.c Tue Oct 30 18:26:34 2018 (r339927) @@ -175,7 +175,7 @@ kva_free(vm_offset_t addr, vm_size_t size) * necessarily physically contiguous. If M_ZERO is specified through the * given flags, then the pages are zeroed before they are mapped. */ -vm_offset_t +static vm_offset_t kmem_alloc_attr_domain(int domain, vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr) { @@ -231,11 +231,20 @@ vm_offset_t kmem_alloc_attr(vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr) { + + return (kmem_alloc_attr_domainset(DOMAINSET_RR(), size, flags, low, + high, memattr)); +} + +vm_offset_t +kmem_alloc_attr_domainset(struct domainset *ds, vm_size_t size, int flags, + vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr) +{ struct vm_domainset_iter di; vm_offset_t addr; int domain; - vm_domainset_iter_policy_init(&di, DOMAINSET_RR(), &domain, &flags); + vm_domainset_iter_policy_init(&di, ds, &domain, &flags); do { addr = kmem_alloc_attr_domain(domain, size, flags, low, high, memattr); @@ -254,7 +263,7 @@ kmem_alloc_attr(vm_size_t size, int flags, vm_paddr_t * through the given flags, then the pages are zeroed before they are * mapped. */ -vm_offset_t +static vm_offset_t kmem_alloc_contig_domain(int domain, vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr) @@ -315,11 +324,21 @@ vm_offset_t kmem_alloc_contig(vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr) { + + return (kmem_alloc_contig_domainset(DOMAINSET_RR(), size, flags, low, + high, alignment, boundary, memattr)); +} + +vm_offset_t +kmem_alloc_contig_domainset(struct domainset *ds, vm_size_t size, int flags, + vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, + vm_memattr_t memattr) +{ struct vm_domainset_iter di; vm_offset_t addr; int domain; - vm_domainset_iter_policy_init(&di, DOMAINSET_RR(), &domain, &flags); + vm_domainset_iter_policy_init(&di, ds, &domain, &flags); do { addr = kmem_alloc_contig_domain(domain, size, flags, low, high, alignment, boundary, memattr); @@ -368,11 +387,11 @@ kmem_suballoc(vm_map_t parent, vm_offset_t *min, vm_of } /* - * kmem_malloc: + * kmem_malloc_domain: * * Allocate wired-down pages in the kernel's address space. */ -vm_offset_t +static vm_offset_t kmem_malloc_domain(int domain, vm_size_t size, int flags) { vmem_t *arena; @@ -402,11 +421,18 @@ kmem_malloc_domain(int domain, vm_size_t size, int fla vm_offset_t kmem_malloc(vm_size_t size, int flags) { + + return (kmem_malloc_domainset(DOMAINSET_RR(), size, flags)); +} + +vm_offset_t +kmem_malloc_domainset(struct domainset *ds, vm_size_t size, int flags) +{ struct vm_domainset_iter di; vm_offset_t addr; int domain; - vm_domainset_iter_policy_init(&di, DOMAINSET_RR(), &domain, &flags); + vm_domainset_iter_policy_init(&di, ds, &domain, &flags); do { addr = kmem_malloc_domain(domain, size, flags); if (addr != 0) Modified: head/sys/x86/iommu/busdma_dmar.c ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Tue Oct 30 18:20:34 2018 (r339926) +++ head/sys/x86/iommu/busdma_dmar.c Tue Oct 30 18:26:34 2018 (r339927) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -373,16 +374,16 @@ dmar_bus_dmamap_create(bus_dma_tag_t dmat, int flags, WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s", __func__); tag = (struct bus_dma_tag_dmar *)dmat; - map = malloc_domain(sizeof(*map), M_DMAR_DMAMAP, - tag->common.domain, M_NOWAIT | M_ZERO); + map = malloc_domainset(sizeof(*map), M_DMAR_DMAMAP, + DOMAINSET_PREF(tag->common.domain), M_NOWAIT | M_ZERO); if (map == NULL) { *mapp = NULL; return (ENOMEM); } if (tag->segments == NULL) { - tag->segments = malloc_domain(sizeof(bus_dma_segment_t) * + tag->segments = malloc_domainset(sizeof(bus_dma_segment_t) * tag->common.nsegments, M_DMAR_DMAMAP, - tag->common.domain, M_NOWAIT); + DOMAINSET_PREF(tag->common.domain), M_NOWAIT); if (tag->segments == NULL) { free_domain(map, M_DMAR_DMAMAP); *mapp = NULL; @@ -447,13 +448,13 @@ dmar_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr if (tag->common.maxsize < PAGE_SIZE && tag->common.alignment <= tag->common.maxsize && attr == VM_MEMATTR_DEFAULT) { - *vaddr = malloc_domain(tag->common.maxsize, M_DEVBUF, - tag->common.domain, mflags); + *vaddr = malloc_domainset(tag->common.maxsize, M_DEVBUF, + DOMAINSET_PREF(tag->common.domain), mflags); map->flags |= BUS_DMAMAP_DMAR_MALLOC; } else { - *vaddr = (void *)kmem_alloc_attr_domain(tag->common.domain, - tag->common.maxsize, mflags, 0ul, BUS_SPACE_MAXADDR, - attr); + *vaddr = (void *)kmem_alloc_attr_domainset( + DOMAINSET_PREF(tag->common.domain), tag->common.maxsize, + mflags, 0ul, BUS_SPACE_MAXADDR, attr); map->flags |= BUS_DMAMAP_DMAR_KMEM_ALLOC; } if (*vaddr == NULL) { Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Tue Oct 30 18:20:34 2018 (r339926) +++ head/sys/x86/x86/busdma_bounce.c Tue Oct 30 18:26:34 2018 (r339927) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -294,9 +295,9 @@ bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags error = 0; if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc_domain( + dmat->segments = (bus_dma_segment_t *)malloc_domainset( sizeof(bus_dma_segment_t) * dmat->common.nsegments, - M_DEVBUF, dmat->common.domain, M_NOWAIT); + M_DEVBUF, DOMAINSET_PREF(dmat->common.domain), M_NOWAIT); if (dmat->segments == NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); @@ -317,8 +318,8 @@ bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags } bz = dmat->bounce_zone; - *mapp = (bus_dmamap_t)malloc_domain(sizeof(**mapp), M_DEVBUF, - dmat->common.domain, M_NOWAIT | M_ZERO); + *mapp = (bus_dmamap_t)malloc_domainset(sizeof(**mapp), M_DEVBUF, + DOMAINSET_PREF(dmat->common.domain), M_NOWAIT | M_ZERO); if (*mapp == NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); @@ -411,9 +412,9 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vad *mapp = NULL; if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc_domain( + dmat->segments = (bus_dma_segment_t *)malloc_domainset( sizeof(bus_dma_segment_t) * dmat->common.nsegments, - M_DEVBUF, dmat->common.domain, mflags); + M_DEVBUF, DOMAINSET_PREF(dmat->common.domain), mflags); if (dmat->segments == NULL) { CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->common.flags, ENOMEM); @@ -452,20 +453,21 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vad (dmat->common.alignment <= dmat->common.maxsize) && dmat->common.lowaddr >= ptoa((vm_paddr_t)Maxmem) && attr == VM_MEMATTR_DEFAULT) { - *vaddr = malloc_domain(dmat->common.maxsize, M_DEVBUF, - dmat->common.domain, mflags); + *vaddr = malloc_domainset(dmat->common.maxsize, M_DEVBUF, + DOMAINSET_PREF(dmat->common.domain), mflags); } else if (dmat->common.nsegments >= howmany(dmat->common.maxsize, MIN(dmat->common.maxsegsz, PAGE_SIZE)) && dmat->common.alignment <= PAGE_SIZE && (dmat->common.boundary % PAGE_SIZE) == 0) { /* Page-based multi-segment allocations allowed */ - *vaddr = (void *)kmem_alloc_attr_domain(dmat->common.domain, - dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, - attr); + *vaddr = (void *)kmem_alloc_attr_domainset( + DOMAINSET_PREF(dmat->common.domain), dmat->common.maxsize, + mflags, 0ul, dmat->common.lowaddr, attr); dmat->bounce_flags |= BUS_DMA_KMEM_ALLOC; } else { - *vaddr = (void *)kmem_alloc_contig_domain(dmat->common.domain, - dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, + *vaddr = (void *)kmem_alloc_contig_domainset( + DOMAINSET_PREF(dmat->common.domain), dmat->common.maxsize, + mflags, 0ul, dmat->common.lowaddr, dmat->common.alignment != 0 ? dmat->common.alignment : 1ul, dmat->common.boundary, attr); dmat->bounce_flags |= BUS_DMA_KMEM_ALLOC; @@ -1149,14 +1151,14 @@ alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages) while (numpages > 0) { struct bounce_page *bpage; - bpage = (struct bounce_page *)malloc_domain(sizeof(*bpage), - M_DEVBUF, dmat->common.domain, M_NOWAIT | M_ZERO); + bpage = malloc_domainset(sizeof(*bpage), M_DEVBUF, + DOMAINSET_PREF(dmat->common.domain), M_NOWAIT | M_ZERO); if (bpage == NULL) break; - bpage->vaddr = (vm_offset_t)contigmalloc_domain(PAGE_SIZE, - M_DEVBUF, dmat->common.domain, M_NOWAIT, 0ul, - bz->lowaddr, PAGE_SIZE, 0); + bpage->vaddr = (vm_offset_t)contigmalloc_domainset(PAGE_SIZE, + M_DEVBUF, DOMAINSET_PREF(dmat->common.domain), M_NOWAIT, + 0ul, bz->lowaddr, PAGE_SIZE, 0); if (bpage->vaddr == 0) { free_domain(bpage, M_DEVBUF); break; From owner-svn-src-head@freebsd.org Tue Oct 30 19:45:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08FB110F286A for ; Tue, 30 Oct 2018 19:45:20 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic306-21.consmr.mail.ne1.yahoo.com (sonic306-21.consmr.mail.ne1.yahoo.com [66.163.189.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 788267669D for ; Tue, 30 Oct 2018 19:45:19 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: YsHzZgIVM1k1AXliVA_VUUHXUWqyMqFeEeQwqGJvOvp68alAChgZRZcM3AEH0cq mD0wpTtpoaKlx4tP3QRiCHbMWkTBlPnZMlBCbb_yznpmghKtIUcBVY9L2GcEIQNsl8x9LKp08U_Y qcb8qqT2xr6B0g_A3Pu2pfBU1ePmzq7PKBZNgbtpXimxoa.aLcykjGULZbJlqLeXVOPLxXGiIMvK DPhhv6KxhOGWB1Fikw89ek4ZA4PMU4URpkKVy1FiYXYgOyIhZ5.a8Ajdk7axTHaVM1bMoFn8Pesf XHIyYbxWdidVzxi0UFVqf5d60.kwhf_t6tHyzKWpXpV8L1SZV9zialamaaGdDtD_VBxLgp9Tm_Ov rUy4gfwuuN6l9pgvTuviF7hpVLRErxa2UpD.MJRbyxA3YunhzYeoYLwJBuDbYdfBNB0SUYHIBAz1 4PQjtP2LBWhBhILdihcB6iPmZGJrs7hKlIQ6E5eTa82tRaa2Qbxw7oVVnf4wrEiNF8Flp2h9HVRm oi9kjc05W8KVmaGu2nw02.510It0oN_mVabVvxPd_u8wWBlnPOXF.qQ_H.RYoqhgEX313j79360n HE_3DwRltRyUQTy124xW_khir_nKtwiTCoQ4CNdzeeL4IN5MilsqErBA.ogSi2S2XImUmIRrK8rH h35NeVhPEhkwwjo6zlIj7sopdMkTXYyZZSsxNXdbR0faKfQDSxL9SNEslWn4Ii7W0KJGQk7W7Zim MGfWawMgjXR8..Udpdqzx0D3YPHtynUUwUsDgzGxDJUXVamGkvS0tdP.1Q7v4UfaZ05aNcwwzVAa S.HrM5ynkt38pUmDJ5Wcw9I_hJuQDfAoh3ID.rwpIA90HPzQz3uh8RdudTYnNvupfzCGf3DhY551 o2Xyl995ek6MUfpYZxOmP1dsdvMOdI0y39LZVhIazdtnI23ns5rYhhuKEv6za6eNTWj3g9aUAeYY y_YM5Cbu2hejrfQZGjiyf6tZxM8G0j4GIXW_6op_rZDId8j234lF0Oph03V_0XS6X1FoSMuymig9 2hJMEk6uJSXIFjUEXrF.0woDeByVfHrmizueU394pm8Cz0U.g6CHf Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Tue, 30 Oct 2018 19:45:18 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp407.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 411143cf21f8b22ab1c738ac3be9554c; Tue, 30 Oct 2018 19:45:14 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r339876 - head/libexec/rtld-elf Message-Id: <8E5A5F3A-F1A7-4702-A2F7-65D74CC5B2E5@yahoo.com> Date: Tue, 30 Oct 2018 12:45:13 -0700 To: Konstantin Belousov , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 19:45:20 -0000 Konstantin Belousov kostikbel at gmail.com wrote on Tue Oct 30 18:04:04 UTC 2018 : > On Tue, Oct 30, 2018 at 03:32:40PM +0000, Alexander Richardson wrote: > > On Tue, 30 Oct 2018 at 10:17, Michael Tuexen > > wrote: > > > > > > > On 29. Oct 2018, at 22:08, Alex Richardson wrote: > > > > > > > > Author: arichardson > > > > Date: Mon Oct 29 21:08:02 2018 > > > > New Revision: 339876 > > > > URL: https://svnweb.freebsd.org/changeset/base/339876 > > > > > > > > Log: > > > > rtld: set obj->textsize correctly > > > > > > > > With lld-generated binaries the first PT_LOAD will usually be a = read-only > > > > segment unless you pass --no-rosegment. For those binaries the = textsize is > > > > determined by the next PT_LOAD. To allow both LLD and bfd 2.17 = binaries to > > > > be parsed correctly use the end of the last PT_LOAD that is = marked as > > > > executable instead. > > > > > > > > I noticed that the value was wrong while adding some debug = prints for some rtld > > > > changes for CHERI binaries. `obj->textsize` only seems to be = used by PPC so the > > > > effect is untested. However, the value before was definitely = wrong and the new > > > > result matches the phdrs. > > > I build kernel and world with a revision later than this on a PPC. = Buildword > > > ends up with a world where almost all binaries are segfaulting.... = Especially gdb > > > (but svn, ls or so all segfault). > > > > > > Best regards > > > Michael > >=20 > > This is rather surprising since if anything the range of the icache > > flush should increase rather than decrease after this change. > >=20 > > I can only see this causing a behaviour change if we actually need = to > > flush more than just the executable segments. > > Is it possible that some binary/library contains a non-executable > > segment as the first PT_LOAD? > > Or is there some linker script that adds custom PHDRS? > >=20 > Could it be that there is a hole between start of the object mapping = and > the last PT_LOADable segment eligible for execution ? [This note may be easier to deal with than the first note that I sent out.] [My examples are from devel/powerpc64-xtoolchain-gcc used to buildworld buildkernel targeting a head -r339076 based powerpc64 environment. I do that on powerpc64 as well.] powerpc64 loads the readonly data and the readonly code in one PT_LOAD, the first. The 2nd PT_LOAD is for sections without the readonly status, that includes .got and .plt being spanned. See below from objdump -ph for /bin/ls : Program Header: PHDR off 0x0000000000000040 vaddr 0x0000000010000040 paddr = 0x0000000010000040 align 2**3 filesz 0x0000000000000188 memsz 0x0000000000000188 flags r-- INTERP off 0x00000000000001c8 vaddr 0x00000000100001c8 paddr = 0x00000000100001c8 align 2**0 filesz 0x0000000000000015 memsz 0x0000000000000015 flags r-- LOAD off 0x0000000000000000 vaddr 0x0000000010000000 paddr = 0x0000000010000000 align 2**16 filesz 0x000000000000910c memsz 0x000000000000910c flags r-x LOAD off 0x0000000000009110 vaddr 0x0000000010019110 paddr = 0x0000000010019110 align 2**16 filesz 0x0000000000000ee0 memsz 0x00000000000010e8 flags rw- DYNAMIC off 0x0000000000009138 vaddr 0x0000000010019138 paddr = 0x0000000010019138 align 2**3 filesz 0x00000000000001c0 memsz 0x00000000000001c0 flags rw- NOTE off 0x00000000000001e0 vaddr 0x00000000100001e0 paddr = 0x00000000100001e0 align 2**2 filesz 0x0000000000000030 memsz 0x0000000000000030 flags r-- STACK off 0x0000000000000000 vaddr 0x0000000000000000 paddr = 0x0000000000000000 align 2**4 filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw- Sections: Idx Name Size VMA LMA File off = Algn 0 .interp 00000015 00000000100001c8 00000000100001c8 000001c8 = 2**0 CONTENTS, ALLOC, LOAD, READONLY, DATA 1 .note.tag 00000030 00000000100001e0 00000000100001e0 000001e0 = 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 2 .hash 0000027c 0000000010000210 0000000010000210 00000210 = 2**3 CONTENTS, ALLOC, LOAD, READONLY, DATA 3 .dynsym 00000870 0000000010000490 0000000010000490 00000490 = 2**3 CONTENTS, ALLOC, LOAD, READONLY, DATA 4 .dynstr 0000035a 0000000010000d00 0000000010000d00 00000d00 = 2**0 CONTENTS, ALLOC, LOAD, READONLY, DATA 5 .gnu.version 000000b4 000000001000105a 000000001000105a 0000105a = 2**1 CONTENTS, ALLOC, LOAD, READONLY, DATA 6 .gnu.version_r 00000050 0000000010001110 0000000010001110 = 00001110 2**3 CONTENTS, ALLOC, LOAD, READONLY, DATA 7 .rela.dyn 00000198 0000000010001160 0000000010001160 00001160 = 2**3 CONTENTS, ALLOC, LOAD, READONLY, DATA 8 .rela.plt 000006f0 00000000100012f8 00000000100012f8 000012f8 = 2**3 CONTENTS, ALLOC, LOAD, READONLY, DATA 9 .init 0000002c 00000000100019f0 00000000100019f0 000019f0 = 2**4 CONTENTS, ALLOC, LOAD, READONLY, CODE 10 .text 00007204 0000000010001a20 0000000010001a20 00001a20 = 2**5 CONTENTS, ALLOC, LOAD, READONLY, CODE 11 .fini 00000024 0000000010008c30 0000000010008c30 00008c30 = 2**4 CONTENTS, ALLOC, LOAD, READONLY, CODE 12 .rodata 000004b0 0000000010008c58 0000000010008c58 00008c58 = 2**3 CONTENTS, ALLOC, LOAD, READONLY, DATA 13 .eh_frame 00000004 0000000010009108 0000000010009108 00009108 = 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 14 .ctors 00000010 0000000010019110 0000000010019110 00009110 = 2**3 CONTENTS, ALLOC, LOAD, DATA 15 .dtors 00000010 0000000010019120 0000000010019120 00009120 = 2**3 CONTENTS, ALLOC, LOAD, DATA 16 .jcr 00000008 0000000010019130 0000000010019130 00009130 = 2**3 CONTENTS, ALLOC, LOAD, DATA 17 .dynamic 000001c0 0000000010019138 0000000010019138 00009138 = 2**3 CONTENTS, ALLOC, LOAD, DATA 18 .opd 00000468 00000000100192f8 00000000100192f8 000092f8 = 2**3 CONTENTS, ALLOC, LOAD, DATA 19 .got 00000098 0000000010019800 0000000010019800 00009800 = 2**8 CONTENTS, ALLOC, LOAD, DATA 20 .plt 00000708 0000000010019898 0000000010019898 00009898 = 2**3 ALLOC 21 .data 00000050 0000000010019fa0 0000000010019fa0 00009fa0 = 2**3 CONTENTS, ALLOC, LOAD, DATA 22 .bss 00000208 0000000010019ff0 0000000010019ff0 00009ff0 = 2**3 ALLOC 23 .comment 000002b5 0000000000000000 0000000000000000 00009ff0 = 2**0 CONTENTS, READONLY 24 .gnu_debuglink 00000010 0000000000000000 0000000000000000 = 0000a2a8 2**2 CONTENTS, READONLY Note: elfdump indicates a section before what above is listed as "0 .interp", but the section has sh_name empty and SHT_NULL as elfdump reports it. Also elfdump always shows sh_flags as empty, unlike what objdump reports. section header: entry: 0 sh_name:=20 sh_type: SHT_NULL sh_flags:=20 sh_addr: 0 sh_offset: 0 sh_size: 0 sh_link: 0 sh_info: 0 sh_addralign: 0 sh_entsize: 0 So elfdump "entry" numbers for section headers that have matches in the objdump output are one larger than the section "Idx" objdump lists. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Tue Oct 30 20:08:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5304B10F3521; Tue, 30 Oct 2018 20:08:52 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07BF978139; Tue, 30 Oct 2018 20:08:52 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D82A02229F; Tue, 30 Oct 2018 20:08:51 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9UK8pJZ062094; Tue, 30 Oct 2018 20:08:51 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UK8n5N062082; Tue, 30 Oct 2018 20:08:49 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201810302008.w9UK8n5N062082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 30 Oct 2018 20:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339929 - in head: sbin/ifconfig sys/net sys/netinet sys/netinet6 usr.sbin/ndp usr.sbin/rtadvd X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head: sbin/ifconfig sys/net sys/netinet sys/netinet6 usr.sbin/ndp usr.sbin/rtadvd X-SVN-Commit-Revision: 339929 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 20:08:52 -0000 Author: bz Date: Tue Oct 30 20:08:48 2018 New Revision: 339929 URL: https://svnweb.freebsd.org/changeset/base/339929 Log: Initial implementation of draft-ietf-6man-ipv6only-flag. This change defines the RA "6" (IPv6-Only) flag which routers may advertise, kernel logic to check if all routers on a link have the flag set and accordingly update a per-interface flag. If all routers agree that it is an IPv6-only link, ether_output_frame(), based on the interface flag, will filter out all ETHERTYPE_IP/ARP frames, drop them, and return EAFNOSUPPORT to upper layers. The change also updates ndp to show the "6" flag, ifconfig to display the IPV6_ONLY nd6 flag if set, and rtadvd to allow announcing the flag. Further changes to tcpdump (contrib code) are availble and will be upstreamed. Tested the code (slightly earlier version) with 2 FreeBSD IPv6 routers, a FreeBSD laptop on ethernet as well as wifi, and with Win10 and OSX clients (which did not fall over with the "6" flag set but not understood). We may also want to (a) implement and RX filter, and (b) over time enahnce user space to, say, stop dhclient from running when the interface flag is set. Also we might want to start IPv6 before IPv4 in the future. All the code is hidden under the EXPERIMENTAL option and not compiled by default as the draft is a work-in-progress and we cannot rely on the fact that IANA will assign the bits as requested by the draft and hence they may change. Dear 6man, you have running code. Discussed with: Bob Hinden, Brian E Carpenter Modified: head/sbin/ifconfig/Makefile head/sbin/ifconfig/af_nd6.c head/sys/net/if_ethersubr.c head/sys/netinet/icmp6.h head/sys/netinet6/nd6.h head/sys/netinet6/nd6_rtr.c head/usr.sbin/ndp/Makefile head/usr.sbin/ndp/ndp.c head/usr.sbin/rtadvd/Makefile head/usr.sbin/rtadvd/config.c head/usr.sbin/rtadvd/rtadvd.c head/usr.sbin/rtadvd/rtadvd.h Modified: head/sbin/ifconfig/Makefile ============================================================================== --- head/sbin/ifconfig/Makefile Tue Oct 30 19:10:41 2018 (r339928) +++ head/sbin/ifconfig/Makefile Tue Oct 30 20:08:48 2018 (r339929) @@ -51,6 +51,9 @@ SRCS+= ifpfsync.c # pfsync(4) support SRCS+= ifbridge.c # bridge support SRCS+= iflagg.c # lagg support +.if ${MK_EXPERIMENTAL} != "no" +CFLAGS+= -DDRAFT_IETF_6MAN_IPV6ONLY_FLAG +.endif .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif Modified: head/sbin/ifconfig/af_nd6.c ============================================================================== --- head/sbin/ifconfig/af_nd6.c Tue Oct 30 19:10:41 2018 (r339928) +++ head/sbin/ifconfig/af_nd6.c Tue Oct 30 20:08:48 2018 (r339929) @@ -57,9 +57,17 @@ static const char rcsid[] = #include "ifconfig.h" #define MAX_SYSCTL_TRY 5 +#ifdef DRAFT_IETF_6MAN_IPV6ONLY_FLAG #define ND6BITS "\020\001PERFORMNUD\002ACCEPT_RTADV\003PREFER_SOURCE" \ "\004IFDISABLED\005DONT_SET_IFROUTE\006AUTO_LINKLOCAL" \ + "\007NO_RADR\010NO_PREFER_IFACE\011NO_DAD" \ + "\012IPV6_ONLY" \ + "\020DEFAULTIF" +#else +#define ND6BITS "\020\001PERFORMNUD\002ACCEPT_RTADV\003PREFER_SOURCE" \ + "\004IFDISABLED\005DONT_SET_IFROUTE\006AUTO_LINKLOCAL" \ "\007NO_RADR\010NO_PREFER_IFACE\011NO_DAD\020DEFAULTIF" +#endif static int isnd6defif(int); void setnd6flags(const char *, int, int, const struct afswtch *); Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Tue Oct 30 19:10:41 2018 (r339928) +++ head/sys/net/if_ethersubr.c Tue Oct 30 20:08:48 2018 (r339929) @@ -475,6 +475,26 @@ ether_output_frame(struct ifnet *ifp, struct mbuf *m) return (0); } +#ifdef EXPERIMENTAL +#if defined(INET6) && defined(INET) + /* draft-ietf-6man-ipv6only-flag */ + /* Catch ETHERTYPE_IP, and ETHERTYPE_ARP if we are v6-only. */ + if ((ND_IFINFO(ifp)->flags & ND6_IFF_IPV6_ONLY) != 0) { + struct ether_header *eh; + + eh = mtod(m, struct ether_header *); + switch (ntohs(eh->ether_type)) { + case ETHERTYPE_IP: + case ETHERTYPE_ARP: + m_freem(m); + return (EAFNOSUPPORT); + /* NOTREACHED */ + break; + }; + } +#endif +#endif + /* * Queue message on interface, update output statistics if * successful, and start output if interface not yet active. Modified: head/sys/netinet/icmp6.h ============================================================================== --- head/sys/netinet/icmp6.h Tue Oct 30 19:10:41 2018 (r339928) +++ head/sys/netinet/icmp6.h Tue Oct 30 20:08:48 2018 (r339929) @@ -244,6 +244,10 @@ struct nd_router_advert { /* router advertisement */ #define ND_RA_FLAG_RTPREF_LOW 0x18 /* 00011000 */ #define ND_RA_FLAG_RTPREF_RSV 0x10 /* 00010000 */ +#ifdef EXPERIMENTAL +#define ND_RA_FLAG_IPV6_ONLY 0x02 /* draft-ietf-6man-ipv6only-flag */ +#endif + #define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1] struct nd_neighbor_solicit { /* neighbor solicitation */ Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Tue Oct 30 19:10:41 2018 (r339928) +++ head/sys/netinet6/nd6.h Tue Oct 30 20:08:48 2018 (r339929) @@ -90,6 +90,9 @@ struct nd_ifinfo { #define ND6_IFF_NO_RADR 0x40 #define ND6_IFF_NO_PREFER_IFACE 0x80 /* XXX: not related to ND. */ #define ND6_IFF_NO_DAD 0x100 +#ifdef EXPERIMENTAL +#define ND6_IFF_IPV6_ONLY 0x200 /* draft-ietf-6man-ipv6only-flag */ +#endif #ifdef _KERNEL #define ND_IFINFO(ifp) \ Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Tue Oct 30 19:10:41 2018 (r339928) +++ head/sys/netinet6/nd6_rtr.c Tue Oct 30 20:08:48 2018 (r339929) @@ -204,7 +204,38 @@ nd6_rs_input(struct mbuf *m, int off, int icmp6len) m_freem(m); } +#ifdef EXPERIMENTAL /* + * An initial update routine for draft-ietf-6man-ipv6only-flag. + * We need to iterate over all default routers for the given + * interface to see whether they are all advertising the "6" + * (IPv6-Only) flag. If they do set, otherwise unset, the + * interface flag we later use to filter on. + */ +static void +defrtr_ipv6_only_ifp(struct ifnet *ifp) +{ + struct nd_defrouter *dr; + bool ipv6_only; + + ipv6_only = true; + ND6_RLOCK(); + TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) + if (dr->ifp == ifp && + (dr->raflags & ND_RA_FLAG_IPV6_ONLY) == 0) + ipv6_only = false; + ND6_RUNLOCK(); + + IF_AFDATA_WLOCK(ifp); + if (ipv6_only) + ND_IFINFO(ifp)->flags |= ND6_IFF_IPV6_ONLY; + else + ND_IFINFO(ifp)->flags &= ~ND6_IFF_IPV6_ONLY; + IF_AFDATA_WUNLOCK(ifp); +} +#endif + +/* * Receive Router Advertisement Message. * * Based on RFC 2461 @@ -319,6 +350,9 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) } } dr = defrtrlist_update(&dr0); +#ifdef EXPERIMENTAL + defrtr_ipv6_only_ifp(ifp); +#endif } /* @@ -691,6 +725,10 @@ defrouter_del(struct nd_defrouter *dr) */ if (ND_IFINFO(dr->ifp)->flags & ND6_IFF_ACCEPT_RTADV) rt6_flush(&dr->rtaddr, dr->ifp); + +#ifdef EXPERIMENTAL + defrtr_ipv6_only_ifp(dr->ifp); +#endif if (dr->installed) { deldr = dr; Modified: head/usr.sbin/ndp/Makefile ============================================================================== --- head/usr.sbin/ndp/Makefile Tue Oct 30 19:10:41 2018 (r339928) +++ head/usr.sbin/ndp/Makefile Tue Oct 30 20:08:48 2018 (r339929) @@ -13,6 +13,8 @@ # A PARTICULAR PURPOSE. # $FreeBSD$ +.include + .PATH: ${SRCTOP}/contrib/tcpdump PROG= ndp @@ -21,6 +23,11 @@ SRCS= ndp.c gmt2local.c CFLAGS+= -I. -I${.CURDIR} -I${SRCTOP}/contrib/tcpdump CFLAGS+= -D_U_="" + +.if ${MK_EXPERIMENTAL} != "no" +CFLAGS+= -DEXPERIMENTAL +CFLAGS+= -DDRAFT_IETF_6MAN_IPV6ONLY_FLAG +.endif WARNS?= 3 Modified: head/usr.sbin/ndp/ndp.c ============================================================================== --- head/usr.sbin/ndp/ndp.c Tue Oct 30 19:10:41 2018 (r339928) +++ head/usr.sbin/ndp/ndp.c Tue Oct 30 20:08:48 2018 (r339929) @@ -1096,6 +1096,9 @@ rtrlist() printf(", flags=%s%s", p->flags & ND_RA_FLAG_MANAGED ? "M" : "", p->flags & ND_RA_FLAG_OTHER ? "O" : ""); +#ifdef DRAFT_IETF_6MAN_IPV6ONLY_FLAG + printf("%s", p->flags & ND_RA_FLAG_IPV6_ONLY ? "6" : ""); +#endif rtpref = ((p->flags & ND_RA_FLAG_RTPREF_MASK) >> 3) & 0xff; printf(", pref=%s", rtpref_str[rtpref]); Modified: head/usr.sbin/rtadvd/Makefile ============================================================================== --- head/usr.sbin/rtadvd/Makefile Tue Oct 30 19:10:41 2018 (r339928) +++ head/usr.sbin/rtadvd/Makefile Tue Oct 30 20:08:48 2018 (r339929) @@ -14,10 +14,17 @@ # # $FreeBSD$ +.include + PROG= rtadvd MAN= rtadvd.conf.5 rtadvd.8 SRCS= rtadvd.c rrenum.c advcap.c if.c config.c timer.c timer_subr.c \ control.c control_server.c + +.if ${MK_EXPERIMENTAL} != "no" +CFLAGS+= -DEXPERIMENTAL +CFLAGS+= -DDRAFT_IETF_6MAN_IPV6ONLY_FLAG +.endif LIBADD= util Modified: head/usr.sbin/rtadvd/config.c ============================================================================== --- head/usr.sbin/rtadvd/config.c Tue Oct 30 19:10:41 2018 (r339928) +++ head/usr.sbin/rtadvd/config.c Tue Oct 30 20:08:48 2018 (r339929) @@ -437,6 +437,10 @@ getconfig(struct ifinfo *ifi) } val |= ND_RA_FLAG_RTPREF_LOW; } +#ifdef DRAFT_IETF_6MAN_IPV6ONLY_FLAG + if (strchr(flagstr, '6')) + val |= ND_RA_FLAG_IPV6_ONLY; +#endif } else MAYHAVE(val, "raflags", 0); @@ -452,6 +456,9 @@ getconfig(struct ifinfo *ifi) __func__, rai->rai_rtpref, ifi->ifi_ifname); goto getconfig_free_rai; } +#ifdef DRAFT_IETF_6MAN_IPV6ONLY_FLAG + rai->rai_ipv6onlyflg = val & ND_RA_FLAG_IPV6_ONLY; +#endif MAYHAVE(val, "rltime", rai->rai_maxinterval * 3); if ((uint16_t)val && ((uint16_t)val < rai->rai_maxinterval || @@ -1406,6 +1413,10 @@ make_packet(struct rainfo *rai) rai->rai_managedflg ? ND_RA_FLAG_MANAGED : 0; ra->nd_ra_flags_reserved |= rai->rai_otherflg ? ND_RA_FLAG_OTHER : 0; +#ifdef DRAFT_IETF_6MAN_IPV6ONLY_FLAG + ra->nd_ra_flags_reserved |= + rai->rai_ipv6onlyflg ? ND_RA_FLAG_IPV6_ONLY : 0; +#endif ra->nd_ra_router_lifetime = htons(rai->rai_lifetime); ra->nd_ra_reachable = htonl(rai->rai_reachabletime); ra->nd_ra_retransmit = htonl(rai->rai_retranstimer); Modified: head/usr.sbin/rtadvd/rtadvd.c ============================================================================== --- head/usr.sbin/rtadvd/rtadvd.c Tue Oct 30 19:10:41 2018 (r339928) +++ head/usr.sbin/rtadvd/rtadvd.c Tue Oct 30 20:08:48 2018 (r339929) @@ -1160,6 +1160,19 @@ ra_input(int len, struct nd_router_advert *nra, sizeof(ntopbuf)), on_off[rai->rai_otherflg]); inconsistent++; } +#ifdef DRAFT_IETF_6MAN_IPV6ONLY_FLAG + /* 6 flag */ + if ((nra->nd_ra_flags_reserved & ND_RA_FLAG_IPV6_ONLY) != + rai->rai_ipv6onlyflg) { + syslog(LOG_NOTICE, + "6 flag inconsistent on %s:" + " %s from %s, %s from us", + ifi->ifi_ifname, on_off[!rai->rai_ipv6onlyflg], + inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf, + sizeof(ntopbuf)), on_off[rai->rai_ipv6onlyflg]); + inconsistent++; + } +#endif /* Reachable Time */ reachabletime = ntohl(nra->nd_ra_reachable); if (reachabletime && rai->rai_reachabletime && Modified: head/usr.sbin/rtadvd/rtadvd.h ============================================================================== --- head/usr.sbin/rtadvd/rtadvd.h Tue Oct 30 19:10:41 2018 (r339928) +++ head/usr.sbin/rtadvd/rtadvd.h Tue Oct 30 20:08:48 2018 (r339929) @@ -196,6 +196,9 @@ struct rainfo { uint16_t rai_mininterval; /* MinRtrAdvInterval */ int rai_managedflg; /* AdvManagedFlag */ int rai_otherflg; /* AdvOtherConfigFlag */ +#ifdef DRAFT_IETF_6MAN_IPV6ONLY_FLAG + int rai_ipv6onlyflg; /* AdvIPv6OnlyFlag */ +#endif int rai_rtpref; /* router preference */ uint32_t rai_linkmtu; /* AdvLinkMTU */ From owner-svn-src-head@freebsd.org Tue Oct 30 20:45:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0326610F44E8; Tue, 30 Oct 2018 20:45:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC02D79D31; Tue, 30 Oct 2018 20:45:15 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D17B22952; Tue, 30 Oct 2018 20:45:15 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9UKjFvG082519; Tue, 30 Oct 2018 20:45:15 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UKjFEm082518; Tue, 30 Oct 2018 20:45:15 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201810302045.w9UKjFEm082518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 30 Oct 2018 20:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339930 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 339930 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 20:45:16 -0000 Author: bz Date: Tue Oct 30 20:45:15 2018 New Revision: 339930 URL: https://svnweb.freebsd.org/changeset/base/339930 Log: With more excessive use of modules, more kernel parts working with VIMAGE, and feature richness and global state increasing the 8k of vnet module space are no longer sufficient for people and loading multiple modules, e.g., pf(4) and ipl(4) or ipsec(4) will fail on the second module. Increase the module space to 8 * PAGE_SIZE which should be enough to hold multiple firewalls, ipsec, multicast (as in the old days was a problem), epair, carp, and any kind of other vnet enabled modules. Sadly this is a global byte array part of the vnet_set, so we cannot dynamically change its size; otherwise a TUNABLE would have been a better solution. PR: 228854 Reported by: Ernie Luzar, Marek Zarychta Discussed with: rgrimes on current MFC after: 3 days Modified: head/sys/net/vnet.c Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Tue Oct 30 20:08:48 2018 (r339929) +++ head/sys/net/vnet.c Tue Oct 30 20:45:15 2018 (r339930) @@ -171,7 +171,7 @@ static MALLOC_DEFINE(M_VNET_DATA, "vnet_data", "VNET d * we want the virtualized global variable space to be page-sized, we may * have more space than that in practice. */ -#define VNET_MODMIN 8192 +#define VNET_MODMIN (8 * PAGE_SIZE) #define VNET_SIZE roundup2(VNET_BYTES, PAGE_SIZE) /* From owner-svn-src-head@freebsd.org Tue Oct 30 20:51:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44A5A10F469C; Tue, 30 Oct 2018 20:51:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC4D17A05D; Tue, 30 Oct 2018 20:51:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB8E722985; Tue, 30 Oct 2018 20:51:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9UKp3Gu083626; Tue, 30 Oct 2018 20:51:03 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UKp3JK083624; Tue, 30 Oct 2018 20:51:03 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201810302051.w9UKp3JK083624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 30 Oct 2018 20:51:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339931 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 339931 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 20:51:04 -0000 Author: bz Date: Tue Oct 30 20:51:03 2018 New Revision: 339931 URL: https://svnweb.freebsd.org/changeset/base/339931 Log: As a follow-up to r339930 and various reports implement logging in case we fail during module load because the pcpu or vnet module sections are full. We did return a proper error but not leaving any indication to the user as to what the actual problem was. Even worse, on 12/13 currently we are seeing an unrelated error (ENOSYS instead of ENOSPC, which gets skipped over in kern_linker.c) to be printed which made problem diagnostics even harder. PR: 228854 MFC after: 3 days Modified: head/sys/kern/link_elf.c head/sys/kern/link_elf_obj.c Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Tue Oct 30 20:45:15 2018 (r339930) +++ head/sys/kern/link_elf.c Tue Oct 30 20:51:03 2018 (r339931) @@ -637,8 +637,12 @@ parse_dpcpu(elf_file_t ef) * all per-cpu storage from that. */ ef->pcpu_base = (Elf_Addr)(uintptr_t)dpcpu_alloc(size); - if (ef->pcpu_base == 0) + if (ef->pcpu_base == 0) { + printf("%s: pcpu module space is out of space; " + "cannot allocate %d for %s\n", + __func__, size, ef->lf.pathname); return (ENOSPC); + } memcpy((void *)ef->pcpu_base, (void *)ef->pcpu_start, size); dpcpu_copy((void *)ef->pcpu_base, size); elf_set_add(&set_pcpu_list, ef->pcpu_start, ef->pcpu_stop, @@ -670,8 +674,12 @@ parse_vnet(elf_file_t ef) * all per-vnet storage from that. */ ef->vnet_base = (Elf_Addr)(uintptr_t)vnet_data_alloc(size); - if (ef->vnet_base == 0) + if (ef->vnet_base == 0) { + printf("%s: vnet module space is out of space; " + "cannot allocate %d for %s\n", + __func__, size, ef->lf.pathname); return (ENOSPC); + } memcpy((void *)ef->vnet_base, (void *)ef->vnet_start, size); vnet_data_copy((void *)ef->vnet_base, size); elf_set_add(&set_vnet_list, ef->vnet_start, ef->vnet_stop, Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Tue Oct 30 20:45:15 2018 (r339930) +++ head/sys/kern/link_elf_obj.c Tue Oct 30 20:51:03 2018 (r339931) @@ -368,6 +368,10 @@ link_elf_link_preload(linker_class_t cls, const char * dpcpu = dpcpu_alloc(shdr[i].sh_size); if (dpcpu == NULL) { + printf("%s: pcpu module space is out " + "of space; cannot allocate %ld for " + "%s\n", __func__, shdr[i].sh_size, + filename); error = ENOSPC; goto out; } @@ -382,6 +386,10 @@ link_elf_link_preload(linker_class_t cls, const char * vnet_data = vnet_data_alloc(shdr[i].sh_size); if (vnet_data == NULL) { + printf("%s: vnet module space is out " + "of space; cannot allocate %ld for " + "%s\n", __func__, shdr[i].sh_size, + filename); error = ENOSPC; goto out; } @@ -847,14 +855,28 @@ link_elf_load_file(linker_class_t cls, const char *fil else ef->progtab[pb].name = "<>"; if (ef->progtab[pb].name != NULL && - !strcmp(ef->progtab[pb].name, DPCPU_SETNAME)) + !strcmp(ef->progtab[pb].name, DPCPU_SETNAME)) { ef->progtab[pb].addr = dpcpu_alloc(shdr[i].sh_size); + if (ef->progtab[pb].addr == NULL) { + printf("%s: pcpu module space is out " + "of space; cannot allocate %ld for " + "%s\n", __func__, shdr[i].sh_size, + filename); + } + } #ifdef VIMAGE else if (ef->progtab[pb].name != NULL && - !strcmp(ef->progtab[pb].name, VNET_SETNAME)) + !strcmp(ef->progtab[pb].name, VNET_SETNAME)) { ef->progtab[pb].addr = vnet_data_alloc(shdr[i].sh_size); + if (ef->progtab[pb].addr == NULL) { + printf("%s: vnet module space is out " + "of space; cannot allocate %ld for " + "%s\n", __func__, shdr[i].sh_size, + filename); + } + } #endif else ef->progtab[pb].addr = From owner-svn-src-head@freebsd.org Tue Oct 30 21:24:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8224510F503E for ; Tue, 30 Oct 2018 21:24:04 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-yw1-f45.google.com (mail-yw1-f45.google.com [209.85.161.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 15FB17B08F for ; Tue, 30 Oct 2018 21:24:03 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-yw1-f45.google.com with SMTP id f192-v6so3960764ywh.7 for ; Tue, 30 Oct 2018 14:24:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9FQsFKmqZgc2PjGoXyxS+yCjcFUgRLJ0hlnVD8vZJ5E=; b=XEd8vhMqinrbHP2WeYmV29RqIXSiNMCh2Xg8e8zQKC8xfDrv8ZJXvm5TXkrKgC9PZ4 6OX1GNKR2148JDMo8Rzjpb1bfzvQI8/o9uFa/CwakBPuOie9Rn1ETECO/lhOcMmbO+t5 EJ5DOMgoplrShfrmifCPVHN2QdqBGc4Zjg3jIqfnloPjy0mhIODVbah+EhQ/9cfzss4K 6a5cZTIU7GN3+K6umMaAfyznYMLODPhRbr4wiJHYt//yA9N5e0S0L2hCq5gIRK2fmwpG TpgeNEFxMmic+i1V7OX6xKNReAz8ik8k2ZlC29x1VzyBeWIEQjBdRm1Vv90e2DjkpxSI OTSw== X-Gm-Message-State: AGRZ1gLsRnrQyXuPhQhsf7gWYCbtkKaUoeCsigRUBzRWr+w2C7Oe/aDo tIf5S9CqgOV+CvIY0r2KA9Nk1M/9M54= X-Google-Smtp-Source: AJdET5cWy9/9CpcPiUkxtEgNQvt54tDdbrh9fuj2ZG+kqbffnxd5pu28Be/bBRpGloLHXOZTZdx2yw== X-Received: by 2002:a0d:c306:: with SMTP id f6-v6mr450475ywd.356.1540934636953; Tue, 30 Oct 2018 14:23:56 -0700 (PDT) Received: from mail-yb1-f176.google.com (mail-yb1-f176.google.com. [209.85.219.176]) by smtp.gmail.com with ESMTPSA id 206-v6sm3268021ywy.104.2018.10.30.14.23.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Oct 2018 14:23:56 -0700 (PDT) Received: by mail-yb1-f176.google.com with SMTP id i78-v6so5712212ybg.0 for ; Tue, 30 Oct 2018 14:23:56 -0700 (PDT) X-Received: by 2002:a25:888d:: with SMTP id d13-v6mr476470ybl.74.1540934636264; Tue, 30 Oct 2018 14:23:56 -0700 (PDT) MIME-Version: 1.0 References: <7DC6D9C4-C153-4BCE-851C-22C890AB0D73@yahoo.com> In-Reply-To: <7DC6D9C4-C153-4BCE-851C-22C890AB0D73@yahoo.com> From: Alexander Richardson Date: Tue, 30 Oct 2018 21:23:45 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r339876 - head/libexec/rtld-elf To: marklmi26-fbsd@yahoo.com Cc: svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 21:24:04 -0000 On Tue, 30 Oct 2018 at 18:19, Mark Millard wrote: > > Alexander Richardson arichardson at freebsd.org wrote on > Tue Oct 30 15:33:00 UTC 2018 : > > > On Tue, 30 Oct 2018 at 10:17, Michael Tuexen > > wrote: > > > > > > > On 29. Oct 2018, at 22:08, Alex Richardson wrote: > > > > > > > > Author: arichardson > > > > Date: Mon Oct 29 21:08:02 2018 > > > > New Revision: 339876 > > > > URL: https://svnweb.freebsd.org/changeset/base/339876 > > > > > > > > Log: > > > > rtld: set obj->textsize correctly > > > > > > > > With lld-generated binaries the first PT_LOAD will usually be a read-only > > > > segment unless you pass --no-rosegment. For those binaries the textsize is > > > > determined by the next PT_LOAD. To allow both LLD and bfd 2.17 binaries to > > > > be parsed correctly use the end of the last PT_LOAD that is marked as > > > > executable instead. > > > > > > > > I noticed that the value was wrong while adding some debug prints for some rtld > > > > changes for CHERI binaries. `obj->textsize` only seems to be used by PPC so the > > > > effect is untested. However, the value before was definitely wrong and the new > > > > result matches the phdrs. > > > I build kernel and world with a revision later than this on a PPC. Buildword > > > ends up with a world where almost all binaries are segfaulting.... Especially gdb > > > (but svn, ls or so all segfault). > > > > > > Best regards > > > Michael > > > > This is rather surprising since if anything the range of the icache > > flush should increase rather than decrease after this change. > > > > I can only see this causing a behaviour change if we actually need to > > flush more than just the executable segments. > > Is it possible that some binary/library contains a non-executable > > segment as the first PT_LOAD? > > Or is there some linker script that adds custom PHDRS? > > The following is based on using devel/powerpc64-xtoolchain-gcc > to buildworld buildkernel on/for powerpc64. (I experiment with > using fairly modern tools to target powerpc64 and powerpc.) > The build context is head -r339076 based, both for what > did the build and for what it was building. > > I report from both elfdump and objdump output > because each seems to have some oddities in what > it outputs. > > I start with elfdump (which leaves sh_flags blank > and shows a section header with sh_name empty > that objdump does not list at all): > > # elfdump -pc /bin/ls | less > > program header: > > entry: 0 > p_type: PT_PHDR > p_offset: 64 > p_vaddr: 0x10000040 > p_paddr: 0x10000040 > p_filesz: 392 > p_memsz: 392 > p_flags: PF_R > p_align: 8 > > entry: 1 > p_type: PT_INTERP > p_offset: 456 > p_vaddr: 0x100001c8 > p_paddr: 0x100001c8 > p_filesz: 21 > p_memsz: 21 > p_flags: PF_R > p_align: 1 > > entry: 2 > p_type: PT_LOAD > p_offset: 0 > p_vaddr: 0x10000000 > p_paddr: 0x10000000 > p_filesz: 37132 > p_memsz: 37132 > p_flags: PF_X|PF_R > p_align: 65536 > > entry: 3 > p_type: PT_LOAD > p_offset: 37136 > p_vaddr: 0x10019110 > p_paddr: 0x10019110 > p_filesz: 3808 > p_memsz: 4328 > p_flags: PF_W|PF_R > p_align: 65536 > > entry: 4 > p_type: PT_DYNAMIC > p_offset: 37176 > p_vaddr: 0x10019138 > p_paddr: 0x10019138 > p_filesz: 448 > p_memsz: 448 > p_flags: PF_W|PF_R > p_align: 8 > > entry: 5 > p_type: PT_NOTE > p_offset: 480 > p_vaddr: 0x100001e0 > p_paddr: 0x100001e0 > p_filesz: 48 > p_memsz: 48 > p_flags: PF_R > p_align: 4 > > entry: 6 > p_type: PT_LOAD > p_offset: 0 > p_vaddr: 0 > p_paddr: 0 > p_filesz: 0 > p_memsz: 0 > p_flags: PF_W|PF_R > p_align: 16 > > section header: > > entry: 0 > sh_name: > sh_type: SHT_NULL > sh_flags: > sh_addr: 0 > sh_offset: 0 > sh_size: 0 > sh_link: 0 > sh_info: 0 > sh_addralign: 0 > sh_entsize: 0 > > entry: 1 > sh_name: .interp > sh_type: SHT_PROGBITS > sh_flags: > sh_addr: 0x100001c8 > sh_offset: 456 > sh_size: 21 > sh_link: 0 > sh_info: 0 > sh_addralign: 1 > sh_entsize: 0 > > entry: 2 > sh_name: .note.tag > sh_type: SHT_NOTE > sh_flags: > sh_addr: 0x100001e0 > sh_offset: 480 > sh_size: 48 > sh_link: 0 > sh_info: 0 > sh_addralign: 4 > sh_entsize: 0 > > entry: 3 > sh_name: .hash > sh_type: SHT_HASH > sh_flags: > sh_addr: 0x10000210 > sh_offset: 528 > sh_size: 636 > sh_link: 4 > sh_info: 0 > sh_addralign: 8 > sh_entsize: 4 > > entry: 4 > sh_name: .dynsym > sh_type: SHT_DYNSYM > sh_flags: > sh_addr: 0x10000490 > sh_offset: 1168 > sh_size: 2160 > sh_link: 5 > sh_info: 1 > sh_addralign: 8 > sh_entsize: 24 > > entry: 5 > sh_name: .dynstr > sh_type: SHT_STRTAB > sh_flags: > sh_addr: 0x10000d00 > sh_offset: 3328 > sh_size: 858 > sh_link: 0 > sh_info: 0 > sh_addralign: 1 > sh_entsize: 0 > > entry: 6 > sh_name: .gnu.version > sh_type: SHT_SUNW(GNU)_versym > sh_flags: > sh_addr: 0x1000105a > sh_offset: 4186 > sh_size: 180 > sh_link: 4 > sh_info: 0 > sh_addralign: 2 > sh_entsize: 2 > > entry: 7 > sh_name: .gnu.version_r > sh_type: SHT_SUNW(GNU)_verneed > sh_flags: > sh_addr: 0x10001110 > sh_offset: 4368 > sh_size: 80 > sh_link: 5 > sh_info: 1 > sh_addralign: 8 > sh_entsize: 0 > > entry: 8 > sh_name: .rela.dyn > sh_type: SHT_RELA > sh_flags: > sh_addr: 0x10001160 > sh_offset: 4448 > sh_size: 408 > sh_link: 4 > sh_info: 0 > sh_addralign: 8 > sh_entsize: 24 > > entry: 9 > sh_name: .rela.plt > sh_type: SHT_RELA > sh_flags: > sh_addr: 0x100012f8 > sh_offset: 4856 > sh_size: 1776 > sh_link: 4 > sh_info: 21 > sh_addralign: 8 > sh_entsize: 24 > > entry: 10 > sh_name: .init > sh_type: SHT_PROGBITS > sh_flags: > sh_addr: 0x100019f0 > sh_offset: 6640 > sh_size: 44 > sh_link: 0 > sh_info: 0 > sh_addralign: 16 > sh_entsize: 0 > > entry: 11 > sh_name: .text > sh_type: SHT_PROGBITS > sh_flags: > sh_addr: 0x10001a20 > sh_offset: 6688 > sh_size: 29188 > sh_link: 0 > sh_info: 0 > sh_addralign: 32 > sh_entsize: 0 > > entry: 12 > sh_name: .fini > sh_type: SHT_PROGBITS > sh_flags: > sh_addr: 0x10008c30 > sh_offset: 35888 > sh_size: 36 > sh_link: 0 > sh_info: 0 > sh_addralign: 16 > sh_entsize: 0 > > entry: 13 > sh_name: .rodata > sh_type: SHT_PROGBITS > sh_flags: > sh_addr: 0x10008c58 > sh_offset: 35928 > sh_size: 1200 > sh_link: 0 > sh_info: 0 > sh_addralign: 8 > sh_entsize: 0 > > entry: 14 > sh_name: .eh_frame > sh_type: SHT_PROGBITS > sh_flags: > sh_addr: 0x10009108 > sh_offset: 37128 > sh_size: 4 > sh_link: 0 > sh_info: 0 > sh_addralign: 4 > sh_entsize: 0 > > entry: 15 > sh_name: .ctors > sh_type: SHT_PROGBITS > sh_flags: > sh_addr: 0x10019110 > sh_offset: 37136 > sh_size: 16 > sh_link: 0 > sh_info: 0 > sh_addralign: 8 > sh_entsize: 0 > > entry: 16 > sh_name: .dtors > sh_type: SHT_PROGBITS > sh_flags: > sh_addr: 0x10019120 > sh_offset: 37152 > sh_size: 16 > sh_link: 0 > sh_info: 0 > sh_addralign: 8 > sh_entsize: 0 > > entry: 17 > sh_name: .jcr > sh_type: SHT_PROGBITS > sh_flags: > sh_addr: 0x10019130 > sh_offset: 37168 > sh_size: 8 > sh_link: 0 > sh_info: 0 > sh_addralign: 8 > sh_entsize: 0 > > entry: 18 > sh_name: .dynamic > sh_type: SHT_DYNAMIC > sh_flags: > sh_addr: 0x10019138 > sh_offset: 37176 > sh_size: 448 > sh_link: 5 > sh_info: 0 > sh_addralign: 8 > sh_entsize: 16 > > entry: 19 > sh_name: .opd > sh_type: SHT_PROGBITS > sh_flags: > sh_addr: 0x100192f8 > sh_offset: 37624 > sh_size: 1128 > sh_link: 0 > sh_info: 0 > sh_addralign: 8 > sh_entsize: 0 > > entry: 20 > sh_name: .got > sh_type: SHT_PROGBITS > sh_flags: > sh_addr: 0x10019800 > sh_offset: 38912 > sh_size: 152 > sh_link: 0 > sh_info: 0 > sh_addralign: 256 > sh_entsize: 8 > > entry: 21 > sh_name: .plt > sh_type: SHT_NOBITS > sh_flags: > sh_addr: 0x10019898 > sh_offset: 39064 > sh_size: 1800 > sh_link: 0 > sh_info: 0 > sh_addralign: 8 > sh_entsize: 24 > > entry: 22 > sh_name: .data > sh_type: SHT_PROGBITS > sh_flags: > sh_addr: 0x10019fa0 > sh_offset: 40864 > sh_size: 80 > sh_link: 0 > sh_info: 0 > sh_addralign: 8 > sh_entsize: 0 > > entry: 23 > sh_name: .bss > sh_type: SHT_NOBITS > sh_flags: > sh_addr: 0x10019ff0 > sh_offset: 40944 > sh_size: 520 > sh_link: 0 > sh_info: 0 > sh_addralign: 8 > sh_entsize: 0 > > entry: 24 > sh_name: .comment > sh_type: SHT_PROGBITS > sh_flags: > sh_addr: 0 > sh_offset: 40944 > sh_size: 693 > sh_link: 0 > sh_info: 0 > sh_addralign: 1 > sh_entsize: 1 > > entry: 25 > sh_name: .gnu_debuglink > sh_type: SHT_PROGBITS > sh_flags: > sh_addr: 0 > sh_offset: 41640 > sh_size: 16 > sh_link: 0 > sh_info: 0 > sh_addralign: 4 > sh_entsize: 0 > > entry: 26 > sh_name: .shstrtab > sh_type: SHT_STRTAB > sh_flags: > sh_addr: 0 > sh_offset: 41656 > sh_size: 208 > sh_link: 0 > sh_info: 0 > sh_addralign: 1 > sh_entsize: 0 > > As for objdump on the same file (section > one less than elfdump listed, no empty sh_name > section listed): > > # objdump -ph /bin/ls | less > > /bin/ls: file format elf64-powerpc-freebsd > > Program Header: > PHDR off 0x0000000000000040 vaddr 0x0000000010000040 paddr 0x0000000010000040 align 2**3 > filesz 0x0000000000000188 memsz 0x0000000000000188 flags r-- > INTERP off 0x00000000000001c8 vaddr 0x00000000100001c8 paddr 0x00000000100001c8 align 2**0 > filesz 0x0000000000000015 memsz 0x0000000000000015 flags r-- > LOAD off 0x0000000000000000 vaddr 0x0000000010000000 paddr 0x0000000010000000 align 2**16 > filesz 0x000000000000910c memsz 0x000000000000910c flags r-x > LOAD off 0x0000000000009110 vaddr 0x0000000010019110 paddr 0x0000000010019110 align 2**16 > filesz 0x0000000000000ee0 memsz 0x00000000000010e8 flags rw- > DYNAMIC off 0x0000000000009138 vaddr 0x0000000010019138 paddr 0x0000000010019138 align 2**3 > filesz 0x00000000000001c0 memsz 0x00000000000001c0 flags rw- > NOTE off 0x00000000000001e0 vaddr 0x00000000100001e0 paddr 0x00000000100001e0 align 2**2 > filesz 0x0000000000000030 memsz 0x0000000000000030 flags r-- > STACK off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**4 > filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw- > > Dynamic Section: > NEEDED libutil.so.9 > NEEDED libncursesw.so.8 > NEEDED libc.so.7 > INIT 0x0000000010019328 > FINI 0x0000000010019340 > HASH 0x0000000010000210 > STRTAB 0x0000000010000d00 > SYMTAB 0x0000000010000490 > STRSZ 0x000000000000035a > SYMENT 0x0000000000000018 > DEBUG 0x0000000000000000 > PLTGOT 0x0000000010019898 > PLTRELSZ 0x00000000000006f0 > PLTREL 0x0000000000000007 > JMPREL 0x00000000100012f8 > 0x70000000 0x00000000100089b4 > RELA 0x0000000010001160 > RELASZ 0x0000000000000198 > RELAENT 0x0000000000000018 > VERNEED 0x0000000010001110 > VERNEEDNUM 0x0000000000000001 > VERSYM 0x000000001000105a > > Version References: > required from libc.so.7: > 0x077a28b3 0x00 05 FBSD_1.3 > 0x077a28b1 0x00 04 FBSD_1.1 > 0x077a28b5 0x00 03 FBSD_1.5 > 0x077a28b0 0x00 02 FBSD_1.0 > private flags = 0x1: [abiv1] > > Sections: > Idx Name Size VMA LMA File off Algn > 0 .interp 00000015 00000000100001c8 00000000100001c8 000001c8 2**0 > CONTENTS, ALLOC, LOAD, READONLY, DATA > 1 .note.tag 00000030 00000000100001e0 00000000100001e0 000001e0 2**2 > CONTENTS, ALLOC, LOAD, READONLY, DATA > 2 .hash 0000027c 0000000010000210 0000000010000210 00000210 2**3 > CONTENTS, ALLOC, LOAD, READONLY, DATA > 3 .dynsym 00000870 0000000010000490 0000000010000490 00000490 2**3 > CONTENTS, ALLOC, LOAD, READONLY, DATA > 4 .dynstr 0000035a 0000000010000d00 0000000010000d00 00000d00 2**0 > CONTENTS, ALLOC, LOAD, READONLY, DATA > 5 .gnu.version 000000b4 000000001000105a 000000001000105a 0000105a 2**1 > CONTENTS, ALLOC, LOAD, READONLY, DATA > 6 .gnu.version_r 00000050 0000000010001110 0000000010001110 00001110 2**3 > CONTENTS, ALLOC, LOAD, READONLY, DATA > 7 .rela.dyn 00000198 0000000010001160 0000000010001160 00001160 2**3 > CONTENTS, ALLOC, LOAD, READONLY, DATA > 8 .rela.plt 000006f0 00000000100012f8 00000000100012f8 000012f8 2**3 > CONTENTS, ALLOC, LOAD, READONLY, DATA > 9 .init 0000002c 00000000100019f0 00000000100019f0 000019f0 2**4 > CONTENTS, ALLOC, LOAD, READONLY, CODE > 10 .text 00007204 0000000010001a20 0000000010001a20 00001a20 2**5 > CONTENTS, ALLOC, LOAD, READONLY, CODE > 11 .fini 00000024 0000000010008c30 0000000010008c30 00008c30 2**4 > CONTENTS, ALLOC, LOAD, READONLY, CODE > 12 .rodata 000004b0 0000000010008c58 0000000010008c58 00008c58 2**3 > CONTENTS, ALLOC, LOAD, READONLY, DATA > 13 .eh_frame 00000004 0000000010009108 0000000010009108 00009108 2**2 > CONTENTS, ALLOC, LOAD, READONLY, DATA > 14 .ctors 00000010 0000000010019110 0000000010019110 00009110 2**3 > CONTENTS, ALLOC, LOAD, DATA > 15 .dtors 00000010 0000000010019120 0000000010019120 00009120 2**3 > CONTENTS, ALLOC, LOAD, DATA > 16 .jcr 00000008 0000000010019130 0000000010019130 00009130 2**3 > CONTENTS, ALLOC, LOAD, DATA > 17 .dynamic 000001c0 0000000010019138 0000000010019138 00009138 2**3 > CONTENTS, ALLOC, LOAD, DATA > 18 .opd 00000468 00000000100192f8 00000000100192f8 000092f8 2**3 > CONTENTS, ALLOC, LOAD, DATA > 19 .got 00000098 0000000010019800 0000000010019800 00009800 2**8 > CONTENTS, ALLOC, LOAD, DATA > 20 .plt 00000708 0000000010019898 0000000010019898 00009898 2**3 > ALLOC > 21 .data 00000050 0000000010019fa0 0000000010019fa0 00009fa0 2**3 > CONTENTS, ALLOC, LOAD, DATA > 22 .bss 00000208 0000000010019ff0 0000000010019ff0 00009ff0 2**3 > ALLOC > 23 .comment 000002b5 0000000000000000 0000000000000000 00009ff0 2**0 > CONTENTS, READONLY > 24 .gnu_debuglink 00000010 0000000000000000 0000000000000000 0000a2a8 2**2 > CONTENTS, READONLY > > The first PT_LOAD is also executable so there will be no be behaviour change. It must be one of the library dependencies that is different. The difference in section headers output doesn't matter here since all that RTLD looks at is the PHDRS. Alex From owner-svn-src-head@freebsd.org Tue Oct 30 21:32:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2085F10F5533 for ; Tue, 30 Oct 2018 21:32:18 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic308-11.consmr.mail.ne1.yahoo.com (sonic308-11.consmr.mail.ne1.yahoo.com [66.163.187.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D002C7B8EC for ; Tue, 30 Oct 2018 21:32:17 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: nx8yMmIVM1nzgXfoZ69v6mEWjQtZaUd_FqDSfn9qOk1DVysumQueVDIh0AQggT2 L6bVKC3uA7gvi6GRv8APJVclU_mZ.zAe8IBQsXobLLkWmHaWfC1sBNv9q9C8q9b9GQQ8DX7SWpg2 lLTiWTNAEuFF2JEyAxciexv4Ir_uem5k1oUbbPKVpjHSMBMDakpBSxdHF6wBgWwaTDQE.M1drJ5C Vf7HgeEJquY2oIud_pRyGwVd5qwCg7hrf6JenXbhKc7G1xj._z6UukvggdCYIfxIhEDJDhwV_Rl. t1hZGGcqeQ8oPpE6iOdB6ErkVcdKflXmpk6RN2xT2h0d7MkuOjSMt2aVqT.X70NLA5bNL0llSC7S KPpEOj4UYDeXMFNL7znhlnbaQDaaojZMfygpsyVSewQnirRrR5CAFr9qdWJsIcc3ikBxrP0e.Se5 KwsPhlyUq8p80mVHPsz96h_K3AALVGEjpTQ3W7I5ydc5azCaBR.UHQRwnsY2Fkii8mb92y6K.cl5 CxSdxl1R0faaM3iXdZB4juWR_koivwp3sD5u6PS0.X_LN6vfAMKOoCyQQHZZxqLM2He.gebOcNfP YG9NVylyxaEptdeUFkICLsDwp5uWVscdAsyvjcMHwqj0uMcmOf6ohlFzGqoohh0B5rM8ZoeTfz9p n1kY8tH.G78oLprEvFbVvhSGz.Q7YPL7ju.7i9sWTGRnrF4pyji3oqcg2JS23kaIoDyse5iRULWO QtCeWavOH.YCcoR_0WjqkwQpNMrkj6mJ5e9nU5pHx8pCgkdzsMlbWdp0rU0OkcuN7raeDyH10qxF _vTSwFISR.EQq08aNHS1ZfRUgmL3zljPoJLhkA4UcAl3rg8etzUwLex5fqtpwBqa4tQmfg_v255n vJ0QoIve4etE4MxuNrVOLCMHLW5Oyc1iG_APM41o4IoZu04WTqsRitz9n7nbkRGueUVD7mvBpuS8 mhV64mlNyKyDUvBYig5dzycyAZXuPn6I1PkU8Ub.1o9kLfqQ4JMLk.lPHYQvXJkU7AlElUVfC06L f5loTLdPL4agzqvMfDv5cdyWxnX_dLv8t_M2fk2ECHBQt7n1jvuo1 Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.ne1.yahoo.com with HTTP; Tue, 30 Oct 2018 21:32:16 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp404.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID db851d29825de84d9bb4aef54f4d11db; Tue, 30 Oct 2018 21:32:11 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r339876 - head/libexec/rtld-elf From: Mark Millard In-Reply-To: Date: Tue, 30 Oct 2018 14:32:10 -0700 Cc: svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <7DC6D9C4-C153-4BCE-851C-22C890AB0D73@yahoo.com> To: Alexander Richardson X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 21:32:18 -0000 On 2018-Oct-30, at 2:23 PM, Alexander Richardson wrote: > On Tue, 30 Oct 2018 at 18:19, Mark Millard wrote: >>=20 >> Alexander Richardson arichardson at freebsd.org wrote on >> Tue Oct 30 15:33:00 UTC 2018 : >>=20 >>> On Tue, 30 Oct 2018 at 10:17, Michael Tuexen >>> wrote: >>>>=20 >>>>> On 29. Oct 2018, at 22:08, Alex Richardson wrote: >>>>>=20 >>>>> Author: arichardson >>>>> Date: Mon Oct 29 21:08:02 2018 >>>>> New Revision: 339876 >>>>> URL: https://svnweb.freebsd.org/changeset/base/339876 >>>>>=20 >>>>> Log: >>>>> rtld: set obj->textsize correctly >>>>>=20 >>>>> With lld-generated binaries the first PT_LOAD will usually be a = read-only >>>>> segment unless you pass --no-rosegment. For those binaries the = textsize is >>>>> determined by the next PT_LOAD. To allow both LLD and bfd 2.17 = binaries to >>>>> be parsed correctly use the end of the last PT_LOAD that is marked = as >>>>> executable instead. >>>>>=20 >>>>> I noticed that the value was wrong while adding some debug prints = for some rtld >>>>> changes for CHERI binaries. `obj->textsize` only seems to be used = by PPC so the >>>>> effect is untested. However, the value before was definitely wrong = and the new >>>>> result matches the phdrs. >>>> I build kernel and world with a revision later than this on a PPC. = Buildword >>>> ends up with a world where almost all binaries are segfaulting.... = Especially gdb >>>> (but svn, ls or so all segfault). >>>>=20 >>>> Best regards >>>> Michael >>>=20 >>> This is rather surprising since if anything the range of the icache >>> flush should increase rather than decrease after this change. >>>=20 >>> I can only see this causing a behaviour change if we actually need = to >>> flush more than just the executable segments. >>> Is it possible that some binary/library contains a non-executable >>> segment as the first PT_LOAD? >>> Or is there some linker script that adds custom PHDRS? >>=20 >> The following is based on using devel/powerpc64-xtoolchain-gcc >> to buildworld buildkernel on/for powerpc64. (I experiment with >> using fairly modern tools to target powerpc64 and powerpc.) >> The build context is head -r339076 based, both for what >> did the build and for what it was building. >>=20 >> I report from both elfdump and objdump output >> because each seems to have some oddities in what >> it outputs. >>=20 >> I start with elfdump (which leaves sh_flags blank >> and shows a section header with sh_name empty >> that objdump does not list at all): >>=20 >> # elfdump -pc /bin/ls | less >>=20 >> . . . >>=20 >> As for objdump on the same file (section >> one less than elfdump listed, no empty sh_name >> section listed): >>=20 >> # objdump -ph /bin/ls | less >>=20 >> /bin/ls: file format elf64-powerpc-freebsd >>=20 >> Program Header: >> PHDR off 0x0000000000000040 vaddr 0x0000000010000040 paddr = 0x0000000010000040 align 2**3 >> filesz 0x0000000000000188 memsz 0x0000000000000188 flags r-- >> INTERP off 0x00000000000001c8 vaddr 0x00000000100001c8 paddr = 0x00000000100001c8 align 2**0 >> filesz 0x0000000000000015 memsz 0x0000000000000015 flags r-- >> LOAD off 0x0000000000000000 vaddr 0x0000000010000000 paddr = 0x0000000010000000 align 2**16 >> filesz 0x000000000000910c memsz 0x000000000000910c flags r-x >> LOAD off 0x0000000000009110 vaddr 0x0000000010019110 paddr = 0x0000000010019110 align 2**16 >> filesz 0x0000000000000ee0 memsz 0x00000000000010e8 flags rw- >> DYNAMIC off 0x0000000000009138 vaddr 0x0000000010019138 paddr = 0x0000000010019138 align 2**3 >> filesz 0x00000000000001c0 memsz 0x00000000000001c0 flags rw- >> NOTE off 0x00000000000001e0 vaddr 0x00000000100001e0 paddr = 0x00000000100001e0 align 2**2 >> filesz 0x0000000000000030 memsz 0x0000000000000030 flags r-- >> STACK off 0x0000000000000000 vaddr 0x0000000000000000 paddr = 0x0000000000000000 align 2**4 >> filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw- >>=20 >> Dynamic Section: >> NEEDED libutil.so.9 >> NEEDED libncursesw.so.8 >> NEEDED libc.so.7 >> INIT 0x0000000010019328 >> FINI 0x0000000010019340 >> HASH 0x0000000010000210 >> STRTAB 0x0000000010000d00 >> SYMTAB 0x0000000010000490 >> STRSZ 0x000000000000035a >> SYMENT 0x0000000000000018 >> DEBUG 0x0000000000000000 >> PLTGOT 0x0000000010019898 >> PLTRELSZ 0x00000000000006f0 >> PLTREL 0x0000000000000007 >> JMPREL 0x00000000100012f8 >> 0x70000000 0x00000000100089b4 >> RELA 0x0000000010001160 >> RELASZ 0x0000000000000198 >> RELAENT 0x0000000000000018 >> VERNEED 0x0000000010001110 >> VERNEEDNUM 0x0000000000000001 >> VERSYM 0x000000001000105a >>=20 >> Version References: >> required from libc.so.7: >> 0x077a28b3 0x00 05 FBSD_1.3 >> 0x077a28b1 0x00 04 FBSD_1.1 >> 0x077a28b5 0x00 03 FBSD_1.5 >> 0x077a28b0 0x00 02 FBSD_1.0 >> private flags =3D 0x1: [abiv1] >>=20 >> Sections: >> Idx Name Size VMA LMA File = off Algn >> 0 .interp 00000015 00000000100001c8 00000000100001c8 = 000001c8 2**0 >> CONTENTS, ALLOC, LOAD, READONLY, DATA >> 1 .note.tag 00000030 00000000100001e0 00000000100001e0 = 000001e0 2**2 >> CONTENTS, ALLOC, LOAD, READONLY, DATA >> 2 .hash 0000027c 0000000010000210 0000000010000210 = 00000210 2**3 >> CONTENTS, ALLOC, LOAD, READONLY, DATA >> 3 .dynsym 00000870 0000000010000490 0000000010000490 = 00000490 2**3 >> CONTENTS, ALLOC, LOAD, READONLY, DATA >> 4 .dynstr 0000035a 0000000010000d00 0000000010000d00 = 00000d00 2**0 >> CONTENTS, ALLOC, LOAD, READONLY, DATA >> 5 .gnu.version 000000b4 000000001000105a 000000001000105a = 0000105a 2**1 >> CONTENTS, ALLOC, LOAD, READONLY, DATA >> 6 .gnu.version_r 00000050 0000000010001110 0000000010001110 = 00001110 2**3 >> CONTENTS, ALLOC, LOAD, READONLY, DATA >> 7 .rela.dyn 00000198 0000000010001160 0000000010001160 = 00001160 2**3 >> CONTENTS, ALLOC, LOAD, READONLY, DATA >> 8 .rela.plt 000006f0 00000000100012f8 00000000100012f8 = 000012f8 2**3 >> CONTENTS, ALLOC, LOAD, READONLY, DATA >> 9 .init 0000002c 00000000100019f0 00000000100019f0 = 000019f0 2**4 >> CONTENTS, ALLOC, LOAD, READONLY, CODE >> 10 .text 00007204 0000000010001a20 0000000010001a20 = 00001a20 2**5 >> CONTENTS, ALLOC, LOAD, READONLY, CODE >> 11 .fini 00000024 0000000010008c30 0000000010008c30 = 00008c30 2**4 >> CONTENTS, ALLOC, LOAD, READONLY, CODE >> 12 .rodata 000004b0 0000000010008c58 0000000010008c58 = 00008c58 2**3 >> CONTENTS, ALLOC, LOAD, READONLY, DATA >> 13 .eh_frame 00000004 0000000010009108 0000000010009108 = 00009108 2**2 >> CONTENTS, ALLOC, LOAD, READONLY, DATA >> 14 .ctors 00000010 0000000010019110 0000000010019110 = 00009110 2**3 >> CONTENTS, ALLOC, LOAD, DATA >> 15 .dtors 00000010 0000000010019120 0000000010019120 = 00009120 2**3 >> CONTENTS, ALLOC, LOAD, DATA >> 16 .jcr 00000008 0000000010019130 0000000010019130 = 00009130 2**3 >> CONTENTS, ALLOC, LOAD, DATA >> 17 .dynamic 000001c0 0000000010019138 0000000010019138 = 00009138 2**3 >> CONTENTS, ALLOC, LOAD, DATA >> 18 .opd 00000468 00000000100192f8 00000000100192f8 = 000092f8 2**3 >> CONTENTS, ALLOC, LOAD, DATA >> 19 .got 00000098 0000000010019800 0000000010019800 = 00009800 2**8 >> CONTENTS, ALLOC, LOAD, DATA >> 20 .plt 00000708 0000000010019898 0000000010019898 = 00009898 2**3 >> ALLOC >> 21 .data 00000050 0000000010019fa0 0000000010019fa0 = 00009fa0 2**3 >> CONTENTS, ALLOC, LOAD, DATA >> 22 .bss 00000208 0000000010019ff0 0000000010019ff0 = 00009ff0 2**3 >> ALLOC >> 23 .comment 000002b5 0000000000000000 0000000000000000 = 00009ff0 2**0 >> CONTENTS, READONLY >> 24 .gnu_debuglink 00000010 0000000000000000 0000000000000000 = 0000a2a8 2**2 >> CONTENTS, READONLY >>=20 >>=20 >=20 > The first PT_LOAD is also executable so there will be no be behaviour > change. It must be one of the library dependencies that is different. > The difference in section headers output doesn't matter here since all > that RTLD looks at is the PHDRS. >=20 I think you missed the fact that the .got and .plt are in the material from the 2nd PT_LOAD: there are writeable code areas involved for powerpc64. So both PT_LOAD's contribute code areas and there is a space between the two contributions. The first PT_LOAD loads most code (the readonly code, to be specific). The 2nd contributes a writable-code area. But may be i've misunderstood the assumptions that your change is based on. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Tue Oct 30 21:35:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A142C10F5818; Tue, 30 Oct 2018 21:35:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EAE27BC22; Tue, 30 Oct 2018 21:35:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20C5A23172; Tue, 30 Oct 2018 21:35:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9ULZuPU008439; Tue, 30 Oct 2018 21:35:56 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9ULZuVp008438; Tue, 30 Oct 2018 21:35:56 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201810302135.w9ULZuVp008438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 30 Oct 2018 21:35:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339933 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 339933 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 21:35:57 -0000 Author: bz Date: Tue Oct 30 21:35:56 2018 New Revision: 339933 URL: https://svnweb.freebsd.org/changeset/base/339933 Log: Fix mips build after r339931. I erroneously thought that it was two 64bit platforms which use link_elf_obj.c. PR: 228854 Reported by: ci.f.o. MFC after: 3 days X-MFC with: r339931 Pointyhat to: bz Modified: head/sys/kern/link_elf_obj.c Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Tue Oct 30 21:31:32 2018 (r339932) +++ head/sys/kern/link_elf_obj.c Tue Oct 30 21:35:56 2018 (r339933) @@ -369,8 +369,9 @@ link_elf_link_preload(linker_class_t cls, const char * dpcpu = dpcpu_alloc(shdr[i].sh_size); if (dpcpu == NULL) { printf("%s: pcpu module space is out " - "of space; cannot allocate %ld for " - "%s\n", __func__, shdr[i].sh_size, + "of space; cannot allocate %#jx " + "for %s\n", __func__, + (uintmax_t)shdr[i].sh_size, filename); error = ENOSPC; goto out; @@ -387,8 +388,9 @@ link_elf_link_preload(linker_class_t cls, const char * vnet_data = vnet_data_alloc(shdr[i].sh_size); if (vnet_data == NULL) { printf("%s: vnet module space is out " - "of space; cannot allocate %ld for " - "%s\n", __func__, shdr[i].sh_size, + "of space; cannot allocate %#jx " + "for %s\n", __func__, + (uintmax_t)shdr[i].sh_size, filename); error = ENOSPC; goto out; @@ -860,8 +862,9 @@ link_elf_load_file(linker_class_t cls, const char *fil dpcpu_alloc(shdr[i].sh_size); if (ef->progtab[pb].addr == NULL) { printf("%s: pcpu module space is out " - "of space; cannot allocate %ld for " - "%s\n", __func__, shdr[i].sh_size, + "of space; cannot allocate %#jx " + "for %s\n", __func__, + (uintmax_t)shdr[i].sh_size, filename); } } @@ -872,8 +875,9 @@ link_elf_load_file(linker_class_t cls, const char *fil vnet_data_alloc(shdr[i].sh_size); if (ef->progtab[pb].addr == NULL) { printf("%s: vnet module space is out " - "of space; cannot allocate %ld for " - "%s\n", __func__, shdr[i].sh_size, + "of space; cannot allocate %#jx " + "for %s\n", __func__, + (uintmax_t)shdr[i].sh_size, filename); } } From owner-svn-src-head@freebsd.org Tue Oct 30 22:12:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CAEC100892A for ; Tue, 30 Oct 2018 22:12:37 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-yb1-f194.google.com (mail-yb1-f194.google.com [209.85.219.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35BD57D165 for ; Tue, 30 Oct 2018 22:12:37 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-yb1-f194.google.com with SMTP id d18-v6so5761255yba.4 for ; Tue, 30 Oct 2018 15:12:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9C1ccPKDD1dVgC6TDEEN7XoTIWrykNpFnxvGX7Wnvzo=; b=fD+EeWpwSDNAXG3RmTIYRDCxkKXlmRfg3Ug/a2MH7l7UPp+nts1OgVXmidw+JG3X94 3uRZd5XHEa+R0oilbbj6OCUocedjmASmCxG9Yto5NDCeWWT3BTQZJFxX8hdJdxhyBl6e wKdvQxBKh2kDNbOTHtGqzy9Xqi5Imq7DQSN6CtuH1ChTUtTLkxBLcw7KJ2SaoipzZZZ/ 8Fzvse/jTvR5Fc1R+isjQPrKG+nkj00XXkfGfZy8kU2JPLTwRfFcXUMYf4ImzRx49H/u yamD2dKUpkfIuMHdWreCi9bsEXBKvWDZBTdGa7jXr4qHnZGBDGsOVUcXSt62izwNGobR vS4g== X-Gm-Message-State: AGRZ1gKRAdx0xuX/X3ukjMEfWFgqMf5ZAes1iex+mAYAxVVBkNgG36iI LNmyviLLpvYlkwhgiu8YZTsD2LQQL3o= X-Google-Smtp-Source: AJdET5e60xTiU50Pwfte7xxbP3IGe1Hbkxe02j03QZspksyHqOJmXIx0r7L79GCLOPs5q0SgWaJacw== X-Received: by 2002:a5b:406:: with SMTP id m6-v6mr480571ybp.223.1540935653963; Tue, 30 Oct 2018 14:40:53 -0700 (PDT) Received: from mail-yw1-f54.google.com (mail-yw1-f54.google.com. [209.85.161.54]) by smtp.gmail.com with ESMTPSA id g21-v6sm5927429ywk.5.2018.10.30.14.40.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Oct 2018 14:40:53 -0700 (PDT) Received: by mail-yw1-f54.google.com with SMTP id v77-v6so5586865ywc.4 for ; Tue, 30 Oct 2018 14:40:53 -0700 (PDT) X-Received: by 2002:a0d:d88d:: with SMTP id a135-v6mr476317ywe.75.1540935653400; Tue, 30 Oct 2018 14:40:53 -0700 (PDT) MIME-Version: 1.0 References: <7DC6D9C4-C153-4BCE-851C-22C890AB0D73@yahoo.com> In-Reply-To: From: Alexander Richardson Date: Tue, 30 Oct 2018 21:40:42 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r339876 - head/libexec/rtld-elf To: marklmi26-fbsd@yahoo.com Cc: svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 22:12:37 -0000 On Tue, 30 Oct 2018 at 21:32, Mark Millard wrote: > > > > On 2018-Oct-30, at 2:23 PM, Alexander Richardson wrote: > > > On Tue, 30 Oct 2018 at 18:19, Mark Millard wrote: > >> > >> Alexander Richardson arichardson at freebsd.org wrote on > >> Tue Oct 30 15:33:00 UTC 2018 : > >> > >>> On Tue, 30 Oct 2018 at 10:17, Michael Tuexen > >>> wrote: > >>>> > >>>>> On 29. Oct 2018, at 22:08, Alex Richardson wrote: > >>>>> > >>>>> Author: arichardson > >>>>> Date: Mon Oct 29 21:08:02 2018 > >>>>> New Revision: 339876 > >>>>> URL: https://svnweb.freebsd.org/changeset/base/339876 > >>>>> > >>>>> Log: > >>>>> rtld: set obj->textsize correctly > >>>>> > >>>>> With lld-generated binaries the first PT_LOAD will usually be a read-only > >>>>> segment unless you pass --no-rosegment. For those binaries the textsize is > >>>>> determined by the next PT_LOAD. To allow both LLD and bfd 2.17 binaries to > >>>>> be parsed correctly use the end of the last PT_LOAD that is marked as > >>>>> executable instead. > >>>>> > >>>>> I noticed that the value was wrong while adding some debug prints for some rtld > >>>>> changes for CHERI binaries. `obj->textsize` only seems to be used by PPC so the > >>>>> effect is untested. However, the value before was definitely wrong and the new > >>>>> result matches the phdrs. > >>>> I build kernel and world with a revision later than this on a PPC. Buildword > >>>> ends up with a world where almost all binaries are segfaulting.... Especially gdb > >>>> (but svn, ls or so all segfault). > >>>> > >>>> Best regards > >>>> Michael > >>> > >>> This is rather surprising since if anything the range of the icache > >>> flush should increase rather than decrease after this change. > >>> > >>> I can only see this causing a behaviour change if we actually need to > >>> flush more than just the executable segments. > >>> Is it possible that some binary/library contains a non-executable > >>> segment as the first PT_LOAD? > >>> Or is there some linker script that adds custom PHDRS? > >> > >> The following is based on using devel/powerpc64-xtoolchain-gcc > >> to buildworld buildkernel on/for powerpc64. (I experiment with > >> using fairly modern tools to target powerpc64 and powerpc.) > >> The build context is head -r339076 based, both for what > >> did the build and for what it was building. > >> > >> I report from both elfdump and objdump output > >> because each seems to have some oddities in what > >> it outputs. > >> > >> I start with elfdump (which leaves sh_flags blank > >> and shows a section header with sh_name empty > >> that objdump does not list at all): > >> > >> # elfdump -pc /bin/ls | less > >> > >> . . . > >> > >> As for objdump on the same file (section > >> one less than elfdump listed, no empty sh_name > >> section listed): > >> > >> # objdump -ph /bin/ls | less > >> > >> /bin/ls: file format elf64-powerpc-freebsd > >> > >> Program Header: > >> PHDR off 0x0000000000000040 vaddr 0x0000000010000040 paddr 0x0000000010000040 align 2**3 > >> filesz 0x0000000000000188 memsz 0x0000000000000188 flags r-- > >> INTERP off 0x00000000000001c8 vaddr 0x00000000100001c8 paddr 0x00000000100001c8 align 2**0 > >> filesz 0x0000000000000015 memsz 0x0000000000000015 flags r-- > >> LOAD off 0x0000000000000000 vaddr 0x0000000010000000 paddr 0x0000000010000000 align 2**16 > >> filesz 0x000000000000910c memsz 0x000000000000910c flags r-x > >> LOAD off 0x0000000000009110 vaddr 0x0000000010019110 paddr 0x0000000010019110 align 2**16 > >> filesz 0x0000000000000ee0 memsz 0x00000000000010e8 flags rw- > >> DYNAMIC off 0x0000000000009138 vaddr 0x0000000010019138 paddr 0x0000000010019138 align 2**3 > >> filesz 0x00000000000001c0 memsz 0x00000000000001c0 flags rw- > >> NOTE off 0x00000000000001e0 vaddr 0x00000000100001e0 paddr 0x00000000100001e0 align 2**2 > >> filesz 0x0000000000000030 memsz 0x0000000000000030 flags r-- > >> STACK off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**4 > >> filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw- > >> > >> Dynamic Section: > >> NEEDED libutil.so.9 > >> NEEDED libncursesw.so.8 > >> NEEDED libc.so.7 > >> INIT 0x0000000010019328 > >> FINI 0x0000000010019340 > >> HASH 0x0000000010000210 > >> STRTAB 0x0000000010000d00 > >> SYMTAB 0x0000000010000490 > >> STRSZ 0x000000000000035a > >> SYMENT 0x0000000000000018 > >> DEBUG 0x0000000000000000 > >> PLTGOT 0x0000000010019898 > >> PLTRELSZ 0x00000000000006f0 > >> PLTREL 0x0000000000000007 > >> JMPREL 0x00000000100012f8 > >> 0x70000000 0x00000000100089b4 > >> RELA 0x0000000010001160 > >> RELASZ 0x0000000000000198 > >> RELAENT 0x0000000000000018 > >> VERNEED 0x0000000010001110 > >> VERNEEDNUM 0x0000000000000001 > >> VERSYM 0x000000001000105a > >> > >> Version References: > >> required from libc.so.7: > >> 0x077a28b3 0x00 05 FBSD_1.3 > >> 0x077a28b1 0x00 04 FBSD_1.1 > >> 0x077a28b5 0x00 03 FBSD_1.5 > >> 0x077a28b0 0x00 02 FBSD_1.0 > >> private flags = 0x1: [abiv1] > >> > >> Sections: > >> Idx Name Size VMA LMA File off Algn > >> 0 .interp 00000015 00000000100001c8 00000000100001c8 000001c8 2**0 > >> CONTENTS, ALLOC, LOAD, READONLY, DATA > >> 1 .note.tag 00000030 00000000100001e0 00000000100001e0 000001e0 2**2 > >> CONTENTS, ALLOC, LOAD, READONLY, DATA > >> 2 .hash 0000027c 0000000010000210 0000000010000210 00000210 2**3 > >> CONTENTS, ALLOC, LOAD, READONLY, DATA > >> 3 .dynsym 00000870 0000000010000490 0000000010000490 00000490 2**3 > >> CONTENTS, ALLOC, LOAD, READONLY, DATA > >> 4 .dynstr 0000035a 0000000010000d00 0000000010000d00 00000d00 2**0 > >> CONTENTS, ALLOC, LOAD, READONLY, DATA > >> 5 .gnu.version 000000b4 000000001000105a 000000001000105a 0000105a 2**1 > >> CONTENTS, ALLOC, LOAD, READONLY, DATA > >> 6 .gnu.version_r 00000050 0000000010001110 0000000010001110 00001110 2**3 > >> CONTENTS, ALLOC, LOAD, READONLY, DATA > >> 7 .rela.dyn 00000198 0000000010001160 0000000010001160 00001160 2**3 > >> CONTENTS, ALLOC, LOAD, READONLY, DATA > >> 8 .rela.plt 000006f0 00000000100012f8 00000000100012f8 000012f8 2**3 > >> CONTENTS, ALLOC, LOAD, READONLY, DATA > >> 9 .init 0000002c 00000000100019f0 00000000100019f0 000019f0 2**4 > >> CONTENTS, ALLOC, LOAD, READONLY, CODE > >> 10 .text 00007204 0000000010001a20 0000000010001a20 00001a20 2**5 > >> CONTENTS, ALLOC, LOAD, READONLY, CODE > >> 11 .fini 00000024 0000000010008c30 0000000010008c30 00008c30 2**4 > >> CONTENTS, ALLOC, LOAD, READONLY, CODE > >> 12 .rodata 000004b0 0000000010008c58 0000000010008c58 00008c58 2**3 > >> CONTENTS, ALLOC, LOAD, READONLY, DATA > >> 13 .eh_frame 00000004 0000000010009108 0000000010009108 00009108 2**2 > >> CONTENTS, ALLOC, LOAD, READONLY, DATA > >> 14 .ctors 00000010 0000000010019110 0000000010019110 00009110 2**3 > >> CONTENTS, ALLOC, LOAD, DATA > >> 15 .dtors 00000010 0000000010019120 0000000010019120 00009120 2**3 > >> CONTENTS, ALLOC, LOAD, DATA > >> 16 .jcr 00000008 0000000010019130 0000000010019130 00009130 2**3 > >> CONTENTS, ALLOC, LOAD, DATA > >> 17 .dynamic 000001c0 0000000010019138 0000000010019138 00009138 2**3 > >> CONTENTS, ALLOC, LOAD, DATA > >> 18 .opd 00000468 00000000100192f8 00000000100192f8 000092f8 2**3 > >> CONTENTS, ALLOC, LOAD, DATA > >> 19 .got 00000098 0000000010019800 0000000010019800 00009800 2**8 > >> CONTENTS, ALLOC, LOAD, DATA > >> 20 .plt 00000708 0000000010019898 0000000010019898 00009898 2**3 > >> ALLOC > >> 21 .data 00000050 0000000010019fa0 0000000010019fa0 00009fa0 2**3 > >> CONTENTS, ALLOC, LOAD, DATA > >> 22 .bss 00000208 0000000010019ff0 0000000010019ff0 00009ff0 2**3 > >> ALLOC > >> 23 .comment 000002b5 0000000000000000 0000000000000000 00009ff0 2**0 > >> CONTENTS, READONLY > >> 24 .gnu_debuglink 00000010 0000000000000000 0000000000000000 0000a2a8 2**2 > >> CONTENTS, READONLY > >> > >> > > > > The first PT_LOAD is also executable so there will be no be behaviour > > change. It must be one of the library dependencies that is different. > > The difference in section headers output doesn't matter here since all > > that RTLD looks at is the PHDRS. > > > > I think you missed the fact that the .got and .plt are in the > material from the 2nd PT_LOAD: there are writeable code areas > involved for powerpc64. > > So both PT_LOAD's contribute code areas and there is a space > between the two contributions. The first PT_LOAD loads most > code (the readonly code, to be specific). The 2nd contributes > a writable-code area. > > But may be i've misunderstood the assumptions that your change > is based on. Before my change the second PT would also not be included in obj->textsize since we were setting obj->textsize as end of PT_LOAD[0]. After the change it will be end of last executable PT_LOAD (which will usually be PT_LOAD[0] but could also include more now). Since there is only one executable PT_LOAD which happens to be also be PT_LOAD[0], there will be no change to obj->textsize. The only time this commit could change anything is if there is a PT_LOAD that is executable but is not PT_LOAD[0] or if PT_LOAD[0] is not executable. I think it must be the former case since as far as I know ld.bfd will always create a read/execute segment as PT_LOAD[0] unless it is given a custom linker script. Alex From owner-svn-src-head@freebsd.org Tue Oct 30 22:15:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85D2110089A7 for ; Tue, 30 Oct 2018 22:15:58 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic306-22.consmr.mail.ne1.yahoo.com (sonic306-22.consmr.mail.ne1.yahoo.com [66.163.189.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13FCA7D1E6 for ; Tue, 30 Oct 2018 22:15:58 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: MYrlIQAVM1nAMUVcK_IKUwLMRiAu2CBYT07BiSYZaibCwcKP0sHhil6Yt6wW0MC hxOjb1JqePN7KxegYvkIX_12SMrx.GnL8eDotD8qnVqtYjbOUzH3hYUzQbL4YDRfRWjwjNrMojwP MW7sgdncGY55FNL.M9FTnK4SqpDCh.veOtxeZbHUvQZ8UxX2h48QxIJ2xlY66t2.v45lU_WQKU2u dxWAce0i_tyzahA4uznIjMcVWHoheYBXWWG30TN2AI5._v2PrBzemdIMQEaU1HETE48K1_tcqHLa prpGR6UfYNv3UL4HS2BrrNuKjuny98xjtOOzSkMisID9qZfmL6QWYSmLLxpe2Ukg.Wl6M4pOWdEk hPvSZ2UEWAWmOxHY4HmgqXBFV.ahbsYFb8ADLctXI_CHiLayD64OEfymeLsf8GTSS6e6wTfP_cR4 zVjbTdrwS1zFqlqLa2pOXxO8N1uavJ2u1j_kq67YXHo0UvNry7q524YG9cZDHiwjLh5Ilzxl7FMo XI0ZYKpFNvNav8mT8eTg7ls8wDbJiZrxgzCkeHFmozP_eqdmP7a7j0J0QrhDhbuLrmDJu_DyLP4J OmErg8Z1jvUf0W_3YQVSveu3m69D7BrGCqbfOaDgowBp6OZwExM1Y9ue42OwWhHb3vVTfMjhhbwX X6laKkiazoJGopm98cTKZ0uSbhS7pdC0stPmRZmEIL7q4_h8m25aOKpyxgAIDCvWaRVoFfX1ocGg aOULiTy0MZUP1RiSnMN5p4oo3HKEGvlmo6haI4yXProlKmWYn5BmQM5FrOGkiWv.8A.ou3QEiQzh cauk94bTvtJkjjFaQTvLpe2EQ1EUbE2tNpmaLIycZ4qXfzWPxqxHsa4BlRvNFAdHwI6LHxNuI5T1 67f6H2amfgorb4IS2ea.4a0ywiddMBMwv.FbvDxMQZTq40J1NGtJ..jw4qL.6e3IPOU7NZMkef8h XJA_cTZD4RJ0g8frRiwOeK2JgMFvtHr5IZBUb1FMnMKVke.3i0zDbKhw1iY8b6jYeRvrsOHMZN9G KoCjTmZCU.kpXPjlHZrP60VBCUb_2mCSmww6bjqKUq29lEdIbWtg- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Tue, 30 Oct 2018 22:15:50 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp430.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID d4f02ec27408de3ecd5ccc93fed13232; Tue, 30 Oct 2018 22:05:43 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r339876 - head/libexec/rtld-elf From: Mark Millard In-Reply-To: Date: Tue, 30 Oct 2018 15:05:42 -0700 Cc: svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2D7C5FC6-CA8D-4AAB-BD64-CC883531F737@yahoo.com> References: <7DC6D9C4-C153-4BCE-851C-22C890AB0D73@yahoo.com> To: Alexander Richardson X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 22:15:58 -0000 On 2018-Oct-30, at 2:40 PM, Alexander Richardson wrote: > On Tue, 30 Oct 2018 at 21:32, Mark Millard wrote: >>=20 >>=20 >>=20 >> On 2018-Oct-30, at 2:23 PM, Alexander Richardson wrote: >>=20 >>> On Tue, 30 Oct 2018 at 18:19, Mark Millard wrote: >>>>=20 >>>> Alexander Richardson arichardson at freebsd.org wrote on >>>> Tue Oct 30 15:33:00 UTC 2018 : >>>>=20 >>>>> On Tue, 30 Oct 2018 at 10:17, Michael Tuexen >>>>> wrote: >>>>>>=20 >>>>>>> On 29. Oct 2018, at 22:08, Alex Richardson wrote: >>>>>>>=20 >>>>>>> Author: arichardson >>>>>>> Date: Mon Oct 29 21:08:02 2018 >>>>>>> New Revision: 339876 >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/339876 >>>>>>>=20 >>>>>>> Log: >>>>>>> rtld: set obj->textsize correctly >>>>>>>=20 >>>>>>> With lld-generated binaries the first PT_LOAD will usually be a = read-only >>>>>>> segment unless you pass --no-rosegment. For those binaries the = textsize is >>>>>>> determined by the next PT_LOAD. To allow both LLD and bfd 2.17 = binaries to >>>>>>> be parsed correctly use the end of the last PT_LOAD that is = marked as >>>>>>> executable instead. >>>>>>>=20 >>>>>>> I noticed that the value was wrong while adding some debug = prints for some rtld >>>>>>> changes for CHERI binaries. `obj->textsize` only seems to be = used by PPC so the >>>>>>> effect is untested. However, the value before was definitely = wrong and the new >>>>>>> result matches the phdrs. >>>>>> I build kernel and world with a revision later than this on a = PPC. Buildword >>>>>> ends up with a world where almost all binaries are = segfaulting.... Especially gdb >>>>>> (but svn, ls or so all segfault). >>>>>>=20 >>>>>> Best regards >>>>>> Michael >>>>>=20 >>>>> This is rather surprising since if anything the range of the = icache >>>>> flush should increase rather than decrease after this change. >>>>>=20 >>>>> I can only see this causing a behaviour change if we actually need = to >>>>> flush more than just the executable segments. >>>>> Is it possible that some binary/library contains a non-executable >>>>> segment as the first PT_LOAD? >>>>> Or is there some linker script that adds custom PHDRS? >>>>=20 >>>> The following is based on using devel/powerpc64-xtoolchain-gcc >>>> to buildworld buildkernel on/for powerpc64. (I experiment with >>>> using fairly modern tools to target powerpc64 and powerpc.) >>>> The build context is head -r339076 based, both for what >>>> did the build and for what it was building. >>>>=20 >>>> I report from both elfdump and objdump output >>>> because each seems to have some oddities in what >>>> it outputs. >>>>=20 >>>> I start with elfdump (which leaves sh_flags blank >>>> and shows a section header with sh_name empty >>>> that objdump does not list at all): >>>>=20 >>>> # elfdump -pc /bin/ls | less >>>>=20 >>>> . . . >>>>=20 >>>> As for objdump on the same file (section >>>> one less than elfdump listed, no empty sh_name >>>> section listed): >>>>=20 >>>> # objdump -ph /bin/ls | less >>>>=20 >>>> /bin/ls: file format elf64-powerpc-freebsd >>>>=20 >>>> Program Header: >>>> PHDR off 0x0000000000000040 vaddr 0x0000000010000040 paddr = 0x0000000010000040 align 2**3 >>>> filesz 0x0000000000000188 memsz 0x0000000000000188 flags r-- >>>> INTERP off 0x00000000000001c8 vaddr 0x00000000100001c8 paddr = 0x00000000100001c8 align 2**0 >>>> filesz 0x0000000000000015 memsz 0x0000000000000015 flags r-- >>>> LOAD off 0x0000000000000000 vaddr 0x0000000010000000 paddr = 0x0000000010000000 align 2**16 >>>> filesz 0x000000000000910c memsz 0x000000000000910c flags r-x >>>> LOAD off 0x0000000000009110 vaddr 0x0000000010019110 paddr = 0x0000000010019110 align 2**16 >>>> filesz 0x0000000000000ee0 memsz 0x00000000000010e8 flags rw- >>>> DYNAMIC off 0x0000000000009138 vaddr 0x0000000010019138 paddr = 0x0000000010019138 align 2**3 >>>> filesz 0x00000000000001c0 memsz 0x00000000000001c0 flags rw- >>>> NOTE off 0x00000000000001e0 vaddr 0x00000000100001e0 paddr = 0x00000000100001e0 align 2**2 >>>> filesz 0x0000000000000030 memsz 0x0000000000000030 flags r-- >>>> STACK off 0x0000000000000000 vaddr 0x0000000000000000 paddr = 0x0000000000000000 align 2**4 >>>> filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw- >>>>=20 >>>> Dynamic Section: >>>> NEEDED libutil.so.9 >>>> NEEDED libncursesw.so.8 >>>> NEEDED libc.so.7 >>>> INIT 0x0000000010019328 >>>> FINI 0x0000000010019340 >>>> HASH 0x0000000010000210 >>>> STRTAB 0x0000000010000d00 >>>> SYMTAB 0x0000000010000490 >>>> STRSZ 0x000000000000035a >>>> SYMENT 0x0000000000000018 >>>> DEBUG 0x0000000000000000 >>>> PLTGOT 0x0000000010019898 >>>> PLTRELSZ 0x00000000000006f0 >>>> PLTREL 0x0000000000000007 >>>> JMPREL 0x00000000100012f8 >>>> 0x70000000 0x00000000100089b4 >>>> RELA 0x0000000010001160 >>>> RELASZ 0x0000000000000198 >>>> RELAENT 0x0000000000000018 >>>> VERNEED 0x0000000010001110 >>>> VERNEEDNUM 0x0000000000000001 >>>> VERSYM 0x000000001000105a >>>>=20 >>>> Version References: >>>> required from libc.so.7: >>>> 0x077a28b3 0x00 05 FBSD_1.3 >>>> 0x077a28b1 0x00 04 FBSD_1.1 >>>> 0x077a28b5 0x00 03 FBSD_1.5 >>>> 0x077a28b0 0x00 02 FBSD_1.0 >>>> private flags =3D 0x1: [abiv1] >>>>=20 >>>> Sections: >>>> Idx Name Size VMA LMA = File off Algn >>>> 0 .interp 00000015 00000000100001c8 00000000100001c8 = 000001c8 2**0 >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA >>>> 1 .note.tag 00000030 00000000100001e0 00000000100001e0 = 000001e0 2**2 >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA >>>> 2 .hash 0000027c 0000000010000210 0000000010000210 = 00000210 2**3 >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA >>>> 3 .dynsym 00000870 0000000010000490 0000000010000490 = 00000490 2**3 >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA >>>> 4 .dynstr 0000035a 0000000010000d00 0000000010000d00 = 00000d00 2**0 >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA >>>> 5 .gnu.version 000000b4 000000001000105a 000000001000105a = 0000105a 2**1 >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA >>>> 6 .gnu.version_r 00000050 0000000010001110 0000000010001110 = 00001110 2**3 >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA >>>> 7 .rela.dyn 00000198 0000000010001160 0000000010001160 = 00001160 2**3 >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA >>>> 8 .rela.plt 000006f0 00000000100012f8 00000000100012f8 = 000012f8 2**3 >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA >>>> 9 .init 0000002c 00000000100019f0 00000000100019f0 = 000019f0 2**4 >>>> CONTENTS, ALLOC, LOAD, READONLY, CODE >>>> 10 .text 00007204 0000000010001a20 0000000010001a20 = 00001a20 2**5 >>>> CONTENTS, ALLOC, LOAD, READONLY, CODE >>>> 11 .fini 00000024 0000000010008c30 0000000010008c30 = 00008c30 2**4 >>>> CONTENTS, ALLOC, LOAD, READONLY, CODE >>>> 12 .rodata 000004b0 0000000010008c58 0000000010008c58 = 00008c58 2**3 >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA >>>> 13 .eh_frame 00000004 0000000010009108 0000000010009108 = 00009108 2**2 >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA >>>> 14 .ctors 00000010 0000000010019110 0000000010019110 = 00009110 2**3 >>>> CONTENTS, ALLOC, LOAD, DATA >>>> 15 .dtors 00000010 0000000010019120 0000000010019120 = 00009120 2**3 >>>> CONTENTS, ALLOC, LOAD, DATA >>>> 16 .jcr 00000008 0000000010019130 0000000010019130 = 00009130 2**3 >>>> CONTENTS, ALLOC, LOAD, DATA >>>> 17 .dynamic 000001c0 0000000010019138 0000000010019138 = 00009138 2**3 >>>> CONTENTS, ALLOC, LOAD, DATA >>>> 18 .opd 00000468 00000000100192f8 00000000100192f8 = 000092f8 2**3 >>>> CONTENTS, ALLOC, LOAD, DATA >>>> 19 .got 00000098 0000000010019800 0000000010019800 = 00009800 2**8 >>>> CONTENTS, ALLOC, LOAD, DATA >>>> 20 .plt 00000708 0000000010019898 0000000010019898 = 00009898 2**3 >>>> ALLOC >>>> 21 .data 00000050 0000000010019fa0 0000000010019fa0 = 00009fa0 2**3 >>>> CONTENTS, ALLOC, LOAD, DATA >>>> 22 .bss 00000208 0000000010019ff0 0000000010019ff0 = 00009ff0 2**3 >>>> ALLOC >>>> 23 .comment 000002b5 0000000000000000 0000000000000000 = 00009ff0 2**0 >>>> CONTENTS, READONLY >>>> 24 .gnu_debuglink 00000010 0000000000000000 0000000000000000 = 0000a2a8 2**2 >>>> CONTENTS, READONLY >>>>=20 >>>>=20 >>>=20 >>> The first PT_LOAD is also executable so there will be no be = behaviour >>> change. It must be one of the library dependencies that is = different. >>> The difference in section headers output doesn't matter here since = all >>> that RTLD looks at is the PHDRS. >>>=20 >>=20 >> I think you missed the fact that the .got and .plt are in the >> material from the 2nd PT_LOAD: there are writeable code areas >> involved for powerpc64. >>=20 >> So both PT_LOAD's contribute code areas and there is a space >> between the two contributions. The first PT_LOAD loads most >> code (the readonly code, to be specific). The 2nd contributes >> a writable-code area. >>=20 >> But may be i've misunderstood the assumptions that your change >> is based on. >=20 > Before my change the second PT would also not be included in > obj->textsize since we were setting obj->textsize as end of > PT_LOAD[0]. > After the change it will be end of last executable PT_LOAD (which will > usually be PT_LOAD[0] but could also include more now). > Since there is only one executable PT_LOAD which happens to be also be > PT_LOAD[0], there will be no change to obj->textsize. >=20 > The only time this commit could change anything is if there is a > PT_LOAD that is executable but is not PT_LOAD[0] or if PT_LOAD[0] is > not executable. > I think it must be the former case since as far as I know ld.bfd will > always create a read/execute segment as PT_LOAD[0] unless it is given > a custom linker script. I do not see any evidence that PF_X would match the tests for either of the following from the 2nd PT_LOAD: 19 .got 00000098 0000000010019800 0000000010019800 00009800 = 2**8 CONTENTS, ALLOC, LOAD, DATA 20 .plt 00000708 0000000010019898 0000000010019898 00009898 = 2**3 ALLOC in the likes of: 135 if ((segs[nsegs]->p_flags & PF_X) =3D=3D PF_X) { 136 text_end =3D MAX(text_end, 137 round_page(segs[nsegs]->p_vaddr + = segs[nsegs]->p_memsz)); 138 } in map_object.c This is possibly to avoid: 467 if (elfflags & PF_X) 468 prot |=3D PROT_EXEC; because of writable code. rtld.c also, for: 1397 nsegs++; 1398 if ((ph->p_flags & PF_X) =3D=3D PF_X) { 1399 obj->textsize =3D MAX(obj->textsize, 1400 round_page(ph->p_vaddr + ph->p_memsz) - = obj->vaddrbase); 1401 } Still, I may be missing something in my understanding. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Tue Oct 30 22:24:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFD9C1008C95 for ; Tue, 30 Oct 2018 22:24:11 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-yb1-f181.google.com (mail-yb1-f181.google.com [209.85.219.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DEE37D59D for ; Tue, 30 Oct 2018 22:24:11 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-yb1-f181.google.com with SMTP id p144-v6so5755685yba.11 for ; Tue, 30 Oct 2018 15:24:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MfLbjGeyEJ1KA2rXhvmlXdBFx88g8q6LsqliAAZq1xQ=; b=YnfYYHfzCvVwTXQxf9vNgqFCFGlllTPzjJBUQronACSytc9vzrO6gS0lAaQlZncCHD nsShwbavhsLz6bNT9EfbO5/KiSlxQVF+fLGoeQMPyZ2pIFWlQdvY14c5cp51qWXN91T6 h44ODl/dQUuVLQ+4Y2HTAAPuxZL75KEDy++Fjp7foKIm1h8zn+8+lJXxW9fMH5Q0j4b7 ClcZBrW4SfXQ8UYo5rsUiUoJVCEcXxqyngzSyJU74mM2kUBT/E+zBGLasU7wsbWiCPGA z1LTpOWoCJVRQpuyhI3ME2KhJ5CLMHJIJTswCquWyaPvCBnCMXgJzqwi2rBGx+TymVQ7 AKWA== X-Gm-Message-State: AGRZ1gL1EK1wxiK/K7Huelp2/QuEmHqbQ9KOUbOFy0zoQgSv5yhGZIst Aos0wrC9970Iz7uO8OObjX4IK7fYAGM= X-Google-Smtp-Source: AJdET5dQNtkr4UIdy1QYA5bnJjOUSZvlCJhRJHcflJk9sNha01RHMbbtNxPS9X+UFLw1niHinuRJvA== X-Received: by 2002:a25:ad9a:: with SMTP id z26-v6mr619987ybi.267.1540938245109; Tue, 30 Oct 2018 15:24:05 -0700 (PDT) Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com. [209.85.219.169]) by smtp.gmail.com with ESMTPSA id 138-v6sm6122702yws.28.2018.10.30.15.24.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Oct 2018 15:24:04 -0700 (PDT) Received: by mail-yb1-f169.google.com with SMTP id i78-v6so5778223ybg.0 for ; Tue, 30 Oct 2018 15:24:04 -0700 (PDT) X-Received: by 2002:a25:6d44:: with SMTP id i65-v6mr628848ybc.454.1540938244538; Tue, 30 Oct 2018 15:24:04 -0700 (PDT) MIME-Version: 1.0 References: <7DC6D9C4-C153-4BCE-851C-22C890AB0D73@yahoo.com> <2D7C5FC6-CA8D-4AAB-BD64-CC883531F737@yahoo.com> In-Reply-To: <2D7C5FC6-CA8D-4AAB-BD64-CC883531F737@yahoo.com> From: Alexander Richardson Date: Tue, 30 Oct 2018 22:23:52 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r339876 - head/libexec/rtld-elf To: marklmi26-fbsd@yahoo.com Cc: svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 22:24:12 -0000 On Tue, 30 Oct 2018 at 22:16, Mark Millard wrote: > > On 2018-Oct-30, at 2:40 PM, Alexander Richardson wrote: > > > On Tue, 30 Oct 2018 at 21:32, Mark Millard wrote: > >> > >> > >> > >> On 2018-Oct-30, at 2:23 PM, Alexander Richardson wrote: > >> > >>> On Tue, 30 Oct 2018 at 18:19, Mark Millard wrote: > >>>> > >>>> Alexander Richardson arichardson at freebsd.org wrote on > >>>> Tue Oct 30 15:33:00 UTC 2018 : > >>>> > >>>>> On Tue, 30 Oct 2018 at 10:17, Michael Tuexen > >>>>> wrote: > >>>>>> > >>>>>>> On 29. Oct 2018, at 22:08, Alex Richardson wrote: > >>>>>>> > >>>>>>> Author: arichardson > >>>>>>> Date: Mon Oct 29 21:08:02 2018 > >>>>>>> New Revision: 339876 > >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/339876 > >>>>>>> > >>>>>>> Log: > >>>>>>> rtld: set obj->textsize correctly > >>>>>>> > >>>>>>> With lld-generated binaries the first PT_LOAD will usually be a read-only > >>>>>>> segment unless you pass --no-rosegment. For those binaries the textsize is > >>>>>>> determined by the next PT_LOAD. To allow both LLD and bfd 2.17 binaries to > >>>>>>> be parsed correctly use the end of the last PT_LOAD that is marked as > >>>>>>> executable instead. > >>>>>>> > >>>>>>> I noticed that the value was wrong while adding some debug prints for some rtld > >>>>>>> changes for CHERI binaries. `obj->textsize` only seems to be used by PPC so the > >>>>>>> effect is untested. However, the value before was definitely wrong and the new > >>>>>>> result matches the phdrs. > >>>>>> I build kernel and world with a revision later than this on a PPC. Buildword > >>>>>> ends up with a world where almost all binaries are segfaulting.... Especially gdb > >>>>>> (but svn, ls or so all segfault). > >>>>>> > >>>>>> Best regards > >>>>>> Michael > >>>>> > >>>>> This is rather surprising since if anything the range of the icache > >>>>> flush should increase rather than decrease after this change. > >>>>> > >>>>> I can only see this causing a behaviour change if we actually need to > >>>>> flush more than just the executable segments. > >>>>> Is it possible that some binary/library contains a non-executable > >>>>> segment as the first PT_LOAD? > >>>>> Or is there some linker script that adds custom PHDRS? > >>>> > >>>> The following is based on using devel/powerpc64-xtoolchain-gcc > >>>> to buildworld buildkernel on/for powerpc64. (I experiment with > >>>> using fairly modern tools to target powerpc64 and powerpc.) > >>>> The build context is head -r339076 based, both for what > >>>> did the build and for what it was building. > >>>> > >>>> I report from both elfdump and objdump output > >>>> because each seems to have some oddities in what > >>>> it outputs. > >>>> > >>>> I start with elfdump (which leaves sh_flags blank > >>>> and shows a section header with sh_name empty > >>>> that objdump does not list at all): > >>>> > >>>> # elfdump -pc /bin/ls | less > >>>> > >>>> . . . > >>>> > >>>> As for objdump on the same file (section > >>>> one less than elfdump listed, no empty sh_name > >>>> section listed): > >>>> > >>>> # objdump -ph /bin/ls | less > >>>> > >>>> /bin/ls: file format elf64-powerpc-freebsd > >>>> > >>>> Program Header: > >>>> PHDR off 0x0000000000000040 vaddr 0x0000000010000040 paddr 0x0000000010000040 align 2**3 > >>>> filesz 0x0000000000000188 memsz 0x0000000000000188 flags r-- > >>>> INTERP off 0x00000000000001c8 vaddr 0x00000000100001c8 paddr 0x00000000100001c8 align 2**0 > >>>> filesz 0x0000000000000015 memsz 0x0000000000000015 flags r-- > >>>> LOAD off 0x0000000000000000 vaddr 0x0000000010000000 paddr 0x0000000010000000 align 2**16 > >>>> filesz 0x000000000000910c memsz 0x000000000000910c flags r-x > >>>> LOAD off 0x0000000000009110 vaddr 0x0000000010019110 paddr 0x0000000010019110 align 2**16 > >>>> filesz 0x0000000000000ee0 memsz 0x00000000000010e8 flags rw- > >>>> DYNAMIC off 0x0000000000009138 vaddr 0x0000000010019138 paddr 0x0000000010019138 align 2**3 > >>>> filesz 0x00000000000001c0 memsz 0x00000000000001c0 flags rw- > >>>> NOTE off 0x00000000000001e0 vaddr 0x00000000100001e0 paddr 0x00000000100001e0 align 2**2 > >>>> filesz 0x0000000000000030 memsz 0x0000000000000030 flags r-- > >>>> STACK off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**4 > >>>> filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw- > >>>> > >>>> Dynamic Section: > >>>> NEEDED libutil.so.9 > >>>> NEEDED libncursesw.so.8 > >>>> NEEDED libc.so.7 > >>>> INIT 0x0000000010019328 > >>>> FINI 0x0000000010019340 > >>>> HASH 0x0000000010000210 > >>>> STRTAB 0x0000000010000d00 > >>>> SYMTAB 0x0000000010000490 > >>>> STRSZ 0x000000000000035a > >>>> SYMENT 0x0000000000000018 > >>>> DEBUG 0x0000000000000000 > >>>> PLTGOT 0x0000000010019898 > >>>> PLTRELSZ 0x00000000000006f0 > >>>> PLTREL 0x0000000000000007 > >>>> JMPREL 0x00000000100012f8 > >>>> 0x70000000 0x00000000100089b4 > >>>> RELA 0x0000000010001160 > >>>> RELASZ 0x0000000000000198 > >>>> RELAENT 0x0000000000000018 > >>>> VERNEED 0x0000000010001110 > >>>> VERNEEDNUM 0x0000000000000001 > >>>> VERSYM 0x000000001000105a > >>>> > >>>> Version References: > >>>> required from libc.so.7: > >>>> 0x077a28b3 0x00 05 FBSD_1.3 > >>>> 0x077a28b1 0x00 04 FBSD_1.1 > >>>> 0x077a28b5 0x00 03 FBSD_1.5 > >>>> 0x077a28b0 0x00 02 FBSD_1.0 > >>>> private flags = 0x1: [abiv1] > >>>> > >>>> Sections: > >>>> Idx Name Size VMA LMA File off Algn > >>>> 0 .interp 00000015 00000000100001c8 00000000100001c8 000001c8 2**0 > >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA > >>>> 1 .note.tag 00000030 00000000100001e0 00000000100001e0 000001e0 2**2 > >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA > >>>> 2 .hash 0000027c 0000000010000210 0000000010000210 00000210 2**3 > >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA > >>>> 3 .dynsym 00000870 0000000010000490 0000000010000490 00000490 2**3 > >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA > >>>> 4 .dynstr 0000035a 0000000010000d00 0000000010000d00 00000d00 2**0 > >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA > >>>> 5 .gnu.version 000000b4 000000001000105a 000000001000105a 0000105a 2**1 > >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA > >>>> 6 .gnu.version_r 00000050 0000000010001110 0000000010001110 00001110 2**3 > >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA > >>>> 7 .rela.dyn 00000198 0000000010001160 0000000010001160 00001160 2**3 > >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA > >>>> 8 .rela.plt 000006f0 00000000100012f8 00000000100012f8 000012f8 2**3 > >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA > >>>> 9 .init 0000002c 00000000100019f0 00000000100019f0 000019f0 2**4 > >>>> CONTENTS, ALLOC, LOAD, READONLY, CODE > >>>> 10 .text 00007204 0000000010001a20 0000000010001a20 00001a20 2**5 > >>>> CONTENTS, ALLOC, LOAD, READONLY, CODE > >>>> 11 .fini 00000024 0000000010008c30 0000000010008c30 00008c30 2**4 > >>>> CONTENTS, ALLOC, LOAD, READONLY, CODE > >>>> 12 .rodata 000004b0 0000000010008c58 0000000010008c58 00008c58 2**3 > >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA > >>>> 13 .eh_frame 00000004 0000000010009108 0000000010009108 00009108 2**2 > >>>> CONTENTS, ALLOC, LOAD, READONLY, DATA > >>>> 14 .ctors 00000010 0000000010019110 0000000010019110 00009110 2**3 > >>>> CONTENTS, ALLOC, LOAD, DATA > >>>> 15 .dtors 00000010 0000000010019120 0000000010019120 00009120 2**3 > >>>> CONTENTS, ALLOC, LOAD, DATA > >>>> 16 .jcr 00000008 0000000010019130 0000000010019130 00009130 2**3 > >>>> CONTENTS, ALLOC, LOAD, DATA > >>>> 17 .dynamic 000001c0 0000000010019138 0000000010019138 00009138 2**3 > >>>> CONTENTS, ALLOC, LOAD, DATA > >>>> 18 .opd 00000468 00000000100192f8 00000000100192f8 000092f8 2**3 > >>>> CONTENTS, ALLOC, LOAD, DATA > >>>> 19 .got 00000098 0000000010019800 0000000010019800 00009800 2**8 > >>>> CONTENTS, ALLOC, LOAD, DATA > >>>> 20 .plt 00000708 0000000010019898 0000000010019898 00009898 2**3 > >>>> ALLOC > >>>> 21 .data 00000050 0000000010019fa0 0000000010019fa0 00009fa0 2**3 > >>>> CONTENTS, ALLOC, LOAD, DATA > >>>> 22 .bss 00000208 0000000010019ff0 0000000010019ff0 00009ff0 2**3 > >>>> ALLOC > >>>> 23 .comment 000002b5 0000000000000000 0000000000000000 00009ff0 2**0 > >>>> CONTENTS, READONLY > >>>> 24 .gnu_debuglink 00000010 0000000000000000 0000000000000000 0000a2a8 2**2 > >>>> CONTENTS, READONLY > >>>> > >>>> > >>> > >>> The first PT_LOAD is also executable so there will be no be behaviour > >>> change. It must be one of the library dependencies that is different. > >>> The difference in section headers output doesn't matter here since all > >>> that RTLD looks at is the PHDRS. > >>> > >> > >> I think you missed the fact that the .got and .plt are in the > >> material from the 2nd PT_LOAD: there are writeable code areas > >> involved for powerpc64. > >> > >> So both PT_LOAD's contribute code areas and there is a space > >> between the two contributions. The first PT_LOAD loads most > >> code (the readonly code, to be specific). The 2nd contributes > >> a writable-code area. > >> > >> But may be i've misunderstood the assumptions that your change > >> is based on. > > > > Before my change the second PT would also not be included in > > obj->textsize since we were setting obj->textsize as end of > > PT_LOAD[0]. > > After the change it will be end of last executable PT_LOAD (which will > > usually be PT_LOAD[0] but could also include more now). > > Since there is only one executable PT_LOAD which happens to be also be > > PT_LOAD[0], there will be no change to obj->textsize. > > > > The only time this commit could change anything is if there is a > > PT_LOAD that is executable but is not PT_LOAD[0] or if PT_LOAD[0] is > > not executable. > > I think it must be the former case since as far as I know ld.bfd will > > always create a read/execute segment as PT_LOAD[0] unless it is given > > a custom linker script. > > I do not see any evidence that PF_X would match the tests for either > of the following from the 2nd PT_LOAD: > > 19 .got 00000098 0000000010019800 0000000010019800 00009800 2**8 > CONTENTS, ALLOC, LOAD, DATA > 20 .plt 00000708 0000000010019898 0000000010019898 00009898 2**3 > ALLOC > > in the likes of: > > 135 if ((segs[nsegs]->p_flags & PF_X) == PF_X) { > 136 text_end = MAX(text_end, > 137 round_page(segs[nsegs]->p_vaddr + segs[nsegs]->p_memsz)); > 138 } > > in map_object.c > > This is possibly to avoid: > > 467 if (elfflags & PF_X) > 468 prot |= PROT_EXEC; > > because of writable code. > > > rtld.c also, for: > > 1397 nsegs++; > 1398 if ((ph->p_flags & PF_X) == PF_X) { > 1399 obj->textsize = MAX(obj->textsize, > 1400 round_page(ph->p_vaddr + ph->p_memsz) - obj->vaddrbase); > 1401 } > > Still, I may be missing something in my understanding. > Before this change obj->textsize was always set as the end of PT_LOAD[0]. Now it will contain everything up to the end of the last PT_LOAD with execute permissions. In the binary you dumped this is PT_LOAD[0] both before and after the patch so there is no change in behaviour. The .got and .plt we not included in textsize before this patch either. Therefore the only way I can see this patch breaking anything is if the PHDRS of one of the loaded libraries causes a change in behaviour. Alex From owner-svn-src-head@freebsd.org Tue Oct 30 22:40:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6C901036098; Tue, 30 Oct 2018 22:40:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D9FF7DBA2; Tue, 30 Oct 2018 22:40:41 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6019223B3D; Tue, 30 Oct 2018 22:40:41 +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 w9UMef1j038779; Tue, 30 Oct 2018 22:40:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UMefcU038778; Tue, 30 Oct 2018 22:40:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810302240.w9UMefcU038778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 30 Oct 2018 22:40:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339934 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 339934 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 22:40:41 -0000 Author: markj Date: Tue Oct 30 22:40:40 2018 New Revision: 339934 URL: https://svnweb.freebsd.org/changeset/base/339934 Log: Revert r336984. It appears to be responsible for random segfaults observed when lots of paging activity is taking place, but the root cause is not yet understood. Requested by: alc MFC after: now Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Tue Oct 30 21:35:56 2018 (r339933) +++ head/sys/vm/vm_object.c Tue Oct 30 22:40:40 2018 (r339934) @@ -2143,9 +2143,8 @@ vm_object_coalesce(vm_object_t prev_object, vm_ooffset next_size >>= PAGE_SHIFT; next_pindex = OFF_TO_IDX(prev_offset) + prev_size; - if (prev_object->ref_count > 1 && - prev_object->size != next_pindex && - (prev_object->flags & OBJ_ONEMAPPING) == 0) { + if ((prev_object->ref_count > 1) && + (prev_object->size != next_pindex)) { VM_OBJECT_WUNLOCK(prev_object); return (FALSE); } From owner-svn-src-head@freebsd.org Wed Oct 31 01:27:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 886F11071AC1; Wed, 31 Oct 2018 01:27:45 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3035283E83; Wed, 31 Oct 2018 01:27:45 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BFB825773; Wed, 31 Oct 2018 01:27:45 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9V1RiHo025464; Wed, 31 Oct 2018 01:27:44 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9V1RiFX025463; Wed, 31 Oct 2018 01:27:44 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201810310127.w9V1RiFX025463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 31 Oct 2018 01:27:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339936 - head/sys/amd64/vmm/amd X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/sys/amd64/vmm/amd X-SVN-Commit-Revision: 339936 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 01:27:45 -0000 Author: araujo Date: Wed Oct 31 01:27:44 2018 New Revision: 339936 URL: https://svnweb.freebsd.org/changeset/base/339936 Log: Merge cases with upper block. This is a cosmetic change only to simplify code. Reported by: anish Sponsored by: iXsystems Inc. Modified: head/sys/amd64/vmm/amd/svm_msr.c Modified: head/sys/amd64/vmm/amd/svm_msr.c ============================================================================== --- head/sys/amd64/vmm/amd/svm_msr.c Tue Oct 30 23:09:04 2018 (r339935) +++ head/sys/amd64/vmm/amd/svm_msr.c Wed Oct 31 01:27:44 2018 (r339936) @@ -122,11 +122,7 @@ svm_rdmsr(struct svm_softc *sc, int vcpu, u_int num, u case MSR_MTRR16kBase ... MSR_MTRR16kBase + 1: case MSR_MTRR64kBase: case MSR_SYSCFG: - *result = 0; - break; case MSR_AMDK8_IPM: - *result = 0; - break; case MSR_EXTFEATURES: *result = 0; break; From owner-svn-src-head@freebsd.org Wed Oct 31 05:17:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B09410795A5; Wed, 31 Oct 2018 05:17:55 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 212788C15C; Wed, 31 Oct 2018 05:17:55 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 028D927D3A; Wed, 31 Oct 2018 05:17:55 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9V5HsBm044322; Wed, 31 Oct 2018 05:17:54 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9V5Hr9p044316; Wed, 31 Oct 2018 05:17:53 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201810310517.w9V5Hr9p044316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 31 Oct 2018 05:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339941 - in head/sbin: fsck_ffs fsdb X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sbin: fsck_ffs fsdb X-SVN-Commit-Revision: 339941 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 05:17:55 -0000 Author: mckusick Date: Wed Oct 31 05:17:53 2018 New Revision: 339941 URL: https://svnweb.freebsd.org/changeset/base/339941 Log: In preparation for adding inode check-hashes, change the fsck_ffs inodirty() function to have a pointer to the inode being dirtied. No functional change (as for now the parameter is ununsed). Sponsored by: Netflix Modified: head/sbin/fsck_ffs/dir.c head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/inode.c head/sbin/fsck_ffs/pass1.c head/sbin/fsck_ffs/pass2.c head/sbin/fsdb/fsdb.c Modified: head/sbin/fsck_ffs/dir.c ============================================================================== --- head/sbin/fsck_ffs/dir.c Wed Oct 31 02:02:41 2018 (r339940) +++ head/sbin/fsck_ffs/dir.c Wed Oct 31 05:17:53 2018 (r339941) @@ -323,7 +323,7 @@ adjust(struct inodesc *idesc, int lcnt) if (preen || reply("ADJUST") == 1) { if (bkgrdflag == 0) { DIP_SET(dp, di_nlink, DIP(dp, di_nlink) - lcnt); - inodirty(); + inodirty(dp); } else { cmd.value = idesc->id_number; cmd.size = -lcnt; @@ -449,7 +449,7 @@ linkup(ino_t orphan, ino_t parentdir, char *name) pfatal("SORRY. CANNOT CREATE lost+found DIRECTORY\n\n"); return (0); } - inodirty(); + inodirty(dp); idesc.id_type = ADDR; idesc.id_func = pass4check; idesc.id_number = oldlfdir; @@ -474,7 +474,7 @@ linkup(ino_t orphan, ino_t parentdir, char *name) (void)makeentry(orphan, lfdir, ".."); dp = ginode(lfdir); DIP_SET(dp, di_nlink, DIP(dp, di_nlink) + 1); - inodirty(); + inodirty(dp); inoinfo(lfdir)->ino_linkcnt++; pwarn("DIR I=%lu CONNECTED. ", (u_long)orphan); if (parentdir != (ino_t)-1) { @@ -535,7 +535,7 @@ makeentry(ino_t parent, ino_t ino, const char *name) dp = ginode(parent); if (DIP(dp, di_size) % DIRBLKSIZ) { DIP_SET(dp, di_size, roundup(DIP(dp, di_size), DIRBLKSIZ)); - inodirty(); + inodirty(dp); } if ((ckinode(dp, &idesc) & ALTERED) != 0) return (1); @@ -591,7 +591,7 @@ expanddir(union dinode *dp, char *name) else if (reply("EXPAND") == 0) goto bad; dirty(bp); - inodirty(); + inodirty(dp); return (1); bad: DIP_SET(dp, di_db[lastbn], DIP(dp, di_db[lastbn + 1])); @@ -632,7 +632,7 @@ allocdir(ino_t parent, ino_t request, int mode) memmove(cp, &emptydir, sizeof emptydir); dirty(bp); DIP_SET(dp, di_nlink, 2); - inodirty(); + inodirty(dp); if (ino == UFS_ROOTINO) { inoinfo(ino)->ino_linkcnt = DIP(dp, di_nlink); cacheino(dp, ino); @@ -653,7 +653,7 @@ allocdir(ino_t parent, ino_t request, int mode) } dp = ginode(parent); DIP_SET(dp, di_nlink, DIP(dp, di_nlink) + 1); - inodirty(); + inodirty(dp); return (ino); } @@ -668,7 +668,7 @@ freedir(ino_t ino, ino_t parent) if (ino != parent) { dp = ginode(parent); DIP_SET(dp, di_nlink, DIP(dp, di_nlink) - 1); - inodirty(); + inodirty(dp); } freeino(ino); } Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Wed Oct 31 02:02:41 2018 (r339940) +++ head/sbin/fsck_ffs/fsck.h Wed Oct 31 05:17:53 2018 (r339941) @@ -448,7 +448,7 @@ union dinode *ginode(ino_t inumber); void infohandler(int sig); void alarmhandler(int sig); void inocleanup(void); -void inodirty(void); +void inodirty(union dinode *); struct inostat *inoinfo(ino_t inum); void IOstats(char *what); int linkup(ino_t orphan, ino_t parentdir, char *name); Modified: head/sbin/fsck_ffs/inode.c ============================================================================== --- head/sbin/fsck_ffs/inode.c Wed Oct 31 02:02:41 2018 (r339940) +++ head/sbin/fsck_ffs/inode.c Wed Oct 31 05:17:53 2018 (r339941) @@ -102,7 +102,7 @@ ckinode(union dinode *dp, struct inodesc *idesc) printf( "YOU MUST RERUN FSCK AFTERWARDS\n"); rerun = 1; - inodirty(); + inodirty(dp); } } @@ -142,7 +142,7 @@ ckinode(union dinode *dp, struct inodesc *idesc) printf( "YOU MUST RERUN FSCK AFTERWARDS\n"); rerun = 1; - inodirty(); + inodirty(dp); break; } } @@ -221,7 +221,7 @@ iblock(struct inodesc *idesc, long ilevel, off_t isize printf( "YOU MUST RERUN FSCK AFTERWARDS\n"); rerun = 1; - inodirty(); + inodirty(dp); bp->b_flags &= ~B_INUSE; return(STOP); } @@ -519,7 +519,7 @@ inocleanup(void) } void -inodirty(void) +inodirty(union dinode *dp) { dirty(pbp); @@ -544,7 +544,7 @@ clri(struct inodesc *idesc, const char *type, int flag (void)ckinode(dp, idesc); inoinfo(idesc->id_number)->ino_state = USTATE; clearinode(dp); - inodirty(); + inodirty(dp); } else { cmd.value = idesc->id_number; cmd.size = -DIP(dp, di_nlink); @@ -711,7 +711,7 @@ allocino(ino_t request, int type) DIP_SET(dp, di_size, sblock.fs_fsize); DIP_SET(dp, di_blocks, btodb(sblock.fs_fsize)); n_files++; - inodirty(); + inodirty(dp); inoinfo(ino)->ino_type = IFTODT(type); return (ino); } @@ -732,7 +732,7 @@ freeino(ino_t ino) dp = ginode(ino); (void)ckinode(dp, &idesc); clearinode(dp); - inodirty(); + inodirty(dp); inoinfo(ino)->ino_state = USTATE; n_files--; } Modified: head/sbin/fsck_ffs/pass1.c ============================================================================== --- head/sbin/fsck_ffs/pass1.c Wed Oct 31 02:02:41 2018 (r339940) +++ head/sbin/fsck_ffs/pass1.c Wed Oct 31 05:17:53 2018 (r339941) @@ -270,7 +270,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r if (reply("CLEAR") == 1) { dp = ginode(inumber); clearinode(dp); - inodirty(); + inodirty(dp); } } inoinfo(inumber)->ino_state = USTATE; @@ -293,7 +293,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r dp = ginode(inumber); DIP_SET(dp, di_size, sblock.fs_fsize); DIP_SET(dp, di_mode, IFREG|0600); - inodirty(); + inodirty(dp); } if ((mode == IFBLK || mode == IFCHR || mode == IFIFO || mode == IFSOCK) && DIP(dp, di_size) != 0) { @@ -410,7 +410,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r if (bkgrdflag == 0) { dp = ginode(inumber); DIP_SET(dp, di_blocks, idesc->id_entryno); - inodirty(); + inodirty(dp); } else { cmd.value = idesc->id_number; cmd.size = idesc->id_entryno - DIP(dp, di_blocks); @@ -430,7 +430,7 @@ unknown: inoinfo(inumber)->ino_state = USTATE; dp = ginode(inumber); clearinode(dp); - inodirty(); + inodirty(dp); } return (1); } Modified: head/sbin/fsck_ffs/pass2.c ============================================================================== --- head/sbin/fsck_ffs/pass2.c Wed Oct 31 02:02:41 2018 (r339940) +++ head/sbin/fsck_ffs/pass2.c Wed Oct 31 05:17:53 2018 (r339941) @@ -114,7 +114,7 @@ pass2(void) dp = ginode(UFS_ROOTINO); DIP_SET(dp, di_mode, DIP(dp, di_mode) & ~IFMT); DIP_SET(dp, di_mode, DIP(dp, di_mode) | IFDIR); - inodirty(); + inodirty(dp); break; case DSTATE: @@ -160,7 +160,7 @@ pass2(void) if (reply("FIX") == 1) { dp = ginode(inp->i_number); DIP_SET(dp, di_size, inp->i_isize); - inodirty(); + inodirty(dp); } } else if ((inp->i_isize & (DIRBLKSIZ - 1)) != 0) { getpathname(pathbuf, inp->i_number, inp->i_number); @@ -179,7 +179,7 @@ pass2(void) dp = ginode(inp->i_number); DIP_SET(dp, di_size, roundup(inp->i_isize, DIRBLKSIZ)); - inodirty(); + inodirty(dp); } } dp = &dino; Modified: head/sbin/fsdb/fsdb.c ============================================================================== --- head/sbin/fsdb/fsdb.c Wed Oct 31 02:02:41 2018 (r339940) +++ head/sbin/fsdb/fsdb.c Wed Oct 31 05:17:53 2018 (r339941) @@ -340,7 +340,7 @@ CMDFUNCSTART(zapi) GETINUM(1,inum); dp = ginode(inum); clearinode(dp); - inodirty(); + inodirty(dp); if (curinode) /* re-set after potential change */ curinode = ginode(curinum); return 0; @@ -370,7 +370,7 @@ CMDFUNCSTART(uplink) DIP_SET(curinode, di_nlink, DIP(curinode, di_nlink) + 1); printf("inode %ju link count now %d\n", (uintmax_t)curinum, DIP(curinode, di_nlink)); - inodirty(); + inodirty(curinode); return 0; } @@ -381,7 +381,7 @@ CMDFUNCSTART(downlink) DIP_SET(curinode, di_nlink, DIP(curinode, di_nlink) - 1); printf("inode %ju link count now %d\n", (uintmax_t)curinum, DIP(curinode, di_nlink)); - inodirty(); + inodirty(curinode); return 0; } @@ -919,7 +919,7 @@ CMDFUNCSTART(newtype) } DIP_SET(curinode, di_mode, DIP(curinode, di_mode) & ~IFMT); DIP_SET(curinode, di_mode, DIP(curinode, di_mode) | type); - inodirty(); + inodirty(curinode); printactive(0); return 0; } @@ -940,7 +940,7 @@ CMDFUNCSTART(chlen) } DIP_SET(curinode, di_size, len); - inodirty(); + inodirty(curinode); printactive(0); return rval; } @@ -962,7 +962,7 @@ CMDFUNCSTART(chmode) DIP_SET(curinode, di_mode, DIP(curinode, di_mode) & ~07777); DIP_SET(curinode, di_mode, DIP(curinode, di_mode) | modebits); - inodirty(); + inodirty(curinode); printactive(0); return rval; } @@ -987,7 +987,7 @@ CMDFUNCSTART(chaflags) return(1); } DIP_SET(curinode, di_flags, flags); - inodirty(); + inodirty(curinode); printactive(0); return rval; } @@ -1012,7 +1012,7 @@ CMDFUNCSTART(chgen) return(1); } DIP_SET(curinode, di_gen, gen); - inodirty(); + inodirty(curinode); printactive(0); return rval; } @@ -1037,7 +1037,7 @@ CMDFUNCSTART(linkcount) } DIP_SET(curinode, di_nlink, lcnt); - inodirty(); + inodirty(curinode); printactive(0); return rval; } @@ -1064,7 +1064,7 @@ CMDFUNCSTART(chowner) } DIP_SET(curinode, di_uid, uid); - inodirty(); + inodirty(curinode); printactive(0); return rval; } @@ -1090,7 +1090,7 @@ CMDFUNCSTART(chgroup) } DIP_SET(curinode, di_gid, gid); - inodirty(); + inodirty(curinode); printactive(0); return rval; } @@ -1159,7 +1159,7 @@ CMDFUNCSTART(chbtime) return 1; curinode->dp2.di_birthtime = _time_to_time64(secs); curinode->dp2.di_birthnsec = nsecs; - inodirty(); + inodirty(curinode); printactive(0); return 0; } @@ -1176,7 +1176,7 @@ CMDFUNCSTART(chmtime) else curinode->dp2.di_mtime = _time_to_time64(secs); DIP_SET(curinode, di_mtimensec, nsecs); - inodirty(); + inodirty(curinode); printactive(0); return 0; } @@ -1193,7 +1193,7 @@ CMDFUNCSTART(chatime) else curinode->dp2.di_atime = _time_to_time64(secs); DIP_SET(curinode, di_atimensec, nsecs); - inodirty(); + inodirty(curinode); printactive(0); return 0; } @@ -1210,7 +1210,7 @@ CMDFUNCSTART(chctime) else curinode->dp2.di_ctime = _time_to_time64(secs); DIP_SET(curinode, di_ctimensec, nsecs); - inodirty(); + inodirty(curinode); printactive(0); return 0; } From owner-svn-src-head@freebsd.org Wed Oct 31 07:53:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E297B107C94C; Wed, 31 Oct 2018 07:53:40 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5256269DC6; Wed, 31 Oct 2018 07:53:40 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w9V7rUep064955; Wed, 31 Oct 2018 00:53:30 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w9V7rT5F064954; Wed, 31 Oct 2018 00:53:29 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201810310753.w9V7rT5F064954@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r339930 - head/sys/net In-Reply-To: <201810302045.w9UKjFEm082518@repo.freebsd.org> To: "Bjoern A. Zeeb" Date: Wed, 31 Oct 2018 00:53:29 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, re@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 07:53:41 -0000 > Author: bz > Date: Tue Oct 30 20:45:15 2018 > New Revision: 339930 > URL: https://svnweb.freebsd.org/changeset/base/339930 > > Log: > With more excessive use of modules, more kernel parts working with > VIMAGE, and feature richness and global state increasing the 8k of > vnet module space are no longer sufficient for people and loading > multiple modules, e.g., pf(4) and ipl(4) or ipsec(4) will fail on > the second module. > > Increase the module space to 8 * PAGE_SIZE which should be enough > to hold multiple firewalls, ipsec, multicast (as in the old days was > a problem), epair, carp, and any kind of other vnet enabled modules. > > Sadly this is a global byte array part of the vnet_set, so we cannot > dynamically change its size; otherwise a TUNABLE would have been > a better solution. > > PR: 228854 > Reported by: Ernie Luzar, Marek Zarychta > Discussed with: rgrimes on current > MFC after: 3 days Pleaes fast track this, I would like to see this in before BETA3 is built on Nov 1st. Same with the better diagnostics commit that followed this. Thanks. Rod Modified: > head/sys/net/vnet.c > > Modified: head/sys/net/vnet.c > ============================================================================== > --- head/sys/net/vnet.c Tue Oct 30 20:08:48 2018 (r339929) > +++ head/sys/net/vnet.c Tue Oct 30 20:45:15 2018 (r339930) > @@ -171,7 +171,7 @@ static MALLOC_DEFINE(M_VNET_DATA, "vnet_data", "VNET d > * we want the virtualized global variable space to be page-sized, we may > * have more space than that in practice. > */ > -#define VNET_MODMIN 8192 > +#define VNET_MODMIN (8 * PAGE_SIZE) > #define VNET_SIZE roundup2(VNET_BYTES, PAGE_SIZE) > > /* > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Oct 31 09:25:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 802B1107F220; Wed, 31 Oct 2018 09:25:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3618D6C653; Wed, 31 Oct 2018 09:25:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 172DE25F5; Wed, 31 Oct 2018 09:25:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9V9PHIG071793; Wed, 31 Oct 2018 09:25:17 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9V9PHbp071792; Wed, 31 Oct 2018 09:25:17 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810310925.w9V9PHbp071792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 31 Oct 2018 09:25:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339943 - 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: 339943 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 09:25:18 -0000 Author: andrew Date: Wed Oct 31 09:25:17 2018 New Revision: 339943 URL: https://svnweb.freebsd.org/changeset/base/339943 Log: Remove the unused arm64_cpu driver. This was previously used for CPU initilisation, however this hasn't been the case in a long time. 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 Wed Oct 31 06:24:07 2018 (r339942) +++ head/sys/arm64/arm64/mp_machdep.c Wed Oct 31 09:25:17 2018 (r339943) @@ -126,8 +126,6 @@ static void ipi_stop(void *); struct mtx ap_boot_mtx; struct pcb stoppcbs[MAXCPU]; -static device_t cpu_list[MAXCPU]; - /* * Not all systems boot from the first CPU in the device tree. To work around * this we need to find which CPU we have booted from so when we later @@ -145,78 +143,6 @@ volatile int aps_ready = 0; /* Temporary variables for init_secondary() */ void *dpcpu[MAXCPU - 1]; - -static device_method_t arm64_cpu_methods[] = { - /* Device interface */ - DEVMETHOD(device_identify, arm64_cpu_identify), - DEVMETHOD(device_probe, arm64_cpu_probe), - DEVMETHOD(device_attach, arm64_cpu_attach), - - DEVMETHOD_END -}; - -static devclass_t arm64_cpu_devclass; -static driver_t arm64_cpu_driver = { - "arm64_cpu", - arm64_cpu_methods, - 0 -}; - -DRIVER_MODULE(arm64_cpu, cpu, arm64_cpu_driver, arm64_cpu_devclass, 0, 0); - -static void -arm64_cpu_identify(driver_t *driver, device_t parent) -{ - - if (device_find_child(parent, "arm64_cpu", -1) != NULL) - return; - if (BUS_ADD_CHILD(parent, 0, "arm64_cpu", -1) == NULL) - device_printf(parent, "add child failed\n"); -} - -static int -arm64_cpu_probe(device_t dev) -{ - u_int cpuid; - - cpuid = device_get_unit(dev); - if (cpuid >= MAXCPU || cpuid > mp_maxid) - return (EINVAL); - - device_quiet(dev); - return (0); -} - -static int -arm64_cpu_attach(device_t dev) -{ - const uint32_t *reg; - size_t reg_size; - u_int cpuid; - int i; - - cpuid = device_get_unit(dev); - - if (cpuid >= MAXCPU || cpuid > mp_maxid) - return (EINVAL); - KASSERT(cpu_list[cpuid] == NULL, ("Already have cpu %u", cpuid)); - - reg = cpu_get_cpuid(dev, ®_size); - if (reg == NULL) - return (EINVAL); - - if (bootverbose) { - device_printf(dev, "register <"); - for (i = 0; i < reg_size; i++) - printf("%s%x", (i == 0) ? "" : " ", reg[i]); - printf(">\n"); - } - - /* Set the device to start it later */ - cpu_list[cpuid] = dev; - - return (0); -} static void release_aps(void *dummy __unused) From owner-svn-src-head@freebsd.org Wed Oct 31 09:39:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAF57107F797; Wed, 31 Oct 2018 09:39:39 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 909F06CD5C; Wed, 31 Oct 2018 09:39:39 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C9A1278C; Wed, 31 Oct 2018 09:39:39 +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 w9V9ddmf077381; Wed, 31 Oct 2018 09:39:39 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9V9ddTc077380; Wed, 31 Oct 2018 09:39:39 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810310939.w9V9ddTc077380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 31 Oct 2018 09:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339944 - 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: 339944 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 09:39:40 -0000 Author: andrew Date: Wed Oct 31 09:39:38 2018 New Revision: 339944 URL: https://svnweb.freebsd.org/changeset/base/339944 Log: Fix some style(9) issues in the arm64 pmap_mapbios/unmapbios. Split lines when they are too long. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed Oct 31 09:25:17 2018 (r339943) +++ head/sys/arm64/arm64/pmap.c Wed Oct 31 09:39:38 2018 (r339944) @@ -4604,8 +4604,9 @@ pmap_mapbios(vm_paddr_t pa, vm_size_t size) if (size == 0) return (NULL); - /* Calculate how many full L2 blocks are needed for the mapping */ - l2_blocks = (roundup2(pa + size, L2_SIZE) - rounddown2(pa, L2_SIZE)) >> L2_SHIFT; + /* Calculate how many L2 blocks are needed for the mapping */ + l2_blocks = (roundup2(pa + size, L2_SIZE) - + rounddown2(pa, L2_SIZE)) >> L2_SHIFT; offset = pa & L2_OFFSET; @@ -4652,8 +4653,10 @@ pmap_mapbios(vm_paddr_t pa, vm_size_t size) for (i = 0; i < l2_blocks; i++) { pde = pmap_pde(kernel_pmap, va, &lvl); KASSERT(pde != NULL, - ("pmap_mapbios: Invalid page entry, va: 0x%lx", va)); - KASSERT(lvl == 1, ("pmap_mapbios: Invalid level %d", lvl)); + ("pmap_mapbios: Invalid page entry, va: 0x%lx", + va)); + KASSERT(lvl == 1, + ("pmap_mapbios: Invalid level %d", lvl)); /* Insert L2_BLOCK */ l2 = pmap_l1_to_l2(pde, va); @@ -4698,7 +4701,8 @@ pmap_unmapbios(vm_offset_t va, vm_size_t size) pt_entry_t *l2; int i, lvl, l2_blocks, block; - l2_blocks = (roundup2(va + size, L2_SIZE) - rounddown2(va, L2_SIZE)) >> L2_SHIFT; + l2_blocks = + (roundup2(va + size, L2_SIZE) - rounddown2(va, L2_SIZE)) >> L2_SHIFT; KASSERT(l2_blocks > 0, ("pmap_unmapbios: invalid size %lx", size)); /* Remove preinit mapping */ @@ -4706,7 +4710,8 @@ pmap_unmapbios(vm_offset_t va, vm_size_t size) for (i = 0; i < PMAP_PREINIT_MAPPING_COUNT; i++) { ppim = pmap_preinit_mapping + i; if (ppim->va == va) { - KASSERT(ppim->size == size, ("pmap_unmapbios: size mismatch")); + KASSERT(ppim->size == size, + ("pmap_unmapbios: size mismatch")); ppim->va = 0; ppim->pa = 0; ppim->size = 0; @@ -4716,10 +4721,12 @@ pmap_unmapbios(vm_offset_t va, vm_size_t size) /* Remove L2_BLOCK */ pde = pmap_pde(kernel_pmap, va_trunc, &lvl); KASSERT(pde != NULL, - ("pmap_unmapbios: Invalid page entry, va: 0x%lx", va_trunc)); + ("pmap_unmapbios: Invalid page entry, va: 0x%lx", + va_trunc)); l2 = pmap_l1_to_l2(pde, va_trunc); pmap_load_clear(l2); - pmap_invalidate_range(kernel_pmap, va_trunc, va_trunc + L2_SIZE); + pmap_invalidate_range(kernel_pmap, va_trunc, + va_trunc + L2_SIZE); if (block == (l2_blocks - 1)) return; From owner-svn-src-head@freebsd.org Wed Oct 31 10:30:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3DC910D21A8; Wed, 31 Oct 2018 10:30:20 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A31C6E690; Wed, 31 Oct 2018 10:30:20 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 474B42FA2; Wed, 31 Oct 2018 10:30:20 +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 w9VAUKfR003212; Wed, 31 Oct 2018 10:30:20 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VAUKZt003211; Wed, 31 Oct 2018 10:30:20 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810311030.w9VAUKZt003211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 31 Oct 2018 10:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339945 - 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: 339945 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 10:30:20 -0000 Author: andrew Date: Wed Oct 31 10:30:19 2018 New Revision: 339945 URL: https://svnweb.freebsd.org/changeset/base/339945 Log: Remove function prototypes for functions removed in r339943. 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 Wed Oct 31 09:39:38 2018 (r339944) +++ head/sys/arm64/arm64/mp_machdep.c Wed Oct 31 10:30:19 2018 (r339945) @@ -113,10 +113,6 @@ static void intr_pic_ipi_setup(u_int, const char *, in extern struct pcpu __pcpu[]; -static device_identify_t arm64_cpu_identify; -static device_probe_t arm64_cpu_probe; -static device_attach_t arm64_cpu_attach; - static void ipi_ast(void *); static void ipi_hardclock(void *); static void ipi_preempt(void *); From owner-svn-src-head@freebsd.org Wed Oct 31 10:45:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7A6810D2A88; Wed, 31 Oct 2018 10:45:29 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45C926F026; Wed, 31 Oct 2018 10:45:29 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0761A32CA; Wed, 31 Oct 2018 10:45:29 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9VAjSTF012969; Wed, 31 Oct 2018 10:45:28 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VAjSs7012968; Wed, 31 Oct 2018 10:45:28 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201810311045.w9VAjSs7012968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Wed, 31 Oct 2018 10:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339946 - in head: . share/mk X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: . share/mk X-SVN-Commit-Revision: 339946 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 10:45:29 -0000 Author: arichardson Date: Wed Oct 31 10:45:28 2018 New Revision: 339946 URL: https://svnweb.freebsd.org/changeset/base/339946 Log: Don't run cc --version during cleandir/obj stages This will no work when there is no cc in $PATH (which is the case before the cross-tools stage once we no longer inherit $PATH in $WMAKE). The variables set by bsd.compiler.mk/bsd.linker.mk are not needed in these stages so this avoids a little bit of makefile parsing. Reviewed By: emaste Approved By: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D16814 Modified: head/Makefile.inc1 head/share/mk/bsd.compiler.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Oct 31 10:30:19 2018 (r339945) +++ head/Makefile.inc1 Wed Oct 31 10:45:28 2018 (r339946) @@ -950,7 +950,7 @@ _worldtmp: .PHONY .else ${_+_}@if [ -e "${WORLDTMP}" ]; then \ echo ">>> Deleting stale files in build tree..."; \ - cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \ + cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES _NO_INCLUDE_COMPILERMK=t \ delete-old delete-old-libs >/dev/null; \ fi rm -rf ${WORLDTMP}/legacy/usr/include @@ -1003,19 +1003,21 @@ _cleanobj: @echo "--------------------------------------------------------------" @echo ">>> stage 2.1: cleaning up the object tree" @echo "--------------------------------------------------------------" - ${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR} + # Avoid including bsd.compiler.mk in clean and obj with _NO_INCLUDE_COMPILERMK + # since the restricted $PATH might not contain a valid cc binary + ${_+_}cd ${.CURDIR}; ${WMAKE} _NO_INCLUDE_COMPILERMK=t ${CLEANDIR} .if defined(LIBCOMPAT) - ${_+_}cd ${.CURDIR}; ${LIBCOMPATWMAKE} -f Makefile.inc1 ${CLEANDIR} + ${_+_}cd ${.CURDIR}; ${LIBCOMPATWMAKE} _NO_INCLUDE_COMPILERMK=t -f Makefile.inc1 ${CLEANDIR} .endif .else - ${_+_}cd ${.CURDIR}; ${WMAKE} _cleanobj_fast_depend_hack + ${_+_}cd ${.CURDIR}; ${WMAKE} _NO_INCLUDE_COMPILERMK=t _cleanobj_fast_depend_hack .endif # !defined(NO_CLEAN) _obj: @echo @echo "--------------------------------------------------------------" @echo ">>> stage 2.2: rebuilding the object tree" @echo "--------------------------------------------------------------" - ${_+_}cd ${.CURDIR}; ${WMAKE} obj + ${_+_}cd ${.CURDIR}; ${WMAKE} _NO_INCLUDE_COMPILERMK=t obj _build-tools: @echo @echo "--------------------------------------------------------------" Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Wed Oct 31 10:30:19 2018 (r339945) +++ head/share/mk/bsd.compiler.mk Wed Oct 31 10:45:28 2018 (r339946) @@ -33,6 +33,16 @@ ____: .include +.if defined(_NO_INCLUDE_COMPILERMK) +# If _NO_INCLUDE_COMPILERMK is set we are doing a make obj/cleandir/cleanobj +# and might not have a valid compiler in $PATH yet. In this case just set the +# variables that are expected by the other .mk files and return +COMPILER_TYPE=none +X_COMPILER_TYPE=none +COMPILER_VERSION=0 +X_COMPILER_VERSION=0 +COMPILER_FEATURES=none +.else # command = /usr/local/bin/ccache cc ... # wrapper = /usr/local/libexec/ccache/cc ... CCACHE_BUILD_TYPE?= command @@ -220,4 +230,5 @@ ${var}.${${X_}_cc_hash}:= ${${var}} .if !defined(_NO_INCLUDE_LINKERMK) .include .endif +.endif # defined(_NO_INCLUDE_COMPILERMK) .endif # !target(____) From owner-svn-src-head@freebsd.org Wed Oct 31 12:00:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BB7710D537C; Wed, 31 Oct 2018 12:00:36 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11650714F2; Wed, 31 Oct 2018 12:00: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3C694298; Wed, 31 Oct 2018 12:00:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9VC0ZUb049105; Wed, 31 Oct 2018 12:00:35 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VC0ZmE049104; Wed, 31 Oct 2018 12:00:35 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810311200.w9VC0ZmE049104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 31 Oct 2018 12:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339948 - 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: 339948 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 12:00:36 -0000 Author: andrew Date: Wed Oct 31 12:00:35 2018 New Revision: 339948 URL: https://svnweb.freebsd.org/changeset/base/339948 Log: Use pmap_invalidate_all rather than invalidating 512 level 2 entries in the early pmap_mapbios/unmapbios code. It is even worse when there are multiple L2 entries to handle as we would need to iterate over all pages. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed Oct 31 11:37:05 2018 (r339947) +++ head/sys/arm64/arm64/pmap.c Wed Oct 31 12:00:35 2018 (r339948) @@ -4663,11 +4663,11 @@ pmap_mapbios(vm_paddr_t pa, vm_size_t size) pmap_load_store(l2, pa | ATTR_DEFAULT | ATTR_XN | ATTR_IDX(CACHED_MEMORY) | L2_BLOCK); - pmap_invalidate_range(kernel_pmap, va, va + L2_SIZE); va += L2_SIZE; pa += L2_SIZE; } + pmap_invalidate_all(kernel_pmap); va = preinit_map_va + (start_idx * L2_SIZE); @@ -4700,12 +4700,14 @@ pmap_unmapbios(vm_offset_t va, vm_size_t size) pd_entry_t *pde; pt_entry_t *l2; int i, lvl, l2_blocks, block; + bool preinit_map; l2_blocks = (roundup2(va + size, L2_SIZE) - rounddown2(va, L2_SIZE)) >> L2_SHIFT; KASSERT(l2_blocks > 0, ("pmap_unmapbios: invalid size %lx", size)); /* Remove preinit mapping */ + preinit_map = false; block = 0; for (i = 0; i < PMAP_PREINIT_MAPPING_COUNT; i++) { ppim = pmap_preinit_mapping + i; @@ -4715,6 +4717,7 @@ pmap_unmapbios(vm_offset_t va, vm_size_t size) ppim->va = 0; ppim->pa = 0; ppim->size = 0; + preinit_map = true; offset = block * L2_SIZE; va_trunc = rounddown2(va, L2_SIZE) + offset; @@ -4725,13 +4728,15 @@ pmap_unmapbios(vm_offset_t va, vm_size_t size) va_trunc)); l2 = pmap_l1_to_l2(pde, va_trunc); pmap_load_clear(l2); - pmap_invalidate_range(kernel_pmap, va_trunc, - va_trunc + L2_SIZE); if (block == (l2_blocks - 1)) - return; + break; block++; } + } + if (preinit_map) { + pmap_invalidate_all(kernel_pmap); + return; } /* Unmap the pages reserved with kva_alloc. */ From owner-svn-src-head@freebsd.org Wed Oct 31 12:53:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19FA010D74D0; Wed, 31 Oct 2018 12:53:59 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C45A973A21; Wed, 31 Oct 2018 12:53:58 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A511D4C37; Wed, 31 Oct 2018 12:53:58 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9VCrwAR080460; Wed, 31 Oct 2018 12:53:58 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VCrwG4080459; Wed, 31 Oct 2018 12:53:58 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201810311253.w9VCrwG4080459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Wed, 31 Oct 2018 12:53:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339952 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 339952 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 12:53:59 -0000 Author: 0mp (ports committer) Date: Wed Oct 31 12:53:58 2018 New Revision: 339952 URL: https://svnweb.freebsd.org/changeset/base/339952 Log: tpm(4): Add the STANDARDS and HISTORY sections Also, link to the homepage of the BSSSD project, which developed the original driver. Reviewed by: bcr, kevans Approved by: krion (mentor, implicit), mat (mentor, implicit) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D17608 Modified: head/share/man/man4/tpm.4 Modified: head/share/man/man4/tpm.4 ============================================================================== --- head/share/man/man4/tpm.4 Wed Oct 31 12:50:39 2018 (r339951) +++ head/share/man/man4/tpm.4 Wed Oct 31 12:53:58 2018 (r339952) @@ -15,7 +15,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 15, 2010 +.Dd October 31, 2018 .Dt TPM 4 .Os .Sh NAME @@ -76,6 +76,44 @@ interrupt vector in .Xr intro 4 , .Xr device.hints 5 , .Xr config 8 +.Pp +The homepage of the BSSSD project, which developed the original +.Nm +driver: +.Lk "http://bsssd.sourceforge.net/" . +.Pp +TPM main specification can be found at: +.Lk "https://trustedcomputinggroup.org/resource/tpm-main-specification/" . +.Sh STANDARDS +TPM Main Specification Level 2 Version 1.2: +.Bl -dash +.It +.Rs +.%A ISO/IEC +.%T 11889-1:2009, Information technology -- Trusted Platform Module -- Part 1: Overview +.%U "https://www.iso.org/standard/50970.html" +.Re +.It +.Rs +.%A ISO/IEC +.%T 11889-2:2009, Information technology -- Trusted Platform Module -- Part 2: Design principles +.%U "https://www.iso.org/standard/50971.html" +.Re +.It +.Rs +.%A ISO/IEC +.%T 11889-3:2009, Information technology -- Trusted Platform Module -- Part 3: Structures +.%U "https://www.iso.org/standard/50972.html" +.Re +.El +.Sh HISTORY +The +.Nm +driver +first appeared in +.Fx 8.2 +and was later added to +.Ox 6.1 . .Sh AUTHORS .An -nosplit The From owner-svn-src-head@freebsd.org Wed Oct 31 14:07:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 112C010DA593 for ; Wed, 31 Oct 2018 14:07:17 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89AA6768AC for ; Wed, 31 Oct 2018 14:07:16 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-ed1-x542.google.com with SMTP id u12-v6so10852528eds.4 for ; Wed, 31 Oct 2018 07:07:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Xda4X/sBW0jPMVbmpuTzQ0rtkGQmp96cP+tc02JwxRw=; b=XWExuOy0XJY5SsAGKAlmB0+Qu25YjYqUXX2d2Vnwn9zXS/VnbVB3gk/IG6HH2Ixmvj 3XKB50PVOil417gKuOY1n/gWfW+p4jziaxmxX9NmvsIS6FAwgn0TnGiS5jUS/YkqbsY2 OYXrb1U2QNejTcNMLwdVtnKucdqvSbhX9cbxBKlKBTghXLQeWt77m/7Wvgkd8JDWz03n BmD9kkLWz5x1Xi3HWQ18GhDXUeDzwV09f9ZLKTcWIAW3GXfFPM4iNLWKg5oYy9k07NN8 rQNaQy6yqKG5n7HPsqRxTd2S8g9v4F06s/h/A2XGOAGHajpEvO5b/oTlqaiBRyYEYc/I z+bA== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Xda4X/sBW0jPMVbmpuTzQ0rtkGQmp96cP+tc02JwxRw=; b=PV0KH8XG0rd3eIIaEQZriUjqGj7P42ZYkF+DsTkKpqNX+i0NSRaLT9pUplrXeib8on ydAh/fOeBf/qcWlGQZAUl5wuyyRacc9jtqab4eh7EHcu0UesCnu4VdIUMRNHUuPSoNRa EE9iUQwdMMGw5waPZ3rQiT6Ur5X79i6ZGaERVhHv38TypS7VXci/kyGfEzPuyfBXy6tF 7T6DhpwHbKVct3zlDxN55j2QyqcXq0FmYwSNIX1Cm8J3annG37J2LMIJyFRL738Whxq8 OKzF7Qg2uPfKIreHfO56zesJ5gYgF6ZqnjhlUOWe2a9LBGzn0G2HAIiMFuLS0lqAawk5 pvTQ== X-Gm-Message-State: AGRZ1gKt7bJLpE5dasV4hvl16hJbABEjGXpW/McWXN4wxMmMFyPMsLTZ +p9QgNNgzqkCP4IkGjjqCnCr1Q== X-Google-Smtp-Source: AJdET5eRinbtdIfzqXR6QEcHkGFH3aHe/4mAxlNNEXPWVvoZplZFKZuusIMB0yAJHcL/54cFUSLJQw== X-Received: by 2002:aa7:d804:: with SMTP id v4-v6mr2203041edq.255.1540994835299; Wed, 31 Oct 2018 07:07:15 -0700 (PDT) Received: from mutt-hbsd ([5.101.40.89]) by smtp.gmail.com with ESMTPSA id b9-v6sm2742217ejd.3.2018.10.31.07.07.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Oct 2018 07:07:14 -0700 (PDT) Date: Wed, 31 Oct 2018 10:06:31 -0400 From: Shawn Webb To: Marcelo Araujo Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339936 - head/sys/amd64/vmm/amd Message-ID: <20181031140631.ipwlwh3rlm7ma4xk@mutt-hbsd> References: <201810310127.w9V1RiFX025463@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xvtltbeb4cvnrabj" Content-Disposition: inline In-Reply-To: <201810310127.w9V1RiFX025463@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-ALPHA7 FreeBSD 12.0-ALPHA7 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180622 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 14:07:17 -0000 --xvtltbeb4cvnrabj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 31, 2018 at 01:27:44AM +0000, Marcelo Araujo wrote: > Author: araujo > Date: Wed Oct 31 01:27:44 2018 > New Revision: 339936 > URL: https://svnweb.freebsd.org/changeset/base/339936 >=20 > Log: > Merge cases with upper block. > This is a cosmetic change only to simplify code. > =20 > Reported by: anish > Sponsored by: iXsystems Inc. >=20 > Modified: > head/sys/amd64/vmm/amd/svm_msr.c >=20 > Modified: head/sys/amd64/vmm/amd/svm_msr.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/amd64/vmm/amd/svm_msr.c Tue Oct 30 23:09:04 2018 (r339935) > +++ head/sys/amd64/vmm/amd/svm_msr.c Wed Oct 31 01:27:44 2018 (r339936) > @@ -122,11 +122,7 @@ svm_rdmsr(struct svm_softc *sc, int vcpu, u_int num,= u > case MSR_MTRR16kBase ... MSR_MTRR16kBase + 1: > case MSR_MTRR64kBase: > case MSR_SYSCFG: > - *result =3D 0; > - break; > case MSR_AMDK8_IPM: > - *result =3D 0; > - break; > case MSR_EXTFEATURES: > *result =3D 0; > break; Does this need a /* FALLTHROUGH */ comment to appease the Coverity Gods? Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --xvtltbeb4cvnrabj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlvZtuIACgkQaoRlj1JF bu7YFxAAotLfwS4nmHkls1xlMbHO3p+lP7fFfthSLhnsEFSHLNCxtNRcLYCFyIpU TiSKpDWZ7yAJOtW5vjEjZFSRNC5CEaXBGJN0wCHdhlsbFhtdh7RvmYazNB/U6zTC hCuCdXnRThDKhfU3Rbb8Fax+Lnp/t38tm7e/w4z7h/D/6k7Fb2MjmADVAiwi5epn RLKu4KtUl3DUr2gBhsEkedJx7peWPdALiQE2MOA//A2hOTyE9SSjcL2mvOLsdC8i iVsT2bBWhVjIamxMXXjO0v+lq6eR8WGkqwDVoHHDXJcimmqtytp7rCAm+UNiI3Jg Z53edZLY1Ghj5rptb3xg/SsGUqC2GlBz+ey12YobxcX6/yPjKvJ3xO3W1FLmM+/g A8T04chtwtJG9XNe87L45TD1GvSWNR85mRHoV4TLieajUnCA8hjzovteBbcKffnt bAAwPmJ/SNVlH4+YAGN39bjfMYwqXZ/DUatbLWaUi2uG2W+i6n/Hifjr1bu3ZvOZ c/mR7IRvvQQh4QrAZXg/uR1+dPylNwwKJGt3SaauZGK1Ph5OKs1gT0JIs5eZB90e peT+KYSthlC4CVu9KKkiKzdD+vw0y9iCgb3OnbtGlp/kQfjdU0GfJlKviiucYg/T poKWItRICo32mTUmVPPKM6+4zFeEUbLgmB+02yjosN0U7/v7Z2w= =It1J -----END PGP SIGNATURE----- --xvtltbeb4cvnrabj-- From owner-svn-src-head@freebsd.org Wed Oct 31 14:12:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB5D610DAB97; Wed, 31 Oct 2018 14:12:18 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49B6E76DF3; Wed, 31 Oct 2018 14:12:18 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-lf1-x129.google.com with SMTP id h192so11765728lfg.3; Wed, 31 Oct 2018 07:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=usWPUN25vv2Db7zMbidg6FWEJkqndvVQCp3L1VYJAEI=; b=VYIRLwDMTnckKlgvrS2SZ6KOF8H4dk0fVR5nz1TPktBWShUJQuHcSg3cslajrQ+7ri VAjvGZi9L+Cbc4AebqJV//TetH6UKUKBoT4k8IInqX54o/nsdfOEa99sfAY4c/S60BPh n+gFWvByeIeCpvhuUE+RzSXnN4gfe4/IulSYa3VwIUWHO2FY9rZSoCioToFjiE2OkK41 AfDEQIxBBNlqwnwyYmqbuyMeGl2SMPjJq9KjbK+gDVU/dIZq+Wp23I8H1/bAJGg3nRyx ALORobty6RQonN5wn5iCCdEeE3+bQtXBmja1Y9s1V4rm43aeD1lXXCss9gmnl1/iyitq KNkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=usWPUN25vv2Db7zMbidg6FWEJkqndvVQCp3L1VYJAEI=; b=dF0qlNKN3kEdyPc8vDE6XkyzkKUYBiHRhtCX/3T/b6GsVd2ys8/dr1+fq4kC0MdcY/ E6jqFuZiPqtik7UgmQZzNB/lKHXD6hTb2GrFxk2xm780LfFGpyew5gjjcRdGMcfRBxMs GYA+4wSUlqXgIugXS6COoxvq5KjV/sXjVDZCeYTKPsfGvdHShC/z7vGuoz/2Ahh+Ub8O l6Iv82MLnAUIjuuRCK/Oyae3y+r7Vjg2mq/CV1Jb9+Ro44ER/2sj6n/D8wsTYCqS7flz coq0g2Z3YFXDgJJrGEc3xfkTSfquvLUDVsGsPUlbk0ZhFBB6Z5pzd4X3BAHC7IYWtH/E HXrg== X-Gm-Message-State: AGRZ1gJQI/LDzIHLMkoj6p3HY4MD26AOIbza1TBriPYQXv78f1DSEzGP XkFcca2N6QomWz1VK863v7PS1ak52I98nmeazd89AQ== X-Google-Smtp-Source: AJdET5dYDyjH3SQPEAbmkZTU8GHQcH4M+X+8gnGWcrSKhYMSpnbmbDK19n5R4Zx1QvWYXhRT6ErQFwkGEK/vV4kiZjI= X-Received: by 2002:a19:1d0d:: with SMTP id d13mr1906787lfd.74.1540995136081; Wed, 31 Oct 2018 07:12:16 -0700 (PDT) MIME-Version: 1.0 References: <201810310127.w9V1RiFX025463@repo.freebsd.org> <20181031140631.ipwlwh3rlm7ma4xk@mutt-hbsd> In-Reply-To: <20181031140631.ipwlwh3rlm7ma4xk@mutt-hbsd> Reply-To: araujo@freebsd.org From: Marcelo Araujo Date: Wed, 31 Oct 2018 22:12:04 +0800 Message-ID: Subject: Re: svn commit: r339936 - head/sys/amd64/vmm/amd To: Shawn Webb Cc: Marcelo Araujo , 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.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 14:12:19 -0000 On Wed, Oct 31, 2018, 10:07 PM Shawn Webb wrote: > On Wed, Oct 31, 2018 at 01:27:44AM +0000, Marcelo Araujo wrote: > > Author: araujo > > Date: Wed Oct 31 01:27:44 2018 > > New Revision: 339936 > > URL: https://svnweb.freebsd.org/changeset/base/339936 > > > > Log: > > Merge cases with upper block. > > This is a cosmetic change only to simplify code. > > > > Reported by: anish > > Sponsored by: iXsystems Inc. > > > > Modified: > > head/sys/amd64/vmm/amd/svm_msr.c > > > > Modified: head/sys/amd64/vmm/amd/svm_msr.c > > > ============================================================================== > > --- head/sys/amd64/vmm/amd/svm_msr.c Tue Oct 30 23:09:04 2018 > (r339935) > > +++ head/sys/amd64/vmm/amd/svm_msr.c Wed Oct 31 01:27:44 2018 > (r339936) > > @@ -122,11 +122,7 @@ svm_rdmsr(struct svm_softc *sc, int vcpu, u_int > num, u > > case MSR_MTRR16kBase ... MSR_MTRR16kBase + 1: > > case MSR_MTRR64kBase: > > case MSR_SYSCFG: > > - *result = 0; > > - break; > > case MSR_AMDK8_IPM: > > - *result = 0; > > - break; > > case MSR_EXTFEATURES: > > *result = 0; > > break; > > Does this need a /* FALLTHROUGH */ comment to appease the Coverity > Gods? > Wow yeah, probably yes!!! I will check tomorrow! Thanks. > Thanks, > > -- > Shawn Webb > Cofounder and Security Engineer > HardenedBSD > > Tor-ified Signal: +1 443-546-8752 > Tor+XMPP+OTR: lattera@is.a.hacker.sx > GPG Key ID: 0x6A84658F52456EEE > GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE > From owner-svn-src-head@freebsd.org Wed Oct 31 14:19:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E38510DB1AF; Wed, 31 Oct 2018 14:19:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E7DF775F6; Wed, 31 Oct 2018 14:19:59 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F6925978; Wed, 31 Oct 2018 14:19:59 +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 w9VEJw28023124; Wed, 31 Oct 2018 14:19:58 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VEJwmA023123; Wed, 31 Oct 2018 14:19:58 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810311419.w9VEJwmA023123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 31 Oct 2018 14:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339954 - head/lib/csu/common X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/csu/common X-SVN-Commit-Revision: 339954 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 14:19:59 -0000 Author: emaste Date: Wed Oct 31 14:19:58 2018 New Revision: 339954 URL: https://svnweb.freebsd.org/changeset/base/339954 Log: Add __used to __CTOR_LIST__ and __DTOR_LIST__ Enabling BSD_CRTBEGIN on amd64 resulted in error: unused variable '__CTOR_LIST__'. __CTOR_LIST__ is indeed unused in crtbegin.c; it marks the beginning of the .ctors array and is used in crtend.c. Annotate __DTOR_LIST__ as well for consistency. Discussed with: andrew MFC with: r339738 Sponsored by: The FreeBSD Foundation Modified: head/lib/csu/common/crtbegin.c Modified: head/lib/csu/common/crtbegin.c ============================================================================== --- head/lib/csu/common/crtbegin.c Wed Oct 31 14:03:48 2018 (r339953) +++ head/lib/csu/common/crtbegin.c Wed Oct 31 14:19:58 2018 (r339954) @@ -45,10 +45,10 @@ void *__dso_handle = 0; #ifdef HAVE_CTORS static void __do_global_dtors_aux(void) __used; -static crt_func __CTOR_LIST__[] __section(".ctors") = { +static crt_func __CTOR_LIST__[] __section(".ctors") __used = { (crt_func)-1 }; -static crt_func __DTOR_LIST__[] __section(".dtors") = { +static crt_func __DTOR_LIST__[] __section(".dtors") __used = { (crt_func)-1 }; From owner-svn-src-head@freebsd.org Wed Oct 31 14:49:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8F8F10DC0A1; Wed, 31 Oct 2018 14:49:29 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f171.google.com (mail-it1-f171.google.com [209.85.166.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55F06790DA; Wed, 31 Oct 2018 14:49:29 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f171.google.com with SMTP id s16so2253438itj.1; Wed, 31 Oct 2018 07:49:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TpvgE1yHwq+OoN6ClvPSJGXUsG6Krs7r0ABc0JwSNc0=; b=m/dDtAWa0PdIOfpLJs9m5Hd4DmN0XnIKcQSqhmr49PEr/Gj0Su4b8Ix6topohBGxB9 kU0poLQP3Ls8mmiawtatBCMyna2GN/1rviQiXjhx7OMnwfdpfrWiN5amEYADOksfZAKH DUtVJ1KRT9r1bIgytiFh086hnymH7oxuwbAhtE3nDv4GaLc4GvAIluuNLSd77HcNMuNQ If6RtsD8FE5gYpnjffG622ZoScxVQdOWkyqhhx0Zu5YRrwj3W2TA/zxPqncqUD0+mzQH XfmIqGbT1v3L3TjioNalzygiYJXCbeqxx4VdjJ0lrMi6ZDkj4AG7mxh8fwSyjbWQPhAJ Hf4A== X-Gm-Message-State: AGRZ1gKt84nCk+h0lvPwmxnliKFajRYBRDMRTo+0fRUkSvkb+44WdT2Y vRPOy6agPSwjeP3JUMNtnS2zK3+6UQoGh+5FaL2YbWd4 X-Google-Smtp-Source: AJdET5dZ23um9V4lKjL7amg2r7iwWQFrULDJ2asxbi/dY0sSzmpvxRjqSurapGinBO3QbQjZglIOdx96O0z4Ke+unzE= X-Received: by 2002:a24:11d0:: with SMTP id 199-v6mr2234629itf.33.1540997368608; Wed, 31 Oct 2018 07:49:28 -0700 (PDT) MIME-Version: 1.0 References: <201810310127.w9V1RiFX025463@repo.freebsd.org> <20181031140631.ipwlwh3rlm7ma4xk@mutt-hbsd> In-Reply-To: <20181031140631.ipwlwh3rlm7ma4xk@mutt-hbsd> From: Ed Maste Date: Wed, 31 Oct 2018 06:50:53 -0400 Message-ID: Subject: Re: svn commit: r339936 - head/sys/amd64/vmm/amd To: Shawn Webb Cc: Marcelo Araujo , src-committers , 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 14:49:29 -0000 On Wed, 31 Oct 2018 at 10:07, Shawn Webb wrote: > > Does this need a /* FALLTHROUGH */ comment to appease the Coverity > Gods? No, successive case statements without intervening bodies is a widely used idiom well understood by all reasonable tools. From owner-svn-src-head@freebsd.org Wed Oct 31 14:52:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73FE010DC309 for ; Wed, 31 Oct 2018 14:52:41 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E54C179507 for ; Wed, 31 Oct 2018 14:52:40 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1540997551; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Qmvrtpkk+AWttktSZlS+vfw7Lr5qgnvEESMvRUE+h5DUwCZHqfmu/TPrRfOesea901BfalDmp9Hog enFUcm9DLewo/rg4U59s5uKR9I3jze+fEQAaBsJeaRH8rKubTnn1Rc8L5ESO4DGSn159HSObezfE8j 4xLyJZ0yKprhx2BXNQ4Q/ebbkzfR8O8yavO0yY2yP2zsveAGwlKqnJGjxtu8aKExt8ygtz8Rc3Mdb4 vonvkj75qN6XBgn6OFP8P/wO/s9e/fMvU8gj6oZ75DhPmoe2RZp9WHOXss3VTaWgTqdslnBis0KwKB 6ex85GbOAU/4JYl0XkFMyj9Xgzxi7hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=Hd1Awmkuu0I/S+5TgXlK4bgsIZerGKumy4sOuOUii7U=; b=isHG5iTA4FSCZZfnGPFiMRhVSLcP9GGOOiHNOu50EQViGZpNI8ej/CLotY5qqECNCEuTRfpcHE02Q rgvIUB+WXN4MTVhaG7m3/qNA0PEfmN8q92UQ8QugW6NivzHiUBQy8App+Hcf9EsfGTcoJ7CFfDO6An 11J6ZHfAsxJgNE96a9FEIfa3FNMimWe2aFX9L1QLw7qP1rvz1PrT+tPc2nt/PV4yOuCNFqugijvxVK vGVStdmmUhkPC1ZIxvEXuyPuzJi+T+NOFzngSahGWT9pzcz6qiQgZLu1MwxIaD1mtcmjFhVZ5VFn1Q FA8pk7r0g6+jUvDc7IX80NHD4ZFtyDg== ARC-Authentication-Results: i=1; outbound1.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=Hd1Awmkuu0I/S+5TgXlK4bgsIZerGKumy4sOuOUii7U=; b=HU9T5YX/qJnk4WMf5mBIpuFeUMlXjFWCDc/ZPVJVhYTA+qBuiAVEJ4LX5ZdIyzF3gCs9i0TFg5Cbr YQYpRdyZJMdDjRvBG9AwFlAl1FDuvLU3AtRnA/uIxf+DuU8s9XM9BDBzvx8hv9ey0dKJVrhLkN2mfV ezpQGts0OuSuYJEDCCjAnIilW/97kMzT0FgL/v+FdioERTSFGmvEVCI9/qjLVK+Pw/pdn7oP5//ok9 DFgaGb6GZZohABySC/F0prJSxBlF3G99dSXW6lBjShHZDaIVPIgVcbK3CIcQHdpQ0/GTXMwnVeo24X gAV3cFSlCzChlGC6Wtkyrrb2Q8e0aOw== X-MHO-RoutePath: aGlwcGll X-MHO-User: 9273fc5f-dd1c-11e8-9048-075f73944867 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 9273fc5f-dd1c-11e8-9048-075f73944867; Wed, 31 Oct 2018 14:52:27 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w9VEqLRV067365; Wed, 31 Oct 2018 08:52:21 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1540997541.22340.165.camel@freebsd.org> Subject: Re: svn commit: r339936 - head/sys/amd64/vmm/amd From: Ian Lepore To: Shawn Webb , Marcelo Araujo Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 31 Oct 2018 08:52:21 -0600 In-Reply-To: <20181031140631.ipwlwh3rlm7ma4xk@mutt-hbsd> References: <201810310127.w9V1RiFX025463@repo.freebsd.org> <20181031140631.ipwlwh3rlm7ma4xk@mutt-hbsd> 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 14:52:41 -0000 On Wed, 2018-10-31 at 10:06 -0400, Shawn Webb wrote: > On Wed, Oct 31, 2018 at 01:27:44AM +0000, Marcelo Araujo wrote: > > > > Author: araujo > > Date: Wed Oct 31 01:27:44 2018 > > New Revision: 339936 > > URL: https://svnweb.freebsd.org/changeset/base/339936 > > > > Log: > >   Merge cases with upper block. > >   This is a cosmetic change only to simplify code. > >    > >   Reported by: anish > >   Sponsored by: iXsystems Inc. > > > > Modified: > >   head/sys/amd64/vmm/amd/svm_msr.c > > > > Modified: head/sys/amd64/vmm/amd/svm_msr.c > > =================================================================== > > =========== > > --- head/sys/amd64/vmm/amd/svm_msr.c Tue Oct 30 23:09:04 > > 2018 (r339935) > > +++ head/sys/amd64/vmm/amd/svm_msr.c Wed Oct 31 01:27:44 > > 2018 (r339936) > > @@ -122,11 +122,7 @@ svm_rdmsr(struct svm_softc *sc, int vcpu, > > u_int num, u > >   case MSR_MTRR16kBase ... MSR_MTRR16kBase + 1: > >   case MSR_MTRR64kBase: > >   case MSR_SYSCFG: > > - *result = 0; > > - break; > >   case MSR_AMDK8_IPM: > > - *result = 0; > > - break; > >   case MSR_EXTFEATURES: > >   *result = 0; > >   break; > Does this need a /* FALLTHROUGH */ comment to appease the Coverity > Gods? > > Thanks, > I would hope not, stacking multiple case values together is a common technique that almost never indicates a coding accident. The fall- through warning should only get triggered when there is executable code without a break between the various case values.  Good:    case 1:    case 2:        code();        break;  Warning:    case 1:        code();    case 2:        morecode();        break; -- Ian From owner-svn-src-head@freebsd.org Wed Oct 31 15:04:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF4C010DC6FD; Wed, 31 Oct 2018 15:04:41 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9505779C42; Wed, 31 Oct 2018 15:04:41 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 771236200; Wed, 31 Oct 2018 15:04:41 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9VF4fpQ049458; Wed, 31 Oct 2018 15:04:41 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VF4fkk049457; Wed, 31 Oct 2018 15:04:41 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201810311504.w9VF4fkk049457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Wed, 31 Oct 2018 15:04:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339955 - head/usr.bin/sed/tests/regress.multitest.out X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/usr.bin/sed/tests/regress.multitest.out X-SVN-Commit-Revision: 339955 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 15:04:42 -0000 Author: yuripv Date: Wed Oct 31 15:04:41 2018 New Revision: 339955 URL: https://svnweb.freebsd.org/changeset/base/339955 Log: usr.bin/sed/tests: fix one of the regression test cases by adding its results file to the build. Reviewed by: kevans Approved by: kib (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D17776 Modified: head/usr.bin/sed/tests/regress.multitest.out/Makefile Modified: head/usr.bin/sed/tests/regress.multitest.out/Makefile ============================================================================== --- head/usr.bin/sed/tests/regress.multitest.out/Makefile Wed Oct 31 14:19:58 2018 (r339954) +++ head/usr.bin/sed/tests/regress.multitest.out/Makefile Wed Oct 31 15:04:41 2018 (r339955) @@ -38,6 +38,7 @@ ${PACKAGE}FILES+= 2.2 ${PACKAGE}FILES+= 2.20 ${PACKAGE}FILES+= 2.21 ${PACKAGE}FILES+= 2.22 +${PACKAGE}FILES+= 2.23 ${PACKAGE}FILES+= 2.3 ${PACKAGE}FILES+= 2.4 ${PACKAGE}FILES+= 2.5 From owner-svn-src-head@freebsd.org Wed Oct 31 15:29:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0685C10DCE9B; Wed, 31 Oct 2018 15:29:27 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF02D7AD99; Wed, 31 Oct 2018 15:29:26 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 908466559; Wed, 31 Oct 2018 15:29:26 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9VFTQWl060545; Wed, 31 Oct 2018 15:29:26 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VFTQ1T060544; Wed, 31 Oct 2018 15:29:26 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201810311529.w9VFTQ1T060544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Wed, 31 Oct 2018 15:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339956 - head/cddl/contrib/opensolaris/cmd/dtrace X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/dtrace X-SVN-Commit-Revision: 339956 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 15:29:27 -0000 Author: yuripv Date: Wed Oct 31 15:29:26 2018 New Revision: 339956 URL: https://svnweb.freebsd.org/changeset/base/339956 Log: dtrace(1): remove reference to dtruss that was removed from base system in r300226. PR: 211618 Reviewed by: gnn, markj, 0mp Approved by: kib (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D17762 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Wed Oct 31 15:04:41 2018 (r339955) +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Wed Oct 31 15:29:26 2018 (r339956) @@ -20,7 +20,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2018 +.Dd October 30, 2018 .Dt DTRACE 1 .Os .Sh NAME @@ -778,7 +778,6 @@ Invalid command line options or arguments were specifi .El .Sh SEE ALSO .Xr cpp 1 , -.Xr dtruss 1 , .Xr elf 5 , .Xr SDT 9 .Rs From owner-svn-src-head@freebsd.org Wed Oct 31 16:10:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 944CF10DDF92; Wed, 31 Oct 2018 16:10:05 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4610D7C669; Wed, 31 Oct 2018 16:10:05 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 274266C0A; Wed, 31 Oct 2018 16:10:05 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9VGA5kG081475; Wed, 31 Oct 2018 16:10:05 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VGA5pV081474; Wed, 31 Oct 2018 16:10:05 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201810311610.w9VGA5pV081474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Wed, 31 Oct 2018 16:10:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339957 - head/bin/ps X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/bin/ps X-SVN-Commit-Revision: 339957 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 16:10:05 -0000 Author: 0mp (ports committer) Date: Wed Oct 31 16:10:04 2018 New Revision: 339957 URL: https://svnweb.freebsd.org/changeset/base/339957 Log: ps(1): Add a standard exit status section Reviewed by: bcr, eadler Approved by: krion (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D17146 Modified: head/bin/ps/ps.1 Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Wed Oct 31 15:29:26 2018 (r339956) +++ head/bin/ps/ps.1 Wed Oct 31 16:10:04 2018 (r339957) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd March 13, 2018 +.Dd October 31, 2018 .Dt PS 1 .Os .Sh NAME @@ -750,6 +750,8 @@ attempts to automatically determine the terminal width .It Pa /boot/kernel/kernel default system namelist .El +.Sh EXIT STATUS +.Ex -std .Sh EXAMPLES Display information on all system processes: .Pp From owner-svn-src-head@freebsd.org Wed Oct 31 16:17:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF95C10DE2FD; Wed, 31 Oct 2018 16:17:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FD127CC08; Wed, 31 Oct 2018 16:17:46 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50B7E6DCE; Wed, 31 Oct 2018 16:17:46 +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 w9VGHk3E086451; Wed, 31 Oct 2018 16:17:46 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VGHkkR086450; Wed, 31 Oct 2018 16:17:46 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201810311617.w9VGHkkR086450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 31 Oct 2018 16:17:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339958 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 339958 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 16:17:47 -0000 Author: brooks Date: Wed Oct 31 16:17:45 2018 New Revision: 339958 URL: https://svnweb.freebsd.org/changeset/base/339958 Log: Reformat syscalls.master for better readability. This takes advantage of two recents changes to makesyscalls.sh: r328598: Permit a range of syscall numbers for UNIMPL r339624: Remove the need for backslashes in syscalls.master Syscall declerations are now split across multiple lines with the syscall name and variables each on seperate lines (with an exception for syscalls taking no arguments.) Reviewed by: imp Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17706 Modified: head/sys/kern/syscalls.master Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Wed Oct 31 16:10:04 2018 (r339957) +++ head/sys/kern/syscalls.master Wed Oct 31 16:17:45 2018 (r339958) @@ -84,314 +84,867 @@ ; redistributions should be placed in the reserved range at the end ; of the current calls. -0 AUE_NULL STD { int nosys(void); } syscall nosys_args int -1 AUE_EXIT STD { void sys_exit(int rval); } exit \ - sys_exit_args void -2 AUE_FORK STD { int fork(void); } -3 AUE_READ STD { ssize_t read(int fd, \ - _Out_writes_bytes_(nbyte) void *buf, \ - size_t nbyte); } -4 AUE_WRITE STD { ssize_t write(int fd, \ - _In_reads_bytes_(nbyte) const void *buf, \ - size_t nbyte); } -5 AUE_OPEN_RWTC STD { int open( \ - _In_z_ char *path, \ - int flags, \ - int mode); } +0 AUE_NULL STD { + int nosys(void); + } syscall nosys_args int +1 AUE_EXIT STD { + void sys_exit( + int rval + ); + } exit sys_exit_args void +2 AUE_FORK STD { + int fork(void); + } +3 AUE_READ STD { + ssize_t read( + int fd, + _Out_writes_bytes_(nbyte) void *buf, + size_t nbyte + ); + } +4 AUE_WRITE STD { + ssize_t write( + int fd, + _In_reads_bytes_(nbyte) const void *buf, + size_t nbyte + ); + } +5 AUE_OPEN_RWTC STD { + int open( + _In_z_ char *path, + int flags, + int mode + ); + } ; XXX should be { int open(const char *path, int flags, ...); } ; but we're not ready for `const' or varargs. ; XXX man page says `mode_t mode'. -6 AUE_CLOSE STD { int close(int fd); } -7 AUE_WAIT4 STD { int wait4(int pid, \ - _Out_opt_ int *status, \ - int options, \ - _Out_opt_ struct rusage *rusage); } -8 AUE_CREAT COMPAT { int creat(_In_z_ char *path, int mode); } -9 AUE_LINK STD { int link(_In_z_ char *path, \ - _In_z_ char *link); } -10 AUE_UNLINK STD { int unlink(_In_z_ char *path); } +6 AUE_CLOSE STD { + int close( + int fd + ); + } +7 AUE_WAIT4 STD { + int wait4( + int pid, + _Out_opt_ int *status, + int options, + _Out_opt_ struct rusage *rusage + ); + } +8 AUE_CREAT COMPAT { + int creat( + _In_z_ char *path, + int mode + ); + } +9 AUE_LINK STD { + int link( + _In_z_ char *path, + _In_z_ char *link + ); + } +10 AUE_UNLINK STD { + int unlink( + _In_z_ char *path + ); + } 11 AUE_NULL OBSOL execv -12 AUE_CHDIR STD { int chdir(_In_z_ char *path); } -13 AUE_FCHDIR STD { int fchdir(int fd); } -14 AUE_MKNOD COMPAT11 { int mknod(_In_z_ char *path, int mode, \ - int dev); } -15 AUE_CHMOD STD { int chmod(_In_z_ char *path, int mode); } -16 AUE_CHOWN STD { int chown(_In_z_ char *path, \ - int uid, int gid); } -17 AUE_NULL STD { caddr_t break(_In_ char *nsize); } -18 AUE_GETFSSTAT COMPAT4 { int getfsstat( \ - _Out_writes_bytes_opt_(bufsize) \ - struct ostatfs *buf, \ - long bufsize, int mode); } -19 AUE_LSEEK COMPAT { long lseek(int fd, long offset, \ - int whence); } -20 AUE_GETPID STD { pid_t getpid(void); } -21 AUE_MOUNT STD { int mount(_In_z_ char *type, \ - _In_z_ char *path, int flags, \ - _In_opt_ caddr_t data); } +12 AUE_CHDIR STD { + int chdir( + _In_z_ char *path + ); + } +13 AUE_FCHDIR STD { + int fchdir( + int fd + ); + } +14 AUE_MKNOD COMPAT11 { + int mknod( + _In_z_ char *path, + int mode, + int dev + ); + } +15 AUE_CHMOD STD { + int chmod( + _In_z_ char *path, + int mode + ); + } +16 AUE_CHOWN STD { + int chown( + _In_z_ char *path, + int uid, + int gid + ); + } +17 AUE_NULL STD { + caddr_t break( + _In_ char *nsize + ); + } +18 AUE_GETFSSTAT COMPAT4 { + int getfsstat( + _Out_writes_bytes_opt_(bufsize) struct ostatfs *buf, + long bufsize, + int mode + ); + } +19 AUE_LSEEK COMPAT { + long lseek( + int fd, + long offset, + int whence + ); + } +20 AUE_GETPID STD { + pid_t getpid(void); + } +21 AUE_MOUNT STD { + int mount( + _In_z_ char *type, + _In_z_ char *path, + int flags, + _In_opt_ caddr_t data + ); + } ; XXX `path' should have type `const char *' but we're not ready for that. -22 AUE_UMOUNT STD { int unmount(_In_z_ char *path, int flags); } -23 AUE_SETUID STD { int setuid(uid_t uid); } -24 AUE_GETUID STD { uid_t getuid(void); } -25 AUE_GETEUID STD { uid_t geteuid(void); } -26 AUE_PTRACE STD { int ptrace(int req, pid_t pid, \ - _Inout_opt_ caddr_t addr, int data); } -27 AUE_RECVMSG STD { int recvmsg(int s, \ - _Inout_ struct msghdr *msg, int flags); } -28 AUE_SENDMSG STD { int sendmsg(int s, _In_ struct msghdr *msg, \ - int flags); } -29 AUE_RECVFROM STD { int recvfrom(int s, \ - _Out_writes_bytes_(len) caddr_t buf, \ - size_t len, int flags, \ - _Out_writes_bytes_opt_(*fromlenaddr) \ - struct sockaddr *from, \ - _Inout_opt_ \ - __socklen_t *fromlenaddr); } -30 AUE_ACCEPT STD { int accept(int s, \ - _Out_writes_bytes_opt_(*anamelen) \ - struct sockaddr *name, \ - _Inout_opt_ \ - __socklen_t *anamelen); } -31 AUE_GETPEERNAME STD { int getpeername(int fdes, \ - _Out_writes_bytes_(*alen) \ - struct sockaddr *asa, \ - _Inout_opt_ \ - __socklen_t *alen); } -32 AUE_GETSOCKNAME STD { int getsockname(int fdes, \ - _Out_writes_bytes_(*alen) \ - struct sockaddr *asa, \ - _Inout_ __socklen_t *alen); } -33 AUE_ACCESS STD { int access(_In_z_ char *path, int amode); } -34 AUE_CHFLAGS STD { int chflags(_In_z_ const char *path, \ - u_long flags); } -35 AUE_FCHFLAGS STD { int fchflags(int fd, u_long flags); } -36 AUE_SYNC STD { int sync(void); } -37 AUE_KILL STD { int kill(int pid, int signum); } -38 AUE_STAT COMPAT { int stat(_In_z_ char *path, \ - _Out_ struct ostat *ub); } -39 AUE_GETPPID STD { pid_t getppid(void); } -40 AUE_LSTAT COMPAT { int lstat(_In_z_ char *path, \ - _Out_ struct ostat *ub); } -41 AUE_DUP STD { int dup(u_int fd); } -42 AUE_PIPE COMPAT10 { int pipe(void); } -43 AUE_GETEGID STD { gid_t getegid(void); } -44 AUE_PROFILE STD { int profil( \ - _Out_writes_bytes_(size) caddr_t samples, \ - size_t size, size_t offset, u_int scale); } -45 AUE_KTRACE STD { int ktrace(_In_z_ const char *fname, \ - int ops, int facs, int pid); } -46 AUE_SIGACTION COMPAT { int sigaction(int signum, \ - _In_opt_ struct osigaction *nsa, \ - _Out_opt_ struct osigaction *osa); } -47 AUE_GETGID STD { gid_t getgid(void); } -48 AUE_SIGPROCMASK COMPAT { int sigprocmask(int how, osigset_t mask); } +22 AUE_UMOUNT STD { + int unmount( + _In_z_ char *path, + int flags + ); + } +23 AUE_SETUID STD { + int setuid( + uid_t uid + ); + } +24 AUE_GETUID STD { + uid_t getuid(void); + } +25 AUE_GETEUID STD { + uid_t geteuid(void); + } +26 AUE_PTRACE STD { + int ptrace( + int req, + pid_t pid, + _Inout_opt_ caddr_t addr, + int data + ); + } +27 AUE_RECVMSG STD { + int recvmsg( + int s, + _Inout_ struct msghdr *msg, + int flags + ); + } +28 AUE_SENDMSG STD { + int sendmsg( + int s, + _In_ struct msghdr *msg, + int flags + ); + } +29 AUE_RECVFROM STD { + int recvfrom( + int s, + _Out_writes_bytes_(len) caddr_t buf, + size_t len, + int flags, + _Out_writes_bytes_opt_(*fromlenaddr) struct sockaddr *from, + _Inout_opt_ __socklen_t *fromlenaddr + ); + } +30 AUE_ACCEPT STD { + int accept( + int s, + _Out_writes_bytes_opt_(*anamelen) struct sockaddr *name, + _Inout_opt_ __socklen_t *anamelen + ); + } +31 AUE_GETPEERNAME STD { + int getpeername( + int fdes, + _Out_writes_bytes_(*alen) struct sockaddr *asa, + _Inout_opt_ __socklen_t *alen + ); + } +32 AUE_GETSOCKNAME STD { + int getsockname( + int fdes, + _Out_writes_bytes_(*alen) struct sockaddr *asa, + _Inout_ __socklen_t *alen + ); + } +33 AUE_ACCESS STD { + int access( + _In_z_ char *path, + int amode + ); + } +34 AUE_CHFLAGS STD { + int chflags( + _In_z_ const char *path, + u_long flags + ); + } +35 AUE_FCHFLAGS STD { + int fchflags( + int fd, + u_long flags + ); + } +36 AUE_SYNC STD { + int sync(void); + } +37 AUE_KILL STD { + int kill( + int pid, + int signum + ); + } +38 AUE_STAT COMPAT { + int stat( + _In_z_ char *path, + _Out_ struct ostat *ub + ); + } +39 AUE_GETPPID STD { + pid_t getppid(void); + } +40 AUE_LSTAT COMPAT { + int lstat( + _In_z_ char *path, + _Out_ struct ostat *ub + ); + } +41 AUE_DUP STD { + int dup( + u_int fd + ); + } +42 AUE_PIPE COMPAT10 { + int pipe(void); + } +43 AUE_GETEGID STD { + gid_t getegid(void); + } +44 AUE_PROFILE STD { + int profil( + _Out_writes_bytes_(size) caddr_t samples, + size_t size, + size_t offset, + u_int scale + ); + } +45 AUE_KTRACE STD { + int ktrace( + _In_z_ const char *fname, + int ops, + int facs, + int pid + ); + } +46 AUE_SIGACTION COMPAT { + int sigaction( + int signum, + _In_opt_ struct osigaction *nsa, + _Out_opt_ struct osigaction *osa + ); + } +47 AUE_GETGID STD { + gid_t getgid(void); + } +48 AUE_SIGPROCMASK COMPAT { + int sigprocmask( + int how, + osigset_t mask + ); + } ; XXX note nonstandard (bogus) calling convention - the libc stub passes ; us the mask, not a pointer to it, and we return the old mask as the ; (int) return value. -49 AUE_GETLOGIN STD { int getlogin( \ - _Out_writes_z_(namelen) char *namebuf, \ - u_int namelen); } -50 AUE_SETLOGIN STD { int setlogin(_In_z_ char *namebuf); } -51 AUE_ACCT STD { int acct(_In_z_ char *path); } -52 AUE_SIGPENDING COMPAT { int sigpending(void); } -53 AUE_SIGALTSTACK STD { int sigaltstack(_In_opt_ stack_t *ss, \ - _Out_opt_ stack_t *oss); } -54 AUE_IOCTL STD { int ioctl(int fd, u_long com, \ - _Inout_opt_ caddr_t data); } -55 AUE_REBOOT STD { int reboot(int opt); } -56 AUE_REVOKE STD { int revoke(_In_z_ char *path); } -57 AUE_SYMLINK STD { int symlink(_In_z_ char *path, \ - _In_z_ char *link); } -58 AUE_READLINK STD { ssize_t readlink(_In_z_ char *path, \ - _Out_writes_z_(count) char *buf, \ - size_t count); } -59 AUE_EXECVE STD { int execve( \ - _In_z_ char *fname, \ - _In_z_ char **argv, \ - _In_z_ char **envv); } -60 AUE_UMASK STD { int umask(int newmask); } -61 AUE_CHROOT STD { int chroot(_In_z_ char *path); } -62 AUE_FSTAT COMPAT { int fstat(int fd, _Out_ struct ostat *sb); } -63 AUE_NULL COMPAT { int getkerninfo(int op, \ - _Out_writes_bytes_opt(*size) char *where, \ - _Inout_opt_ size_t *size, \ - int arg); } getkerninfo getkerninfo_args int -64 AUE_NULL COMPAT { int getpagesize(void); } getpagesize \ - getpagesize_args int -65 AUE_MSYNC STD { int msync(_In_ void *addr, size_t len, \ - int flags); } -66 AUE_VFORK STD { int vfork(void); } +49 AUE_GETLOGIN STD { + int getlogin( + _Out_writes_z_(namelen) char *namebuf, + u_int namelen + ); + } +50 AUE_SETLOGIN STD { + int setlogin( + _In_z_ char *namebuf + ); + } +51 AUE_ACCT STD { + int acct( + _In_z_ char *path + ); + } +52 AUE_SIGPENDING COMPAT { + int sigpending(void); + } +53 AUE_SIGALTSTACK STD { + int sigaltstack( + _In_opt_ stack_t *ss, + _Out_opt_ stack_t *oss + ); + } +54 AUE_IOCTL STD { + int ioctl( + int fd, + u_long com, + _Inout_opt_ caddr_t data + ); + } +55 AUE_REBOOT STD { + int reboot( + int opt + ); + } +56 AUE_REVOKE STD { + int revoke( + _In_z_ char *path + ); + } +57 AUE_SYMLINK STD { + int symlink( + _In_z_ char *path, + _In_z_ char *link + ); + } +58 AUE_READLINK STD { + ssize_t readlink( + _In_z_ char *path, + _Out_writes_z_(count) char *buf, + size_t count + ); + } +59 AUE_EXECVE STD { + int execve( + _In_z_ char *fname, + _In_z_ char **argv, + _In_z_ char **envv + ); + } +60 AUE_UMASK STD { + int umask( + int newmask + ); + } +61 AUE_CHROOT STD { + int chroot( + _In_z_ char *path + ); + } +62 AUE_FSTAT COMPAT { + int fstat( + int fd, + _Out_ struct ostat *sb + ); + } +63 AUE_NULL COMPAT { + int getkerninfo( + int op, + _Out_writes_bytes_opt( + *size) char *where, + _Inout_opt_ size_t *size, + int arg + ); + } getkerninfo getkerninfo_args int +64 AUE_NULL COMPAT { + int getpagesize(void); + } getpagesize getpagesize_args int +65 AUE_MSYNC STD { + int msync( + _In_ void *addr, + size_t len, + int flags + ); + } +66 AUE_VFORK STD { + int vfork(void); + } 67 AUE_NULL OBSOL vread 68 AUE_NULL OBSOL vwrite -69 AUE_SBRK STD { int sbrk(int incr); } -70 AUE_SSTK STD { int sstk(int incr); } -71 AUE_MMAP COMPAT { int mmap(_In_ void *addr, int len, int prot, \ - int flags, int fd, long pos); } -72 AUE_O_VADVISE COMPAT11 { int vadvise(int anom); } -73 AUE_MUNMAP STD { int munmap(_In_ void *addr, size_t len); } -74 AUE_MPROTECT STD { int mprotect(_In_ void *addr, \ - size_t len, int prot); } -75 AUE_MADVISE STD { int madvise(_In_ void *addr, \ - size_t len, int behav); } +69 AUE_SBRK STD { + int sbrk( + int incr + ); + } +70 AUE_SSTK STD { + int sstk( + int incr + ); + } +71 AUE_MMAP COMPAT { + int mmap( + _In_ void *addr, + int len, + int prot, + int flags, + int fd, + long pos + ); + } +72 AUE_O_VADVISE COMPAT11 { + int vadvise( + int anom + ); + } +73 AUE_MUNMAP STD { + int munmap( + _In_ void *addr, + size_t len + ); + } +74 AUE_MPROTECT STD { + int mprotect( + _In_ void *addr, + size_t len, + int prot + ); + } +75 AUE_MADVISE STD { + int madvise( + _In_ void *addr, + size_t len, + int behav + ); + } 76 AUE_NULL OBSOL vhangup 77 AUE_NULL OBSOL vlimit -78 AUE_MINCORE STD { int mincore( \ - _In_ const void *addr, \ - size_t len, \ - _Out_writes_bytes_(len/PAGE_SIZE) \ - char *vec); } -79 AUE_GETGROUPS STD { int getgroups(u_int gidsetsize, \ - _Out_writes_opt_(gidsetsize) \ - gid_t *gidset); } -80 AUE_SETGROUPS STD { int setgroups(u_int gidsetsize, \ - _In_reads_(gidsetsize) gid_t *gidset); } -81 AUE_GETPGRP STD { int getpgrp(void); } -82 AUE_SETPGRP STD { int setpgid(int pid, int pgid); } -83 AUE_SETITIMER STD { int setitimer(u_int which, \ - _In_ struct itimerval *itv, \ - _Out_opt_ struct itimerval *oitv); } -84 AUE_WAIT4 COMPAT { int wait(void); } -85 AUE_SWAPON STD { int swapon(_In_z_ char *name); } -86 AUE_GETITIMER STD { int getitimer(u_int which, \ - _Out_ struct itimerval *itv); } -87 AUE_SYSCTL COMPAT { int gethostname( \ - _Out_writes_z_(len) char *hostname, \ - u_int len); } gethostname \ - gethostname_args int -88 AUE_SYSCTL COMPAT { int sethostname( \ - _In_reads_z_(len) char *hostname, \ - u_int len); } sethostname \ - sethostname_args int -89 AUE_GETDTABLESIZE STD { int getdtablesize(void); } -90 AUE_DUP2 STD { int dup2(u_int from, u_int to); } +78 AUE_MINCORE STD { + int mincore( + _In_ const void *addr, + size_t len, + _Out_writes_bytes_(len/PAGE_SIZE) char *vec + ); + } +79 AUE_GETGROUPS STD { + int getgroups( + u_int gidsetsize, + _Out_writes_opt_(gidsetsize) gid_t *gidset + ); + } +80 AUE_SETGROUPS STD { + int setgroups( + u_int gidsetsize, + _In_reads_(gidsetsize) gid_t *gidset + ); + } +81 AUE_GETPGRP STD { + int getpgrp(void); + } +82 AUE_SETPGRP STD { + int setpgid( + int pid, + int pgid + ); + } +83 AUE_SETITIMER STD { + int setitimer( + u_int which, + _In_ struct itimerval *itv, + _Out_opt_ struct itimerval *oitv + ); + } +84 AUE_WAIT4 COMPAT { + int wait(void); + } +85 AUE_SWAPON STD { + int swapon( + _In_z_ char *name + ); + } +86 AUE_GETITIMER STD { + int getitimer( + u_int which, + _Out_ struct itimerval *itv + ); + } +87 AUE_SYSCTL COMPAT { + int gethostname( + _Out_writes_z_(len) char *hostname, + u_int len + ); + } gethostname gethostname_args int +88 AUE_SYSCTL COMPAT { + int sethostname( + _In_reads_z_(len) char *hostname, + u_int len + ); + } sethostname sethostname_args int +89 AUE_GETDTABLESIZE STD { + int getdtablesize(void); + } +90 AUE_DUP2 STD { + int dup2( + u_int from, + u_int to + ); + } 91 AUE_NULL UNIMPL getdopt -92 AUE_FCNTL STD { int fcntl(int fd, int cmd, long arg); } -; XXX should be { int fcntl(int fd, int cmd, ...); } +92 AUE_FCNTL STD { + int fcntl( + int fd, + int cmd, + long arg + ); + } +; XXX should be { int fcntl(int fd, int cmd, ...); } ; but we're not ready for varargs. -93 AUE_SELECT STD { int select(int nd, \ - _Inout_opt_ fd_set *in, \ - _Inout_opt_ fd_set *ou, \ - _Inout_opt_ fd_set *ex, \ - _In_opt_ struct timeval *tv); } +93 AUE_SELECT STD { + int select( + int nd, + _Inout_opt_ fd_set *in, + _Inout_opt_ fd_set *ou, + _Inout_opt_ fd_set *ex, + _In_opt_ struct timeval *tv + ); + } 94 AUE_NULL UNIMPL setdopt -95 AUE_FSYNC STD { int fsync(int fd); } -96 AUE_SETPRIORITY STD { int setpriority(int which, int who, \ - int prio); } -97 AUE_SOCKET STD { int socket(int domain, int type, \ - int protocol); } -98 AUE_CONNECT STD { int connect(int s, \ - _In_reads_bytes_(namelen) caddr_t name, \ - int namelen); } -99 AUE_ACCEPT COMPAT|NOARGS { int accept(int s, \ - _Out_writes_bytes_opt_(*anamelen) \ - caddr_t name, int *anamelen); } \ - accept accept_args int -100 AUE_GETPRIORITY STD { int getpriority(int which, int who); } -101 AUE_SEND COMPAT { int send(int s, \ - _In_reads_bytes_(len) caddr_t buf, \ - int len, \ - int flags); } -102 AUE_RECV COMPAT { int recv(int s, \ - _Out_writes_bytes_(len) caddr_t buf, \ - int len, int flags); } -103 AUE_SIGRETURN COMPAT { int sigreturn( \ - _In_ struct osigcontext *sigcntxp); } -104 AUE_BIND STD { int bind(int s, \ - _In_reads_bytes_(namelen) caddr_t name, \ - int namelen); } -105 AUE_SETSOCKOPT STD { int setsockopt(int s, int level, int name, \ - _In_reads_bytes_opt_(valsize) caddr_t val, \ - int valsize); } -106 AUE_LISTEN STD { int listen(int s, int backlog); } +95 AUE_FSYNC STD { + int fsync( + int fd + ); + } +96 AUE_SETPRIORITY STD { + int setpriority( + int which, + int who, + int prio + ); + } +97 AUE_SOCKET STD { + int socket( + int domain, + int type, + int protocol + ); + } +98 AUE_CONNECT STD { + int connect( + int s, + _In_reads_bytes_(namelen) caddr_t name, + int namelen + ); + } +99 AUE_ACCEPT COMPAT|NOARGS { + int accept( + int s, + _Out_writes_bytes_opt_(*anamelen) caddr_t name, + int *anamelen + ); + } accept accept_args int +100 AUE_GETPRIORITY STD { + int getpriority( + int which, + int who + ); + } +101 AUE_SEND COMPAT { + int send( + int s, + _In_reads_bytes_(len) caddr_t buf, + int len, + int flags + ); + } +102 AUE_RECV COMPAT { + int recv( + int s, + _Out_writes_bytes_(len) caddr_t buf, + int len, + int flags + ); + } +103 AUE_SIGRETURN COMPAT { + int sigreturn( + _In_ struct osigcontext *sigcntxp + ); + } +104 AUE_BIND STD { + int bind( + int s, + _In_reads_bytes_(namelen) caddr_t name, + int namelen + ); + } +105 AUE_SETSOCKOPT STD { + int setsockopt( + int s, + int level, + int name, + _In_reads_bytes_opt_(valsize) caddr_t val, + int valsize + ); + } +106 AUE_LISTEN STD { + int listen( + int s, + int backlog + ); + } 107 AUE_NULL OBSOL vtimes -108 AUE_NULL COMPAT { int sigvec(int signum, \ - _In_opt_ struct sigvec *nsv, \ - _Out_opt_ struct sigvec *osv); } -109 AUE_NULL COMPAT { int sigblock(int mask); } -110 AUE_NULL COMPAT { int sigsetmask(int mask); } -111 AUE_NULL COMPAT { int sigsuspend(osigset_t mask); } +108 AUE_NULL COMPAT { + int sigvec( + int signum, + _In_opt_ struct sigvec *nsv, + _Out_opt_ struct sigvec *osv + ); + } +109 AUE_NULL COMPAT { + int sigblock( + int mask + ); + } +110 AUE_NULL COMPAT { + int sigsetmask( + int mask + ); + } +111 AUE_NULL COMPAT { + int sigsuspend( + osigset_t mask + ); + } ; XXX note nonstandard (bogus) calling convention - the libc stub passes ; us the mask, not a pointer to it. -112 AUE_NULL COMPAT { int sigstack(_In_opt_ struct sigstack *nss, \ - _Out_opt_ struct sigstack *oss); } -113 AUE_RECVMSG COMPAT { int recvmsg(int s, \ - _Inout_ struct omsghdr *msg, \ - int flags); } -114 AUE_SENDMSG COMPAT { int sendmsg(int s, _In_ caddr_t msg, \ - int flags); } +112 AUE_NULL COMPAT { + int sigstack( + _In_opt_ struct sigstack *nss, + _Out_opt_ struct sigstack *oss + ); + } +113 AUE_RECVMSG COMPAT { + int recvmsg( + int s, + _Inout_ struct omsghdr *msg, + int flags + ); + } +114 AUE_SENDMSG COMPAT { + int sendmsg( + int s, + _In_ caddr_t msg, + int flags + ); + } 115 AUE_NULL OBSOL vtrace -116 AUE_GETTIMEOFDAY STD { int gettimeofday( \ - _Out_ struct timeval *tp, \ - _Out_opt_ struct timezone *tzp); } -117 AUE_GETRUSAGE STD { int getrusage(int who, \ - _Out_ struct rusage *rusage); } -118 AUE_GETSOCKOPT STD { int getsockopt(int s, int level, int name, \ - _Out_writes_bytes_opt_(*avalsize) \ - caddr_t val, _Inout_ int *avalsize); } +116 AUE_GETTIMEOFDAY STD { + int gettimeofday( + _Out_ struct timeval *tp, + _Out_opt_ struct timezone *tzp + ); + } +117 AUE_GETRUSAGE STD { + int getrusage( + int who, + _Out_ struct rusage *rusage + ); + } +118 AUE_GETSOCKOPT STD { + int getsockopt( + int s, + int level, + int name, + _Out_writes_bytes_opt_(*avalsize) caddr_t val, + _Inout_ int *avalsize + ); + } 119 AUE_NULL UNIMPL resuba (BSD/OS 2.x) -120 AUE_READV STD { int readv(int fd, \ - _Inout_updates_(iovcnt) struct iovec *iovp, \ - u_int iovcnt); } -121 AUE_WRITEV STD { int writev(int fd, \ - _In_reads_opt_(iovcnt) struct iovec *iovp, \ - u_int iovcnt); } -122 AUE_SETTIMEOFDAY STD { int settimeofday( \ - _In_ struct timeval *tv, \ - _In_opt_ struct timezone *tzp); } -123 AUE_FCHOWN STD { int fchown(int fd, int uid, int gid); } -124 AUE_FCHMOD STD { int fchmod(int fd, int mode); } -125 AUE_RECVFROM COMPAT|NOARGS { int recvfrom(int s, \ - _Out_writes_(len) caddr_t buf, \ - size_t len, int flags, \ - _Out_writes_bytes_(*fromlenaddr) \ - caddr_t from, \ - _Inout_ int *fromlenaddr); } \ - recvfrom recvfrom_args int -126 AUE_SETREUID STD { int setreuid(int ruid, int euid); } -127 AUE_SETREGID STD { int setregid(int rgid, int egid); } -128 AUE_RENAME STD { int rename(_In_z_ char *from, \ - _In_z_ char *to); } -129 AUE_TRUNCATE COMPAT { int truncate(_In_z_ char *path, \ - long length); } -130 AUE_FTRUNCATE COMPAT { int ftruncate(int fd, long length); } -131 AUE_FLOCK STD { int flock(int fd, int how); } -132 AUE_MKFIFO STD { int mkfifo(_In_z_ char *path, int mode); } -133 AUE_SENDTO STD { int sendto(int s, \ - _In_reads_bytes_(len) caddr_t buf, \ - size_t len, int flags, \ - _In_reads_bytes_opt_(tolen) caddr_t to, \ - int tolen); } -134 AUE_SHUTDOWN STD { int shutdown(int s, int how); } -135 AUE_SOCKETPAIR STD { int socketpair(int domain, int type, \ - int protocol, _Out_writes_(2) int *rsv); } -136 AUE_MKDIR STD { int mkdir(_In_z_ char *path, int mode); } -137 AUE_RMDIR STD { int rmdir(_In_z_ char *path); } -138 AUE_UTIMES STD { int utimes(_In_z_ char *path, \ - _In_ struct timeval *tptr); } +120 AUE_READV STD { + int readv( + int fd, + _Inout_updates_(iovcnt) struct iovec *iovp, + u_int iovcnt + ); + } +121 AUE_WRITEV STD { + int writev( + int fd, + _In_reads_opt_(iovcnt) struct iovec *iovp, + u_int iovcnt + ); + } +122 AUE_SETTIMEOFDAY STD { + int settimeofday( + _In_ struct timeval *tv, + _In_opt_ struct timezone *tzp + ); + } +123 AUE_FCHOWN STD { + int fchown( + int fd, + int uid, + int gid + ); + } +124 AUE_FCHMOD STD { + int fchmod( + int fd, + int mode + ); + } +125 AUE_RECVFROM COMPAT|NOARGS { + int recvfrom( + int s, + _Out_writes_(len) caddr_t buf, + size_t len, + int flags, + _Out_writes_bytes_(*fromlenaddr) caddr_t from, + _Inout_ int *fromlenaddr + ); + } recvfrom recvfrom_args int +126 AUE_SETREUID STD { + int setreuid( + int ruid, + int euid + ); + } +127 AUE_SETREGID STD { + int setregid( + int rgid, + int egid + ); + } +128 AUE_RENAME STD { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Oct 31 16:42:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2BB810DEAC2; Wed, 31 Oct 2018 16:42:40 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9809F7D93E; Wed, 31 Oct 2018 16:42:40 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79BF972C6; Wed, 31 Oct 2018 16:42:40 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9VGgeKv003378; Wed, 31 Oct 2018 16:42:40 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VGgexd003377; Wed, 31 Oct 2018 16:42:40 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201810311642.w9VGgexd003377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 31 Oct 2018 16:42:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339959 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 339959 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 16:42:41 -0000 Author: tsoome Date: Wed Oct 31 16:42:40 2018 New Revision: 339959 URL: https://svnweb.freebsd.org/changeset/base/339959 Log: loader: issue edd probe before legacy ah=08 and detect no media while probing for drives, use int13 extended info before standard one and provide workaround for case we are not getting needed information in case of floppy drive. In case of INT13 errors, there are (at least) 3 error codes appearing in case of missin media - 20h, 31h and 80h. Flag the no media and do not print an error. Differential Revision: https://reviews.freebsd.org/D17667 Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Wed Oct 31 16:17:45 2018 (r339958) +++ head/stand/i386/libi386/biosdisk.c Wed Oct 31 16:42:40 2018 (r339959) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -81,8 +80,10 @@ static struct bdinfo #define BD_MODEINT13 0x0000 #define BD_MODEEDD1 0x0001 #define BD_MODEEDD3 0x0002 +#define BD_MODEEDD (BD_MODEEDD1 | BD_MODEEDD3) #define BD_MODEMASK 0x0003 #define BD_FLOPPY 0x0004 +#define BD_NO_MEDIA 0x0008 int bd_type; /* BIOS 'drive type' (floppy only) */ uint16_t bd_sectorsize; /* Sector size */ uint64_t bd_sectors; /* Disk size */ @@ -188,60 +189,83 @@ bd_init(void) } /* - * Try to detect a device supported by the legacy int13 BIOS + * Return EDD version or 0 if EDD is not supported on this drive. */ static int -bd_int13probe(struct bdinfo *bd) +bd_check_extensions(int unit) { - struct edd_params params; - int ret = 1; /* assume success */ + /* Determine if we can use EDD with this device. */ + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0x4100; + v86.edx = unit; + v86.ebx = 0x55aa; + v86int(); + if (V86_CY(v86.efl) || /* carry set */ + (v86.ebx & 0xffff) != 0xaa55) /* signature */ + return (0); + + /* extended disk access functions (AH=42h-44h,47h,48h) supported */ + if ((v86.ecx & EDD_INTERFACE_FIXED_DISK) == 0) + return (0); + + return ((v86.eax >> 8) & 0xff); +} + +static void +bd_reset_disk(int unit) +{ + /* reset disk */ v86.ctl = V86_FLAGS; v86.addr = 0x13; + v86.eax = 0; + v86.edx = unit; + v86int(); +} + +/* + * Read CHS info. Return 0 on success, error otherwise. + */ +static int +bd_get_diskinfo_std(struct bdinfo *bd) +{ + bzero(&v86, sizeof(v86)); + v86.ctl = V86_FLAGS; + v86.addr = 0x13; v86.eax = 0x800; v86.edx = bd->bd_unit; v86int(); - /* Don't error out if we get bad sector number, try EDD as well */ - if (V86_CY(v86.efl) || /* carry set */ - (v86.edx & 0xff) <= (unsigned)(bd->bd_unit & 0x7f)) /* unit # bad */ - return (0); /* skip device */ + if (V86_CY(v86.efl) && ((v86.eax & 0xff00) != 0)) + return ((v86.eax & 0xff00) >> 8); - if ((v86.ecx & 0x3f) == 0) /* absurd sector number */ - ret = 0; /* set error */ + /* return custom error on absurd sector number */ + if ((v86.ecx & 0x3f) == 0) + return (0x60); - /* Convert max cyl # -> # of cylinders */ bd->bd_cyl = ((v86.ecx & 0xc0) << 2) + ((v86.ecx & 0xff00) >> 8) + 1; /* Convert max head # -> # of heads */ bd->bd_hds = ((v86.edx & 0xff00) >> 8) + 1; bd->bd_sec = v86.ecx & 0x3f; - bd->bd_type = v86.ebx & 0xff; - bd->bd_flags |= BD_MODEINT13; + bd->bd_type = v86.ebx; + bd->bd_sectors = (uint64_t)bd->bd_cyl * bd->bd_hds * bd->bd_sec; - /* Calculate sectors count from the geometry */ - bd->bd_sectors = bd->bd_cyl * bd->bd_hds * bd->bd_sec; - bd->bd_sectorsize = BIOSDISK_SECSIZE; - DEBUG("unit 0x%x geometry %d/%d/%d", bd->bd_unit, bd->bd_cyl, - bd->bd_hds, bd->bd_sec); + return (0); +} - /* Determine if we can use EDD with this device. */ - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0x4100; - v86.edx = bd->bd_unit; - v86.ebx = 0x55aa; - v86int(); - if (V86_CY(v86.efl) || /* carry set */ - (v86.ebx & 0xffff) != 0xaa55 || /* signature */ - (v86.ecx & EDD_INTERFACE_FIXED_DISK) == 0) - return (ret); /* return code from int13 AH=08 */ +/* + * Read EDD info. Return 0 on success, error otherwise. + */ +static int +bd_get_diskinfo_ext(struct bdinfo *bd) +{ + struct edd_params params; + uint64_t total; - /* EDD supported */ - bd->bd_flags |= BD_MODEEDD1; - if ((v86.eax & 0xff00) >= 0x3000) - bd->bd_flags |= BD_MODEEDD3; /* Get disk params */ - params.len = sizeof(struct edd_params); + bzero(¶ms, sizeof(params)); + params.len = sizeof(params); v86.ctl = V86_FLAGS; v86.addr = 0x13; v86.eax = 0x4800; @@ -249,37 +273,120 @@ bd_int13probe(struct bdinfo *bd) v86.ds = VTOPSEG(¶ms); v86.esi = VTOPOFF(¶ms); v86int(); - if (!V86_CY(v86.efl)) { - uint64_t total; - /* - * Sector size must be a multiple of 512 bytes. - * An alternate test would be to check power of 2, - * powerof2(params.sector_size). - * 4K is largest read buffer we can use at this time. - */ - if (params.sector_size >= 512 && - params.sector_size <= 4096 && - (params.sector_size % BIOSDISK_SECSIZE) == 0) - bd->bd_sectorsize = params.sector_size; + if (V86_CY(v86.efl) && ((v86.eax & 0xff00) != 0)) + return ((v86.eax & 0xff00) >> 8); - total = bd->bd_sectorsize * params.sectors; - if (params.sectors != 0) { - /* Only update if we did not overflow. */ - if (total > params.sectors) - bd->bd_sectors = params.sectors; - } + /* + * Sector size must be a multiple of 512 bytes. + * An alternate test would be to check power of 2, + * powerof2(params.sector_size). + * 4K is largest read buffer we can use at this time. + */ + if (params.sector_size >= 512 && + params.sector_size <= 4096 && + (params.sector_size % BIOSDISK_SECSIZE) == 0) + bd->bd_sectorsize = params.sector_size; + bd->bd_cyl = params.cylinders; + bd->bd_hds = params.heads; + bd->bd_sec = params.sectors_per_track; + + if (params.sectors != 0) { + total = params.sectors; + } else { total = (uint64_t)params.cylinders * params.heads * params.sectors_per_track; - if (total > 0 && bd->bd_sectors > total) - bd->bd_sectors = total; + } + bd->bd_sectors = total; - ret = 1; + return (0); +} + +/* + * Try to detect a device supported by the legacy int13 BIOS + */ +static int +bd_int13probe(struct bdinfo *bd) +{ + int edd; + int ret; + + bd->bd_flags &= ~BD_NO_MEDIA; + + edd = bd_check_extensions(bd->bd_unit); + if (edd == 0) + bd->bd_flags |= BD_MODEINT13; + else if (edd < 0x30) + bd->bd_flags |= BD_MODEEDD1; + else + bd->bd_flags |= BD_MODEEDD3; + + /* Default sector size */ + bd->bd_sectorsize = BIOSDISK_SECSIZE; + + /* + * Test if the floppy device is present, so we can avoid receiving + * bogus information from bd_get_diskinfo_std(). + */ + if (bd->bd_unit < 0x80) { + /* reset disk */ + bd_reset_disk(bd->bd_unit); + + /* Get disk type */ + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0x1500; + v86.edx = bd->bd_unit; + v86int(); + if (V86_CY(v86.efl) || (v86.eax & 0x300) == 0) + return (0); } - DEBUG("unit 0x%x flags %x, sectors %llu, sectorsize %u", - bd->bd_unit, bd->bd_flags, bd->bd_sectors, bd->bd_sectorsize); - return (ret); + + ret = 1; + if (edd != 0) + ret = bd_get_diskinfo_ext(bd); + if (ret != 0 || bd->bd_sectors == 0) + ret = bd_get_diskinfo_std(bd); + + if (ret != 0 && bd->bd_unit < 0x80) { + /* Set defaults for 1.44 floppy */ + bd->bd_cyl = 80; + bd->bd_hds = 2; + bd->bd_sec = 18; + bd->bd_type = 4; + bd->bd_sectors = 2880; + /* Since we are there, there most likely is no media */ + bd->bd_flags |= BD_NO_MEDIA; + ret = 0; + } + + if (ret != 0) { + if (bd->bd_sectors != 0 && edd != 0) { + bd->bd_sec = 63; + bd->bd_hds = 255; + bd->bd_cyl = + (bd->bd_sectors + bd->bd_sec * bd->bd_hds - 1) / + bd->bd_sec * bd->bd_hds; + } else { + printf("Can not get information about %s unit %#x\n", + biosdisk.dv_name, bd->bd_unit); + return (0); + } + } + + if (bd->bd_sec == 0) + bd->bd_sec = 63; + if (bd->bd_hds == 0) + bd->bd_hds = 255; + + if (bd->bd_sectors == 0) + bd->bd_sectors = (uint64_t)bd->bd_cyl * bd->bd_hds * bd->bd_sec; + + DEBUG("unit 0x%x geometry %d/%d/%d", bd->bd_unit, bd->bd_cyl, + bd->bd_hds, bd->bd_sec); + + return (1); } /* @@ -301,9 +408,11 @@ bd_print(int verbose) for (i = 0; i < nbdinfo; i++) { snprintf(line, sizeof(line), - " disk%d: BIOS drive %c (%ju X %u):\n", i, + " disk%d: BIOS drive %c (%s%ju X %u):\n", i, (bdinfo[i].bd_unit < 0x80) ? ('A' + bdinfo[i].bd_unit): ('C' + bdinfo[i].bd_unit - 0x80), + (bdinfo[i].bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA ? + "no media, " : "", (uintmax_t)bdinfo[i].bd_sectors, bdinfo[i].bd_sectorsize); if ((ret = pager_output(line)) != 0) @@ -351,6 +460,11 @@ bd_open(struct open_file *f, ...) if (dev->dd.d_unit < 0 || dev->dd.d_unit >= nbdinfo) return (EIO); + + if ((BD(dev).bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) { + if (!bd_int13probe(&BD(dev))) + return (EIO); + } BD(dev).bd_open++; if (BD(dev).bd_bcache == NULL) BD(dev).bd_bcache = bcache_allocate(); @@ -499,7 +613,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s * partition. */ if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks) == 0) { - /* DIOCGMEDIASIZE returns bytes. */ + /* DIOCGMEDIASIZE does return bytes. */ disk_blocks /= BD(dev).bd_sectorsize; } else { /* We should not get here. Just try to survive. */ @@ -685,29 +799,33 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks if (dowrite == BD_RD && dblk >= 0x100000000) bd_io_workaround(dev); for (retry = 0; retry < 3; retry++) { - /* if retrying, reset the drive */ - if (retry > 0) { - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0; - v86.edx = BD(dev).bd_unit; - v86int(); - } - - if (BD(dev).bd_flags & BD_MODEEDD1) + if (BD(dev).bd_flags & BD_MODEEDD) result = bd_edd_io(dev, dblk, blks, dest, dowrite); else result = bd_chs_io(dev, dblk, blks, dest, dowrite); - if (result == 0) + if (result == 0) { + if (BD(dev).bd_flags & BD_NO_MEDIA) + BD(dev).bd_flags &= ~BD_NO_MEDIA; break; + } + + bd_reset_disk(BD(dev).bd_unit); + + /* + * Error codes: + * 20h controller failure + * 31h no media in drive (IBM/MS INT 13 extensions) + * 80h no media in drive, VMWare (Fusion) + * There is no reason to repeat the IO with errors above. + */ + if (result == 0x20 || result == 0x31 || result == 0x80) { + BD(dev).bd_flags |= BD_NO_MEDIA; + break; + } } - /* - * 0x20 - Controller failure. This is common error when the - * media is not present. - */ - if (result != 0 && result != 0x20) { + if (result != 0 && (BD(dev).bd_flags & BD_NO_MEDIA) == 0) { if (dowrite == BD_WR) { printf("%s%d: Write %d sector(s) from %p (0x%x) " "to %lld: 0x%x\n", dev->dd.d_dev->dv_name, From owner-svn-src-head@freebsd.org Wed Oct 31 16:45:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74CB410DEC1C; Wed, 31 Oct 2018 16:45:46 +0000 (UTC) (envelope-from tsoome@me.com) Received: from mr28p00im-ztfo03025201.me.com (mr28p00im-ztfo03025201.me.com [17.110.71.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15CF77DB6B; Wed, 31 Oct 2018 16:45:46 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.mr28p00im-ztfo03025201.me.com by mr28p00im-ztfo03025201.me.com (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) id <0PHH00E000I3VW00@mr28p00im-ztfo03025201.me.com>; Wed, 31 Oct 2018 16:45:35 +0000 (GMT) Received: from icloud.com ([127.0.0.1]) by mr28p00im-ztfo03025201.me.com (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPSA id <0PHH00I3J2JR2L10@mr28p00im-ztfo03025201.me.com>; Wed, 31 Oct 2018 16:45:32 +0000 (GMT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810310139 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-10-31_06:,, signatures=0 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 12.0 \(3445.100.39\)) Subject: Re: svn commit: r339959 - head/stand/i386/libi386 From: Toomas Soome In-reply-to: <201810311642.w9VGgexd003377@repo.freebsd.org> Date: Wed, 31 Oct 2018 18:45:26 +0200 Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-transfer-encoding: quoted-printable Message-id: <9C4FF89C-F821-4AE3-BB06-BD23400DA977@me.com> References: <201810311642.w9VGgexd003377@repo.freebsd.org> To: src-committers X-Mailer: Apple Mail (2.3445.100.39) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 16:45:46 -0000 I forgot to note imp, sorry=E2=80=A6 rgds, toomas > On 31 Oct 2018, at 18:42, Toomas Soome wrote: >=20 > Author: tsoome > Date: Wed Oct 31 16:42:40 2018 > New Revision: 339959 > URL: https://svnweb.freebsd.org/changeset/base/339959 >=20 > Log: > loader: issue edd probe before legacy ah=3D08 and detect no media >=20 > while probing for drives, use int13 extended info before standard one = and > provide workaround for case we are not getting needed information in = case > of floppy drive. >=20 > In case of INT13 errors, there are (at least) 3 error codes appearing = in case > of missin media - 20h, 31h and 80h. Flag the no media and do not = print an > error. >=20 > Differential Revision: https://reviews.freebsd.org/D17667 >=20 > Modified: > head/stand/i386/libi386/biosdisk.c >=20 > Modified: head/stand/i386/libi386/biosdisk.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/stand/i386/libi386/biosdisk.c Wed Oct 31 16:17:45 2018 = (r339958) > +++ head/stand/i386/libi386/biosdisk.c Wed Oct 31 16:42:40 2018 = (r339959) > @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include >=20 > #include > #include > @@ -81,8 +80,10 @@ static struct bdinfo > #define BD_MODEINT13 0x0000 > #define BD_MODEEDD1 0x0001 > #define BD_MODEEDD3 0x0002 > +#define BD_MODEEDD (BD_MODEEDD1 | BD_MODEEDD3) > #define BD_MODEMASK 0x0003 > #define BD_FLOPPY 0x0004 > +#define BD_NO_MEDIA 0x0008 > int bd_type; /* BIOS 'drive type' (floppy = only) */ > uint16_t bd_sectorsize; /* Sector size */ > uint64_t bd_sectors; /* Disk size */ > @@ -188,60 +189,83 @@ bd_init(void) > } >=20 > /* > - * Try to detect a device supported by the legacy int13 BIOS > + * Return EDD version or 0 if EDD is not supported on this drive. > */ > static int > -bd_int13probe(struct bdinfo *bd) > +bd_check_extensions(int unit) > { > - struct edd_params params; > - int ret =3D 1; /* assume success */ > + /* Determine if we can use EDD with this device. */ > + v86.ctl =3D V86_FLAGS; > + v86.addr =3D 0x13; > + v86.eax =3D 0x4100; > + v86.edx =3D unit; > + v86.ebx =3D 0x55aa; > + v86int(); >=20 > + if (V86_CY(v86.efl) || /* carry set */ > + (v86.ebx & 0xffff) !=3D 0xaa55) /* signature */ > + return (0); > + > + /* extended disk access functions (AH=3D42h-44h,47h,48h) = supported */ > + if ((v86.ecx & EDD_INTERFACE_FIXED_DISK) =3D=3D 0) > + return (0); > + > + return ((v86.eax >> 8) & 0xff); > +} > + > +static void > +bd_reset_disk(int unit) > +{ > + /* reset disk */ > v86.ctl =3D V86_FLAGS; > v86.addr =3D 0x13; > + v86.eax =3D 0; > + v86.edx =3D unit; > + v86int(); > +} > + > +/* > + * Read CHS info. Return 0 on success, error otherwise. > + */ > +static int > +bd_get_diskinfo_std(struct bdinfo *bd) > +{ > + bzero(&v86, sizeof(v86)); > + v86.ctl =3D V86_FLAGS; > + v86.addr =3D 0x13; > v86.eax =3D 0x800; > v86.edx =3D bd->bd_unit; > v86int(); >=20 > - /* Don't error out if we get bad sector number, try EDD as well = */ > - if (V86_CY(v86.efl) || /* carry set */ > - (v86.edx & 0xff) <=3D (unsigned)(bd->bd_unit & 0x7f)) = /* unit # bad */ > - return (0); /* skip device */ > + if (V86_CY(v86.efl) && ((v86.eax & 0xff00) !=3D 0)) > + return ((v86.eax & 0xff00) >> 8); >=20 > - if ((v86.ecx & 0x3f) =3D=3D 0) /* absurd sector number */ > - ret =3D 0; /* set error */ > + /* return custom error on absurd sector number */ > + if ((v86.ecx & 0x3f) =3D=3D 0) > + return (0x60); >=20 > - /* Convert max cyl # -> # of cylinders */ > bd->bd_cyl =3D ((v86.ecx & 0xc0) << 2) + ((v86.ecx & 0xff00) >> = 8) + 1; > /* Convert max head # -> # of heads */ > bd->bd_hds =3D ((v86.edx & 0xff00) >> 8) + 1; > bd->bd_sec =3D v86.ecx & 0x3f; > - bd->bd_type =3D v86.ebx & 0xff; > - bd->bd_flags |=3D BD_MODEINT13; > + bd->bd_type =3D v86.ebx; > + bd->bd_sectors =3D (uint64_t)bd->bd_cyl * bd->bd_hds * = bd->bd_sec; >=20 > - /* Calculate sectors count from the geometry */ > - bd->bd_sectors =3D bd->bd_cyl * bd->bd_hds * bd->bd_sec; > - bd->bd_sectorsize =3D BIOSDISK_SECSIZE; > - DEBUG("unit 0x%x geometry %d/%d/%d", bd->bd_unit, bd->bd_cyl, > - bd->bd_hds, bd->bd_sec); > + return (0); > +} >=20 > - /* Determine if we can use EDD with this device. */ > - v86.ctl =3D V86_FLAGS; > - v86.addr =3D 0x13; > - v86.eax =3D 0x4100; > - v86.edx =3D bd->bd_unit; > - v86.ebx =3D 0x55aa; > - v86int(); > - if (V86_CY(v86.efl) || /* carry set */ > - (v86.ebx & 0xffff) !=3D 0xaa55 || /* signature */ > - (v86.ecx & EDD_INTERFACE_FIXED_DISK) =3D=3D 0) > - return (ret); /* return code from int13 AH=3D08 */ > +/* > + * Read EDD info. Return 0 on success, error otherwise. > + */ > +static int > +bd_get_diskinfo_ext(struct bdinfo *bd) > +{ > + struct edd_params params; > + uint64_t total; >=20 > - /* EDD supported */ > - bd->bd_flags |=3D BD_MODEEDD1; > - if ((v86.eax & 0xff00) >=3D 0x3000) > - bd->bd_flags |=3D BD_MODEEDD3; > /* Get disk params */ > - params.len =3D sizeof(struct edd_params); > + bzero(¶ms, sizeof(params)); > + params.len =3D sizeof(params); > v86.ctl =3D V86_FLAGS; > v86.addr =3D 0x13; > v86.eax =3D 0x4800; > @@ -249,37 +273,120 @@ bd_int13probe(struct bdinfo *bd) > v86.ds =3D VTOPSEG(¶ms); > v86.esi =3D VTOPOFF(¶ms); > v86int(); > - if (!V86_CY(v86.efl)) { > - uint64_t total; >=20 > - /* > - * Sector size must be a multiple of 512 bytes. > - * An alternate test would be to check power of 2, > - * powerof2(params.sector_size). > - * 4K is largest read buffer we can use at this time. > - */ > - if (params.sector_size >=3D 512 && > - params.sector_size <=3D 4096 && > - (params.sector_size % BIOSDISK_SECSIZE) =3D=3D 0) > - bd->bd_sectorsize =3D params.sector_size; > + if (V86_CY(v86.efl) && ((v86.eax & 0xff00) !=3D 0)) > + return ((v86.eax & 0xff00) >> 8); >=20 > - total =3D bd->bd_sectorsize * params.sectors; > - if (params.sectors !=3D 0) { > - /* Only update if we did not overflow. */ > - if (total > params.sectors) > - bd->bd_sectors =3D params.sectors; > - } > + /* > + * Sector size must be a multiple of 512 bytes. > + * An alternate test would be to check power of 2, > + * powerof2(params.sector_size). > + * 4K is largest read buffer we can use at this time. > + */ > + if (params.sector_size >=3D 512 && > + params.sector_size <=3D 4096 && > + (params.sector_size % BIOSDISK_SECSIZE) =3D=3D 0) > + bd->bd_sectorsize =3D params.sector_size; >=20 > + bd->bd_cyl =3D params.cylinders; > + bd->bd_hds =3D params.heads; > + bd->bd_sec =3D params.sectors_per_track; > + > + if (params.sectors !=3D 0) { > + total =3D params.sectors; > + } else { > total =3D (uint64_t)params.cylinders * > params.heads * params.sectors_per_track; > - if (total > 0 && bd->bd_sectors > total) > - bd->bd_sectors =3D total; > + } > + bd->bd_sectors =3D total; >=20 > - ret =3D 1; > + return (0); > +} > + > +/* > + * Try to detect a device supported by the legacy int13 BIOS > + */ > +static int > +bd_int13probe(struct bdinfo *bd) > +{ > + int edd; > + int ret; > + > + bd->bd_flags &=3D ~BD_NO_MEDIA; > + > + edd =3D bd_check_extensions(bd->bd_unit); > + if (edd =3D=3D 0) > + bd->bd_flags |=3D BD_MODEINT13; > + else if (edd < 0x30) > + bd->bd_flags |=3D BD_MODEEDD1; > + else > + bd->bd_flags |=3D BD_MODEEDD3; > + > + /* Default sector size */ > + bd->bd_sectorsize =3D BIOSDISK_SECSIZE; > + > + /* > + * Test if the floppy device is present, so we can avoid = receiving > + * bogus information from bd_get_diskinfo_std(). > + */ > + if (bd->bd_unit < 0x80) { > + /* reset disk */ > + bd_reset_disk(bd->bd_unit); > + > + /* Get disk type */ > + v86.ctl =3D V86_FLAGS; > + v86.addr =3D 0x13; > + v86.eax =3D 0x1500; > + v86.edx =3D bd->bd_unit; > + v86int(); > + if (V86_CY(v86.efl) || (v86.eax & 0x300) =3D=3D 0) > + return (0); > } > - DEBUG("unit 0x%x flags %x, sectors %llu, sectorsize %u", > - bd->bd_unit, bd->bd_flags, bd->bd_sectors, = bd->bd_sectorsize); > - return (ret); > + > + ret =3D 1; > + if (edd !=3D 0) > + ret =3D bd_get_diskinfo_ext(bd); > + if (ret !=3D 0 || bd->bd_sectors =3D=3D 0) > + ret =3D bd_get_diskinfo_std(bd); > + > + if (ret !=3D 0 && bd->bd_unit < 0x80) { > + /* Set defaults for 1.44 floppy */ > + bd->bd_cyl =3D 80; > + bd->bd_hds =3D 2; > + bd->bd_sec =3D 18; > + bd->bd_type =3D 4; > + bd->bd_sectors =3D 2880; > + /* Since we are there, there most likely is no media */ > + bd->bd_flags |=3D BD_NO_MEDIA; > + ret =3D 0; > + } > + > + if (ret !=3D 0) { > + if (bd->bd_sectors !=3D 0 && edd !=3D 0) { > + bd->bd_sec =3D 63; > + bd->bd_hds =3D 255; > + bd->bd_cyl =3D > + (bd->bd_sectors + bd->bd_sec * bd->bd_hds - = 1) / > + bd->bd_sec * bd->bd_hds; > + } else { > + printf("Can not get information about %s unit = %#x\n", > + biosdisk.dv_name, bd->bd_unit); > + return (0); > + } > + } > + > + if (bd->bd_sec =3D=3D 0) > + bd->bd_sec =3D 63; > + if (bd->bd_hds =3D=3D 0) > + bd->bd_hds =3D 255; > + > + if (bd->bd_sectors =3D=3D 0) > + bd->bd_sectors =3D (uint64_t)bd->bd_cyl * bd->bd_hds * = bd->bd_sec; > + > + DEBUG("unit 0x%x geometry %d/%d/%d", bd->bd_unit, bd->bd_cyl, > + bd->bd_hds, bd->bd_sec); > + > + return (1); > } >=20 > /* > @@ -301,9 +408,11 @@ bd_print(int verbose) >=20 > for (i =3D 0; i < nbdinfo; i++) { > snprintf(line, sizeof(line), > - " disk%d: BIOS drive %c (%ju X %u):\n", i, > + " disk%d: BIOS drive %c (%s%ju X %u):\n", i, > (bdinfo[i].bd_unit < 0x80) ? ('A' + = bdinfo[i].bd_unit): > ('C' + bdinfo[i].bd_unit - 0x80), > + (bdinfo[i].bd_flags & BD_NO_MEDIA) =3D=3D = BD_NO_MEDIA ? > + "no media, " : "", > (uintmax_t)bdinfo[i].bd_sectors, > bdinfo[i].bd_sectorsize); > if ((ret =3D pager_output(line)) !=3D 0) > @@ -351,6 +460,11 @@ bd_open(struct open_file *f, ...) >=20 > if (dev->dd.d_unit < 0 || dev->dd.d_unit >=3D nbdinfo) > return (EIO); > + > + if ((BD(dev).bd_flags & BD_NO_MEDIA) =3D=3D BD_NO_MEDIA) { > + if (!bd_int13probe(&BD(dev))) > + return (EIO); > + } > BD(dev).bd_open++; > if (BD(dev).bd_bcache =3D=3D NULL) > BD(dev).bd_bcache =3D bcache_allocate(); > @@ -499,7 +613,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t = dblk, s > * partition. > */ > if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks) =3D=3D 0) { > - /* DIOCGMEDIASIZE returns bytes. */ > + /* DIOCGMEDIASIZE does return bytes. */ > disk_blocks /=3D BD(dev).bd_sectorsize; > } else { > /* We should not get here. Just try to survive. */ > @@ -685,29 +799,33 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, = int blks > if (dowrite =3D=3D BD_RD && dblk >=3D 0x100000000) > bd_io_workaround(dev); > for (retry =3D 0; retry < 3; retry++) { > - /* if retrying, reset the drive */ > - if (retry > 0) { > - v86.ctl =3D V86_FLAGS; > - v86.addr =3D 0x13; > - v86.eax =3D 0; > - v86.edx =3D BD(dev).bd_unit; > - v86int(); > - } > - > - if (BD(dev).bd_flags & BD_MODEEDD1) > + if (BD(dev).bd_flags & BD_MODEEDD) > result =3D bd_edd_io(dev, dblk, blks, dest, = dowrite); > else > result =3D bd_chs_io(dev, dblk, blks, dest, = dowrite); >=20 > - if (result =3D=3D 0) > + if (result =3D=3D 0) { > + if (BD(dev).bd_flags & BD_NO_MEDIA) > + BD(dev).bd_flags &=3D ~BD_NO_MEDIA; > break; > + } > + > + bd_reset_disk(BD(dev).bd_unit); > + > + /* > + * Error codes: > + * 20h controller failure > + * 31h no media in drive (IBM/MS INT 13 extensions) > + * 80h no media in drive, VMWare (Fusion) > + * There is no reason to repeat the IO with errors = above. > + */ > + if (result =3D=3D 0x20 || result =3D=3D 0x31 || result = =3D=3D 0x80) { > + BD(dev).bd_flags |=3D BD_NO_MEDIA; > + break; > + } > } >=20 > - /* > - * 0x20 - Controller failure. This is common error when the > - * media is not present. > - */ > - if (result !=3D 0 && result !=3D 0x20) { > + if (result !=3D 0 && (BD(dev).bd_flags & BD_NO_MEDIA) =3D=3D 0) = { > if (dowrite =3D=3D BD_WR) { > printf("%s%d: Write %d sector(s) from %p (0x%x) = " > "to %lld: 0x%x\n", dev->dd.d_dev->dv_name, >=20 From owner-svn-src-head@freebsd.org Wed Oct 31 16:58:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE2B710DF1CD for ; Wed, 31 Oct 2018 16:58:44 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FAC17E251 for ; Wed, 31 Oct 2018 16:58:44 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wm1-x343.google.com with SMTP id w7-v6so4799475wmc.1 for ; Wed, 31 Oct 2018 09:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=uz6QUnhIN18yPS79tto/HOMX8L8azH2RhPhAjo4M86I=; b=BQhZAguHqnMhqlbbPTz7EzldXeUkuTmP7HrDQygEQyhGk4nf0MZz89fZGs3GGM5WLH PvhIyG9jvLGEts0WA3dgnBLBrwMFV/08y9Fjv1ml6PJLfh5H20YILBmmyyxkz7VS6sym q5mQ7hiLw+1WtiAuaKocH8EVLPa86lscQw4VHIzD1qaeyHY0tw7NoZad4eIWfm80/JX6 q/dsHw0b5uE0wwz0jT3nCuB20YMnOlvXVuIRDN9GH+nIrqYMflmUoxtU1PgiqJb9lnN7 /JXSaiCapcO5tWeEvekFQYx0opB/KBKjVa9zhx8tIedkYVPfr/Fs0JNO695zaupZkmwC Q5fQ== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=uz6QUnhIN18yPS79tto/HOMX8L8azH2RhPhAjo4M86I=; b=F4UzJZ0IfLpPWIRkZNv4L7jZekj+x5QAbxYS7iGnVJbOJTzbWkIOAM/qfNXM6bPAcA s9kBQxUIsvlbLaH1c0tONmiNFp7Be8bg/9zDZJbp2Cr3c30vHWngmK7DorngssZZo5nE vrUZAwWufgnVKLR317ovv8+VVY0HZlRAP01i37Z0dbnIlMDGYPjncdDhF/m2I5TFay79 Dn606MwmLgvQAQEmwFMEPknlnYk4FF7tusPDtaPSke0jg9LDCL6Xp6WTVU+W2Xqsm9oi HsSj7XlpDL/J46SwSylvXAAQo8J9op2f0OkP50a/H037eLwzmg2+HEt8CKi1zcR3UQQ5 5uNg== X-Gm-Message-State: AGRZ1gLmzfjSSQWDv7xdgzrbzsj6IR6XXvl9XMm25q25rhAqmk5Xd15q eyCCeL5VP6ssvPNMtdpYbymaC3dwlSwsoQ== X-Google-Smtp-Source: AJdET5cw7XhP2st5A3KtCM83FYhxaL4v8lU5GQKandQiKTfTeM8akyhcuuFS6ifTilGxO3J4xcKoRA== X-Received: by 2002:a1c:868e:: with SMTP id i136-v6mr3045736wmd.50.1541005122237; Wed, 31 Oct 2018 09:58:42 -0700 (PDT) Received: from mutt-hbsd (tor-exit-2.zbau.f3netze.de. [185.220.100.253]) by smtp.gmail.com with ESMTPSA id v19-v6sm13184858wmd.20.2018.10.31.09.58.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Oct 2018 09:58:41 -0700 (PDT) Date: Wed, 31 Oct 2018 12:58:10 -0400 From: Shawn Webb To: Ed Maste Cc: Marcelo Araujo , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339936 - head/sys/amd64/vmm/amd Message-ID: <20181031165810.oiiyz2omi45sqoxc@mutt-hbsd> References: <201810310127.w9V1RiFX025463@repo.freebsd.org> <20181031140631.ipwlwh3rlm7ma4xk@mutt-hbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vp6sorfm3mxggr3h" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD mutt-hbsd 12.0-ALPHA7 FreeBSD 12.0-ALPHA7 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180622 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 16:58:45 -0000 --vp6sorfm3mxggr3h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 31, 2018 at 06:50:53AM -0400, Ed Maste wrote: > On Wed, 31 Oct 2018 at 10:07, Shawn Webb wro= te: > > > > Does this need a /* FALLTHROUGH */ comment to appease the Coverity > > Gods? >=20 > No, successive case statements without intervening bodies is a widely > used idiom well understood by all reasonable tools. Good catch. Thanks for the clarification! --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --vp6sorfm3mxggr3h Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlvZ3x0ACgkQaoRlj1JF bu4UAA//RzYwi/G7TRHpwkls2ih8yz1qbF0fc9GDHJCpXGHYOh81xDNod2eLTnTE DqVliYAK7v1P64G/d0qgi4gUdtUEhuY8gitrA+0X20HRW4wXagKN2TQ9nEsf0xLp LAhErULKw4wlsAEWQoPbu0ihu1GpMM7w+98x45uuvsEEW6hwQvKLxnEUNXjuVVQ/ /Mj1kOeKNiYZSMoJ4jietuVs08xtN4IwUAF2sSL4FKrhMdOVObJIuXc/6E4gC6JY XtS7FjABkC/gJewZI/MH4NKqKa+c75PNWKGS20KGBmAadgG0cxj2mG2xMHvxrA8v Jl7P0IdwspxkU5DbvpBxzGzA+mTpE4aaOy5ZeTXlGv85cbk1BcAssqB/Q0g1unxC rcJf8QYbhYc1y4gLWQttmMT/N+38FdsiDrxDeGlxcbjHI8myjXlNn0xuv29kMvW8 fZgum8flQ9YSjwQPxRv4E3rlWVWjQN59tMtRjRDHIoF4UB9/xCxxmTUAQJcTxMLj CsoIfy/JWk3LBQpVxPBxFynuC91Q6WDyu/hTPBg4EeVgEmSbNWumSIrhk1nh5NSE Zs+y8w5kFymsvK/dI9LVdlwX//fGvYa9o+GRBFNAW1gkjZhSIA3Z+Oqo1DekurMK oeT6ODs07qqOyPCB7iYGytkq8gVYXPA+iODVgrnPKS5VfwnK8mY= =Fu7W -----END PGP SIGNATURE----- --vp6sorfm3mxggr3h-- From owner-svn-src-head@freebsd.org Wed Oct 31 17:37:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9EA910E0247; Wed, 31 Oct 2018 17:37:54 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 900C57FEF7; Wed, 31 Oct 2018 17:37:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 711E07ACF; Wed, 31 Oct 2018 17:37:54 +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 w9VHbsnN033346; Wed, 31 Oct 2018 17:37:54 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VHbsj1033345; Wed, 31 Oct 2018 17:37:54 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810311737.w9VHbsj1033345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 31 Oct 2018 17:37:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339960 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 339960 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 17:37:55 -0000 Author: cem Date: Wed Oct 31 17:37:54 2018 New Revision: 339960 URL: https://svnweb.freebsd.org/changeset/base/339960 Log: freebsd-update: add a progress report for the "fetching files..." After patching step is done. PR: 232857 Submitted by: mat@ MFC after: a week Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Wed Oct 31 16:42:40 2018 (r339959) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Wed Oct 31 17:37:54 2018 (r339960) @@ -1888,7 +1888,7 @@ fetch_files () { echo ${NDEBUG} "files... " lam -s "${FETCHDIR}/f/" - -s ".gz" < filelist | xargs ${XARGST} ${PHTTPGET} ${SERVERNAME} \ - 2>${QUIETREDIR} + 2>${STATSREDIR} | fetch_progress while read Y; do if ! [ -f ${Y}.gz ]; then From owner-svn-src-head@freebsd.org Wed Oct 31 17:41:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B52E10E0575; Wed, 31 Oct 2018 17:41:54 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6245803C6; Wed, 31 Oct 2018 17:41:53 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7E627C30; Wed, 31 Oct 2018 17:41:53 +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 w9VHfrpB036303; Wed, 31 Oct 2018 17:41:53 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VHfrfU036302; Wed, 31 Oct 2018 17:41:53 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201810311741.w9VHfrfU036302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 31 Oct 2018 17:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339961 - 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: 339961 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 17:41:54 -0000 Author: andrew Date: Wed Oct 31 17:41:53 2018 New Revision: 339961 URL: https://svnweb.freebsd.org/changeset/base/339961 Log: Always set the MP_QUIRK_CPULIST quirk under ACPI. This needs a run time check to only set it for emulators as the CPU list may be changed when the emulator starts. Until this is working just always set it. 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 Wed Oct 31 17:37:54 2018 (r339960) +++ head/sys/arm64/arm64/mp_machdep.c Wed Oct 31 17:41:53 2018 (r339961) @@ -525,6 +525,7 @@ cpu_mp_start(void) switch(arm64_bus_method) { #ifdef DEV_ACPI case ARM64_BUS_ACPI: + mp_quirks = MP_QUIRK_CPULIST; KASSERT(cpu0 >= 0, ("Current CPU was not found")); cpu_init_acpi(); break; From owner-svn-src-head@freebsd.org Wed Oct 31 17:47:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 228B110E078A; Wed, 31 Oct 2018 17:47:10 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6095180818; Wed, 31 Oct 2018 17:47:09 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28F017C6F; Wed, 31 Oct 2018 17:47:09 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9VHl9Qp039483; Wed, 31 Oct 2018 17:47:09 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VHl9v6039482; Wed, 31 Oct 2018 17:47:09 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201810311747.w9VHl9v6039482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Wed, 31 Oct 2018 17:47:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339962 - head/bin/ps X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/bin/ps X-SVN-Commit-Revision: 339962 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 17:47:10 -0000 Author: 0mp (ports committer) Date: Wed Oct 31 17:47:08 2018 New Revision: 339962 URL: https://svnweb.freebsd.org/changeset/base/339962 Log: ps(1): Pet mandoc and igor - Use Xr to reference other manual pages. - Reference execve(2) instead of exec(2) as exec(2) does not exist. - Remove the deprecated "Tn" macro. - Improve the formatting of the etime description. Reviewed by: bcr Approved by: krion (mentor, implicit), mat (mentor, implicit) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D17780 Modified: head/bin/ps/ps.1 Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Wed Oct 31 17:41:53 2018 (r339961) +++ head/bin/ps/ps.1 Wed Oct 31 17:47:08 2018 (r339962) @@ -346,7 +346,7 @@ the include file .It Dv "P_HWPMC" Ta No "0x800000" Ta "Process is using HWPMCs" .It Dv "P_JAILED" Ta No "0x1000000" Ta "Process is in jail" .It Dv "P_TOTAL_STOP" Ta No "0x2000000" Ta "Stopped for system suspend" -.It Dv "P_INEXEC" Ta No "0x4000000" Ta "Process is in execve()" +.It Dv "P_INEXEC" Ta No "0x4000000" Ta Process is in Xr execve 2 .It Dv "P_STATCHILD" Ta No "0x8000000" Ta "Child process stopped or exited" .It Dv "P_INMEM" Ta No "0x10000000" Ta "Loaded into memory" .It Dv "P_SWAPPINGOUT" Ta No "0x20000000" Ta "Process is being swapped out" @@ -361,8 +361,8 @@ the include file .In sys/proc.h : .Bl -column P2_INHERIT_PROTECTED 0x00000001 .It Dv "P2_INHERIT_PROTECTED" Ta No "0x00000001" Ta "New children get P_PROTECTED" -.It Dv "P2_NOTRACE" Ta No "0x00000002" Ta "No ptrace(2) attach or coredumps" -.It Dv "P2_NOTRACE_EXEC" Ta No "0x00000004" Ta "Keep P2_NOPTRACE on exec(2)" +.It Dv "P2_NOTRACE" Ta No "0x00000002" Ta "No" Xr ptrace 2 attach or coredumps +.It Dv "P2_NOTRACE_EXEC" Ta No "0x00000004" Ta Keep P2_NOPTRACE on Xr execve 2 .It Dv "P2_AST_SU" Ta No "0x00000008" Ta "Handles SU ast for kthreads" .It Dv "P2_PTRACE_FSTP" Ta No "0x00000010" Ta "SIGSTOP from PT_ATTACH not yet handled" .El @@ -453,8 +453,7 @@ Marks a process which is in The hostname of the prison can be found in .Pa /proc/ Ns Ao Ar pid Ac Ns Pa /status . .It Li L -The process has pages locked in core (for example, for raw -.Tn I/O ) . +The process has pages locked in core (for example, for raw I/O). .It Li N The process has reduced CPU scheduling priority (see .Xr setpriority 2 ) . @@ -553,9 +552,11 @@ data size (in Kbytes) system-call emulation environment (ABI) .It Cm etime elapsed running time, format +.Do .Op days- Ns -.Op hours: Ns -minutes:seconds. +.Op hours\&: Ns +minutes:seconds +.Dc .It Cm etimes elapsed running time, in decimal integer seconds .It Cm fib From owner-svn-src-head@freebsd.org Wed Oct 31 18:08:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15A8210E11A0; Wed, 31 Oct 2018 18:08:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC2248166F; Wed, 31 Oct 2018 18:08:12 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D0D47FC0; Wed, 31 Oct 2018 18:08:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9VI8C2g049739; Wed, 31 Oct 2018 18:08:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VI8CAQ049738; Wed, 31 Oct 2018 18:08:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810311808.w9VI8CAQ049738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 31 Oct 2018 18:08:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339964 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 339964 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 18:08:13 -0000 Author: emaste Date: Wed Oct 31 18:08:12 2018 New Revision: 339964 URL: https://svnweb.freebsd.org/changeset/base/339964 Log: Avoid binutils test in cleandir/obj stages Further to r339946 skip the .error case for lack of in-tree binutils support when we haven't set the toolchain feature variables. Discussed with: arichardson Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Oct 31 18:01:02 2018 (r339963) +++ head/Makefile.inc1 Wed Oct 31 18:08:12 2018 (r339964) @@ -183,7 +183,7 @@ CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} # support the target architecture), provide a default cross-binutils prefix. # This allows riscv64 builds, for example, to automatically use the # riscv64-binutils port or package. -.if !make(showconfig) +.if !make(showconfig) && !defined(_NO_INCLUDE_COMPILERMK) .if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \ ${MK_LLD_BOOTSTRAP} == "no" && \ !defined(CROSS_BINUTILS_PREFIX) From owner-svn-src-head@freebsd.org Wed Oct 31 18:30:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 997D410E18C1; Wed, 31 Oct 2018 18:30:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 507B4828F5; Wed, 31 Oct 2018 18:30: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33202102EB; Wed, 31 Oct 2018 18:30: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 w9VIUImx060092; Wed, 31 Oct 2018 18:30:18 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VIUIMi060091; Wed, 31 Oct 2018 18:30:18 GMT (envelope-from np@FreeBSD.org) Message-Id: <201810311830.w9VIUIMi060091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 31 Oct 2018 18:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339965 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 339965 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 18:30:18 -0000 Author: np Date: Wed Oct 31 18:30:17 2018 New Revision: 339965 URL: https://svnweb.freebsd.org/changeset/base/339965 Log: cxgbe(4): Report a reasonable non-zero if_hw_tsomaxsegsize to the kernel. This reverts an accidental change that snuck in with r339628. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Oct 31 18:08:12 2018 (r339964) +++ head/sys/dev/cxgbe/t4_main.c Wed Oct 31 18:30:17 2018 (r339965) @@ -1543,7 +1543,7 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) if (is_ethoffload(vi->pi->adapter) && vi->nofldtxq != 0) ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_EO_TSO; #endif - ifp->if_hw_tsomaxsegsize = 0; + ifp->if_hw_tsomaxsegsize = 65536; ether_ifattach(ifp, vi->hw_addr); #ifdef DEV_NETMAP From owner-svn-src-head@freebsd.org Wed Oct 31 18:38:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A04D10E1B0C for ; Wed, 31 Oct 2018 18:38:52 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic309-21.consmr.mail.gq1.yahoo.com (sonic309-21.consmr.mail.gq1.yahoo.com [98.137.65.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE03A82D9F for ; Wed, 31 Oct 2018 18:38:51 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: UKl8HpAVM1m9J9adTlWTxlViqpKDc1bjtj12MwkvA70Hoz0dfc7suI0Ub.drkzi FNTbOx0TrolAowdtpmN5qEZ5Nzh6fX9S1r33mvjdFF2RNPsZHkTxapGlF6Pr2rAyCZ0GP7pmAT2t MHLFwFYUAtr4NFOoQmWzfMcW2K.rHRU7hrzo_g1arwrGS6Sqb0_Fvpawi1asbM4GEcTMfqziTmet VIRwWgiA91mu5T6qmK50p35PIzy7iPvxVNh6WCvZvKeEGN.dUD2qNc1Pcs6dJwxRY4XNsq4R8An9 x4E.630DWKES7AfTRwElBLKgroEhM7BQHkwzMG9FxoTdUVJFb5iYfPCclbs4GooCUQTexi6MfMrV n5OfyKbr8P9stHoEzM35rtsqyXpOvfilZQh4vLfd5Be9iY0qYUUj6mE2h9VuEVl.wDeVVBBRuHJl .ULBxvoKK0jBk5_naBpJQvr3YGRWbb2CpIRptb8zXL1GpBSNRCuricUhYQ6sOvcmMfXEjKZ6b4WI ZQYzSJTCGYWpDVJDvkLFv7w0ss08XACvnztRz.EwyWr7yxWlsyuwBNn0sODwvWOi1EYrE_5jtzH0 u4vaiE.jN_DlnNRuugEwFNrcgcza4.yffg5lRPR4XR4OgsZTgHKfmnHzgSyEpACJg3m.Fkx9bcoE xARauZTnaAECsqwZJHJkiB50sxLBg1LU0.lb8Ma37Ik19ncVu56NG9vKE44j_rDJaSbUkvA3Ltls O_Bx2C0Zup8lS9gRXd2uODqWNdzyyMrQIz_4f77IpW5T1Q_TPu2JjsdSu72nRWhDpSzAMX_aPOAO sxJ3DX6cr2hTmdBWxVSkA_6G0tu6ChwyKS8.abzt4EUZ2SrqHPQNdKXUY0LzsE_3q4Wmf8zigVuv kXzvReIX3_R8hZ0MU00d4KARO17s5Fv66NbVBehWsQYMzJknTearB6qtPk3yooFvcDg05GTT5SlC Z2AZoXHCQ.RXKBWHHONseYFrVMHxU96XDaeSNnv5G_axeZ0tI5YviXiiPeRNEX9kdpuLouiDKbb8 YQR9zBPHSAIOl515zgz_XFTYkda.YAuqwIzYi_YCNLsSD7ig- Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.gq1.yahoo.com with HTTP; Wed, 31 Oct 2018 18:38:44 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp430.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 2da2d2961cecf87805b184f9e8b26b99; Wed, 31 Oct 2018 18:38:41 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r339876 - head/libexec/rtld-elf From: Mark Millard In-Reply-To: Date: Wed, 31 Oct 2018 11:38:40 -0700 Cc: svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <7DC6D9C4-C153-4BCE-851C-22C890AB0D73@yahoo.com> <2D7C5FC6-CA8D-4AAB-BD64-CC883531F737@yahoo.com> To: Alexander Richardson X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 18:38:52 -0000 On 2018-Oct-30, at 3:23 PM, Alexander Richardson wrote: > . . . > Before this change obj->textsize was always set as the end of > PT_LOAD[0]. Now it will contain everything up to the end of the last > PT_LOAD with execute permissions. In the binary you dumped this is > PT_LOAD[0] both before and after the patch so there is no change in > behaviour. The .got and .plt we not included in textsize before this > patch either. Therefore the only way I can see this patch breaking > anything is if the PHDRS of one of the loaded libraries causes a > change in behaviour. A fair night's sleep helps. Not only did I read something into your description that was not there, I looked at powerpc64 when it turns out that only 32-bit powerpc shows the problem. (I asked.) I'm also told reverting just those changes fixes 32-bit powerpc context. So I'm using an older 32-bit powerpc context to look at: = https://artifact.ci.freebsd.org/snapshot/head/r339870/powerpc/powerpc/base= *.txz materials now. -r339870 is the first 32-bit powerpc build available there after the changes were made. So in a /339870/ area from expanding the .txz's inside it I get: # elfdump -p ./bin/ls | less program header: entry: 0 p_type: PT_PHDR p_offset: 52 p_vaddr: 0x1800034 p_paddr: 0x1800034 p_filesz: 224 p_memsz: 224 p_flags: PF_X|PF_R p_align: 4 entry: 1 p_type: PT_INTERP p_offset: 276 p_vaddr: 0x1800114 p_paddr: 0x1800114 p_filesz: 21 p_memsz: 21 p_flags: PF_R p_align: 1 entry: 2 p_type: PT_LOAD p_offset: 0 p_vaddr: 0x1800000 p_paddr: 0x1800000 p_filesz: 34112 p_memsz: 34112 p_flags: PF_X|PF_R p_align: 65536 entry: 3 p_type: PT_LOAD p_offset: 34112 p_vaddr: 0x1818540 p_paddr: 0x1818540 p_filesz: 316 p_memsz: 1752 p_flags: PF_X|PF_W|PF_R p_align: 65536 entry: 4 p_type: PT_DYNAMIC p_offset: 34132 p_vaddr: 0x1818554 p_paddr: 0x1818554 p_filesz: 216 p_memsz: 216 p_flags: PF_W|PF_R p_align: 4 entry: 5 p_type: PT_NOTE p_offset: 300 p_vaddr: 0x180012c p_paddr: 0x180012c p_filesz: 48 p_memsz: 48 p_flags: PF_R p_align: 4 entry: 6 p_type: PT_LOAD p_offset: 0 p_vaddr: 0 p_paddr: 0 p_filesz: 0 p_memsz: 0 p_flags: PF_W|PF_R p_align: 4 I note some things unique to this compared to powerpc64 and to what the old code would do for what is unique: There are 2 PT_LOADS with PF_X and there are a bunch of pages between that are not covered by any entry. This is from p_align being 65536 from what I can tell. entry 2: 0x1800000+34112=3D=3D0x1808540 for the ending of the read-only PF_X = area. entry 3: 0x1818540 for the beginning of the writable PF_X area. 0x0010000 differences: 65536 Bytes. What is the handling of the page range that is not described in any entry? Is __syncicache(obj->mapbase, obj->textsize) spanning the hole valid? Previously the hole was not spanned as I understand. Libraries also have the hole between the PT_LOAD with PF_X ranges. Using /lib/libc.so as an example: # elfdump -p ./lib/libc.so.7 | less program header: entry: 0 p_type: PT_LOAD p_offset: 0 p_vaddr: 0 p_paddr: 0 p_filesz: 1746472 p_memsz: 1746472 p_flags: PF_X|PF_R p_align: 65536 entry: 1 p_type: PT_LOAD p_offset: 1746480 p_vaddr: 0x1ba630 p_paddr: 0x1ba630 p_filesz: 44188 p_memsz: 201536 p_flags: PF_X|PF_W|PF_R p_align: 65536 entry: 2 p_type: PT_DYNAMIC p_offset: 1762600 p_vaddr: 0x1be528 p_paddr: 0x1be528 p_filesz: 192 p_memsz: 192 p_flags: PF_W|PF_R p_align: 4 entry: 3 p_type: PT_TLS p_offset: 1746480 p_vaddr: 0x1ba630 p_paddr: 0x1ba630 p_filesz: 2832 p_memsz: 2860 p_flags: PF_R p_align: 16 entry: 4 p_type: PT_NULL p_offset: 1745288 p_vaddr: 0x1aa188 p_paddr: 0x1aa188 p_filesz: 236 p_memsz: 236 p_flags: PF_R p_align: 4 entry: 5 p_type: PT_LOAD p_offset: 0 p_vaddr: 0 p_paddr: 0 p_filesz: 0 p_memsz: 0 p_flags: PF_W|PF_R p_align: 4 1746472=3D=3D0x1AA628 for the ending of the readonly code. 0x1ba630 for the beginning of the writable code. 0x10008 difference: 655544 bytes. I doubt the following would contribute but I note them: PT_PHDR for ./bin/ls has PF_X indicated. Various other entries overlap with the PT_LOAD's that have PF_X. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Wed Oct 31 19:19:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E523F10E2F10; Wed, 31 Oct 2018 19:19:13 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94C7484B33; Wed, 31 Oct 2018 19:19:13 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 776E510B45; Wed, 31 Oct 2018 19:19:13 +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 w9VJJDmT086504; Wed, 31 Oct 2018 19:19:13 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VJJDWW086503; Wed, 31 Oct 2018 19:19:13 GMT (envelope-from np@FreeBSD.org) Message-Id: <201810311919.w9VJJDWW086503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 31 Oct 2018 19:19:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339967 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 339967 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 19:19:14 -0000 Author: np Date: Wed Oct 31 19:19:13 2018 New Revision: 339967 URL: https://svnweb.freebsd.org/changeset/base/339967 Log: cxgbe(4): Add rate limiting support for UDP. MFC after: 1 month Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Wed Oct 31 19:09:48 2018 (r339966) +++ head/sys/dev/cxgbe/t4_sge.c Wed Oct 31 19:19:13 2018 (r339967) @@ -5610,10 +5610,6 @@ write_ethofld_wr(struct cxgbe_snd_tag *cst, struct fw_ m0->m_pkthdr.l4hlen > 0, ("%s: ethofld mbuf %p is missing header lengths", __func__, m0)); - if (needs_udp_csum(m0)) { - CXGBE_UNIMPLEMENTED("UDP ethofld"); - } - len16 = mbuf_eo_len16(m0); nsegs = mbuf_eo_nsegs(m0); pktlen = m0->m_pkthdr.len; @@ -5628,37 +5624,52 @@ write_ethofld_wr(struct cxgbe_snd_tag *cst, struct fw_ wr->equiq_to_len16 = htobe32(V_FW_WR_LEN16(len16) | V_FW_WR_FLOWID(cst->etid)); wr->r3 = 0; - wr->u.tcpseg.type = FW_ETH_TX_EO_TYPE_TCPSEG; - wr->u.tcpseg.ethlen = m0->m_pkthdr.l2hlen; - wr->u.tcpseg.iplen = htobe16(m0->m_pkthdr.l3hlen); - wr->u.tcpseg.tcplen = m0->m_pkthdr.l4hlen; - wr->u.tcpseg.tsclk_tsoff = mbuf_eo_tsclk_tsoff(m0); - wr->u.tcpseg.r4 = 0; - wr->u.tcpseg.r5 = 0; - wr->u.tcpseg.plen = htobe32(pktlen - immhdrs); + if (needs_udp_csum(m0)) { + wr->u.udpseg.type = FW_ETH_TX_EO_TYPE_UDPSEG; + wr->u.udpseg.ethlen = m0->m_pkthdr.l2hlen; + wr->u.udpseg.iplen = htobe16(m0->m_pkthdr.l3hlen); + wr->u.udpseg.udplen = m0->m_pkthdr.l4hlen; + wr->u.udpseg.rtplen = 0; + wr->u.udpseg.r4 = 0; + wr->u.udpseg.mss = htobe16(pktlen - immhdrs); + wr->u.udpseg.schedpktsize = wr->u.udpseg.mss; + wr->u.udpseg.plen = htobe32(pktlen - immhdrs); + cpl = (void *)(wr + 1); + } else { + MPASS(needs_tcp_csum(m0)); + wr->u.tcpseg.type = FW_ETH_TX_EO_TYPE_TCPSEG; + wr->u.tcpseg.ethlen = m0->m_pkthdr.l2hlen; + wr->u.tcpseg.iplen = htobe16(m0->m_pkthdr.l3hlen); + wr->u.tcpseg.tcplen = m0->m_pkthdr.l4hlen; + wr->u.tcpseg.tsclk_tsoff = mbuf_eo_tsclk_tsoff(m0); + wr->u.tcpseg.r4 = 0; + wr->u.tcpseg.r5 = 0; + wr->u.tcpseg.plen = htobe32(pktlen - immhdrs); - if (needs_tso(m0)) { - struct cpl_tx_pkt_lso_core *lso = (void *)(wr + 1); + if (needs_tso(m0)) { + struct cpl_tx_pkt_lso_core *lso = (void *)(wr + 1); - wr->u.tcpseg.mss = htobe16(m0->m_pkthdr.tso_segsz); + wr->u.tcpseg.mss = htobe16(m0->m_pkthdr.tso_segsz); - ctrl = V_LSO_OPCODE(CPL_TX_PKT_LSO) | F_LSO_FIRST_SLICE | - F_LSO_LAST_SLICE | V_LSO_IPHDR_LEN(m0->m_pkthdr.l3hlen >> 2) - | V_LSO_TCPHDR_LEN(m0->m_pkthdr.l4hlen >> 2); - if (m0->m_pkthdr.l2hlen == sizeof(struct ether_vlan_header)) - ctrl |= V_LSO_ETHHDR_LEN(1); - if (m0->m_pkthdr.l3hlen == sizeof(struct ip6_hdr)) - ctrl |= F_LSO_IPV6; - lso->lso_ctrl = htobe32(ctrl); - lso->ipid_ofst = htobe16(0); - lso->mss = htobe16(m0->m_pkthdr.tso_segsz); - lso->seqno_offset = htobe32(0); - lso->len = htobe32(pktlen); + ctrl = V_LSO_OPCODE(CPL_TX_PKT_LSO) | + F_LSO_FIRST_SLICE | F_LSO_LAST_SLICE | + V_LSO_IPHDR_LEN(m0->m_pkthdr.l3hlen >> 2) | + V_LSO_TCPHDR_LEN(m0->m_pkthdr.l4hlen >> 2); + if (m0->m_pkthdr.l2hlen == sizeof(struct ether_vlan_header)) + ctrl |= V_LSO_ETHHDR_LEN(1); + if (m0->m_pkthdr.l3hlen == sizeof(struct ip6_hdr)) + ctrl |= F_LSO_IPV6; + lso->lso_ctrl = htobe32(ctrl); + lso->ipid_ofst = htobe16(0); + lso->mss = htobe16(m0->m_pkthdr.tso_segsz); + lso->seqno_offset = htobe32(0); + lso->len = htobe32(pktlen); - cpl = (void *)(lso + 1); - } else { - wr->u.tcpseg.mss = htobe16(0xffff); - cpl = (void *)(wr + 1); + cpl = (void *)(lso + 1); + } else { + wr->u.tcpseg.mss = htobe16(0xffff); + cpl = (void *)(wr + 1); + } } /* Checksum offload must be requested for ethofld. */ @@ -5677,7 +5688,7 @@ write_ethofld_wr(struct cxgbe_snd_tag *cst, struct fw_ cpl->len = htobe16(pktlen); cpl->ctrl1 = htobe64(ctrl1); - /* Copy Ethernet, IP & TCP hdrs as immediate data */ + /* Copy Ethernet, IP & TCP/UDP hdrs as immediate data */ p = (uintptr_t)(cpl + 1); m_copydata(m0, 0, immhdrs, (void *)p); From owner-svn-src-head@freebsd.org Wed Oct 31 19:28:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24FBA10E32C3 for ; Wed, 31 Oct 2018 19:28:47 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic312-22.consmr.mail.gq1.yahoo.com (sonic312-22.consmr.mail.gq1.yahoo.com [98.137.69.203]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4B4C8520A for ; Wed, 31 Oct 2018 19:28:46 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: 8SZii_MVM1kpE3dtTejd3dopv6MfxawUuu62jogrVllnIip0n0KAzVcLD87jkbO IutOiONiCxwL7bVnX7Wkqx8AGB0XxlUuK7sGHTDhcTDj1_n_J9t22crBCty9GwsWezLs2.k7or2v _PjOqg.IvRC8KzKgzrOdOPcYRbDf76WJu.9evm7rm.3Wb3KTmuxlifIAYy8lpeKetVl5xnz9yzF4 a5jxRvKajuP_9NwWjxvZSQKhTA.flX8Q0OV44R2PTpdwhkSFVvy77W69ny8bTKLYFOzxBQujxDAz PpcxEqI2sX_LbnKMlIIK8Jtzl9JIhCjgLy7z_2KDn1_jr2CtbdhWLrtNZdSZRfuUYZsbGzwx2u5A r8SAEddIuD1xw6doif71qpYu3iYqFIPg_1QMgUe.MD2qLYl2bBrRXzvtgqyLUCs7tOBuxt9_Yax8 LT6ik3fKp80sOaLRrFBpf_X_rGupUIazc_6AkTCBJltxadyQ93pSr3sxarqdjJGsZSnjUd4q_kSd RzJHJqki5AS07f37.jtfBkN9zS9vps4BvZZ1agv9D6gkcQhcyMyc3HKGa1s1ghzrIDU1hLHZxu.L dSJcUkQ8u8xbWbOM6UVEvMqDQBYTcrjp.Wmc9Qo2WwBROxF7WW9O5_B7dSw5ooknaZdhBsqjgIK. Da_ba8s7D0UJecHyHIt_.aMb8M9SgDZIVL6Zxlqj8UScea7Aw5U4Vq.NO46dcnjZVLbY29NwPlB3 6h5mVH5jrzNgNB2zX7IQuGgk1LxnoV9WePiHX_4FE692_sHeI1yFYF9rUsmwhg0GRifMSSqEIOL8 5XEqyXfMAjw1alZyG41eRM4GI.8TaSINrBl3GzohNrPIEvCEtLF8f162F225sLyi5NJMnDlBNFI1 I1gn027v9tfobNYmTVlXOb0A9ZG0X30VlgKqdlX3NXbn_71a_JuQsfMyryObMmKdrTqCIVEfatZc 4ejsC9FnqYPKEVY7RaVRbK9ton6hZ9CuqM9F1seZlcVFwFJOVFMpi79mPP7VtFctDNyoqbzu8CtA Ueg7nHZABJXSD7wYw55Jj5qDTXKBWRBMrr0aSX1O2yhibf3s- Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.gq1.yahoo.com with HTTP; Wed, 31 Oct 2018 19:28:39 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp419.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 21a897bc9111048c7c11fee7ebddbcaa; Wed, 31 Oct 2018 19:28:38 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r339876 - head/libexec/rtld-elf From: Mark Millard In-Reply-To: Date: Wed, 31 Oct 2018 12:28:38 -0700 Cc: svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <8358DEE0-D22D-43A5-A531-70A02A262C42@yahoo.com> References: <7DC6D9C4-C153-4BCE-851C-22C890AB0D73@yahoo.com> <2D7C5FC6-CA8D-4AAB-BD64-CC883531F737@yahoo.com> To: Alexander Richardson X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 19:28:47 -0000 On 2018-Oct-31, at 11:53 AM, Alexander Richardson wrote: > On Wed, 31 Oct 2018 at 18:38, Mark Millard wrote: >>=20 >> On 2018-Oct-30, at 3:23 PM, Alexander Richardson wrote: >>=20 >>> . . . >>> Before this change obj->textsize was always set as the end of >>> PT_LOAD[0]. Now it will contain everything up to the end of the last >>> PT_LOAD with execute permissions. In the binary you dumped this is >>> PT_LOAD[0] both before and after the patch so there is no change in >>> behaviour. The .got and .plt we not included in textsize before this >>> patch either. Therefore the only way I can see this patch breaking >>> anything is if the PHDRS of one of the loaded libraries causes a >>> change in behaviour. >>=20 >> A fair night's sleep helps. >>=20 >> Not only did I read something into your description that was >> not there, I looked at powerpc64 when it turns out that >> only 32-bit powerpc shows the problem. (I asked.) >>=20 >> I'm also told reverting just those changes fixes 32-bit >> powerpc context. >>=20 >> So I'm using an older 32-bit powerpc context to look at: >>=20 >> = https://artifact.ci.freebsd.org/snapshot/head/r339870/powerpc/powerpc/base= *.txz >>=20 >> materials now. -r339870 is the first 32-bit powerpc build >> available there after the changes were made. >>=20 >> So in a /339870/ area from expanding the .txz's >> inside it I get: >>=20 >> # elfdump -p ./bin/ls | less >>=20 >> program header: >>=20 >> entry: 0 >> p_type: PT_PHDR >> p_offset: 52 >> p_vaddr: 0x1800034 >> p_paddr: 0x1800034 >> p_filesz: 224 >> p_memsz: 224 >> p_flags: PF_X|PF_R >> p_align: 4 >>=20 >> entry: 1 >> p_type: PT_INTERP >> p_offset: 276 >> p_vaddr: 0x1800114 >> p_paddr: 0x1800114 >> p_filesz: 21 >> p_memsz: 21 >> p_flags: PF_R >> p_align: 1 >>=20 >> entry: 2 >> p_type: PT_LOAD >> p_offset: 0 >> p_vaddr: 0x1800000 >> p_paddr: 0x1800000 >> p_filesz: 34112 >> p_memsz: 34112 >> p_flags: PF_X|PF_R >> p_align: 65536 >>=20 >> entry: 3 >> p_type: PT_LOAD >> p_offset: 34112 >> p_vaddr: 0x1818540 >> p_paddr: 0x1818540 >> p_filesz: 316 >> p_memsz: 1752 >> p_flags: PF_X|PF_W|PF_R >> p_align: 65536 >>=20 >> entry: 4 >> p_type: PT_DYNAMIC >> p_offset: 34132 >> p_vaddr: 0x1818554 >> p_paddr: 0x1818554 >> p_filesz: 216 >> p_memsz: 216 >> p_flags: PF_W|PF_R >> p_align: 4 >>=20 >> entry: 5 >> p_type: PT_NOTE >> p_offset: 300 >> p_vaddr: 0x180012c >> p_paddr: 0x180012c >> p_filesz: 48 >> p_memsz: 48 >> p_flags: PF_R >> p_align: 4 >>=20 >> entry: 6 >> p_type: PT_LOAD >> p_offset: 0 >> p_vaddr: 0 >> p_paddr: 0 >> p_filesz: 0 >> p_memsz: 0 >> p_flags: PF_W|PF_R >> p_align: 4 >>=20 >> I note some things unique to this compared >> to powerpc64 and to what the old code would >> do for what is unique: >>=20 >> There are 2 PT_LOADS with PF_X and there are a >> bunch of pages between that are not covered by >> any entry. This is from p_align being 65536 from >> what I can tell. >>=20 >> entry 2: >> 0x1800000+34112=3D=3D0x1808540 for the ending of the read-only PF_X = area. >> entry 3: >> 0x1818540 for the beginning of the writable PF_X area. >> 0x0010000 differences: 65536 Bytes. >>=20 >> What is the handling of the page range that is >> not described in any entry? Is >> __syncicache(obj->mapbase, obj->textsize) >> spanning the hole valid? Previously the >> hole was not spanned as I understand. >>=20 >>=20 >> Libraries also have the hole between the >> PT_LOAD with PF_X ranges. Using /lib/libc.so >> as an example: >>=20 >> # elfdump -p ./lib/libc.so.7 | less >>=20 >> program header: >>=20 >> entry: 0 >> p_type: PT_LOAD >> p_offset: 0 >> p_vaddr: 0 >> p_paddr: 0 >> p_filesz: 1746472 >> p_memsz: 1746472 >> p_flags: PF_X|PF_R >> p_align: 65536 >>=20 >> entry: 1 >> p_type: PT_LOAD >> p_offset: 1746480 >> p_vaddr: 0x1ba630 >> p_paddr: 0x1ba630 >> p_filesz: 44188 >> p_memsz: 201536 >> p_flags: PF_X|PF_W|PF_R >> p_align: 65536 >>=20 >> entry: 2 >> p_type: PT_DYNAMIC >> p_offset: 1762600 >> p_vaddr: 0x1be528 >> p_paddr: 0x1be528 >> p_filesz: 192 >> p_memsz: 192 >> p_flags: PF_W|PF_R >> p_align: 4 >>=20 >> entry: 3 >> p_type: PT_TLS >> p_offset: 1746480 >> p_vaddr: 0x1ba630 >> p_paddr: 0x1ba630 >> p_filesz: 2832 >> p_memsz: 2860 >> p_flags: PF_R >> p_align: 16 >>=20 >> entry: 4 >> p_type: PT_NULL >> p_offset: 1745288 >> p_vaddr: 0x1aa188 >> p_paddr: 0x1aa188 >> p_filesz: 236 >> p_memsz: 236 >> p_flags: PF_R >> p_align: 4 >>=20 >> entry: 5 >> p_type: PT_LOAD >> p_offset: 0 >> p_vaddr: 0 >> p_paddr: 0 >> p_filesz: 0 >> p_memsz: 0 >> p_flags: PF_W|PF_R >> p_align: 4 >>=20 >> 1746472=3D=3D0x1AA628 for the ending of the readonly code. >> 0x1ba630 for the beginning of the writable code. >> 0x10008 difference: 655544 bytes. [Dumb typo (too many 5's), fix is: 65544 .] >> I doubt the following would contribute but I >> note them: >>=20 >> PT_PHDR for ./bin/ls has PF_X indicated. >>=20 >> Various other entries overlap with the >> PT_LOAD's that have PF_X. >>=20 >=20 > This seems to indicate that it is not possible to for __syncicache() > to span unmapped ranges. > It seems to me like the current behaviour for flushing the icache was > making some assumptions that do not actually hold and my change > exposed them. > Apparently we have some DSOs that have multiple PF_X PT_LOAD segments > (which should probably be included in the __syncicache() call) but > currently > only the value of the first PT_LOAD is included. This will work > correctly for most cases since PT_LOAD[0] usually contains .text but > will break once we start using > LLD since LLD sometimes places a read-only segment first. > I'm not sure what the correct solution is here. Clearly, we should be > flushing the icache for all executable segments and just PT_LOAD[0] > (which may not even be executable). > If it's not possible to use a single contiguous range we might have to > store a list. This is not the first time that the __syncicache (or analogous) and such holes have been an issue. Nathan Whitehorn and I had an exchange long ago that was tied to such --but I've not been able to find a copy in my list/E-mail records or in bugzilla. Back then it turned out that it happened because I'd made a dumb typo someplace where the exponent of 2 was supposed to be in an assembler source to specify a value that had to be a power of 2 but I'd typed the intended overall value instead, making the size bigger than I intended. But, as I remember, Nathan thought that the mistake had exposed a legitimate issue: the hole could have existed for other reasons and requiring there be no hole was too much (long term anyway). Unfortunately, I only have vague memories of what all was written at the time --or exactly what code was involved at the time. I would not depend on any details from back then that come from me. Still, if you are lucky, Nathan might remember what he was thinking back then and know if it applies to this. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Wed Oct 31 19:37:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49DB810E3738; Wed, 31 Oct 2018 19:37:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E83FD859F7; Wed, 31 Oct 2018 19:37:11 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB65D10E6E; Wed, 31 Oct 2018 19:37:11 +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 w9VJbBYk096820; Wed, 31 Oct 2018 19:37:11 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VJbBp1096819; Wed, 31 Oct 2018 19:37:11 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201810311937.w9VJbBp1096819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 31 Oct 2018 19:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339969 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 339969 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 19:37:12 -0000 Author: glebius Date: Wed Oct 31 19:37:11 2018 New Revision: 339969 URL: https://svnweb.freebsd.org/changeset/base/339969 Log: Define QMD_SAVELINK() only for QUEUE_MACRO_DEBUG_TRASH case. Otherwise with QUEUE_MACRO_DEBUG_TRACE compilation fails due to unused variable. Modified: head/sys/sys/queue.h Modified: head/sys/sys/queue.h ============================================================================== --- head/sys/sys/queue.h Wed Oct 31 19:28:05 2018 (r339968) +++ head/sys/sys/queue.h Wed Oct 31 19:37:11 2018 (r339969) @@ -155,18 +155,14 @@ struct qm_trace { #endif /* QUEUE_MACRO_DEBUG_TRACE */ #ifdef QUEUE_MACRO_DEBUG_TRASH +#define QMD_SAVELINK(name, link) void **name = (void *)&(link) #define TRASHIT(x) do {(x) = (void *)-1;} while (0) #define QMD_IS_TRASHED(x) ((x) == (void *)(intptr_t)-1) #else /* !QUEUE_MACRO_DEBUG_TRASH */ +#define QMD_SAVELINK(name, link) #define TRASHIT(x) #define QMD_IS_TRASHED(x) 0 #endif /* QUEUE_MACRO_DEBUG_TRASH */ - -#if defined(QUEUE_MACRO_DEBUG_TRACE) || defined(QUEUE_MACRO_DEBUG_TRASH) -#define QMD_SAVELINK(name, link) void **name = (void *)&(link) -#else /* !QUEUE_MACRO_DEBUG_TRACE && !QUEUE_MACRO_DEBUG_TRASH */ -#define QMD_SAVELINK(name, link) -#endif /* QUEUE_MACRO_DEBUG_TRACE || QUEUE_MACRO_DEBUG_TRASH */ #ifdef __cplusplus /* From owner-svn-src-head@freebsd.org Wed Oct 31 19:55:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD4D710E3F24 for ; Wed, 31 Oct 2018 19:55:15 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com [209.85.219.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67A1A86546 for ; Wed, 31 Oct 2018 19:55:15 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-yb1-f174.google.com with SMTP id g9-v6so7166747ybh.7 for ; Wed, 31 Oct 2018 12:55:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=baJafy33D8zKI9xfY5R5K6FUwdn1z5KvJvkDrRXXQgE=; b=HrhLf4tWZI6NuW6P1Mk3dX9cjAM5Uu3Sw8U3p7vPjGeV4NsUrudoP8livF2kEv4JbK 5RLjKkb9SRZqRtRC1vG0D5+Ke1i72g1MvFh17GclyRlV/w2hFH6KCjizQzUR1x3BY41r mY9PLZIlpp/3dihHxOOEhpuC1bSeGFG+OUIGcAytwIVVKeRU54Zp4O8CeCx8/RwiR+O2 KcspVapg1L+OZizBW8UE5fLCbnw7H3ivHGvS5zbUDfJwBkNvL3GiYO3guS+zfzCwOWoL eBWMHoXvieNxfyY0aqdQUOK5MUGbKKx9xi089f/9xVEydzy7M6smCGjaBLy9W6JjWzOd 75/w== X-Gm-Message-State: AGRZ1gJaCJd8Uzz3OKvTbrDzdMoQwSps8Qfdaon/tR6jNTiq8FRSHam7 PdAMelsu4h1fBXcUre2p58LzIKS3nIw= X-Google-Smtp-Source: AJdET5e1akfezK67DSKYiOd+upLCLmYWemV0J9nEGpuu6pO84ErE0EpnpzZ7DCyqf++WWqPSw6zDzg== X-Received: by 2002:a25:69cd:: with SMTP id e196-v6mr4301714ybc.439.1541012047230; Wed, 31 Oct 2018 11:54:07 -0700 (PDT) Received: from mail-yb1-f176.google.com (mail-yb1-f176.google.com. [209.85.219.176]) by smtp.gmail.com with ESMTPSA id j2-v6sm7113085ywe.92.2018.10.31.11.54.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Oct 2018 11:54:07 -0700 (PDT) Received: by mail-yb1-f176.google.com with SMTP id d18-v6so7092578yba.4 for ; Wed, 31 Oct 2018 11:54:06 -0700 (PDT) X-Received: by 2002:a25:2d16:: with SMTP id t22-v6mr4299285ybt.85.1541012046677; Wed, 31 Oct 2018 11:54:06 -0700 (PDT) MIME-Version: 1.0 References: <7DC6D9C4-C153-4BCE-851C-22C890AB0D73@yahoo.com> <2D7C5FC6-CA8D-4AAB-BD64-CC883531F737@yahoo.com> In-Reply-To: From: Alexander Richardson Date: Wed, 31 Oct 2018 18:53:55 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r339876 - head/libexec/rtld-elf To: marklmi26-fbsd@yahoo.com Cc: svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 19:55:16 -0000 On Wed, 31 Oct 2018 at 18:38, Mark Millard wrote: > > On 2018-Oct-30, at 3:23 PM, Alexander Richardson wrote: > > > . . . > > Before this change obj->textsize was always set as the end of > > PT_LOAD[0]. Now it will contain everything up to the end of the last > > PT_LOAD with execute permissions. In the binary you dumped this is > > PT_LOAD[0] both before and after the patch so there is no change in > > behaviour. The .got and .plt we not included in textsize before this > > patch either. Therefore the only way I can see this patch breaking > > anything is if the PHDRS of one of the loaded libraries causes a > > change in behaviour. > > A fair night's sleep helps. > > Not only did I read something into your description that was > not there, I looked at powerpc64 when it turns out that > only 32-bit powerpc shows the problem. (I asked.) > > I'm also told reverting just those changes fixes 32-bit > powerpc context. > > So I'm using an older 32-bit powerpc context to look at: > > https://artifact.ci.freebsd.org/snapshot/head/r339870/powerpc/powerpc/base*.txz > > materials now. -r339870 is the first 32-bit powerpc build > available there after the changes were made. > > So in a /339870/ area from expanding the .txz's > inside it I get: > > # elfdump -p ./bin/ls | less > > program header: > > entry: 0 > p_type: PT_PHDR > p_offset: 52 > p_vaddr: 0x1800034 > p_paddr: 0x1800034 > p_filesz: 224 > p_memsz: 224 > p_flags: PF_X|PF_R > p_align: 4 > > entry: 1 > p_type: PT_INTERP > p_offset: 276 > p_vaddr: 0x1800114 > p_paddr: 0x1800114 > p_filesz: 21 > p_memsz: 21 > p_flags: PF_R > p_align: 1 > > entry: 2 > p_type: PT_LOAD > p_offset: 0 > p_vaddr: 0x1800000 > p_paddr: 0x1800000 > p_filesz: 34112 > p_memsz: 34112 > p_flags: PF_X|PF_R > p_align: 65536 > > entry: 3 > p_type: PT_LOAD > p_offset: 34112 > p_vaddr: 0x1818540 > p_paddr: 0x1818540 > p_filesz: 316 > p_memsz: 1752 > p_flags: PF_X|PF_W|PF_R > p_align: 65536 > > entry: 4 > p_type: PT_DYNAMIC > p_offset: 34132 > p_vaddr: 0x1818554 > p_paddr: 0x1818554 > p_filesz: 216 > p_memsz: 216 > p_flags: PF_W|PF_R > p_align: 4 > > entry: 5 > p_type: PT_NOTE > p_offset: 300 > p_vaddr: 0x180012c > p_paddr: 0x180012c > p_filesz: 48 > p_memsz: 48 > p_flags: PF_R > p_align: 4 > > entry: 6 > p_type: PT_LOAD > p_offset: 0 > p_vaddr: 0 > p_paddr: 0 > p_filesz: 0 > p_memsz: 0 > p_flags: PF_W|PF_R > p_align: 4 > > I note some things unique to this compared > to powerpc64 and to what the old code would > do for what is unique: > > There are 2 PT_LOADS with PF_X and there are a > bunch of pages between that are not covered by > any entry. This is from p_align being 65536 from > what I can tell. > > entry 2: > 0x1800000+34112==0x1808540 for the ending of the read-only PF_X area. > entry 3: > 0x1818540 for the beginning of the writable PF_X area. > 0x0010000 differences: 65536 Bytes. > > What is the handling of the page range that is > not described in any entry? Is > __syncicache(obj->mapbase, obj->textsize) > spanning the hole valid? Previously the > hole was not spanned as I understand. > > > Libraries also have the hole between the > PT_LOAD with PF_X ranges. Using /lib/libc.so > as an example: > > # elfdump -p ./lib/libc.so.7 | less > > program header: > > entry: 0 > p_type: PT_LOAD > p_offset: 0 > p_vaddr: 0 > p_paddr: 0 > p_filesz: 1746472 > p_memsz: 1746472 > p_flags: PF_X|PF_R > p_align: 65536 > > entry: 1 > p_type: PT_LOAD > p_offset: 1746480 > p_vaddr: 0x1ba630 > p_paddr: 0x1ba630 > p_filesz: 44188 > p_memsz: 201536 > p_flags: PF_X|PF_W|PF_R > p_align: 65536 > > entry: 2 > p_type: PT_DYNAMIC > p_offset: 1762600 > p_vaddr: 0x1be528 > p_paddr: 0x1be528 > p_filesz: 192 > p_memsz: 192 > p_flags: PF_W|PF_R > p_align: 4 > > entry: 3 > p_type: PT_TLS > p_offset: 1746480 > p_vaddr: 0x1ba630 > p_paddr: 0x1ba630 > p_filesz: 2832 > p_memsz: 2860 > p_flags: PF_R > p_align: 16 > > entry: 4 > p_type: PT_NULL > p_offset: 1745288 > p_vaddr: 0x1aa188 > p_paddr: 0x1aa188 > p_filesz: 236 > p_memsz: 236 > p_flags: PF_R > p_align: 4 > > entry: 5 > p_type: PT_LOAD > p_offset: 0 > p_vaddr: 0 > p_paddr: 0 > p_filesz: 0 > p_memsz: 0 > p_flags: PF_W|PF_R > p_align: 4 > > 1746472==0x1AA628 for the ending of the readonly code. > 0x1ba630 for the beginning of the writable code. > 0x10008 difference: 655544 bytes. > > > I doubt the following would contribute but I > note them: > > PT_PHDR for ./bin/ls has PF_X indicated. > > Various other entries overlap with the > PT_LOAD's that have PF_X. > This seems to indicate that it is not possible to for __syncicache() to span unmapped ranges. It seems to me like the current behaviour for flushing the icache was making some assumptions that do not actually hold and my change exposed them. Apparently we have some DSOs that have multiple PF_X PT_LOAD segments (which should probably be included in the __syncicache() call) but currently only the value of the first PT_LOAD is included. This will work correctly for most cases since PT_LOAD[0] usually contains .text but will break once we start using LLD since LLD sometimes places a read-only segment first. I'm not sure what the correct solution is here. Clearly, we should be flushing the icache for all executable segments and just PT_LOAD[0] (which may not even be executable). If it's not possible to use a single contiguous range we might have to store a list. Alex From owner-svn-src-head@freebsd.org Wed Oct 31 19:59:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77F2B10E8256; Wed, 31 Oct 2018 19:59:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F13E86805; Wed, 31 Oct 2018 19:59:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C1E9111CC; Wed, 31 Oct 2018 19:59:21 +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 w9VJxKws007733; Wed, 31 Oct 2018 19:59:20 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VJxK8T007730; Wed, 31 Oct 2018 19:59:20 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201810311959.w9VJxK8T007730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 31 Oct 2018 19:59:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339970 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 339970 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 19:59:21 -0000 Author: glebius Date: Wed Oct 31 19:59:20 2018 New Revision: 339970 URL: https://svnweb.freebsd.org/changeset/base/339970 Log: Remove unnecessary include from libstand. Modified: head/stand/libsa/ip.c head/stand/libsa/net.c head/stand/libsa/udp.c Modified: head/stand/libsa/ip.c ============================================================================== --- head/stand/libsa/ip.c Wed Oct 31 19:37:11 2018 (r339969) +++ head/stand/libsa/ip.c Wed Oct 31 19:59:20 2018 (r339970) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/stand/libsa/net.c ============================================================================== --- head/stand/libsa/net.c Wed Oct 31 19:37:11 2018 (r339969) +++ head/stand/libsa/net.c Wed Oct 31 19:59:20 2018 (r339970) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/stand/libsa/udp.c ============================================================================== --- head/stand/libsa/udp.c Wed Oct 31 19:37:11 2018 (r339969) +++ head/stand/libsa/udp.c Wed Oct 31 19:59:20 2018 (r339970) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include From owner-svn-src-head@freebsd.org Wed Oct 31 20:37:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D242710E94BF; Wed, 31 Oct 2018 20:37:13 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7710C6AC6F; Wed, 31 Oct 2018 20:37:13 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53C9111864; Wed, 31 Oct 2018 20:37:13 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9VKbDlq029123; Wed, 31 Oct 2018 20:37:13 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VKbCCX029120; Wed, 31 Oct 2018 20:37:12 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201810312037.w9VKbCCX029120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 31 Oct 2018 20:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339971 - in head: libexec/rc share/man/man5 share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: in head: libexec/rc share/man/man5 share/man/man8 X-SVN-Commit-Revision: 339971 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 20:37:14 -0000 Author: dteske Date: Wed Oct 31 20:37:12 2018 New Revision: 339971 URL: https://svnweb.freebsd.org/changeset/base/339971 Log: Add new rc keywords: enable, disable, delete This adds new keywords to rc/service to enable/disable a service's rc.conf(5) variable and "delete" to remove the variable. When the "service_delete_empty" variable in rc.conf(5) is set to "YES" (default is "NO") an rc.conf.d file (in /etc/ or /usr/local/etc) is deleted if empty after modification using "service $foo delete". Submitted by: lme (modified) Reviewed by: 0mp (previous version), lme, bcr Relnotes: yes Sponsored by: Smule, Inc. Differential Revision: https://reviews.freebsd.org/D17113 Modified: head/libexec/rc/rc.conf head/libexec/rc/rc.subr head/share/man/man5/rc.conf.5 head/share/man/man8/rc.8 Modified: head/libexec/rc/rc.conf ============================================================================== --- head/libexec/rc/rc.conf Wed Oct 31 19:59:20 2018 (r339970) +++ head/libexec/rc/rc.conf Wed Oct 31 20:37:12 2018 (r339971) @@ -617,6 +617,7 @@ savecore_enable="YES" # Extract core from dump devices savecore_flags="-m 10" # Used if dumpdev is enabled above, and present. # By default, only the 10 most recent kernel dumps # are saved. +service_delete_empty="NO" # Have 'service delete' remove empty rc.conf.d files. crashinfo_enable="YES" # Automatically generate crash dump summary. crashinfo_program="/usr/sbin/crashinfo" # Script to generate crash dump summary. quota_enable="NO" # turn on quotas on startup (or NO). Modified: head/libexec/rc/rc.subr ============================================================================== --- head/libexec/rc/rc.subr Wed Oct 31 19:59:20 2018 (r339970) +++ head/libexec/rc/rc.subr Wed Oct 31 20:37:12 2018 (r339971) @@ -922,7 +922,7 @@ run_rc_command() eval _override_command=\$${name}_program command=${_override_command:-$command} - _keywords="start stop restart rcvar enabled describe extracommands $extra_commands" + _keywords="start stop restart rcvar enable disable delete enabled describe extracommands $extra_commands" rc_pid= _pidcmd= _procname=${procname:-${command}} @@ -977,12 +977,13 @@ run_rc_command() if [ "$_elem" != "$rc_arg" ]; then continue fi - # if ${rcvar} is set, $1 is not "rcvar" and not "describe" - # and ${rc_pid} is not set, then run + # if ${rcvar} is set, $1 is not "rcvar", "describe", + # "enable" or "delete", and ${rc_pid} is not set, run: # checkyesno ${rcvar} # and return if that failed # if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" -a "$rc_arg" != "stop" \ + -a "$rc_arg" != "delete" -a "$rc_arg" != "enable" \ -a "$rc_arg" != "describe" ] || [ -n "${rcvar}" -a "$rc_arg" = "stop" -a -z "${rc_pid}" ]; then if ! checkyesno ${rcvar}; then @@ -1028,6 +1029,31 @@ run_rc_command() extracommands) echo "$extra_commands" + ;; + + enable) + _out=$(/usr/sbin/sysrc -vs "$name" "$rcvar=YES") && + echo "$name enabled in ${_out%%:*}" + ;; + + disable) + _out=$(/usr/sbin/sysrc -vs "$name" "$rcvar=NO") && + echo "$name disabled in ${_out%%:*}" + ;; + + delete) + _files= + for _file in $(sysrc -lEs "$name"); do + _out=$(sysrc -Fif $_file "$rcvar") && _files="$_files $_file" + done + /usr/sbin/sysrc -x "$rcvar" && echo "$rcvar deleted in ${_files# }" + # delete file in rc.conf.d if desired and empty. + checkyesno service_delete_empty || _files= + for _file in $_files; do + [ "$_file" = "${_file#*/rc.conf.d/}" ] && continue + [ $(/usr/bin/stat -f%z $_file) -gt 0 ] && continue + /bin/rm "$_file" && echo "Empty file $_file removed" + done ;; status) Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Wed Oct 31 19:59:20 2018 (r339970) +++ head/share/man/man5/rc.conf.5 Wed Oct 31 20:37:12 2018 (r339971) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 22, 2018 +.Dd October 24, 2018 .Dt RC.CONF 5 .Os .Sh NAME @@ -4509,6 +4509,14 @@ at boot time. The directory where the files exported by USB LUN are located. The default directory is .Pa /var/cfumass . +.It Va service_delete_empty +.Pq Vt bool +If set to +.Dq Li YES , +.Ql Li service delete +removes empty +.Dq Li rc.conf.d +files. .El .Sh FILES .Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact @@ -4597,6 +4605,7 @@ The default directory is .Xr rwhod 8 , .Xr savecore 8 , .Xr sdpd 8 , +.Xr service 8 , .Xr sshd 8 , .Xr swapon 8 , .Xr sysctl 8 , Modified: head/share/man/man8/rc.8 ============================================================================== --- head/share/man/man8/rc.8 Wed Oct 31 19:59:20 2018 (r339970) +++ head/share/man/man8/rc.8 Wed Oct 31 20:37:12 2018 (r339971) @@ -31,7 +31,7 @@ .\" @(#)rc.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd April 25, 2017 +.Dd September 18, 2018 .Dt RC 8 .Os .Sh NAME @@ -327,6 +327,21 @@ If the script starts a process (rather than performing operation), show the status of the process. Otherwise it is not necessary to support this argument. Defaults to displaying the process ID of the program (if running). +.It Cm enable +Enable the service in +.Xr rc.conf 5 . +.It Cm disable +Disable the service in +.Xr rc.conf 5 . +.It Cm delete +Remove the service from +.Xr rc.conf 5 . +If +.Ql Li service_delete_empty +is set to +.Dq Li YES , +.Pa /etc/rc.conf.d/$servicename +will be deleted if empty after modification. .It Cm describe Print a short description of what the script does. .It Cm extracommands From owner-svn-src-head@freebsd.org Wed Oct 31 20:42:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A075410E9701; Wed, 31 Oct 2018 20:42:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55B976B1C7; Wed, 31 Oct 2018 20:42:19 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38026119F5; Wed, 31 Oct 2018 20:42:19 +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 w9VKgJ1j034016; Wed, 31 Oct 2018 20:42:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VKgJk8034015; Wed, 31 Oct 2018 20:42:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201810312042.w9VKgJk8034015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 31 Oct 2018 20:42:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339972 - head/rescue/rescue X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/rescue/rescue X-SVN-Commit-Revision: 339972 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 20:42:19 -0000 Author: kevans Date: Wed Oct 31 20:42:18 2018 New Revision: 339972 URL: https://svnweb.freebsd.org/changeset/base/339972 Log: rescue: Add bectl(8) Requested by: kevans, Shawn Webb MFC after: 3 days Modified: head/rescue/rescue/Makefile Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Wed Oct 31 20:37:12 2018 (r339971) +++ head/rescue/rescue/Makefile Wed Oct 31 20:42:18 2018 (r339972) @@ -116,6 +116,7 @@ CRUNCH_PROGS_sbin+= routed rtquery .endif .if ${MK_ZFS} != "no" +CRUNCH_PROGS_sbin+= bectl CRUNCH_PROGS_sbin+= zfs CRUNCH_PROGS_sbin+= zpool CRUNCH_PROGS_usr.sbin+= zdb @@ -127,6 +128,7 @@ CRUNCH_PROGS_usr.sbin+= zdb CRUNCH_LIBS+= -l80211 -lalias -lcam -lncursesw -ldevstat -lipsec -llzma .if ${MK_ZFS} != "no" CRUNCH_LIBS+= -lavl -lzpool -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem +CRUNCH_LIBS+= -lbe .else # liblzma needs pthread CRUNCH_LIBS+= -lpthread From owner-svn-src-head@freebsd.org Wed Oct 31 22:38:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1710510EB717; Wed, 31 Oct 2018 22:38:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B04C6EAE5; Wed, 31 Oct 2018 22:38:22 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 677BB12BF4; Wed, 31 Oct 2018 22:38:22 +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 w9VMcMxA093621; Wed, 31 Oct 2018 22:38:22 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VMcK5c093611; Wed, 31 Oct 2018 22:38:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201810312238.w9VMcK5c093611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 31 Oct 2018 22:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339973 - in head/sys: amd64/conf arm/conf arm64/conf i386/conf powerpc/conf riscv/conf sparc64/conf X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: amd64/conf arm/conf arm64/conf i386/conf powerpc/conf riscv/conf sparc64/conf X-SVN-Commit-Revision: 339973 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 22:38:23 -0000 Author: kevans Date: Wed Oct 31 22:38:19 2018 New Revision: 339973 URL: https://svnweb.freebsd.org/changeset/base/339973 Log: Compile in VERBOSE_SYSINIT support by default, remain silent by default The loader tunable 'debug.verbose_sysinit' may be used to toggle verbosity. This is added to the debugging section of these kernconfs to be turned off in stable branches for clarity of intent. MFC after: never Modified: head/sys/amd64/conf/GENERIC head/sys/amd64/conf/MINIMAL head/sys/arm/conf/std.arm head/sys/arm/conf/std.armv6 head/sys/arm/conf/std.armv7 head/sys/arm64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/riscv/conf/GENERIC head/sys/sparc64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Wed Oct 31 20:42:18 2018 (r339972) +++ head/sys/amd64/conf/GENERIC Wed Oct 31 22:38:19 2018 (r339973) @@ -99,6 +99,7 @@ options INVARIANT_SUPPORT # Extra sanity checks of in options WITNESS # Enable checks to detect deadlocks and cycles options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default # Kernel dump features. options EKCD # Support for encrypted kernel dumps Modified: head/sys/amd64/conf/MINIMAL ============================================================================== --- head/sys/amd64/conf/MINIMAL Wed Oct 31 20:42:18 2018 (r339972) +++ head/sys/amd64/conf/MINIMAL Wed Oct 31 22:38:19 2018 (r339973) @@ -91,6 +91,7 @@ options INVARIANT_SUPPORT # Extra sanity checks of in options WITNESS # Enable checks to detect deadlocks and cycles options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel Modified: head/sys/arm/conf/std.arm ============================================================================== --- head/sys/arm/conf/std.arm Wed Oct 31 20:42:18 2018 (r339972) +++ head/sys/arm/conf/std.arm Wed Oct 31 22:38:19 2018 (r339973) @@ -20,6 +20,7 @@ options WITNESS_SKIPSPIN # Don't run witness on spinl #options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence options USB_DEBUG # Enable usb debug support code +options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default # Optional extras, never enabled by default: #options BOOTVERBOSE @@ -31,7 +32,6 @@ options USB_DEBUG # Enable usb debug support code #options KTR_VERBOSE=0 #options USB_REQ_DEBUG #options USB_VERBOSE -#options VERBOSE_SYSINIT # Enable verbose sysinit messages Modified: head/sys/arm/conf/std.armv6 ============================================================================== --- head/sys/arm/conf/std.armv6 Wed Oct 31 20:42:18 2018 (r339972) +++ head/sys/arm/conf/std.armv6 Wed Oct 31 22:38:19 2018 (r339973) @@ -70,6 +70,7 @@ options WITNESS_SKIPSPIN # Don't run witness on spinl options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence options USB_DEBUG # Enable usb debug support code +options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default # Optional extras, never enabled by default: #options BOOTVERBOSE @@ -81,5 +82,4 @@ options USB_DEBUG # Enable usb debug support code #options KTR_VERBOSE=0 #options USB_REQ_DEBUG #options USB_VERBOSE -#options VERBOSE_SYSINIT # Enable verbose sysinit messages Modified: head/sys/arm/conf/std.armv7 ============================================================================== --- head/sys/arm/conf/std.armv7 Wed Oct 31 20:42:18 2018 (r339972) +++ head/sys/arm/conf/std.armv7 Wed Oct 31 22:38:19 2018 (r339973) @@ -70,6 +70,7 @@ options WITNESS_SKIPSPIN # Don't run witness on spinl options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence options USB_DEBUG # Enable usb debug support code +options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default # Optional extras, never enabled by default: #options BOOTVERBOSE @@ -81,4 +82,3 @@ options USB_DEBUG # Enable usb debug support code #options KTR_VERBOSE=0 #options USB_REQ_DEBUG #options USB_VERBOSE -#options VERBOSE_SYSINIT # Enable verbose sysinit messages Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Wed Oct 31 20:42:18 2018 (r339972) +++ head/sys/arm64/conf/GENERIC Wed Oct 31 22:38:19 2018 (r339973) @@ -91,6 +91,7 @@ options WITNESS_SKIPSPIN # Don't run witness on spinl options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence options USB_DEBUG # enable debug msgs +options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default # Kernel dump features. options EKCD # Support for encrypted kernel dumps Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Wed Oct 31 20:42:18 2018 (r339972) +++ head/sys/i386/conf/GENERIC Wed Oct 31 22:38:19 2018 (r339973) @@ -93,6 +93,7 @@ options INVARIANT_SUPPORT # Extra sanity checks of in options WITNESS # Enable checks to detect deadlocks and cycles options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default # Kernel dump features. options EKCD # Support for encrypted kernel dumps Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Wed Oct 31 20:42:18 2018 (r339972) +++ head/sys/powerpc/conf/GENERIC Wed Oct 31 22:38:19 2018 (r339973) @@ -98,6 +98,7 @@ options INVARIANT_SUPPORT #Extra sanity checks of int options WITNESS #Enable checks to detect deadlocks and cycles options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default # Kernel dump features. options EKCD # Support for encrypted kernel dumps Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Wed Oct 31 20:42:18 2018 (r339972) +++ head/sys/powerpc/conf/GENERIC64 Wed Oct 31 22:38:19 2018 (r339973) @@ -95,6 +95,7 @@ options INVARIANT_SUPPORT #Extra sanity checks of int options WITNESS #Enable checks to detect deadlocks and cycles options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default # Kernel dump features. options EKCD # Support for encrypted kernel dumps Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Wed Oct 31 20:42:18 2018 (r339972) +++ head/sys/riscv/conf/GENERIC Wed Oct 31 22:38:19 2018 (r339973) @@ -124,7 +124,7 @@ options INVARIANT_SUPPORT # Extra sanity checks of in # options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones # options EARLY_PRINTF -# options VERBOSE_SYSINIT +options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default # Kernel dump features. options ZSTDIO # zstd-compressed kernel and user dumps Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Wed Oct 31 20:42:18 2018 (r339972) +++ head/sys/sparc64/conf/GENERIC Wed Oct 31 22:38:19 2018 (r339973) @@ -88,6 +88,7 @@ options INVARIANT_SUPPORT # Extra sanity checks of in options WITNESS # Enable checks to detect deadlocks and cycles options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default # Kernel dump features. options EKCD # Support for encrypted kernel dumps From owner-svn-src-head@freebsd.org Wed Oct 31 22:55:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E5DB10EBC21; Wed, 31 Oct 2018 22:55:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 341FE6F57C; Wed, 31 Oct 2018 22:55:44 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1136712F36; Wed, 31 Oct 2018 22:55:44 +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 w9VMthWs003952; Wed, 31 Oct 2018 22:55:43 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VMthRX003951; Wed, 31 Oct 2018 22:55:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201810312255.w9VMthRX003951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 31 Oct 2018 22:55:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339974 - head/sys/i386/conf X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/i386/conf X-SVN-Commit-Revision: 339974 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 22:55:44 -0000 Author: kevans Date: Wed Oct 31 22:55:43 2018 New Revision: 339974 URL: https://svnweb.freebsd.org/changeset/base/339974 Log: i386/MINIMAL: VERBOSE_SYSINIT=0 for consistency MFC after: never Modified: head/sys/i386/conf/MINIMAL Modified: head/sys/i386/conf/MINIMAL ============================================================================== --- head/sys/i386/conf/MINIMAL Wed Oct 31 22:38:19 2018 (r339973) +++ head/sys/i386/conf/MINIMAL Wed Oct 31 22:55:43 2018 (r339974) @@ -91,6 +91,7 @@ options INVARIANT_SUPPORT # Extra sanity checks of in options WITNESS # Enable checks to detect deadlocks and cycles options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel From owner-svn-src-head@freebsd.org Wed Oct 31 23:17:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99B701088813; Wed, 31 Oct 2018 23:17:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AD5070B7F; Wed, 31 Oct 2018 23:17: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F30713271; Wed, 31 Oct 2018 23:17: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 w9VNH2pJ014882; Wed, 31 Oct 2018 23:17:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VNH1NM014877; Wed, 31 Oct 2018 23:17:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201810312317.w9VNH1NM014877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 31 Oct 2018 23:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339979 - in head/sys: amd64/amd64 amd64/include conf x86/pci X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/include conf x86/pci X-SVN-Commit-Revision: 339979 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 23:17:03 -0000 Author: kib Date: Wed Oct 31 23:17:00 2018 New Revision: 339979 URL: https://svnweb.freebsd.org/changeset/base/339979 Log: Add pci_early function to detect Intel stolen memory. On some Intel devices BIOS does not properly reserve memory (called "stolen memory") for the GPU. If the stolen memory is claimed by the OS, functions that depend on stolen memory (like frame buffer compression) can't be used. A function called pci_early_quirks that is called before the virtual memory system is started was added. In Linux, this PCI early quirks function iterates through all PCI slots to check for any device that require quirks. While this more generic solution is preferable I only ported the Intel graphics specific parts because I think my implementation would be too similar to Linux GPL'd solution after looking at the Linux code too much. The code regarding Intel graphics stolen memory was ported from Linux. In the case of Intel graphics stolen memory this pci_early_quirks will read the stolen memory base and size from north bridge registers. The values are stored in global variables that is later read by linuxkpi_gplv2. Linuxkpi stores these values in a Linux-specific structure that is read by the drm driver. Relevant linuxkpi code is here: https://github.com/FreeBSDDesktop/kms-drm/blob/drm-v4.16/linuxkpi/gplv2/src/linux_compat.c#L37 For now, only amd64 arch is suppor ted since that is the only arch supported by the new drm drivers. I was told that Intel GPUs are always located on 0:2:0 so these values are hard coded for now. Note that the structure and early execution of the detection code is not required in its current form, but we expect that the code will be added shortly which fixes the potential BIOS bugs by reserving the stolen range in phys_avail[]. This must be done as early as possible to avoid conflicts with the potential usage of the memory in kernel. Submitted by: Johannes Lundberg Reviewed by: bwidawsk, imp MFC after: 1 week Differential revision: https://reviews.freebsd.org/D16719 Differential revision: https://reviews.freebsd.org/D17775 Added: head/sys/x86/pci/pci_early_quirks.c (contents, props changed) head/sys/x86/pci/pci_early_quirks.h (contents, props changed) Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/include/md_var.h head/sys/conf/files.amd64 Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Wed Oct 31 23:08:49 2018 (r339978) +++ head/sys/amd64/amd64/machdep.c Wed Oct 31 23:17:00 2018 (r339979) @@ -317,6 +317,12 @@ cpu_startup(dummy) printf("avail memory = %ju (%ju MB)\n", ptoa((uintmax_t)vm_free_count()), ptoa((uintmax_t)vm_free_count()) / 1048576); +#ifdef DEV_PCI + if (bootverbose && intel_graphics_stolen_base != 0) + printf("intel stolen mem: base %#jx size %ju MB\n", + (uintmax_t)intel_graphics_stolen_base, + (uintmax_t)intel_graphics_stolen_size / 1024 / 1024); +#endif /* * Set up buffers, so they can be used to read disk labels. @@ -1791,6 +1797,11 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) init_param2(physmem); /* now running on new page tables, configured,and u/iom is accessible */ + +#ifdef DEV_PCI + /* This call might adjust phys_avail[]. */ + pci_early_quirks(); +#endif if (late_console) cninit(); Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Wed Oct 31 23:08:49 2018 (r339978) +++ head/sys/amd64/include/md_var.h Wed Oct 31 23:17:00 2018 (r339979) @@ -43,6 +43,9 @@ extern int hw_ssb_disable; extern int nmi_flush_l1d_sw; extern int syscall_ret_l1d_flush_mode; +extern vm_paddr_t intel_graphics_stolen_base; +extern vm_paddr_t intel_graphics_stolen_size; + /* * The file "conf/ldscript.amd64" defines the symbol "kernphys". Its * value is the physical address at which the kernel is loaded. @@ -79,5 +82,6 @@ void setidt(int idx, alias_for_inthand_t *func, int ty void sse2_pagezero(void *addr); struct savefpu *get_pcb_user_save_td(struct thread *td); struct savefpu *get_pcb_user_save_pcb(struct pcb *pcb); +void pci_early_quirks(void); #endif /* !_MACHINE_MD_VAR_H_ */ Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Wed Oct 31 23:08:49 2018 (r339978) +++ head/sys/conf/files.amd64 Wed Oct 31 23:17:00 2018 (r339979) @@ -721,6 +721,7 @@ x86/isa/isa_dma.c standard x86/isa/nmi.c standard x86/isa/orm.c optional isa x86/pci/pci_bus.c optional pci +x86/pci/pci_early_quirks.c optional pci x86/pci/qpi.c optional pci x86/x86/autoconf.c standard x86/x86/bus_machdep.c standard Added: head/sys/x86/pci/pci_early_quirks.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/pci/pci_early_quirks.c Wed Oct 31 23:17:00 2018 (r339979) @@ -0,0 +1,287 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Johannes Lundberg + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +/* XXX: enable this once the KPI is available */ +/* #include */ +#include +#include +#include +#include + +#include + +#define MiB(v) ((unsigned long)(v) << 20) + +struct pci_device_id { + uint32_t vendor; + uint32_t device; + const struct intel_stolen_ops *data; +}; + +/* + * These global variables are read by LinuxKPI. + * LinuxKPI provide this information to the i915 driver. + */ +vm_paddr_t intel_graphics_stolen_base = 0; +vm_paddr_t intel_graphics_stolen_size = 0; + +/* + * Intel early quirks functions + */ +static vm_paddr_t +intel_stolen_base_gen3(int bus, int slot, int func) +{ + uint32_t ctrl; + vm_paddr_t val; + + ctrl = pci_cfgregread(bus, slot, func, INTEL_BSM, 4); + val = ctrl & INTEL_BSM_MASK; + return (val); +} + +static vm_paddr_t +intel_stolen_size_gen3(int bus, int slot, int func) +{ + uint32_t ctrl; + vm_paddr_t val; + + ctrl = pci_cfgregread(0, 0, 0, I830_GMCH_CTRL, 2); + val = ctrl & I855_GMCH_GMS_MASK; + + switch (val) { + case I855_GMCH_GMS_STOLEN_1M: + return (MiB(1)); + case I855_GMCH_GMS_STOLEN_4M: + return (MiB(4)); + case I855_GMCH_GMS_STOLEN_8M: + return (MiB(8)); + case I855_GMCH_GMS_STOLEN_16M: + return (MiB(16)); + case I855_GMCH_GMS_STOLEN_32M: + return (MiB(32)); + case I915_GMCH_GMS_STOLEN_48M: + return (MiB(48)); + case I915_GMCH_GMS_STOLEN_64M: + return (MiB(64)); + case G33_GMCH_GMS_STOLEN_128M: + return (MiB(128)); + case G33_GMCH_GMS_STOLEN_256M: + return (MiB(256)); + case INTEL_GMCH_GMS_STOLEN_96M: + return (MiB(96)); + case INTEL_GMCH_GMS_STOLEN_160M: + return (MiB(160)); + case INTEL_GMCH_GMS_STOLEN_224M: + return (MiB(224)); + case INTEL_GMCH_GMS_STOLEN_352M: + return (MiB(352)); + } + return (0); +} + +static vm_paddr_t +intel_stolen_size_gen6(int bus, int slot, int func) +{ + uint32_t ctrl; + vm_paddr_t val; + + ctrl = pci_cfgregread(bus, slot, func, SNB_GMCH_CTRL, 2); + val = (ctrl >> SNB_GMCH_GMS_SHIFT) & SNB_GMCH_GMS_MASK; + return (val * MiB(32)); +} + +static vm_paddr_t +intel_stolen_size_gen8(int bus, int slot, int func) +{ + uint32_t ctrl; + vm_paddr_t val; + + ctrl = pci_cfgregread(bus, slot, func, SNB_GMCH_CTRL, 2); + val = (ctrl >> BDW_GMCH_GMS_SHIFT) & BDW_GMCH_GMS_MASK; + return (val * MiB(32)); +} + +static vm_paddr_t +intel_stolen_size_chv(int bus, int slot, int func) +{ + uint32_t ctrl; + vm_paddr_t val; + + ctrl = pci_cfgregread(bus, slot, func, SNB_GMCH_CTRL, 2); + val = (ctrl >> SNB_GMCH_GMS_SHIFT) & SNB_GMCH_GMS_MASK; + + /* + * 0x0 to 0x10: 32MB increments starting at 0MB + * 0x11 to 0x16: 4MB increments starting at 8MB + * 0x17 to 0x1d: 4MB increments start at 36MB + */ + if (val < 0x11) + return (val * MiB(32)); + else if (val < 0x17) + return ((val - 0x11) * MiB(4) + MiB(8)); + else + return ((val - 0x17) * MiB(4) + MiB(36)); +} + +static vm_paddr_t +intel_stolen_size_gen9(int bus, int slot, int func) +{ + uint32_t ctrl; + vm_paddr_t val; + + ctrl = pci_cfgregread(bus, slot, func, SNB_GMCH_CTRL, 2); + val = (ctrl >> BDW_GMCH_GMS_SHIFT) & BDW_GMCH_GMS_MASK; + + /* 0x0 to 0xEF: 32MB increments starting at 0MB */ + /* 0xF0 to 0xFE: 4MB increments starting at 4MB */ + if (val < 0xF0) + return (val * MiB(32)); + return ((val - 0xF0) * MiB(4) + MiB(4)); +} + +struct intel_stolen_ops { + vm_paddr_t (*base)(int bus, int slot, int func); + vm_paddr_t (*size)(int bus, int slot, int func); +}; + +static const struct intel_stolen_ops intel_stolen_ops_gen3 = { + .base = intel_stolen_base_gen3, + .size = intel_stolen_size_gen3, +}; + +static const struct intel_stolen_ops intel_stolen_ops_gen6 = { + .base = intel_stolen_base_gen3, + .size = intel_stolen_size_gen6, +}; + +static const struct intel_stolen_ops intel_stolen_ops_gen8 = { + .base = intel_stolen_base_gen3, + .size = intel_stolen_size_gen8, +}; + +static const struct intel_stolen_ops intel_stolen_ops_gen9 = { + .base = intel_stolen_base_gen3, + .size = intel_stolen_size_gen9, +}; + +static const struct intel_stolen_ops intel_stolen_ops_chv = { + .base = intel_stolen_base_gen3, + .size = intel_stolen_size_chv, +}; + +static const struct pci_device_id intel_ids[] = { + INTEL_I915G_IDS(&intel_stolen_ops_gen3), + INTEL_I915GM_IDS(&intel_stolen_ops_gen3), + INTEL_I945G_IDS(&intel_stolen_ops_gen3), + INTEL_I945GM_IDS(&intel_stolen_ops_gen3), + INTEL_VLV_IDS(&intel_stolen_ops_gen6), + INTEL_PINEVIEW_IDS(&intel_stolen_ops_gen3), + INTEL_I965G_IDS(&intel_stolen_ops_gen3), + INTEL_G33_IDS(&intel_stolen_ops_gen3), + INTEL_I965GM_IDS(&intel_stolen_ops_gen3), + INTEL_GM45_IDS(&intel_stolen_ops_gen3), + INTEL_G45_IDS(&intel_stolen_ops_gen3), + INTEL_IRONLAKE_D_IDS(&intel_stolen_ops_gen3), + INTEL_IRONLAKE_M_IDS(&intel_stolen_ops_gen3), + INTEL_SNB_D_IDS(&intel_stolen_ops_gen6), + INTEL_SNB_M_IDS(&intel_stolen_ops_gen6), + INTEL_IVB_M_IDS(&intel_stolen_ops_gen6), + INTEL_IVB_D_IDS(&intel_stolen_ops_gen6), + INTEL_HSW_IDS(&intel_stolen_ops_gen6), + INTEL_BDW_IDS(&intel_stolen_ops_gen8), + INTEL_CHV_IDS(&intel_stolen_ops_chv), + INTEL_SKL_IDS(&intel_stolen_ops_gen9), + INTEL_BXT_IDS(&intel_stolen_ops_gen9), + INTEL_KBL_IDS(&intel_stolen_ops_gen9), + INTEL_CFL_IDS(&intel_stolen_ops_gen9), + INTEL_GLK_IDS(&intel_stolen_ops_gen9), + INTEL_CNL_IDS(&intel_stolen_ops_gen9), +}; + +/* + * Buggy BIOS don't reserve memory for the GPU properly and the OS + * can claim it before the GPU driver is loaded. This function will + * check the registers for base and size of this memory and reserve + * it for the GPU driver. + * gen3 (2004) and newer devices are supported. Support for older hw + * can be ported from Linux if needed. + */ +static void +intel_graphics_stolen(void) +{ + const struct intel_stolen_ops *ops; + uint32_t vendor, device, class; + int i; + + /* XXX: Scan bus instead of assuming 0:2:0? */ + const int bus = 0; + const int slot = 2; + const int func = 0; + + if (pci_cfgregopen() == 0) + return; + + vendor = pci_cfgregread(bus, slot, func, PCIR_VENDOR, 2); + if (vendor != PCI_VENDOR_INTEL) + return; + + class = pci_cfgregread(bus, slot, func, PCIR_SUBCLASS, 2); + if (class != PCI_CLASS_VGA) + return; + + device = pci_cfgregread(bus, slot, func, PCIR_DEVICE, 2); + if (device == 0xFFFF) + return; + + for (i = 0; i < nitems(intel_ids); i++) { + if (intel_ids[i].device != device) + continue; + ops = intel_ids[i].data; + intel_graphics_stolen_base = ops->base(bus, slot, func); + intel_graphics_stolen_size = ops->size(bus, slot, func); + break; + } + + /* XXX: enable this once the KPI is available */ + /* phys_avail_reserve(intel_graphics_stolen_base, */ + /* intel_graphics_stolen_base + intel_graphics_stolen_size); */ +} + +void +pci_early_quirks(void) +{ + + intel_graphics_stolen(); +} Added: head/sys/x86/pci/pci_early_quirks.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/pci/pci_early_quirks.h Wed Oct 31 23:17:00 2018 (r339979) @@ -0,0 +1,479 @@ +/*- + * Copyright (c) 2018 Johannes Lundberg + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _PCI_EARLY_QUIRKS_H_ +#define _PCI_EARLY_QUIRKS_H_ + +/* + * TODO: + * Make a common drm/gpu header that both base and out of tree + * drm modules can use. + */ + +#define PCI_ANY_ID (-1) +#define PCI_VENDOR_INTEL 0x8086 +#define PCI_CLASS_VGA 0x0300 + +#define INTEL_BSM 0x5c +#define INTEL_BSM_MASK (-(1u << 20)) + +#define INTEL_GMCH_CTRL 0x52 +#define INTEL_GMCH_VGA_DISABLE (1 << 1) +#define SNB_GMCH_CTRL 0x50 +#define SNB_GMCH_GGMS_SHIFT 8 /* GTT Graphics Memory Size */ +#define SNB_GMCH_GGMS_MASK 0x3 +#define SNB_GMCH_GMS_SHIFT 3 /* Graphics Mode Select */ +#define SNB_GMCH_GMS_MASK 0x1f +#define BDW_GMCH_GGMS_SHIFT 6 +#define BDW_GMCH_GGMS_MASK 0x3 +#define BDW_GMCH_GMS_SHIFT 8 +#define BDW_GMCH_GMS_MASK 0xff + +#define I830_GMCH_CTRL 0x52 +#define I830_GMCH_GMS_MASK 0x70 +#define I830_GMCH_GMS_LOCAL 0x10 +#define I830_GMCH_GMS_STOLEN_512 0x20 +#define I830_GMCH_GMS_STOLEN_1024 0x30 +#define I830_GMCH_GMS_STOLEN_8192 0x40 + +#define I855_GMCH_GMS_MASK 0xF0 +#define I855_GMCH_GMS_STOLEN_0M 0x0 +#define I855_GMCH_GMS_STOLEN_1M (0x1 << 4) +#define I855_GMCH_GMS_STOLEN_4M (0x2 << 4) +#define I855_GMCH_GMS_STOLEN_8M (0x3 << 4) +#define I855_GMCH_GMS_STOLEN_16M (0x4 << 4) +#define I855_GMCH_GMS_STOLEN_32M (0x5 << 4) +#define I915_GMCH_GMS_STOLEN_48M (0x6 << 4) +#define I915_GMCH_GMS_STOLEN_64M (0x7 << 4) +#define G33_GMCH_GMS_STOLEN_128M (0x8 << 4) +#define G33_GMCH_GMS_STOLEN_256M (0x9 << 4) +#define INTEL_GMCH_GMS_STOLEN_96M (0xa << 4) +#define INTEL_GMCH_GMS_STOLEN_160M (0xb << 4) +#define INTEL_GMCH_GMS_STOLEN_224M (0xc << 4) +#define INTEL_GMCH_GMS_STOLEN_352M (0xd << 4) + +#define INTEL_VGA_DEVICE(id, info) { \ + 0x8086, id, \ + info } + +#define INTEL_I810_IDS(info) \ + INTEL_VGA_DEVICE(0x7121, info), /* I810 */ \ + INTEL_VGA_DEVICE(0x7123, info), /* I810_DC100 */ \ + INTEL_VGA_DEVICE(0x7125, info) /* I810_E */ + +#define INTEL_I815_IDS(info) \ + INTEL_VGA_DEVICE(0x1132, info) /* I815*/ + +#define INTEL_I830_IDS(info) \ + INTEL_VGA_DEVICE(0x3577, info) + +#define INTEL_I845G_IDS(info) \ + INTEL_VGA_DEVICE(0x2562, info) + +#define INTEL_I85X_IDS(info) \ + INTEL_VGA_DEVICE(0x3582, info), /* I855_GM */ \ + INTEL_VGA_DEVICE(0x358e, info) + +#define INTEL_I865G_IDS(info) \ + INTEL_VGA_DEVICE(0x2572, info) /* I865_G */ + +#define INTEL_I915G_IDS(info) \ + INTEL_VGA_DEVICE(0x2582, info), /* I915_G */ \ + INTEL_VGA_DEVICE(0x258a, info) /* E7221_G */ + +#define INTEL_I915GM_IDS(info) \ + INTEL_VGA_DEVICE(0x2592, info) /* I915_GM */ + +#define INTEL_I945G_IDS(info) \ + INTEL_VGA_DEVICE(0x2772, info) /* I945_G */ + +#define INTEL_I945GM_IDS(info) \ + INTEL_VGA_DEVICE(0x27a2, info), /* I945_GM */ \ + INTEL_VGA_DEVICE(0x27ae, info) /* I945_GME */ + +#define INTEL_I965G_IDS(info) \ + INTEL_VGA_DEVICE(0x2972, info), /* I946_GZ */ \ + INTEL_VGA_DEVICE(0x2982, info), /* G35_G */ \ + INTEL_VGA_DEVICE(0x2992, info), /* I965_Q */ \ + INTEL_VGA_DEVICE(0x29a2, info) /* I965_G */ + +#define INTEL_G33_IDS(info) \ + INTEL_VGA_DEVICE(0x29b2, info), /* Q35_G */ \ + INTEL_VGA_DEVICE(0x29c2, info), /* G33_G */ \ + INTEL_VGA_DEVICE(0x29d2, info) /* Q33_G */ + +#define INTEL_I965GM_IDS(info) \ + INTEL_VGA_DEVICE(0x2a02, info), /* I965_GM */ \ + INTEL_VGA_DEVICE(0x2a12, info) /* I965_GME */ + +#define INTEL_GM45_IDS(info) \ + INTEL_VGA_DEVICE(0x2a42, info) /* GM45_G */ + +#define INTEL_G45_IDS(info) \ + INTEL_VGA_DEVICE(0x2e02, info), /* IGD_E_G */ \ + INTEL_VGA_DEVICE(0x2e12, info), /* Q45_G */ \ + INTEL_VGA_DEVICE(0x2e22, info), /* G45_G */ \ + INTEL_VGA_DEVICE(0x2e32, info), /* G41_G */ \ + INTEL_VGA_DEVICE(0x2e42, info), /* B43_G */ \ + INTEL_VGA_DEVICE(0x2e92, info) /* B43_G.1 */ + +#define INTEL_PINEVIEW_IDS(info) \ + INTEL_VGA_DEVICE(0xa001, info), \ + INTEL_VGA_DEVICE(0xa011, info) + +#define INTEL_IRONLAKE_D_IDS(info) \ + INTEL_VGA_DEVICE(0x0042, info) + +#define INTEL_IRONLAKE_M_IDS(info) \ + INTEL_VGA_DEVICE(0x0046, info) + +#define INTEL_SNB_D_GT1_IDS(info) \ + INTEL_VGA_DEVICE(0x0102, info), \ + INTEL_VGA_DEVICE(0x010A, info) + +#define INTEL_SNB_D_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x0112, info), \ + INTEL_VGA_DEVICE(0x0122, info) + +#define INTEL_SNB_D_IDS(info) \ + INTEL_SNB_D_GT1_IDS(info), \ + INTEL_SNB_D_GT2_IDS(info) + +#define INTEL_SNB_M_GT1_IDS(info) \ + INTEL_VGA_DEVICE(0x0106, info) + +#define INTEL_SNB_M_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x0116, info), \ + INTEL_VGA_DEVICE(0x0126, info) + +#define INTEL_SNB_M_IDS(info) \ + INTEL_SNB_M_GT1_IDS(info), \ + INTEL_SNB_M_GT2_IDS(info) + +#define INTEL_IVB_M_GT1_IDS(info) \ + INTEL_VGA_DEVICE(0x0156, info) /* GT1 mobile */ + +#define INTEL_IVB_M_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x0166, info) /* GT2 mobile */ + +#define INTEL_IVB_M_IDS(info) \ + INTEL_IVB_M_GT1_IDS(info), \ + INTEL_IVB_M_GT2_IDS(info) + +#define INTEL_IVB_D_GT1_IDS(info) \ + INTEL_VGA_DEVICE(0x0152, info), /* GT1 desktop */ \ + INTEL_VGA_DEVICE(0x015a, info) /* GT1 server */ + +#define INTEL_IVB_D_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x0162, info), /* GT2 desktop */ \ + INTEL_VGA_DEVICE(0x016a, info) /* GT2 server */ + +#define INTEL_IVB_D_IDS(info) \ + INTEL_IVB_D_GT1_IDS(info), \ + INTEL_IVB_D_GT2_IDS(info) + +#define INTEL_IVB_Q_IDS(info) \ + INTEL_QUANTA_VGA_DEVICE(info) /* Quanta transcode */ + +#define INTEL_HSW_GT1_IDS(info) \ + INTEL_VGA_DEVICE(0x0402, info), /* GT1 desktop */ \ + INTEL_VGA_DEVICE(0x040a, info), /* GT1 server */ \ + INTEL_VGA_DEVICE(0x040B, info), /* GT1 reserved */ \ + INTEL_VGA_DEVICE(0x040E, info), /* GT1 reserved */ \ + INTEL_VGA_DEVICE(0x0C02, info), /* SDV GT1 desktop */ \ + INTEL_VGA_DEVICE(0x0C0A, info), /* SDV GT1 server */ \ + INTEL_VGA_DEVICE(0x0C0B, info), /* SDV GT1 reserved */ \ + INTEL_VGA_DEVICE(0x0C0E, info), /* SDV GT1 reserved */ \ + INTEL_VGA_DEVICE(0x0A02, info), /* ULT GT1 desktop */ \ + INTEL_VGA_DEVICE(0x0A0A, info), /* ULT GT1 server */ \ + INTEL_VGA_DEVICE(0x0A0B, info), /* ULT GT1 reserved */ \ + INTEL_VGA_DEVICE(0x0D02, info), /* CRW GT1 desktop */ \ + INTEL_VGA_DEVICE(0x0D0A, info), /* CRW GT1 server */ \ + INTEL_VGA_DEVICE(0x0D0B, info), /* CRW GT1 reserved */ \ + INTEL_VGA_DEVICE(0x0D0E, info), /* CRW GT1 reserved */ \ + INTEL_VGA_DEVICE(0x0406, info), /* GT1 mobile */ \ + INTEL_VGA_DEVICE(0x0C06, info), /* SDV GT1 mobile */ \ + INTEL_VGA_DEVICE(0x0A06, info), /* ULT GT1 mobile */ \ + INTEL_VGA_DEVICE(0x0A0E, info), /* ULX GT1 mobile */ \ + INTEL_VGA_DEVICE(0x0D06, info) /* CRW GT1 mobile */ + +#define INTEL_HSW_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x0412, info), /* GT2 desktop */ \ + INTEL_VGA_DEVICE(0x041a, info), /* GT2 server */ \ + INTEL_VGA_DEVICE(0x041B, info), /* GT2 reserved */ \ + INTEL_VGA_DEVICE(0x041E, info), /* GT2 reserved */ \ + INTEL_VGA_DEVICE(0x0C12, info), /* SDV GT2 desktop */ \ + INTEL_VGA_DEVICE(0x0C1A, info), /* SDV GT2 server */ \ + INTEL_VGA_DEVICE(0x0C1B, info), /* SDV GT2 reserved */ \ + INTEL_VGA_DEVICE(0x0C1E, info), /* SDV GT2 reserved */ \ + INTEL_VGA_DEVICE(0x0A12, info), /* ULT GT2 desktop */ \ + INTEL_VGA_DEVICE(0x0A1A, info), /* ULT GT2 server */ \ + INTEL_VGA_DEVICE(0x0A1B, info), /* ULT GT2 reserved */ \ + INTEL_VGA_DEVICE(0x0D12, info), /* CRW GT2 desktop */ \ + INTEL_VGA_DEVICE(0x0D1A, info), /* CRW GT2 server */ \ + INTEL_VGA_DEVICE(0x0D1B, info), /* CRW GT2 reserved */ \ + INTEL_VGA_DEVICE(0x0D1E, info), /* CRW GT2 reserved */ \ + INTEL_VGA_DEVICE(0x0416, info), /* GT2 mobile */ \ + INTEL_VGA_DEVICE(0x0426, info), /* GT2 mobile */ \ + INTEL_VGA_DEVICE(0x0C16, info), /* SDV GT2 mobile */ \ + INTEL_VGA_DEVICE(0x0A16, info), /* ULT GT2 mobile */ \ + INTEL_VGA_DEVICE(0x0A1E, info), /* ULX GT2 mobile */ \ + INTEL_VGA_DEVICE(0x0D16, info) /* CRW GT2 mobile */ + +#define INTEL_HSW_GT3_IDS(info) \ + INTEL_VGA_DEVICE(0x0422, info), /* GT3 desktop */ \ + INTEL_VGA_DEVICE(0x042a, info), /* GT3 server */ \ + INTEL_VGA_DEVICE(0x042B, info), /* GT3 reserved */ \ + INTEL_VGA_DEVICE(0x042E, info), /* GT3 reserved */ \ + INTEL_VGA_DEVICE(0x0C22, info), /* SDV GT3 desktop */ \ + INTEL_VGA_DEVICE(0x0C2A, info), /* SDV GT3 server */ \ + INTEL_VGA_DEVICE(0x0C2B, info), /* SDV GT3 reserved */ \ + INTEL_VGA_DEVICE(0x0C2E, info), /* SDV GT3 reserved */ \ + INTEL_VGA_DEVICE(0x0A22, info), /* ULT GT3 desktop */ \ + INTEL_VGA_DEVICE(0x0A2A, info), /* ULT GT3 server */ \ + INTEL_VGA_DEVICE(0x0A2B, info), /* ULT GT3 reserved */ \ + INTEL_VGA_DEVICE(0x0D22, info), /* CRW GT3 desktop */ \ + INTEL_VGA_DEVICE(0x0D2A, info), /* CRW GT3 server */ \ + INTEL_VGA_DEVICE(0x0D2B, info), /* CRW GT3 reserved */ \ + INTEL_VGA_DEVICE(0x0D2E, info), /* CRW GT3 reserved */ \ + INTEL_VGA_DEVICE(0x0C26, info), /* SDV GT3 mobile */ \ + INTEL_VGA_DEVICE(0x0A26, info), /* ULT GT3 mobile */ \ + INTEL_VGA_DEVICE(0x0A2E, info), /* ULT GT3 reserved */ \ + INTEL_VGA_DEVICE(0x0D26, info) /* CRW GT3 mobile */ + +#define INTEL_HSW_IDS(info) \ + INTEL_HSW_GT1_IDS(info), \ + INTEL_HSW_GT2_IDS(info), \ + INTEL_HSW_GT3_IDS(info) + +#define INTEL_VLV_IDS(info) \ + INTEL_VGA_DEVICE(0x0f30, info), \ + INTEL_VGA_DEVICE(0x0f31, info), \ + INTEL_VGA_DEVICE(0x0f32, info), \ + INTEL_VGA_DEVICE(0x0f33, info), \ + INTEL_VGA_DEVICE(0x0157, info), \ + INTEL_VGA_DEVICE(0x0155, info) + +#define INTEL_BDW_GT1_IDS(info) \ + INTEL_VGA_DEVICE(0x1602, info), /* GT1 ULT */ \ + INTEL_VGA_DEVICE(0x1606, info), /* GT1 ULT */ \ + INTEL_VGA_DEVICE(0x160B, info), /* GT1 Iris */ \ + INTEL_VGA_DEVICE(0x160E, info), /* GT1 ULX */ \ + INTEL_VGA_DEVICE(0x160A, info), /* GT1 Server */ \ + INTEL_VGA_DEVICE(0x160D, info) /* GT1 Workstation */ + +#define INTEL_BDW_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x1612, info), /* GT2 Halo */ \ + INTEL_VGA_DEVICE(0x1616, info), /* GT2 ULT */ \ + INTEL_VGA_DEVICE(0x161B, info), /* GT2 ULT */ \ + INTEL_VGA_DEVICE(0x161E, info), /* GT2 ULX */ \ + INTEL_VGA_DEVICE(0x161A, info), /* GT2 Server */ \ + INTEL_VGA_DEVICE(0x161D, info) /* GT2 Workstation */ + +#define INTEL_BDW_GT3_IDS(info) \ + INTEL_VGA_DEVICE(0x1622, info), /* ULT */ \ + INTEL_VGA_DEVICE(0x1626, info), /* ULT */ \ + INTEL_VGA_DEVICE(0x162B, info), /* Iris */ \ + INTEL_VGA_DEVICE(0x162E, info), /* ULX */\ + INTEL_VGA_DEVICE(0x162A, info), /* Server */ \ + INTEL_VGA_DEVICE(0x162D, info) /* Workstation */ + +#define INTEL_BDW_RSVD_IDS(info) \ + INTEL_VGA_DEVICE(0x1632, info), /* ULT */ \ + INTEL_VGA_DEVICE(0x1636, info), /* ULT */ \ + INTEL_VGA_DEVICE(0x163B, info), /* Iris */ \ + INTEL_VGA_DEVICE(0x163E, info), /* ULX */ \ + INTEL_VGA_DEVICE(0x163A, info), /* Server */ \ + INTEL_VGA_DEVICE(0x163D, info) /* Workstation */ + +#define INTEL_BDW_IDS(info) \ + INTEL_BDW_GT1_IDS(info), \ + INTEL_BDW_GT2_IDS(info), \ + INTEL_BDW_GT3_IDS(info), \ + INTEL_BDW_RSVD_IDS(info) + +#define INTEL_CHV_IDS(info) \ + INTEL_VGA_DEVICE(0x22b0, info), \ + INTEL_VGA_DEVICE(0x22b1, info), \ + INTEL_VGA_DEVICE(0x22b2, info), \ + INTEL_VGA_DEVICE(0x22b3, info) + +#define INTEL_SKL_GT1_IDS(info) \ + INTEL_VGA_DEVICE(0x1906, info), /* ULT GT1 */ \ + INTEL_VGA_DEVICE(0x190E, info), /* ULX GT1 */ \ + INTEL_VGA_DEVICE(0x1902, info), /* DT GT1 */ \ + INTEL_VGA_DEVICE(0x190B, info), /* Halo GT1 */ \ + INTEL_VGA_DEVICE(0x190A, info) /* SRV GT1 */ + +#define INTEL_SKL_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x1916, info), /* ULT GT2 */ \ + INTEL_VGA_DEVICE(0x1921, info), /* ULT GT2F */ \ + INTEL_VGA_DEVICE(0x191E, info), /* ULX GT2 */ \ + INTEL_VGA_DEVICE(0x1912, info), /* DT GT2 */ \ + INTEL_VGA_DEVICE(0x191B, info), /* Halo GT2 */ \ + INTEL_VGA_DEVICE(0x191A, info), /* SRV GT2 */ \ + INTEL_VGA_DEVICE(0x191D, info) /* WKS GT2 */ + +#define INTEL_SKL_GT3_IDS(info) \ + INTEL_VGA_DEVICE(0x1923, info), /* ULT GT3 */ \ + INTEL_VGA_DEVICE(0x1926, info), /* ULT GT3 */ \ + INTEL_VGA_DEVICE(0x1927, info), /* ULT GT3 */ \ + INTEL_VGA_DEVICE(0x192B, info), /* Halo GT3 */ \ + INTEL_VGA_DEVICE(0x192D, info) /* SRV GT3 */ + +#define INTEL_SKL_GT4_IDS(info) \ + INTEL_VGA_DEVICE(0x1932, info), /* DT GT4 */ \ + INTEL_VGA_DEVICE(0x193B, info), /* Halo GT4 */ \ + INTEL_VGA_DEVICE(0x193D, info), /* WKS GT4 */ \ + INTEL_VGA_DEVICE(0x192A, info), /* SRV GT4 */ \ + INTEL_VGA_DEVICE(0x193A, info) /* SRV GT4e */ + +#define INTEL_SKL_IDS(info) \ + INTEL_SKL_GT1_IDS(info), \ + INTEL_SKL_GT2_IDS(info), \ + INTEL_SKL_GT3_IDS(info), \ + INTEL_SKL_GT4_IDS(info) + +#define INTEL_BXT_IDS(info) \ + INTEL_VGA_DEVICE(0x0A84, info), \ + INTEL_VGA_DEVICE(0x1A84, info), \ + INTEL_VGA_DEVICE(0x1A85, info), \ + INTEL_VGA_DEVICE(0x5A84, info), /* APL HD Graphics 505 */ \ + INTEL_VGA_DEVICE(0x5A85, info) /* APL HD Graphics 500 */ + +#define INTEL_GLK_IDS(info) \ + INTEL_VGA_DEVICE(0x3184, info), \ + INTEL_VGA_DEVICE(0x3185, info) + +#define INTEL_KBL_GT1_IDS(info) \ + INTEL_VGA_DEVICE(0x5913, info), /* ULT GT1.5 */ \ + INTEL_VGA_DEVICE(0x5915, info), /* ULX GT1.5 */ \ + INTEL_VGA_DEVICE(0x5906, info), /* ULT GT1 */ \ + INTEL_VGA_DEVICE(0x590E, info), /* ULX GT1 */ \ + INTEL_VGA_DEVICE(0x5902, info), /* DT GT1 */ \ + INTEL_VGA_DEVICE(0x5908, info), /* Halo GT1 */ \ + INTEL_VGA_DEVICE(0x590B, info), /* Halo GT1 */ \ + INTEL_VGA_DEVICE(0x590A, info) /* SRV GT1 */ + +#define INTEL_KBL_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x5916, info), /* ULT GT2 */ \ + INTEL_VGA_DEVICE(0x5917, info), /* Mobile GT2 */ \ + INTEL_VGA_DEVICE(0x5921, info), /* ULT GT2F */ \ + INTEL_VGA_DEVICE(0x591E, info), /* ULX GT2 */ \ + INTEL_VGA_DEVICE(0x5912, info), /* DT GT2 */ \ + INTEL_VGA_DEVICE(0x591B, info), /* Halo GT2 */ \ + INTEL_VGA_DEVICE(0x591A, info), /* SRV GT2 */ \ + INTEL_VGA_DEVICE(0x591D, info) /* WKS GT2 */ + +#define INTEL_KBL_GT3_IDS(info) \ + INTEL_VGA_DEVICE(0x5923, info), /* ULT GT3 */ \ + INTEL_VGA_DEVICE(0x5926, info), /* ULT GT3 */ \ + INTEL_VGA_DEVICE(0x5927, info) /* ULT GT3 */ + +#define INTEL_KBL_GT4_IDS(info) \ + INTEL_VGA_DEVICE(0x593B, info) /* Halo GT4 */ + +#define INTEL_KBL_IDS(info) \ + INTEL_KBL_GT1_IDS(info), \ + INTEL_KBL_GT2_IDS(info), \ + INTEL_KBL_GT3_IDS(info), \ + INTEL_KBL_GT4_IDS(info) + +/* CFL S */ +#define INTEL_CFL_S_GT1_IDS(info) \ + INTEL_VGA_DEVICE(0x3E90, info), /* SRV GT1 */ \ + INTEL_VGA_DEVICE(0x3E93, info), /* SRV GT1 */ \ + INTEL_VGA_DEVICE(0x3E99, info) /* SRV GT1 */ + +#define INTEL_CFL_S_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x3E91, info), /* SRV GT2 */ \ + INTEL_VGA_DEVICE(0x3E92, info), /* SRV GT2 */ \ + INTEL_VGA_DEVICE(0x3E96, info), /* SRV GT2 */ \ + INTEL_VGA_DEVICE(0x3E9A, info) /* SRV GT2 */ + +/* CFL H */ +#define INTEL_CFL_H_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x3E9B, info), /* Halo GT2 */ \ + INTEL_VGA_DEVICE(0x3E94, info) /* Halo GT2 */ + +/* CFL U GT1 */ +#define INTEL_CFL_U_GT1_IDS(info) \ + INTEL_VGA_DEVICE(0x3EA1, info), \ + INTEL_VGA_DEVICE(0x3EA4, info) + +/* CFL U GT2 */ +#define INTEL_CFL_U_GT2_IDS(info) \ + INTEL_VGA_DEVICE(0x3EA0, info), \ + INTEL_VGA_DEVICE(0x3EA3, info), \ + INTEL_VGA_DEVICE(0x3EA9, info) + +/* CFL U GT3 */ +#define INTEL_CFL_U_GT3_IDS(info) \ + INTEL_VGA_DEVICE(0x3EA2, info), /* ULT GT3 */ \ + INTEL_VGA_DEVICE(0x3EA5, info), /* ULT GT3 */ \ + INTEL_VGA_DEVICE(0x3EA6, info), /* ULT GT3 */ \ + INTEL_VGA_DEVICE(0x3EA7, info), /* ULT GT3 */ \ + INTEL_VGA_DEVICE(0x3EA8, info) /* ULT GT3 */ + +#define INTEL_CFL_IDS(info) \ + INTEL_CFL_S_GT1_IDS(info), \ + INTEL_CFL_S_GT2_IDS(info), \ + INTEL_CFL_H_GT2_IDS(info), \ + INTEL_CFL_U_GT1_IDS(info), \ + INTEL_CFL_U_GT2_IDS(info), \ + INTEL_CFL_U_GT3_IDS(info) + +/* CNL */ +#define INTEL_CNL_IDS(info) \ + INTEL_VGA_DEVICE(0x5A51, info), \ + INTEL_VGA_DEVICE(0x5A59, info), \ + INTEL_VGA_DEVICE(0x5A41, info), \ + INTEL_VGA_DEVICE(0x5A49, info), \ + INTEL_VGA_DEVICE(0x5A52, info), \ + INTEL_VGA_DEVICE(0x5A5A, info), \ + INTEL_VGA_DEVICE(0x5A42, info), \ + INTEL_VGA_DEVICE(0x5A4A, info), \ + INTEL_VGA_DEVICE(0x5A50, info), \ + INTEL_VGA_DEVICE(0x5A40, info), \ + INTEL_VGA_DEVICE(0x5A54, info), \ + INTEL_VGA_DEVICE(0x5A5C, info), \ + INTEL_VGA_DEVICE(0x5A44, info), \ + INTEL_VGA_DEVICE(0x5A4C, info) + +/* ICL */ +#define INTEL_ICL_11_IDS(info) \ + INTEL_VGA_DEVICE(0x8A50, info), \ + INTEL_VGA_DEVICE(0x8A51, info), \ + INTEL_VGA_DEVICE(0x8A5C, info), \ + INTEL_VGA_DEVICE(0x8A5D, info), \ + INTEL_VGA_DEVICE(0x8A52, info), \ + INTEL_VGA_DEVICE(0x8A5A, info), \ + INTEL_VGA_DEVICE(0x8A5B, info), \ + INTEL_VGA_DEVICE(0x8A71, info), \ + INTEL_VGA_DEVICE(0x8A70, info) + +#endif /* _PCI_EARLY_QUIRKS_H_ */ From owner-svn-src-head@freebsd.org Thu Nov 1 03:38:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19BD010EA671; Thu, 1 Nov 2018 03:38:58 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEEA07C842; Thu, 1 Nov 2018 03:38:57 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EBF5162B4; Thu, 1 Nov 2018 03:38:57 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA13cvuB049995; Thu, 1 Nov 2018 03:38:57 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA13cvC4049994; Thu, 1 Nov 2018 03:38:57 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201811010338.wA13cvC4049994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 1 Nov 2018 03:38:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339983 - head/sbin/clri X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/clri X-SVN-Commit-Revision: 339983 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 03:38:58 -0000 Author: mckusick Date: Thu Nov 1 03:38:57 2018 New Revision: 339983 URL: https://svnweb.freebsd.org/changeset/base/339983 Log: In preparation for adding inode check-hashes, convert the clri(8) program to use the libufs library interface. No functional change (as for now the libufs library does not do inode check-hashes). Reviewed by: kib Sponsored by: Netflix Modified: head/sbin/clri/clri.c Modified: head/sbin/clri/clri.c ============================================================================== --- head/sbin/clri/clri.c Thu Nov 1 02:10:55 2018 (r339982) +++ head/sbin/clri/clri.c Thu Nov 1 03:38:57 2018 (r339983) @@ -62,6 +62,11 @@ __FBSDID("$FreeBSD$"); #include #include +union dinodep { + struct ufs1_dinode *dp1; + struct ufs2_dinode *dp2; +}; + static void usage(void) { @@ -72,81 +77,51 @@ usage(void) int main(int argc, char *argv[]) { - struct fs *fs; - struct ufs1_dinode *dp1; - struct ufs2_dinode *dp2; - char *ibuf[MAXBSIZE]; - long generation, bsize; - off_t offset; - int fd, ret, inonum; + union dinodep dp; + struct uufsd disk; + long generation; + int inonum, exitval; char *fsname; - void *v = ibuf; if (argc < 3) usage(); - fsname = *++argv; - /* get the superblock. */ - if ((fd = open(fsname, O_RDWR, 0)) < 0) - err(1, "%s", fsname); - if ((ret = sbget(fd, &fs, -1)) != 0) { - switch (ret) { - case ENOENT: - warn("Cannot find file system superblock"); - return (1); - default: - warn("Unable to read file system superblock"); - return (1); - } + fsname = *++argv; + if (ufs_disk_fillout(&disk, fsname) == -1) { + printf("loading superblock: %s\n", disk.d_error); + exit (1); } - bsize = fs->fs_bsize; /* remaining arguments are inode numbers. */ + exitval = 0; while (*++argv) { /* get the inode number. */ - if ((inonum = atoi(*argv)) <= 0) - errx(1, "%s is not a valid inode number", *argv); + if ((inonum = atoi(*argv)) < UFS_ROOTINO) { + printf("%s is not a valid inode number", *argv); + exitval = 1; + continue; + } (void)printf("clearing %d\n", inonum); - /* read in the appropriate block. */ - offset = ino_to_fsba(fs, inonum); /* inode to fs blk */ - offset = fsbtodb(fs, offset); /* fs blk disk blk */ - offset *= DEV_BSIZE; /* disk blk to bytes */ - - /* seek and read the block */ - if (lseek(fd, offset, SEEK_SET) < 0) - err(1, "%s", fsname); - if (read(fd, ibuf, bsize) != bsize) - err(1, "%s", fsname); - - if (fs->fs_magic == FS_UFS2_MAGIC) { - /* get the inode within the block. */ - dp2 = &(((struct ufs2_dinode *)v) - [ino_to_fsbo(fs, inonum)]); - - /* clear the inode, and bump the generation count. */ - generation = dp2->di_gen + 1; - memset(dp2, 0, sizeof(*dp2)); - dp2->di_gen = generation; + if (getino(&disk, (void **)&dp, inonum, NULL) == -1) { + printf("getino: %s\n", disk.d_error); + exitval = 1; + continue; + } + /* clear the inode, and bump the generation count. */ + if (disk.d_fs.fs_magic == FS_UFS1_MAGIC) { + generation = dp.dp1->di_gen + 1; + memset(dp.dp1, 0, sizeof(*dp.dp1)); + dp.dp1->di_gen = generation; } else { - /* get the inode within the block. */ - dp1 = &(((struct ufs1_dinode *)v) - [ino_to_fsbo(fs, inonum)]); - - /* clear the inode, and bump the generation count. */ - generation = dp1->di_gen + 1; - memset(dp1, 0, sizeof(*dp1)); - dp1->di_gen = generation; + generation = dp.dp2->di_gen + 1; + memset(dp.dp2, 0, sizeof(*dp.dp2)); + dp.dp2->di_gen = generation; } - - /* backup and write the block */ - if (lseek(fd, (off_t)-bsize, SEEK_CUR) < 0) - err(1, "%s", fsname); - if (write(fd, ibuf, bsize) != bsize) - err(1, "%s", fsname); - (void)fsync(fd); + putino(&disk); + (void)fsync(disk.d_fd); } - (void)close(fd); - exit(0); + (void)ufs_disk_close(&disk); + exit(exitval); } From owner-svn-src-head@freebsd.org Thu Nov 1 06:06:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A7D6112F2DB; Thu, 1 Nov 2018 06:06:26 +0000 (UTC) (envelope-from kozlov@ravenloft.kiev.ua) Received: from ravenloft.kiev.ua (ravenloft.kiev.ua [94.244.131.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3B028BAC7; Thu, 1 Nov 2018 06:06:25 +0000 (UTC) (envelope-from kozlov@ravenloft.kiev.ua) Date: Thu, 1 Nov 2018 07:06:17 +0100 From: Alex Kozlov To: Devin Teske Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339971 - in head: libexec/rc share/man/man5 share/man/man8 Message-ID: <20181101060617.GA51661@ravenloft.kiev.ua> References: <201810312037.w9VKbCCX029120@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201810312037.w9VKbCCX029120@repo.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 06:06:26 -0000 On Wed, Oct 31, 2018 at 08:37:12PM +0000, Devin Teske wrote: > Author: dteske > Date: Wed Oct 31 20:37:12 2018 > New Revision: 339971 > URL: https://svnweb.freebsd.org/changeset/base/339971 > > Log: > Add new rc keywords: enable, disable, delete > > This adds new keywords to rc/service to enable/disable a service's > rc.conf(5) variable and "delete" to remove the variable. The enable command is just one typo away from enabled, so it's quite easy to enable rc-script instead of checking if it enabled. > When the "service_delete_empty" variable in rc.conf(5) is set to "YES" > (default is "NO") an rc.conf.d file (in /etc/ or /usr/local/etc) is > deleted if empty after modification using "service $foo delete". > > Submitted by: lme (modified) > Reviewed by: 0mp (previous version), lme, bcr > Relnotes: yes > Sponsored by: Smule, Inc. > Differential Revision: https://reviews.freebsd.org/D17113 -- Alex From owner-svn-src-head@freebsd.org Thu Nov 1 08:17:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29BAA10F15A6; Thu, 1 Nov 2018 08:17:28 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5F446FB0D; Thu, 1 Nov 2018 08:17:27 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A53A5190E9; Thu, 1 Nov 2018 08:17:27 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA18HRmD094110; Thu, 1 Nov 2018 08:17:27 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA18HRFe094108; Thu, 1 Nov 2018 08:17:27 GMT (envelope-from des@FreeBSD.org) Message-Id: <201811010817.wA18HRFe094108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Thu, 1 Nov 2018 08:17:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339985 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 339985 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 08:17:28 -0000 Author: des Date: Thu Nov 1 08:17:27 2018 New Revision: 339985 URL: https://svnweb.freebsd.org/changeset/base/339985 Log: Fix markup issues and add references to updated RFCs. MFC after: 3 days Modified: head/share/man/man4/icmp6.4 head/share/man/man4/ip6.4 Modified: head/share/man/man4/icmp6.4 ============================================================================== --- head/share/man/man4/icmp6.4 Thu Nov 1 08:08:08 2018 (r339984) +++ head/share/man/man4/icmp6.4 Thu Nov 1 08:17:27 2018 (r339985) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 7, 2012 +.Dd November 1, 2018 .Dt ICMP6 4 .Os .Sh NAME @@ -188,11 +188,11 @@ By default, all messages types are allowed on newly cr sockets. The following macros may be used to refine the input set: .Bl -tag -width Ds -.It Fn "void ICMP6_FILTER_SETPASSALL" "struct icmp6_filter *filterp" +.It Ft void Fn ICMP6_FILTER_SETPASSALL "struct icmp6_filter *filterp" Allow all incoming messages. .Va filterp is modified to allow all message types. -.It Fn "void ICMP6_FILTER_SETBLOCKALL" "struct icmp6_filter *filterp" +.It Ft void Fn ICMP6_FILTER_SETBLOCKALL "struct icmp6_filter *filterp" Ignore all incoming messages. .Va filterp is modified to ignore all message types. @@ -206,7 +206,7 @@ Allow ICMPv6 messages with the given is modified to allow such messages. .It Xo .Ft void -.Fn ICMP6_FILTER_SETBLOCK" "int type" "struct icmp6_filter *filterp" +.Fn ICMP6_FILTER_SETBLOCK "int type" "struct icmp6_filter *filterp" .Xc Ignore ICMPv6 messages with the given .Fa type . @@ -214,13 +214,13 @@ Ignore ICMPv6 messages with the given is modified to ignore such messages. .It Xo .Ft int -.Fn ICMP6_FILTER_WILLPASS" "int type" "const struct icmp6_filter *filterp" +.Fn ICMP6_FILTER_WILLPASS "int type" "const struct icmp6_filter *filterp" .Xc Determine if the given filter will allow an ICMPv6 message of the given type. .It Xo .Ft int -.Fn ICMP6_FILTER_WILLBLOCK" "int type" "const struct icmp6_filter *filterp" +.Fn ICMP6_FILTER_WILLBLOCK "int type" "const struct icmp6_filter *filterp" .Xc Determine if the given filter will ignore an ICMPv6 message of the given type. @@ -262,4 +262,22 @@ structure as the option value. "Protocol Version 6 (IPv6) Specification" .%N RFC 2463 .%D December 1998 +.Re +.Rs +.%A W. Stevens +.%A M. Thomas +.%A E. Nordmark +.%A T. Jinmei +.%T "Advanced Sockets Application Program Interface (API) for IPv6" +.%R RFC 3542 +.%D May 2003 +.Re +.Rs +.%A A. Conta +.%A S. Deering +.%A M. Gupta +.%T "Internet Control Message Protocol (ICMPv6) for the Internet" \ + "Protocol Version 6 (IPv6) Specification" +.%R RFC 4443 +.%D March 2006 .Re Modified: head/share/man/man4/ip6.4 ============================================================================== --- head/share/man/man4/ip6.4 Thu Nov 1 08:08:08 2018 (r339984) +++ head/share/man/man4/ip6.4 Thu Nov 1 08:17:27 2018 (r339985) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 19, 2018 +.Dd November 1, 2018 .Dt IP6 4 .Os .Sh NAME @@ -652,9 +652,8 @@ An ancillary data object was improperly formed. .Xr setsockopt 2 , .Xr socket 2 , .Xr CMSG_DATA 3 , -.\" .Xr inet6_option_space 3 , -.\" .Xr inet6_rthdr_space 3 , .Xr if_nametoindex 3 , +.Xr inet6_opt_init 3 , .Xr bpf 4 , .Xr icmp6 4 , .Xr inet6 4 , @@ -686,16 +685,42 @@ An ancillary data object was improperly formed. .%D March 1999 .Re .Rs +.%A R. Gilligan +.%A S. Thomson +.%A J. Bound +.%A J. McCann .%A W. Stevens +.%T Basic Socket Interface Extensions for IPv6 +.%R RFC 3493 +.%D February 2003 +.Re +.Rs +.%A W. Stevens +.%A M. Thomas +.%A E. Nordmark +.%A T. Jinmei +.%T Advanced Sockets Application Program Interface (API) for IPv6 +.%R RFC 3542 +.%D May 2003 +.Re +.Rs +.%A S. Deering +.%A R. Hinden +.%T Internet Protocol, Version 6 (IPv6) Specification +.%R RFC 8200 +.%D July 2017 +.Re +.Rs +.%A W. Stevens .%A B. Fenner .%A A. Rudoff -.%T UNIX Network Programming, third edition +.%T UNIX Network Programming, 3rd Edition +.%I Addison-Wesley Professional +.%D November 2003 .Re .Sh STANDARDS -Most of the socket options are defined in RFC 2292 or RFC 2553. -The -.Dv IPV6_V6ONLY -socket option is defined in RFC 3493 Section 5.3. +Most of the socket options are defined in RFC 2292 / 3542 or +RFC 2553 / 3493. The .Dv IPV6_PORTRANGE socket option and the conflict resolution rule are not defined in the From owner-svn-src-head@freebsd.org Thu Nov 1 10:25:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CEC910DAD7D; Thu, 1 Nov 2018 10:25:23 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 434506CEEA; Thu, 1 Nov 2018 10:25:23 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23FFD1A644; Thu, 1 Nov 2018 10:25:23 +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 wA1APNAW058913; Thu, 1 Nov 2018 10:25:23 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1APNTF058912; Thu, 1 Nov 2018 10:25:23 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201811011025.wA1APNTF058912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 1 Nov 2018 10:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339988 - 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: 339988 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 10:25:23 -0000 Author: andrew Date: Thu Nov 1 10:25:22 2018 New Revision: 339988 URL: https://svnweb.freebsd.org/changeset/base/339988 Log: Use the correct offsets for the trap frame in fork_trampoline. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/swtch.S Modified: head/sys/arm64/arm64/swtch.S ============================================================================== --- head/sys/arm64/arm64/swtch.S Thu Nov 1 09:00:37 2018 (r339987) +++ head/sys/arm64/arm64/swtch.S Thu Nov 1 10:25:22 2018 (r339988) @@ -236,12 +236,12 @@ ENTRY(fork_trampoline) msr daifset, #2 /* Restore sp and lr */ - ldp x0, x1, [sp] + ldp x0, x1, [sp, #TF_SP] msr sp_el0, x0 mov lr, x1 /* Restore elr and spsr */ - ldp x0, x1, [sp, #16] + ldp x0, x1, [sp, #TF_ELR] msr elr_el1, x0 msr spsr_el1, x1 From owner-svn-src-head@freebsd.org Thu Nov 1 11:35:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66D4010ED7E6; Thu, 1 Nov 2018 11:35:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 155E1712BA; Thu, 1 Nov 2018 11:35:29 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E066C1B23B; Thu, 1 Nov 2018 11:35:28 +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 wA1BZSot094336; Thu, 1 Nov 2018 11:35:28 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1BZSAL094335; Thu, 1 Nov 2018 11:35:28 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201811011135.wA1BZSAL094335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 1 Nov 2018 11:35:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339989 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 339989 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 11:35:29 -0000 Author: tuexen Date: Thu Nov 1 11:35:28 2018 New Revision: 339989 URL: https://svnweb.freebsd.org/changeset/base/339989 Log: Improve a comment to refer to the actual sections in the TCP specification for the comparisons made. Thanks to lstewart@ for the suggestion. MFC after: 4 weeks Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D17595 Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Thu Nov 1 10:25:22 2018 (r339988) +++ head/sys/netinet/tcp_syncache.c Thu Nov 1 11:35:28 2018 (r339989) @@ -581,15 +581,28 @@ syncache_chkrst(struct in_conninfo *inc, struct tcphdr /* * If the RST bit is set, check the sequence number to see * if this is a valid reset segment. + * * RFC 793 page 37: * In all states except SYN-SENT, all reset (RST) segments * are validated by checking their SEQ-fields. A reset is * valid if its sequence number is in the window. * - * The sequence number in the reset segment is normally an - * echo of our outgoing acknowlegement numbers, but some hosts - * send a reset with the sequence number at the rightmost edge - * of our receive window, and we have to handle this case. + * RFC 793 page 69: + * There are four cases for the acceptability test for an incoming + * segment: + * + * Segment Receive Test + * Length Window + * ------- ------- ------------------------------------------- + * 0 0 SEG.SEQ = RCV.NXT + * 0 >0 RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND + * >0 0 not acceptable + * >0 >0 RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND + * or RCV.NXT =< SEG.SEQ+SEG.LEN-1 < RCV.NXT+RCV.WND + * + * Note that when receiving a SYN segment in the LISTEN state, + * IRS is set to SEG.SEQ and RCV.NXT is set to SEG.SEQ+1, as + * described in RFC 793, page 66. */ if ((SEQ_GEQ(th->th_seq, sc->sc_irs + 1) && SEQ_LT(th->th_seq, sc->sc_irs + 1 + sc->sc_wnd)) || @@ -1731,6 +1744,7 @@ syncache_respond(struct syncache *sc, struct syncache_ th->th_seq = htonl(sc->sc_iss); else th->th_seq = htonl(sc->sc_iss + 1); +printf("SEG.SEQ=0x%x, ISS=0x%x.\n", ntohl(th->th_seq), sc->sc_iss); th->th_ack = htonl(sc->sc_irs + 1); th->th_off = sizeof(struct tcphdr) >> 2; th->th_x2 = 0; From owner-svn-src-head@freebsd.org Thu Nov 1 11:37:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DD1F10EDB5B; Thu, 1 Nov 2018 11:37:20 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8347714B7; Thu, 1 Nov 2018 11:37:19 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9F811B255; Thu, 1 Nov 2018 11:37:19 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA1BbJrN094455; Thu, 1 Nov 2018 11:37:19 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1BbJ3d094454; Thu, 1 Nov 2018 11:37:19 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201811011137.wA1BbJ3d094454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Thu, 1 Nov 2018 11:37:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339990 - head/contrib/smbfs/mount_smbfs X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/contrib/smbfs/mount_smbfs X-SVN-Commit-Revision: 339990 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 11:37:20 -0000 Author: 0mp (ports committer) Date: Thu Nov 1 11:37:19 2018 New Revision: 339990 URL: https://svnweb.freebsd.org/changeset/base/339990 Log: mount_smbfs(8): Add the STANDARDS and HISTORY sections - Document that mount_smbfs(8) only supports SMB1 and that SMB2 and SMB3 are not supported at the moment. Suggest users to browse ports for software compatible with newer versions of the protocol. - Copy supported servers list from README. - Add a SEE ALSO section and reference the chapter about Samba in the FreeBSD Handbook. - Add a HISTORY section. - Style changes: - Use Dq instead of Em in the EXAMPLES section. - Mark command modifiers with Cm. Reviewed by: bcr Approved by: krion (mentor, implicit), mat (mentor, implicit) MFC after: 1 week Sponsored by: Bally Wulff Games & Entertainment GmbH Differential Revision: https://reviews.freebsd.org/D17798 Modified: head/contrib/smbfs/mount_smbfs/mount_smbfs.8 Modified: head/contrib/smbfs/mount_smbfs/mount_smbfs.8 ============================================================================== --- head/contrib/smbfs/mount_smbfs/mount_smbfs.8 Thu Nov 1 11:35:28 2018 (r339989) +++ head/contrib/smbfs/mount_smbfs/mount_smbfs.8 Thu Nov 1 11:37:19 2018 (r339990) @@ -1,6 +1,6 @@ .\" $Id: mount_smbfs.8,v 1.10 2002/04/16 02:47:41 bp Exp $ .\" $FreeBSD$ -.Dd September 17, 2011 +.Dd November 1, 2018 .Dt MOUNT_SMBFS 8 .Os .Sh NAME @@ -8,12 +8,12 @@ .Nd "mount a shared resource from an SMB file server" .Sh SYNOPSIS .Nm -.Op Fl E Ar cs1 : Ns Ar cs2 +.Op Fl E Ar cs1 Ns Cm \&: Ns Ar cs2 .Op Fl I Ar host .Op Fl L Ar locale -.Op Fl M Ar crights : Ns Ar srights +.Op Fl M Ar crights Ns Cm \&: Ns Ar srights .Op Fl N -.Op Fl O Ar cowner : Ns Ar cgroup Ns / Ns Ar sowner : Ns Ar sgroup +.Op Fl O Ar cowner Ns Cm \&: Ns Ar cgroup Ns Cm \&/ Ns Ar sowner Ns Cm \&: Ns Ar sgroup .Op Fl R Ar retrycount .Op Fl T Ar timeout .Op Fl U Ar username @@ -25,9 +25,9 @@ .Op Fl n Ar opt .Op Fl u Ar uid .Sm off -.No // Ar user No @ Ar server -.Op Ar :port1 Op Ar :port2 -.No / Ar share +.Cm \&// Ns Ar user Cm \&@ Ar server +.Op Cm \&: Ar port1 Op Cm \&: Ar port2 +.Cm \&/ Ar share .Sm on .Ar node .Sh DESCRIPTION @@ -37,7 +37,7 @@ command mounts a share from a remote server using SMB/ .Pp The options are as follows: .Bl -tag -width indent -.It Fl E Ar cs1 : Ns Ar cs2 +.It Fl E Ar cs1 Ns Cm \&: Ns Ar cs2 Specifies local .Pq Ar cs1 and server's @@ -57,7 +57,7 @@ By default, tries to use an environment variable .Ev LC_* to determine it. -.It Fl M Ar crights : Ns Ar srights +.It Fl M Ar crights Ns Cm \&: Ns Ar srights Assign access rights to the newly created connection. .It Fl N Do not ask for a password. @@ -69,7 +69,7 @@ file for additional configuration parameters and a pas If no password is found, .Nm prompts for it. -.It Fl O Ar cowner : Ns Ar cgroup Ns / Ns Ar sowner : Ns Ar sgroup +.It Fl O Ar cowner Ns Cm \&: Ns Ar cgroup Ns Cm \&/ Ns Ar sowner Ns Cm \&: Ns Ar sgroup Assign owner/group attributes to the newly created connection. .It Fl R Ar retrycount How many retries should be done before the SMB requester decides to drop @@ -111,7 +111,7 @@ server. User ID and group ID assigned to files. The default are owner and group IDs from the directory where the volume is mounted. -.It No // Ns Ar user Ns @ Ns Ar server Ns Oo Ar :port1 Ns Oo Ar :port2 Oc Oc Ns No / Ns Ar share +.It Cm \&// Ns Ar user Ns Cm \&@ Ns Ar server Ns Oo Cm \&: Ns Ar port1 Ns Oo Cm \&: Ns Ar port2 Oc Oc Ns Cm \&/ Ns Ar share The .Nm command will use @@ -145,13 +145,13 @@ for details. .El .Sh EXAMPLES The following example illustrates how to connect to SMB server -.Em SAMBA +.Dq SAMBA as user -.Em GUEST , +.Dq GUEST , and mount shares -.Em PUBLIC +.Dq PUBLIC and -.Em TMP : +.Dq TMP : .Bd -literal -offset indent mount_smbfs -I samba.mydomain.com //guest@samba/public /smb/public mount_smbfs -I 192.168.20.3 -E koi8-r:cp866 //guest@samba/tmp /smb/tmp @@ -159,9 +159,39 @@ mount_smbfs -I 192.168.20.3 -E koi8-r:cp866 //guest@sa .Pp It is also possible to use .Xr fstab 5 -for smbfs mounts (the example below doesn't prompt for a password): +for smbfs mounts (the example below does not prompt for a password): .Pp .Dl "//guest@samba/public /smb/public smbfs rw,noauto,-N 0 0" +.Sh SEE ALSO +.Bl -dash +.It +Chapter dedicated to Samba configuration in the +.Fx +Handbook: +.Lk "https://www.freebsd.org/doc/handbook/network-samba.html" +.El +.Sh STANDARDS +.Nm +offers support for SMB/CIFS/SMB1. +It does not support newer versions of the protocol like SMB2 and SMB3. +SMB2 and SMB3 are supported by software available in the +.Xr ports 7 +collection. +.Pp +The list of supported SMB servers includes: +.Bl -dash -compact +.It +Samba +.It +Windows 95/98/ME/2000/NT4.0 (SPs 4, 5, 6) +.It +IBM LanManager +.It +NetApp +.El +.Sh HISTORY +SMB/CIFS protocol and SMB/CIFS file system implementation first appeared in +.Fx 4.5 . .Sh AUTHORS .An Boris Popov Aq bp@butya.kz , .Aq bp@FreeBSD.org From owner-svn-src-head@freebsd.org Thu Nov 1 11:41:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 588DA10EE5B2; Thu, 1 Nov 2018 11:41:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F08971A31; Thu, 1 Nov 2018 11:41:41 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5D9A1B2CB; Thu, 1 Nov 2018 11:41:40 +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 wA1BfeZW098393; Thu, 1 Nov 2018 11:41:40 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1BfePk098392; Thu, 1 Nov 2018 11:41:40 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201811011141.wA1BfePk098392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 1 Nov 2018 11:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339991 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 339991 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 11:41:41 -0000 Author: tuexen Date: Thu Nov 1 11:41:40 2018 New Revision: 339991 URL: https://svnweb.freebsd.org/changeset/base/339991 Log: Remove debug code which slipped in accidently. MFC after: 4 weeks X-MFC with: r339989 Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Thu Nov 1 11:37:19 2018 (r339990) +++ head/sys/netinet/tcp_syncache.c Thu Nov 1 11:41:40 2018 (r339991) @@ -1744,7 +1744,6 @@ syncache_respond(struct syncache *sc, struct syncache_ th->th_seq = htonl(sc->sc_iss); else th->th_seq = htonl(sc->sc_iss + 1); -printf("SEG.SEQ=0x%x, ISS=0x%x.\n", ntohl(th->th_seq), sc->sc_iss); th->th_ack = htonl(sc->sc_irs + 1); th->th_off = sizeof(struct tcphdr) >> 2; th->th_x2 = 0; From owner-svn-src-head@freebsd.org Thu Nov 1 13:01:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBB2910F2023; Thu, 1 Nov 2018 13:01:00 +0000 (UTC) (envelope-from ml@vishwin.info) Received: from varun.vishwin.info (varun.vishwin.info [46.101.93.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "varun.vishwin.info", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E362D74FA8; Thu, 1 Nov 2018 13:00:56 +0000 (UTC) (envelope-from ml@vishwin.info) Received: from varun.vishwin.info (fd35:9eae:7575::2 [IPv6:fd35:9eae:7575::2]) by varun.vishwin.info (OpenSMTPD) with ESMTP id 44700316; Thu, 1 Nov 2018 08:57:36 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=vishwin.info; h=subject :to:references:from:message-id:date:mime-version:in-reply-to :content-type; s=fuccboi12; bh=j/BWBpF4K5CXV0Kt9KMuBVIOiAcnYGvSs 3U5xaDW16k=; b=lv0JhlmMKHkGJQCeGgk9/4e3c27cr9rRP4N/8VYFXIE3ozlN9 uvn5JKCrsLQqiSxM5/53uLxmDBCn3ukl38EgAVfxuoteNpHRNNmwIcQahOfSsX75 K+OlY2M4W9uxGp/D1FQ+RM8U6UcusHE5JMmDtbuO7JAEw3vXQUwpAVi80Gpb8p0q WBGZZ1dSq/Z/baGqkbVN+jytdh6bw36Jt7a4BDxLgnPPPTfUIt95ZqCv1w1AeePC YfLO5IFXgUGVMn7t0jkPpE9d8Oky1jZgM8c2oTIMj7t8tbB3484MXb2zNBtPR0hk r+JwCCfWdhBSAkRxDhSKZTthZsK5EQU+iSQ1g== Received: from [IPv6:2001:470:8:6ca:cad7:19ff:fec0:a06d] (2001:470:8:6ca:cad7:19ff:fec0:a06d [IPv6:2001:470:8:6ca:cad7:19ff:fec0:a06d]) by varun.vishwin.info (OpenSMTPD) with ESMTPSA id fd77c86d TLS version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO; Thu, 1 Nov 2018 08:57:36 -0400 (EDT) Subject: Re: svn commit: r339898 - head/lib/libc/amd64/sys To: Konstantin Belousov , svn-src-head@freebsd.org, current@freebsd.org, toolchain@freebsd.org References: <201810300011.w9U0BUui038857@repo.freebsd.org> From: Charlie Li Openpgp: preference=signencrypt Autocrypt: addr=ml@vishwin.info; keydata= xsFNBFt7iHUBEADCorTixbMGuHd9WYSKCELlv/TFcRtvpHUw/n9LtXzKixUUwl7iuMFMYTz3 QXePX0Twq4jCQYySfcxWbPkLsSYlPOkaGQ+XytfmIHoqG5ba4i1fp+F41is0oCtLt1+oL84j NKUd13em/JWd+PJeQbSTVnHbT2yaAi7vqWw5WKVaMExjfPGU5TArV46wSRU6Zuy1ZX66q0q5 dPzeBdeKYWJE8aGtyi3pYUpKUOX4gxiNetf6leDFZ4OsexWaRdU0n8fId5d1qwjAE3lOwV5z 0Ilt8t4iXtX3JL3DAQyLZIeXHIg9O3rrpPMXQWSp2/5g39PohNk7farbhcpIKxuDN+L5N6U9 OxNHBSCv9FGDO4R/mw3YwJCovDzsF7RSyXQDIY36yjdh2uTLZ0uD5Ci/DPmJUySFLRvpqWnQ M7V5cYhdqDfcElGpRbi8JZQVYRJjvI5Jj0byG98KeaD0YFxKqmmm+Oh+xWXE7xt/DsBoZeZJ BFP84LvFbwQqprvI+sg+1z2+JIgNbYwl8VaYzfyGnqTEXTOsQYEKTdKA9MODSAsN31MlQICe CIHZV+OwOqH1KQ/mZp59AnpXAmj4T94bnahE9yJtVW/qglX/nTeFNUdu5MyEgkeB0x7mx+t0 3hE20yp/NbyvG1T/o53NHwHiURC/8Fxd1NWPZ6n4X8npQn6iyQARAQABzSFDaGFybGllIExp IDx2aXNod2luQHZpc2h3aW4uaW5mbz7CwZEEEwEIADsCGyMFCwkIBwIGFQoJCAsCBBYCAwEC HgECF4AWIQT/f8Kqvlr7jU9sRv6OcHje8gOrbAUCW3uI+wIZAQAKCRCOcHje8gOrbNX8EACT HGo3AsShFj+AaUgD9V6wTMaR2w7ubIqbkn2ZqZZ1xWj3gM6VYRKHflj9LiYqFRO4wBteAq30 Snz6F93IG+u5B1uwlC58HDwCQaROaU5cHQ8UvGPSEv0XXCcYTaC3d5NMoIh/LdutVZz56LTx hWs5NHUCaG6FfGV9QplECRteQr2rMxHZxZ3ppSY9oev/wY3U3VRUGnhM2ZwGrpmjksC1HTBH Fw2XbYdVNCOYjQrTIulaYb3y0ssgsOhvSk9bPHSTsWSCQGJk0uFNXTvIq68GhkhOwAet6//w R2y1whg47r554pBManttODaQnmWmIWBM0bZMJrlNT8T/oXlG9nA0jrjA8LvTThrCAvMSMB0F 2FhStd/I2/Fs7T6Uk1BUpgCvFiDtE8Jt1W2yq2GLtPysGrJXyDaat8IuVUthnNVhoyZb9tZu sI/FFhfh9MkPmZDwCoTUJN2yU8QhxS1iJXfMZ1f06r1TYY9rwb8E/WCBJFbMzJs3VLj/TnHL N09J2zNZgTs7gewLn/2lEV1kOL/FxIDgN7ailcf3kcNdVUxr/pLbx3NZcDkXniPO0dzQpuRw q841wBT3uqdPFJwIl4pf1EYhLj89r2vOGnM2RChl1/t+wSqHhBji3R3uylzE0qbr8O/cgx/5 wlvZJiUhyu0hJ/JoJkF8WEFkesJrTZORGc7BTQRbe4h1ARAA12Xtgcbwk7IdsRi/7sTFKs73 qoFFq+DUWwMbSuIOaWw5J9nZ+ovr9gkXlax+xf335hJ0iItB8LhA7D9wD4wjrmmBjhwK7jYv tghb8BH6MHWEWD5D9xt47CO4o8Vi1m/F4OlKxoDqIhH6n63gNeSNaXzqDpZoUsL62KX+sKKU Udj/X/oz3XwXWCb/rEIgAMMW7QFcuQBJzkHgu69oUSIki4j1mhAMiBbGexfS1dcTfpLAr9eu jDNHOw5r7aI4cA8q7us8YfDLby87hPlSrtTKcxkbawrdFNs6KNrEvggkXhYxGqm4Z0FInixa avloimBf1q7kvVM0AAgsmkdeeS/6Tzbn71WBuEW0VgEcSSBS1dv7DfgmeQeiSmv0Dvx2lZv5 P6M4Q/plSAz7hVXL6EIKltwJUjY8Re7zDbPf7jJlbEgWbLxRhlGh5MwrNXbMt6KygDRcDyOP njxg0+ICXbQyPKiq7jZY2/Q/x8P08xNx8sUKPY+XE6G5QVohQfe3LT9s15KM+1Ur4v3Hhbft HtTW1iT60HkyU9qRCJJC11OgH7wrfiucG3/eQKgBgvsfKDD36rJmsQpkO0/kkp6R+CzLby3X PrrFYJTCr08e5QWKKPdyNvAhuyQj27Lb7EhNxe3hmpV+llx0aaN9t1M+QZ88famMOgIlp7Nh 1uFr/c5WGZUAEQEAAcLBdgQYAQgAIBYhBP9/wqq+WvuNT2xG/o5weN7yA6tsBQJbe4h1AhsM AAoJEI5weN7yA6tsTGcP/2rBIvgeKismZQQn7kJOHwgmqXg/N5ArwPH3eCJmzmNZWUIlOZyl A2KtYhkzZ5G3rsL/BMmMuYRUbPJJUukaJSqFep1E6AWYPC8Seakhu1ZbK8ayBI4KZmP+3PQY S0tKyMlxX+Qt9+S/tcQqS31mMgmcVhVhKi8MrWjY+g7pF+LkBYccHuNiGNIcm8mMPHTIKU72 ARiG3DtHrRg4sf5wqgOi72277jBHdDBGw0Y7rCvMsaGm3G4GsMwj4e47H6PAFOWK7O69muvL o50oMN2rkPi+9AKPi8WcrinstleEGyEIyguRagDQjZP5gX9Xk5vkS6+xMgKt7+k7+D3jWKlW R6G9U0CyKmVJoeNqwHUdLoFD3lywjwT9vo+cqb4gQKnZsA1ss/WOvEp4EaNSR7JHFOY5X8AN QgiPxLhrbI7FPGXKw3Y7nCpcIlzFph6UL9jhNRwvoQ3GfZ0sF0JgpASdrS4N3Fmnt9L6lc3q rIrxDPpDjYwcDEUBl0sp/prjh3gdC3qs9xZ0RNWWdUqcmvRv2SDkrVDw3iQ9WhMZWuQYBmGa MViypa6WrjjlVTjqZftZyqytnHwuo1PA/qLcF/vUUn0QHFPIDx8/yTSqiw/xTwPuOFxznHjJ VbxEEG0H5rmreh1Z0WeMwsSbjC3EEf+ZI39QpFwVIG8pDwXFOClfhjFz Message-ID: Date: Thu, 1 Nov 2018 08:57:24 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <201810300011.w9U0BUui038857@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mVY8JbXg2b5a6Xhjx6u9jQp2sIvHNgbzx" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 13:01:01 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mVY8JbXg2b5a6Xhjx6u9jQp2sIvHNgbzx Content-Type: multipart/mixed; boundary="VXCCe4XLvxobDqQWmYCQ7uJO8tYfzIBkk"; protected-headers="v1" From: Charlie Li To: Konstantin Belousov , svn-src-head@freebsd.org, current@freebsd.org, toolchain@freebsd.org Message-ID: Subject: Re: svn commit: r339898 - head/lib/libc/amd64/sys References: <201810300011.w9U0BUui038857@repo.freebsd.org> In-Reply-To: <201810300011.w9U0BUui038857@repo.freebsd.org> --VXCCe4XLvxobDqQWmYCQ7uJO8tYfzIBkk Content-Type: text/plain; charset=utf-8 Content-Language: en-GB-large Content-Transfer-Encoding: quoted-printable On 29/10/2018 20:11, Konstantin Belousov wrote: > Author: kib > Date: Tue Oct 30 00:11:30 2018 > New Revision: 339898 > URL: https://svnweb.freebsd.org/changeset/base/339898 >=20 > Log: > Convert amd64_get/set_fs/gsbase to ifunc. > =20 > Note that this is the first use of ifuncs in our userspace. > =20 > Sponsored by: The FreeBSD Foundation > MFC after: 1 month >=20 > Deleted: > head/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.c > head/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.h > Modified: > head/lib/libc/amd64/sys/Makefile.inc > head/lib/libc/amd64/sys/amd64_get_fsbase.c > head/lib/libc/amd64/sys/amd64_get_gsbase.c > head/lib/libc/amd64/sys/amd64_set_fsbase.c > head/lib/libc/amd64/sys/amd64_set_gsbase.c >=20 Using LLVM 7 to build world, fails: --- amd64_get_fsbase.o --- /usr/src/lib/libc/amd64/sys/amd64_get_fsbase.c:60:1: error: ifunc resolver function must have no parameters --- amd64_get_gsbase.o --- /usr/src/lib/libc/amd64/sys/amd64_get_gsbase.c:60:1: error: ifunc resolver function must have no parameters DEFINE_UIFUNC(, int, amd64_get_gsbase, (void **), static) ^ /usr/local/obj/usr/src/amd64.amd64/tmp/usr/include/x86/ifunc.h:43:44: note: expanded from macro 'DEFINE_UIFUNC' --- amd64_get_fsbase.o --- DEFINE_UIFUNC(, int, amd64_get_fsbase, (void **), static) ^ /usr/local/obj/usr/src/amd64.amd64/tmp/usr/include/x86/ifunc.h:43:44: note: expanded from macro 'DEFINE_UIFUNC' --- amd64_get_gsbase.o --- qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \= ^ --- amd64_get_fsbase.o --- qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \= ^ 1 error generated. --- amd64_get_gsbase.o --- 1 error generated. *** [amd64_get_gsbase.o] Error code 1 make[4]: stopped in /usr/src/lib/libc CI appears green after this commit, so I'm inclined to pin this on yet another instance of LLVM 7 being stricter than LLVM 6. Backing out this revision allows the build to continue (successfully). --=20 Charlie Li Can't think of a witty .sigline today=E2=80=A6 (This email address is for mailing list use only; replace local-part with vishwin for off-list communication) --VXCCe4XLvxobDqQWmYCQ7uJO8tYfzIBkk-- --mVY8JbXg2b5a6Xhjx6u9jQp2sIvHNgbzx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE/3/Cqr5a+41PbEb+jnB43vIDq2wFAlva+DwACgkQjnB43vID q2ymnA//VPMjcUnWr85R3WDEugYWjNQZ1PRMzJoE5yl5meVrb4mN3cM8LAONid2x FsyKmEgnwRpvCuTzthyrqmzWA1mEBqzX6ruCsaP6dVCCDPwSrbDJjkQfuciXHK+J Ryv4QICrRctkuYwPoxk2MdX97vStdRutp7HzGeRhPDojTUCwzKB5mKOefVCwh2Nf p8XJ4Q0H003DKc3/zBqvcmM3eeuETq/T6ALokD2Vo2E6JBCbnO2p2LoObzowH9Ur hNF8nycIJRX0nyNXwKRh7GA9BojINq10JNW/pTi7Rnvl3nJgG0a2J7v2d2Ed5w73 pYriflzTZlZHHMWNwVVkClJkaOEaZhqf3CehIXD3BURSXPH58F5J7Qhl09CJ8HnH yhUiK+BLke7I7KNjenXyQLfdRsnKJ5WGbiI0ULBaMMjNWf7Z8ilFsFCjs4Z/KPTB ufvRL35VETlIs0NI2BR7kpYpihZWIBZzLc+RX+nMJ5UrvmhpZ+6w9VluesKeMdOE nIVIv7XV6Uop4AsmMgP8X/cMQsnBwv0m9RUAnS+KTgsdXM8VvHpsKl09XqdlYnRu 0IIJpwe9Aq2BphG8ys67d0XJIAENQs0YeX6/GzFctqgavAA0S+WU/WbIAff4EkxJ FV44ax4e64SGhUuCUc3r4ou1BHcOQgA8MlgTJdaltVgNbjaPHXs= =XSeE -----END PGP SIGNATURE----- --mVY8JbXg2b5a6Xhjx6u9jQp2sIvHNgbzx-- From owner-svn-src-head@freebsd.org Thu Nov 1 13:12:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 879EC10F27EF; Thu, 1 Nov 2018 13:12:06 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B60A75999; Thu, 1 Nov 2018 13:12:06 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17AE91C2CD; Thu, 1 Nov 2018 13:12:06 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA1DC5Z4046427; Thu, 1 Nov 2018 13:12:05 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1DC5t7046426; Thu, 1 Nov 2018 13:12:05 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201811011312.wA1DC5t7046426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 1 Nov 2018 13:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339992 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 339992 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 13:12:06 -0000 Author: tsoome Date: Thu Nov 1 13:12:05 2018 New Revision: 339992 URL: https://svnweb.freebsd.org/changeset/base/339992 Log: libsa: tftp should not read past file end When we have the file size via tsize option, use it to make sure we will not attempt to read past file end. Modified: head/stand/libsa/tftp.c Modified: head/stand/libsa/tftp.c ============================================================================== --- head/stand/libsa/tftp.c Thu Nov 1 11:41:40 2018 (r339991) +++ head/stand/libsa/tftp.c Thu Nov 1 13:12:05 2018 (r339992) @@ -498,11 +498,19 @@ tftp_read(struct open_file *f, void *addr, size_t size size_t *resid /* out */) { struct tftp_handle *tftpfile; + size_t res; int rc; rc = 0; + res = size; tftpfile = (struct tftp_handle *) f->f_fsdata; + /* Make sure we will not read past file end */ + if (tftpfile->tftp_tsize > 0 && + tftpfile->off + size > tftpfile->tftp_tsize) { + size = tftpfile->tftp_tsize - tftpfile->off; + } + while (size > 0) { int needblock, count; @@ -550,6 +558,7 @@ tftp_read(struct open_file *f, void *addr, size_t size addr = (char *)addr + count; tftpfile->off += count; size -= count; + res -= count; if ((tftpfile->islastblock) && (count == inbuffer)) break; /* EOF */ @@ -562,8 +571,8 @@ tftp_read(struct open_file *f, void *addr, size_t size } - if (resid) - *resid = size; + if (resid != NULL) + *resid = res; return (rc); } From owner-svn-src-head@freebsd.org Thu Nov 1 13:29:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC8FE10F2E6C; Thu, 1 Nov 2018 13:29:56 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BE83761A9; Thu, 1 Nov 2018 13:29:56 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 536F11C4C2; Thu, 1 Nov 2018 13:29:56 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA1DTuBp051950; Thu, 1 Nov 2018 13:29:56 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1DTu7T051949; Thu, 1 Nov 2018 13:29:56 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201811011329.wA1DTu7T051949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 1 Nov 2018 13:29:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339993 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 339993 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 13:29:57 -0000 Author: tsoome Date: Thu Nov 1 13:29:55 2018 New Revision: 339993 URL: https://svnweb.freebsd.org/changeset/base/339993 Log: libsa: tftp should use calloc instead of malloc() memset(), use calloc(). Modified: head/stand/libsa/tftp.c Modified: head/stand/libsa/tftp.c ============================================================================== --- head/stand/libsa/tftp.c Thu Nov 1 13:12:05 2018 (r339992) +++ head/stand/libsa/tftp.c Thu Nov 1 13:29:55 2018 (r339993) @@ -448,11 +448,10 @@ tftp_open(const char *path, struct open_file *f) if (is_open) return (EBUSY); - tftpfile = (struct tftp_handle *) malloc(sizeof(*tftpfile)); + tftpfile = calloc(1, sizeof(*tftpfile)); if (!tftpfile) return (ENOMEM); - memset(tftpfile, 0, sizeof(*tftpfile)); tftpfile->tftp_blksize = TFTP_REQUESTED_BLKSIZE; tftpfile->iodesc = io = socktodesc(*(int *) (f->f_devdata)); if (io == NULL) { From owner-svn-src-head@freebsd.org Thu Nov 1 14:00:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4D5C10F3A5D; Thu, 1 Nov 2018 14:00:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B72B77277; Thu, 1 Nov 2018 14:00:56 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D90C1C9E9; Thu, 1 Nov 2018 14:00:56 +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 wA1E0u4Q067139; Thu, 1 Nov 2018 14:00:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1E0u0l067138; Thu, 1 Nov 2018 14:00:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811011400.wA1E0u0l067138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 1 Nov 2018 14:00:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339994 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 339994 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 14:00:57 -0000 Author: kevans Date: Thu Nov 1 14:00:56 2018 New Revision: 339994 URL: https://svnweb.freebsd.org/changeset/base/339994 Log: libbe(3): Don't promote non-cloned BEs Most easily reproducible by attempting to activate the currently activated BE, one would get a "not a cloned filesystem" error instead of success or a sane message. PR: 232488 MFC after: 3 days Modified: head/lib/libbe/be.c Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Thu Nov 1 13:29:55 2018 (r339993) +++ head/lib/libbe/be.c Thu Nov 1 14:00:56 2018 (r339994) @@ -928,7 +928,8 @@ be_activate(libbe_handle_t *lbh, const char *bootenv, { char be_path[BE_MAXPATHLEN]; char buf[BE_MAXPATHLEN]; - nvlist_t *config, *vdevs; + nvlist_t *config, *dsprops, *vdevs; + char *origin; uint64_t pool_guid; zfs_handle_t *zhp; int err; @@ -969,7 +970,18 @@ be_activate(libbe_handle_t *lbh, const char *bootenv, if (zhp == NULL) return (-1); - err = zfs_promote(zhp); + if (be_prop_list_alloc(&dsprops) != 0) + return (-1); + + if (be_get_dataset_props(lbh, be_path, dsprops) != 0) { + nvlist_free(dsprops); + return (-1); + } + + if (nvlist_lookup_string(dsprops, "origin", &origin) == 0) + err = zfs_promote(zhp); + nvlist_free(dsprops); + zfs_close(zhp); if (err) From owner-svn-src-head@freebsd.org Thu Nov 1 14:24:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D89F10F42C8; Thu, 1 Nov 2018 14:24:13 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B78AF77EE4; Thu, 1 Nov 2018 14:24:12 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98A131CEBA; Thu, 1 Nov 2018 14:24:12 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA1EOCLN082272; Thu, 1 Nov 2018 14:24:12 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1EOC4L082271; Thu, 1 Nov 2018 14:24:12 GMT (envelope-from des@FreeBSD.org) Message-Id: <201811011424.wA1EOC4L082271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Thu, 1 Nov 2018 14:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339995 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 339995 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 14:24:13 -0000 Author: des Date: Thu Nov 1 14:24:12 2018 New Revision: 339995 URL: https://svnweb.freebsd.org/changeset/base/339995 Log: Run unbound-anchor when root.key is empty, not just when it is absent. PR: 232555 Submitted by: Ari Suutari MFC after: 3 days Modified: head/libexec/rc/rc.d/local_unbound Modified: head/libexec/rc/rc.d/local_unbound ============================================================================== --- head/libexec/rc/rc.d/local_unbound Thu Nov 1 14:00:56 2018 (r339994) +++ head/libexec/rc/rc.d/local_unbound Thu Nov 1 14:24:12 2018 (r339995) @@ -92,7 +92,7 @@ local_unbound_prestart() fi # Retrieve DNSSEC root key - if [ ! -f ${local_unbound_anchor} ] ; then + if [ ! -s ${local_unbound_anchor} ] ; then run_rc_command anchor fi } From owner-svn-src-head@freebsd.org Thu Nov 1 15:27:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59DA710F5BAE; Thu, 1 Nov 2018 15:27:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E6837AF94; Thu, 1 Nov 2018 15:27:23 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3B5E1D8BE; Thu, 1 Nov 2018 15:27:22 +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 wA1FRMQ8014356; Thu, 1 Nov 2018 15:27:22 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1FRMKM014355; Thu, 1 Nov 2018 15:27:22 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201811011527.wA1FRMKM014355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 1 Nov 2018 15:27:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339999 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 339999 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 15:27:23 -0000 Author: rmacklem Date: Thu Nov 1 15:27:22 2018 New Revision: 339999 URL: https://svnweb.freebsd.org/changeset/base/339999 Log: Fix NFS client vnode locking to avoid a crash during forced dismount. A crash was reported where the crash occurred in nfs_advlock() when the NFS_ISV4(vp) macro was being executed. This was caused by the vnode being VI_DOOMED due to a forced dismount in progress. This patch fixes the problem by locking the vnode before executing the NFS_ISV4() macro. Tested by: rlibby PR: 232673 Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D17757 Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Thu Nov 1 15:19:36 2018 (r339998) +++ head/sys/fs/nfsclient/nfs_clvnops.c Thu Nov 1 15:27:22 2018 (r339999) @@ -3033,14 +3033,19 @@ nfs_advlock(struct vop_advlock_args *ap) int ret, error = EOPNOTSUPP; u_quad_t size; + ret = NFSVOPLOCK(vp, LK_SHARED); + if (ret != 0) + return (EBADF); if (NFS_ISV4(vp) && (ap->a_flags & (F_POSIX | F_FLOCK)) != 0) { - if (vp->v_type != VREG) + if (vp->v_type != VREG) { + NFSVOPUNLOCK(vp, 0); return (EINVAL); + } if ((ap->a_flags & F_POSIX) != 0) cred = p->p_ucred; else cred = td->td_ucred; - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); + NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); if (vp->v_iflag & VI_DOOMED) { NFSVOPUNLOCK(vp, 0); return (EBADF); @@ -3119,9 +3124,6 @@ nfs_advlock(struct vop_advlock_args *ap) NFSVOPUNLOCK(vp, 0); return (0); } else if (!NFS_ISV4(vp)) { - error = NFSVOPLOCK(vp, LK_SHARED); - if (error) - return (error); if ((VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOLOCKD) != 0) { size = VTONFS(vp)->n_size; NFSVOPUNLOCK(vp, 0); @@ -3144,7 +3146,8 @@ nfs_advlock(struct vop_advlock_args *ap) NFSVOPUNLOCK(vp, 0); } } - } + } else + NFSVOPUNLOCK(vp, 0); return (error); } From owner-svn-src-head@freebsd.org Thu Nov 1 15:30:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A872310F5D93; Thu, 1 Nov 2018 15:30:05 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55D867B3C0; Thu, 1 Nov 2018 15:30:05 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C0DE1D8CE; Thu, 1 Nov 2018 15:30:02 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA1FU1mV014798; Thu, 1 Nov 2018 15:30:01 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1FU13F014797; Thu, 1 Nov 2018 15:30:01 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201811011530.wA1FU13F014797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Thu, 1 Nov 2018 15:30:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340000 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 340000 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 15:30:05 -0000 Author: bwidawsk Date: Thu Nov 1 15:30:01 2018 New Revision: 340000 URL: https://svnweb.freebsd.org/changeset/base/340000 Log: linuxkpi: Add GFP flags needed for ttm drivers Submitted by: Johannes Lundberg Requested by: bwidawsk MFC after: 3 days Approved by: emaste (mentor) Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/gfp.h Thu Nov 1 15:27:22 2018 (r339999) +++ head/sys/compat/linuxkpi/common/include/linux/gfp.h Thu Nov 1 15:30:01 2018 (r340000) @@ -52,6 +52,7 @@ #define __GFP_RETRY_MAYFAIL 0 #define __GFP_MOVABLE 0 #define __GFP_COMP 0 +#define __GFP_KSWAPD_RECLAIM 0 #define __GFP_IO 0 #define __GFP_NO_KSWAPD 0 @@ -73,6 +74,7 @@ #define GFP_TEMPORARY M_NOWAIT #define GFP_NATIVE_MASK (M_NOWAIT | M_WAITOK | M_USE_RESERVE | M_ZERO) #define GFP_TRANSHUGE 0 +#define GFP_TRANSHUGE_LIGHT 0 CTASSERT((__GFP_DMA32 & GFP_NATIVE_MASK) == 0); CTASSERT((__GFP_BITS_MASK & GFP_NATIVE_MASK) == GFP_NATIVE_MASK); From owner-svn-src-head@freebsd.org Thu Nov 1 15:40:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1867F10F63AE; Thu, 1 Nov 2018 15:40:58 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2C097BC34; Thu, 1 Nov 2018 15:40:57 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A40E91DABF; Thu, 1 Nov 2018 15:40:57 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA1Fevmt020840; Thu, 1 Nov 2018 15:40:57 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1Fevbr020839; Thu, 1 Nov 2018 15:40:57 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201811011540.wA1Fevbr020839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Thu, 1 Nov 2018 15:40:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340001 - head/share/man/man3 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man3 X-SVN-Commit-Revision: 340001 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 15:40:58 -0000 Author: 0mp (ports committer) Date: Thu Nov 1 15:40:57 2018 New Revision: 340001 URL: https://svnweb.freebsd.org/changeset/base/340001 Log: CMSG_DATA(3): Use consistent variable names The description of CMSG_FIRSTHDR used two variables (mhdr and msg) to reference the same thing. Use msghdr consistency across the manual page instead. Reviewed by: bcr Approved by: krion (mentor, implicit), mat (mentor, implicit) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D17804 Modified: head/share/man/man3/CMSG_DATA.3 Modified: head/share/man/man3/CMSG_DATA.3 ============================================================================== --- head/share/man/man3/CMSG_DATA.3 Thu Nov 1 15:30:01 2018 (r340000) +++ head/share/man/man3/CMSG_DATA.3 Thu Nov 1 15:40:57 2018 (r340001) @@ -2,7 +2,7 @@ .\" Public domain, July 3, 2005 .\" .\" $FreeBSD$ -.Dd August 19, 2018 +.Dd November 1, 2018 .Dt CMSG_DATA 3 .Os .Sh NAME @@ -50,10 +50,10 @@ This routine accesses the data portion of the control .Fa cmsg . It ensures proper alignment constraints on the beginning of ancillary data are met. -.It Fn CMSG_FIRSTHDR mhdr +.It Fn CMSG_FIRSTHDR msghdr This routine accesses the first control message attached to the message -.Fa msg . +.Fa msghdr . If no control messages are attached to the message, this routine returns .Dv NULL . @@ -67,11 +67,11 @@ This value is what is normally stored in the of each control message. This routine accounts for any alignment constraints on the beginning of ancillary data. -.It Fn CMSG_NXTHDR mhdr cmsg +.It Fn CMSG_NXTHDR msghdr cmsg This routine returns the location of the control message following .Fa cmsg in the message -.Fa mhdr . +.Fa msghdr . If .Fa cmsg is the last control message in the chain, this routine returns From owner-svn-src-head@freebsd.org Thu Nov 1 15:51:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3FDF10F6A76; Thu, 1 Nov 2018 15:51:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 799B47C90F; Thu, 1 Nov 2018 15:51:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A91A1DDAE; Thu, 1 Nov 2018 15:51:50 +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 wA1FpoRH029533; Thu, 1 Nov 2018 15:51:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1FpoWM029532; Thu, 1 Nov 2018 15:51:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811011551.wA1FpoWM029532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 1 Nov 2018 15:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340004 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 340004 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 15:51:51 -0000 Author: markj Date: Thu Nov 1 15:51:49 2018 New Revision: 340004 URL: https://svnweb.freebsd.org/changeset/base/340004 Log: Improve style in in_pcbinslbgrouphash() and related subroutines. No functional change intended. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17107 Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Thu Nov 1 15:50:57 2018 (r340003) +++ head/sys/netinet/in_pcb.c Thu Nov 1 15:51:49 2018 (r340004) @@ -266,7 +266,7 @@ in_pcblbgroup_resize(struct inpcblbgrouphead *hdr, grp = in_pcblbgroup_alloc(hdr, old_grp->il_vflag, old_grp->il_lport, &old_grp->il_dependladdr, size); - if (!grp) + if (grp == NULL) return (NULL); KASSERT(old_grp->il_inpcnt < grp->il_inpsiz, @@ -288,21 +288,20 @@ static void in_pcblbgroup_reorder(struct inpcblbgrouphead *hdr, struct inpcblbgroup **grpp, int i) { - struct inpcblbgroup *grp = *grpp; + struct inpcblbgroup *grp, *new_grp; + grp = *grpp; for (; i + 1 < grp->il_inpcnt; ++i) grp->il_inp[i] = grp->il_inp[i + 1]; grp->il_inpcnt--; if (grp->il_inpsiz > INPCBLBGROUP_SIZMIN && - grp->il_inpcnt <= (grp->il_inpsiz / 4)) { + grp->il_inpcnt <= grp->il_inpsiz / 4) { /* Shrink this group. */ - struct inpcblbgroup *new_grp = - in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz / 2); - if (new_grp) + new_grp = in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz / 2); + if (new_grp != NULL) *grpp = new_grp; } - return; } /* @@ -316,9 +315,7 @@ in_pcbinslbgrouphash(struct inpcb *inp) struct inpcbinfo *pcbinfo; struct inpcblbgrouphead *hdr; struct inpcblbgroup *grp; - uint16_t hashmask, lport; - uint32_t group_index; - struct ucred *cred; + uint32_t idx; pcbinfo = inp->inp_pcbinfo; @@ -328,19 +325,10 @@ in_pcbinslbgrouphash(struct inpcb *inp) if (pcbinfo->ipi_lbgrouphashbase == NULL) return (0); - hashmask = pcbinfo->ipi_lbgrouphashmask; - lport = inp->inp_lport; - group_index = INP_PCBLBGROUP_PORTHASH(lport, hashmask); - hdr = &pcbinfo->ipi_lbgrouphashbase[group_index]; - /* * Don't allow jailed socket to join local group. */ - if (inp->inp_socket != NULL) - cred = inp->inp_socket->so_cred; - else - cred = NULL; - if (cred != NULL && jailed(cred)) + if (inp->inp_socket != NULL && jailed(inp->inp_socket->so_cred)) return (0); #ifdef INET6 @@ -354,24 +342,23 @@ in_pcbinslbgrouphash(struct inpcb *inp) } #endif - hdr = &pcbinfo->ipi_lbgrouphashbase[ - INP_PCBLBGROUP_PORTHASH(inp->inp_lport, - pcbinfo->ipi_lbgrouphashmask)]; + idx = INP_PCBLBGROUP_PORTHASH(inp->inp_lport, + pcbinfo->ipi_lbgrouphashmask); + hdr = &pcbinfo->ipi_lbgrouphashbase[idx]; CK_LIST_FOREACH(grp, hdr, il_list) { if (grp->il_vflag == inp->inp_vflag && grp->il_lport == inp->inp_lport && memcmp(&grp->il_dependladdr, - &inp->inp_inc.inc_ie.ie_dependladdr, - sizeof(grp->il_dependladdr)) == 0) { + &inp->inp_inc.inc_ie.ie_dependladdr, + sizeof(grp->il_dependladdr)) == 0) break; - } } if (grp == NULL) { /* Create new load balance group. */ grp = in_pcblbgroup_alloc(hdr, inp->inp_vflag, inp->inp_lport, &inp->inp_inc.inc_ie.ie_dependladdr, INPCBLBGROUP_SIZMIN); - if (!grp) + if (grp == NULL) return (ENOBUFS); } else if (grp->il_inpcnt == grp->il_inpsiz) { if (grp->il_inpsiz >= INPCBLBGROUP_SIZMAX) { @@ -383,13 +370,13 @@ in_pcbinslbgrouphash(struct inpcb *inp) /* Expand this local group. */ grp = in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz * 2); - if (!grp) + if (grp == NULL) return (ENOBUFS); } KASSERT(grp->il_inpcnt < grp->il_inpsiz, - ("invalid local group size %d and count %d", - grp->il_inpsiz, grp->il_inpcnt)); + ("invalid local group size %d and count %d", grp->il_inpsiz, + grp->il_inpcnt)); grp->il_inp[grp->il_inpcnt] = inp; grp->il_inpcnt++; From owner-svn-src-head@freebsd.org Thu Nov 1 15:52:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79DB010F6CB0; Thu, 1 Nov 2018 15:52:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 281777CBFA; Thu, 1 Nov 2018 15:52:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0937F1DE05; Thu, 1 Nov 2018 15:52:50 +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 wA1Fqnbs030410; Thu, 1 Nov 2018 15:52:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1Fqn08030409; Thu, 1 Nov 2018 15:52:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811011552.wA1Fqn08030409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 1 Nov 2018 15:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340005 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 340005 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 15:52:50 -0000 Author: markj Date: Thu Nov 1 15:52:49 2018 New Revision: 340005 URL: https://svnweb.freebsd.org/changeset/base/340005 Log: Remove redundant checks for a NULL lbgroup table. No functional change intended. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17108 Modified: head/sys/netinet/in_pcb.c head/sys/netinet6/in6_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Thu Nov 1 15:51:49 2018 (r340004) +++ head/sys/netinet/in_pcb.c Thu Nov 1 15:52:49 2018 (r340005) @@ -322,9 +322,6 @@ in_pcbinslbgrouphash(struct inpcb *inp) INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(pcbinfo); - if (pcbinfo->ipi_lbgrouphashbase == NULL) - return (0); - /* * Don't allow jailed socket to join local group. */ @@ -399,9 +396,6 @@ in_pcbremlbgrouphash(struct inpcb *inp) INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(pcbinfo); - if (pcbinfo->ipi_lbgrouphashbase == NULL) - return; - hdr = &pcbinfo->ipi_lbgrouphashbase[ INP_PCBLBGROUP_PORTHASH(inp->inp_lport, pcbinfo->ipi_lbgrouphashmask)]; @@ -2276,13 +2270,11 @@ in_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, st /* * Then look in lb group (for wildcard match). */ - if (pcbinfo->ipi_lbgrouphashbase != NULL && - (lookupflags & INPLOOKUP_WILDCARD)) { + if ((lookupflags & INPLOOKUP_WILDCARD) != 0) { inp = in_pcblookup_lbgroup(pcbinfo, &laddr, lport, &faddr, fport, lookupflags); - if (inp != NULL) { + if (inp != NULL) return (inp); - } } /* Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Thu Nov 1 15:51:49 2018 (r340004) +++ head/sys/netinet6/in6_pcb.c Thu Nov 1 15:52:49 2018 (r340005) @@ -1161,13 +1161,11 @@ in6_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, s /* * Then look in lb group (for wildcard match). */ - if (pcbinfo->ipi_lbgrouphashbase != NULL && - (lookupflags & INPLOOKUP_WILDCARD)) { + if ((lookupflags & INPLOOKUP_WILDCARD) != 0) { inp = in6_pcblookup_lbgroup(pcbinfo, laddr, lport, faddr, fport, lookupflags); - if (inp != NULL) { + if (inp != NULL) return (inp); - } } /* From owner-svn-src-head@freebsd.org Thu Nov 1 16:04:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9912510F7205; Thu, 1 Nov 2018 16:04:08 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37C817D575; Thu, 1 Nov 2018 16:04:08 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 0008D3C475F; Thu, 1 Nov 2018 16:04:06 +0000 (UTC) Date: Thu, 1 Nov 2018 16:04:06 +0000 From: Brooks Davis To: Charlie Li Cc: Konstantin Belousov , svn-src-head@freebsd.org, current@freebsd.org, toolchain@freebsd.org Subject: Re: svn commit: r339898 - head/lib/libc/amd64/sys Message-ID: <20181101160406.GA60233@spindle.one-eyed-alien.net> References: <201810300011.w9U0BUui038857@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="45Z9DzgjV8m4Oswq" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 16:04:08 -0000 --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 01, 2018 at 08:57:24AM -0400, Charlie Li wrote: > On 29/10/2018 20:11, Konstantin Belousov wrote: > > Author: kib > > Date: Tue Oct 30 00:11:30 2018 > > New Revision: 339898 > > URL: https://svnweb.freebsd.org/changeset/base/339898 > >=20 > > Log: > > Convert amd64_get/set_fs/gsbase to ifunc. > > =20 > > Note that this is the first use of ifuncs in our userspace. > > =20 > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 month > >=20 > > Deleted: > > head/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.c > > head/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.h > > Modified: > > head/lib/libc/amd64/sys/Makefile.inc > > head/lib/libc/amd64/sys/amd64_get_fsbase.c > > head/lib/libc/amd64/sys/amd64_get_gsbase.c > > head/lib/libc/amd64/sys/amd64_set_fsbase.c > > head/lib/libc/amd64/sys/amd64_set_gsbase.c > >=20 > Using LLVM 7 to build world, fails: >=20 > --- amd64_get_fsbase.o --- > /usr/src/lib/libc/amd64/sys/amd64_get_fsbase.c:60:1: error: ifunc > resolver function must have no parameters > --- amd64_get_gsbase.o --- > /usr/src/lib/libc/amd64/sys/amd64_get_gsbase.c:60:1: error: ifunc > resolver function must have no parameters > DEFINE_UIFUNC(, int, amd64_get_gsbase, (void **), static) > ^ > /usr/local/obj/usr/src/amd64.amd64/tmp/usr/include/x86/ifunc.h:43:44: > note: expanded from macro 'DEFINE_UIFUNC' > --- amd64_get_fsbase.o --- > DEFINE_UIFUNC(, int, amd64_get_fsbase, (void **), static) > ^ > /usr/local/obj/usr/src/amd64.amd64/tmp/usr/include/x86/ifunc.h:43:44: > note: expanded from macro 'DEFINE_UIFUNC' > --- amd64_get_gsbase.o --- > qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ > ^ > --- amd64_get_fsbase.o --- > qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ > ^ > 1 error generated. > --- amd64_get_gsbase.o --- > 1 error generated. > *** [amd64_get_gsbase.o] Error code 1 >=20 > make[4]: stopped in /usr/src/lib/libc >=20 > CI appears green after this commit, so I'm inclined to pin this on yet > another instance of LLVM 7 being stricter than LLVM 6. Backing out this > revision allows the build to continue (successfully). Is this failure with devel/llvm70? It's currently missing the patch required to make this work. https://reviews.freebsd.org/D17709 contains this patch among others. I'll see about getting it applied. -- Brooks --45Z9DzgjV8m4Oswq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJb2yP2AAoJEKzQXbSebgfA39kIAJ4/w70jlXm1KldpSc7K37Sd mxV2Js4ZNOJgqp0eSGZJwekuTYXUGn8kQtOn52AemDZeHOw1zGRp9+wV0OqlaPrj AchHnivDHkk1hHs0Yfv+zH/F2V2ED/kaYp+RDLZ0J73GYRsDv/HmVxQpmnIcDuf6 DfXmy+OdeD97MF6/ny+2v7xG4XFvxq04LZZ0uUiMANOJ2ARsi301HfQSOBSD+Y8J 76uP8aN9TCoC0p/ZT8JSFCEY3jps22fp4R1iOZGgqnb8Z/my6lbZs7R08ck3INoA tn3uXFr1QTVOFzYwX/sDDRMj6fsRtJWsDCsCdMXYXNAq+OMwtc72A+W/JQVJoGc= =Quxb -----END PGP SIGNATURE----- --45Z9DzgjV8m4Oswq-- From owner-svn-src-head@freebsd.org Thu Nov 1 16:36:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12A2D10F7E3A; Thu, 1 Nov 2018 16:36:35 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACE4C7E84C; Thu, 1 Nov 2018 16:36:34 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=53358 helo=[10.0.0.103]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gIFxL-000KGU-DS; Thu, 01 Nov 2018 16:36:27 +0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r339971 - in head: libexec/rc share/man/man5 share/man/man8 From: Devin Teske X-Mailer: iPhone Mail (15D60) In-Reply-To: <20181101060617.GA51661@ravenloft.kiev.ua> Date: Thu, 1 Nov 2018 09:36:27 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <92BDCE19-B205-413E-AAE3-CEBEB45A510B@freebsd.org> References: <201810312037.w9VKbCCX029120@repo.freebsd.org> <20181101060617.GA51661@ravenloft.kiev.ua> To: Alex Kozlov Sender: devin@shxd.cx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 16:36:35 -0000 > On 31 Oct 2018, at 11:06 PM, Alex Kozlov wrote: >=20 >> On Wed, Oct 31, 2018 at 08:37:12PM +0000, Devin Teske wrote: >> Author: dteske >> Date: Wed Oct 31 20:37:12 2018 >> New Revision: 339971 >> URL: https://svnweb.freebsd.org/changeset/base/339971 >>=20 >> Log: >> Add new rc keywords: enable, disable, delete >>=20 >> This adds new keywords to rc/service to enable/disable a service's >> rc.conf(5) variable and "delete" to remove the variable. > The enable command is just one typo away from enabled, so it's quite > easy to enable rc-script instead of checking if it enabled. >=20 Thankfully, easily fixed unlike so many other one-character typos (e.g., one= involving rm) =E2=80=94=20 Devin >> When the "service_delete_empty" variable in rc.conf(5) is set to "YES" >> (default is "NO") an rc.conf.d file (in /etc/ or /usr/local/etc) is >> deleted if empty after modification using "service $foo delete". >>=20 >> Submitted by: lme (modified) >> Reviewed by: 0mp (previous version), lme, bcr >> Relnotes: yes >> Sponsored by: Smule, Inc. >> Differential Revision: https://reviews.freebsd.org/D17113 >=20 >=20 > --=20 > Alex >=20 From owner-svn-src-head@freebsd.org Thu Nov 1 17:05:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0298610F8CFC; Thu, 1 Nov 2018 17:05:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA8FB801FF; Thu, 1 Nov 2018 17:05:10 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CB581E9C7; Thu, 1 Nov 2018 17:05:10 +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 wA1H5AOt067089; Thu, 1 Nov 2018 17:05:10 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1H5Aqm067088; Thu, 1 Nov 2018 17:05:10 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201811011705.wA1H5Aqm067088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 1 Nov 2018 17:05:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340008 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 340008 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 17:05:11 -0000 Author: andrew Date: Thu Nov 1 17:05:10 2018 New Revision: 340008 URL: https://svnweb.freebsd.org/changeset/base/340008 Log: Add the ARMv8.3 HCR_EL2 register fields. MFC after: 1 month Sponsored by: DARPA, AFRL Modified: head/sys/arm64/include/hypervisor.h Modified: head/sys/arm64/include/hypervisor.h ============================================================================== --- head/sys/arm64/include/hypervisor.h Thu Nov 1 16:50:19 2018 (r340007) +++ head/sys/arm64/include/hypervisor.h Thu Nov 1 17:05:10 2018 (r340008) @@ -80,6 +80,17 @@ #define HCR_RW 0x0000000080000000 #define HCR_CD 0x0000000100000000 #define HCR_ID 0x0000000200000000 +#define HCR_E2H 0x0000000400000000 +#define HCR_TLOR 0x0000000800000000 +#define HCR_TERR 0x0000001000000000 +#define HCR_TEA 0x0000002000000000 +#define HCR_MIOCNCE 0x0000004000000000 +/* Bit 39 is reserved */ +#define HCR_APK 0x0000010000000000 +#define HCR_API 0x0000020000000000 +#define HCR_NV 0x0000040000000000 +#define HCR_NV1 0x0000080000000000 +#define HCR_AT 0x0000100000000000 #endif From owner-svn-src-head@freebsd.org Thu Nov 1 17:26:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3238710F93F9; Thu, 1 Nov 2018 17:26:19 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DCB9E80E7E; Thu, 1 Nov 2018 17:26:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BADC91ED12; Thu, 1 Nov 2018 17:26:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA1HQIee077254; Thu, 1 Nov 2018 17:26:18 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1HQIIE077253; Thu, 1 Nov 2018 17:26:18 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201811011726.wA1HQIIE077253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 1 Nov 2018 17:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340009 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 340009 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 17:26:19 -0000 Author: bz Date: Thu Nov 1 17:26:18 2018 New Revision: 340009 URL: https://svnweb.freebsd.org/changeset/base/340009 Log: carpstats are the last virtualised variable in the file and end up at the end of the vnet_set. The generated code uses an absolute relocation at one byte beyond the end of the carpstats array. This means the relocation for the vnet does not happen for carpstats initialisation and as a result the kernel panics on module load. This problem has only been observed with carp and only on i386. We considered various possible solutions including using linker scripts to add padding to all kernel modules for pcpu and vnet sections. While the symbols (by chance) stay in the order of appearance in the file adding an unused non-file-local variable at the end of the file will extend the size of set_vnet and hence make the absolute relocation for carpstats work (think of this as a single-module set_vnet padding). This is a (tmporary) hack. It is the least intrusive one as we need a timely solution for the upcoming release. We will revisit the problem in HEAD. For a lot more information and the possible alternate solutions please see the PR and the references therein. PR: 230857 MFC after: 3 days Modified: head/sys/netinet/ip_carp.c Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Thu Nov 1 17:05:10 2018 (r340008) +++ head/sys/netinet/ip_carp.c Thu Nov 1 17:26:18 2018 (r340009) @@ -2176,6 +2176,21 @@ static struct protosw in6_carp_protosw = { }; #endif +#ifdef VIMAGE +#if defined(__i386__) +/* + * XXX This is a hack to work around an absolute relocation outside + * set_vnet by one (on the stop symbol) for carpstats. Add a dummy variable + * to the end of the file in the hope that the linker will just keep the + * order (as it seems to do at the moment). It is understood to be fragile. + * See PR 230857 for a longer discussion of the problem and the referenced + * review for possible alternate solutions. Each is a hack; we just need + * the least intrusive one for the next release. + */ +VNET_DEFINE(char, carp_zzz) = 0xde; +#endif +#endif + static void carp_mod_cleanup(void) { From owner-svn-src-head@freebsd.org Thu Nov 1 17:29:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 148F410F9529; Thu, 1 Nov 2018 17:29:16 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9ECF810FA; Thu, 1 Nov 2018 17:29:15 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 998811ED19; Thu, 1 Nov 2018 17:29:15 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA1HTFVA077423; Thu, 1 Nov 2018 17:29:15 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1HTFvx077421; Thu, 1 Nov 2018 17:29:15 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201811011729.wA1HTFvx077421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 1 Nov 2018 17:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340010 - head/sys/dev/ixl X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/dev/ixl X-SVN-Commit-Revision: 340010 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 17:29:16 -0000 Author: erj Date: Thu Nov 1 17:29:14 2018 New Revision: 340010 URL: https://svnweb.freebsd.org/changeset/base/340010 Log: ixl/iavf(4): Update remaining references of "num_queues" to "num_rx_queues" This should fix a build issue when "options RSS" is set. Reported by: bz@ Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/iavf_vc.c head/sys/dev/ixl/if_iavf.c Modified: head/sys/dev/ixl/iavf_vc.c ============================================================================== --- head/sys/dev/ixl/iavf_vc.c Thu Nov 1 17:26:18 2018 (r340009) +++ head/sys/dev/ixl/iavf_vc.c Thu Nov 1 17:29:14 2018 (r340010) @@ -720,10 +720,6 @@ iavf_update_stats_counters(struct iavf_sc *sc, struct uint64_t tx_discards; tx_discards = es->tx_discards; -#if 0 - for (int i = 0; i < vsi->num_queues; i++) - tx_discards += sc->vsi.queues[i].txr.br->br_drops; -#endif /* Update ifnet stats */ IXL_SET_IPACKETS(vsi, es->rx_unicast + @@ -826,7 +822,7 @@ iavf_config_rss_lut(struct iavf_sc *sc) /* * Fetch the RSS bucket id for the given indirection entry. * Cap it at the number of configured buckets (which is - * num_queues.) + * num_rx_queues.) */ que_id = rss_get_indirection_to_bucket(i); que_id = que_id % sc->vsi.num_rx_queues; Modified: head/sys/dev/ixl/if_iavf.c ============================================================================== --- head/sys/dev/ixl/if_iavf.c Thu Nov 1 17:26:18 2018 (r340009) +++ head/sys/dev/ixl/if_iavf.c Thu Nov 1 17:29:14 2018 (r340010) @@ -1946,10 +1946,10 @@ iavf_config_rss_reg(struct iavf_sc *sc) /* * Fetch the RSS bucket id for the given indirection entry. * Cap it at the number of configured buckets (which is - * num_queues.) + * num_rx_queues.) */ que_id = rss_get_indirection_to_bucket(i); - que_id = que_id % vsi->num_queues; + que_id = que_id % vsi->num_rx_queues; #else que_id = j; #endif From owner-svn-src-head@freebsd.org Thu Nov 1 17:43:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C667810F9C35; Thu, 1 Nov 2018 17:43:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B5C18262A; Thu, 1 Nov 2018 17:43:29 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 436DD1F06A; Thu, 1 Nov 2018 17:43:29 +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 wA1HhTEU087594; Thu, 1 Nov 2018 17:43:29 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1HhSvT087593; Thu, 1 Nov 2018 17:43:28 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201811011743.wA1HhSvT087593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 1 Nov 2018 17:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340013 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 340013 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 17:43:30 -0000 Author: andrew Date: Thu Nov 1 17:43:28 2018 New Revision: 340013 URL: https://svnweb.freebsd.org/changeset/base/340013 Log: Add the ARMv8.3 SCTLR_EL1 fields. While here tag which architecture release fields were added and remove a field that only existed in very early releases of the ARMv8 spec. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/locore.S head/sys/arm64/include/armreg.h Modified: head/sys/arm64/arm64/locore.S ============================================================================== --- head/sys/arm64/arm64/locore.S Thu Nov 1 17:37:20 2018 (r340012) +++ head/sys/arm64/arm64/locore.S Thu Nov 1 17:43:28 2018 (r340013) @@ -633,7 +633,7 @@ sctlr_set: sctlr_clear: /* Bits to clear */ .quad (SCTLR_EE | SCTLR_EOE | SCTLR_IESB | SCTLR_WXN | SCTLR_UMA | \ - SCTLR_ITD | SCTLR_THEE | SCTLR_A) + SCTLR_ITD | SCTLR_A) .globl abort abort: Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Thu Nov 1 17:37:20 2018 (r340012) +++ head/sys/arm64/include/armreg.h Thu Nov 1 17:43:28 2018 (r340013) @@ -525,7 +525,7 @@ #define PAR_S_MASK (0x1 << PAR_S_SHIFT) /* SCTLR_EL1 - System Control Register */ -#define SCTLR_RES0 0xc8222400 /* Reserved ARMv8.0, write 0 */ +#define SCTLR_RES0 0xc8222440 /* Reserved ARMv8.0, write 0 */ #define SCTLR_RES1 0x30d00800 /* Reserved ARMv8.0, write 1 */ #define SCTLR_M 0x00000001 @@ -534,23 +534,32 @@ #define SCTLR_SA 0x00000008 #define SCTLR_SA0 0x00000010 #define SCTLR_CP15BEN 0x00000020 -#define SCTLR_THEE 0x00000040 +/* Bit 6 is reserved */ #define SCTLR_ITD 0x00000080 #define SCTLR_SED 0x00000100 #define SCTLR_UMA 0x00000200 +/* Bit 10 is reserved */ +/* Bit 11 is reserved */ #define SCTLR_I 0x00001000 +#define SCTLR_EnDB 0x00002000 /* ARMv8.3 */ #define SCTLR_DZE 0x00004000 #define SCTLR_UCT 0x00008000 #define SCTLR_nTWI 0x00010000 +/* Bit 17 is reserved */ #define SCTLR_nTWE 0x00040000 #define SCTLR_WXN 0x00080000 -#define SCTLR_IESB 0x00200000 -#define SCTLR_SPAN 0x00800000 +/* Bit 20 is reserved */ +#define SCTLR_IESB 0x00200000 /* ARMv8.2 */ +/* Bit 22 is reserved */ +#define SCTLR_SPAN 0x00800000 /* ARMv8.1 */ #define SCTLR_EOE 0x01000000 #define SCTLR_EE 0x02000000 #define SCTLR_UCI 0x04000000 -#define SCTLR_nTLSMD 0x10000000 -#define SCTLR_LSMAOE 0x20000000 +#define SCTLR_EnDA 0x08000000 /* ARMv8.3 */ +#define SCTLR_nTLSMD 0x10000000 /* ARMv8.2 */ +#define SCTLR_LSMAOE 0x20000000 /* ARMv8.2 */ +#define SCTLR_EnIB 0x40000000 /* ARMv8.3 */ +#define SCTLR_EnIA 0x80000000 /* ARMv8.3 */ /* SPSR_EL1 */ /* From owner-svn-src-head@freebsd.org Thu Nov 1 17:45:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D64D310F9CEF; Thu, 1 Nov 2018 17:45:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A549827E0; Thu, 1 Nov 2018 17:45:29 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68C2A1F06C; Thu, 1 Nov 2018 17:45: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 wA1HjT8u087743; Thu, 1 Nov 2018 17:45:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1HjTXt087742; Thu, 1 Nov 2018 17:45:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811011745.wA1HjTXt087742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 1 Nov 2018 17:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340014 - head/bin/getfacl X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/bin/getfacl X-SVN-Commit-Revision: 340014 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 17:45:30 -0000 Author: markj Date: Thu Nov 1 17:45:29 2018 New Revision: 340014 URL: https://svnweb.freebsd.org/changeset/base/340014 Log: Avoid copying a struct stat for acl_from_stat() calls. CID: 1375584 MFC after: 2 weeks Modified: head/bin/getfacl/getfacl.c Modified: head/bin/getfacl/getfacl.c ============================================================================== --- head/bin/getfacl/getfacl.c Thu Nov 1 17:43:28 2018 (r340013) +++ head/bin/getfacl/getfacl.c Thu Nov 1 17:45:29 2018 (r340014) @@ -88,7 +88,7 @@ getgname(gid_t gid) * contained in struct stat */ static acl_t -acl_from_stat(struct stat sb) +acl_from_stat(const struct stat *sb) { acl_t acl; acl_entry_t entry; @@ -111,13 +111,13 @@ acl_from_stat(struct stat sb) return NULL; /* calculate user mode */ - if (sb.st_mode & S_IRUSR) + if (sb->st_mode & S_IRUSR) if (acl_add_perm(perms, ACL_READ) == -1) return NULL; - if (sb.st_mode & S_IWUSR) + if (sb->st_mode & S_IWUSR) if (acl_add_perm(perms, ACL_WRITE) == -1) return NULL; - if (sb.st_mode & S_IXUSR) + if (sb->st_mode & S_IXUSR) if (acl_add_perm(perms, ACL_EXECUTE) == -1) return NULL; if (acl_set_permset(entry, perms) == -1) @@ -135,13 +135,13 @@ acl_from_stat(struct stat sb) return NULL; /* calculate group mode */ - if (sb.st_mode & S_IRGRP) + if (sb->st_mode & S_IRGRP) if (acl_add_perm(perms, ACL_READ) == -1) return NULL; - if (sb.st_mode & S_IWGRP) + if (sb->st_mode & S_IWGRP) if (acl_add_perm(perms, ACL_WRITE) == -1) return NULL; - if (sb.st_mode & S_IXGRP) + if (sb->st_mode & S_IXGRP) if (acl_add_perm(perms, ACL_EXECUTE) == -1) return NULL; if (acl_set_permset(entry, perms) == -1) @@ -159,13 +159,13 @@ acl_from_stat(struct stat sb) return NULL; /* calculate other mode */ - if (sb.st_mode & S_IROTH) + if (sb->st_mode & S_IROTH) if (acl_add_perm(perms, ACL_READ) == -1) return NULL; - if (sb.st_mode & S_IWOTH) + if (sb->st_mode & S_IWOTH) if (acl_add_perm(perms, ACL_WRITE) == -1) return NULL; - if (sb.st_mode & S_IXOTH) + if (sb->st_mode & S_IXOTH) if (acl_add_perm(perms, ACL_EXECUTE) == -1) return NULL; if (acl_set_permset(entry, perms) == -1) @@ -229,7 +229,7 @@ print_acl(char *path, acl_type_t type, int hflag, int errno = 0; if (type == ACL_TYPE_DEFAULT) return(0); - acl = acl_from_stat(sb); + acl = acl_from_stat(&sb); if (!acl) { warn("%s: acl_from_stat() failed", path); return(-1); From owner-svn-src-head@freebsd.org Thu Nov 1 18:19:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A38C210FAD12; Thu, 1 Nov 2018 18:19:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5706384123; Thu, 1 Nov 2018 18:19:11 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EB391F59D; Thu, 1 Nov 2018 18:19:11 +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 wA1IJB82005303; Thu, 1 Nov 2018 18:19:11 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1IJABJ005300; Thu, 1 Nov 2018 18:19:10 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201811011819.wA1IJABJ005300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 1 Nov 2018 18:19:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340015 - head/usr.sbin/nscd X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.sbin/nscd X-SVN-Commit-Revision: 340015 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 18:19:11 -0000 Author: trasz Date: Thu Nov 1 18:19:10 2018 New Revision: 340015 URL: https://svnweb.freebsd.org/changeset/base/340015 Log: Unbreak nscd(8). Without this change the CMSG gets truncated. Reviewed by: des MFC after: 2 weeks Sponsored by: Chalmers University of Technology Differential Revision: https://reviews.freebsd.org/D17452 Modified: head/usr.sbin/nscd/nscdcli.c head/usr.sbin/nscd/query.c Modified: head/usr.sbin/nscd/nscdcli.c ============================================================================== --- head/usr.sbin/nscd/nscdcli.c Thu Nov 1 17:45:29 2018 (r340014) +++ head/usr.sbin/nscd/nscdcli.c Thu Nov 1 18:19:10 2018 (r340015) @@ -138,14 +138,14 @@ send_credentials(struct nscd_connection_ *connection, struct msghdr cred_hdr; struct iovec iov; - struct { + union { struct cmsghdr hdr; - struct cmsgcred creds; + char cred[CMSG_SPACE(sizeof(struct cmsgcred))]; } cmsg; TRACE_IN(send_credentials); memset(&cmsg, 0, sizeof(cmsg)); - cmsg.hdr.cmsg_len = sizeof(cmsg); + cmsg.hdr.cmsg_len = CMSG_LEN(sizeof(struct cmsgcred)); cmsg.hdr.cmsg_level = SOL_SOCKET; cmsg.hdr.cmsg_type = SCM_CREDS; @@ -153,7 +153,7 @@ send_credentials(struct nscd_connection_ *connection, cred_hdr.msg_iov = &iov; cred_hdr.msg_iovlen = 1; cred_hdr.msg_control = &cmsg; - cred_hdr.msg_controllen = sizeof(cmsg); + cred_hdr.msg_controllen = CMSG_SPACE(sizeof(struct cmsgcred)); iov.iov_base = &type; iov.iov_len = sizeof(int); Modified: head/usr.sbin/nscd/query.c ============================================================================== --- head/usr.sbin/nscd/query.c Thu Nov 1 17:45:29 2018 (r340014) +++ head/usr.sbin/nscd/query.c Thu Nov 1 18:19:10 2018 (r340015) @@ -160,7 +160,7 @@ on_query_startup(struct query_state *qstate) struct cmsgcred *cred; int elem_type; - struct { + union { struct cmsghdr hdr; char cred[CMSG_SPACE(sizeof(struct cmsgcred))]; } cmsg; @@ -171,8 +171,8 @@ on_query_startup(struct query_state *qstate) memset(&cred_hdr, 0, sizeof(struct msghdr)); cred_hdr.msg_iov = &iov; cred_hdr.msg_iovlen = 1; - cred_hdr.msg_control = (caddr_t)&cmsg; - cred_hdr.msg_controllen = CMSG_LEN(sizeof(struct cmsgcred)); + cred_hdr.msg_control = &cmsg; + cred_hdr.msg_controllen = CMSG_SPACE(sizeof(struct cmsgcred)); memset(&iov, 0, sizeof(struct iovec)); iov.iov_base = &elem_type; @@ -183,7 +183,8 @@ on_query_startup(struct query_state *qstate) return (-1); } - if (cmsg.hdr.cmsg_len < CMSG_LEN(sizeof(struct cmsgcred)) + if (cred_hdr.msg_controllen < CMSG_LEN(sizeof(struct cmsgcred)) + || cmsg.hdr.cmsg_len < CMSG_LEN(sizeof(struct cmsgcred)) || cmsg.hdr.cmsg_level != SOL_SOCKET || cmsg.hdr.cmsg_type != SCM_CREDS) { TRACE_OUT(on_query_startup); From owner-svn-src-head@freebsd.org Thu Nov 1 18:33:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3704810FB282 for ; Thu, 1 Nov 2018 18:33:17 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yw1-xc2e.google.com (mail-yw1-xc2e.google.com [IPv6:2607:f8b0:4864:20::c2e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C03C984BA7 for ; Thu, 1 Nov 2018 18:33:16 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yw1-xc2e.google.com with SMTP id l2-v6so3781213ywb.9 for ; Thu, 01 Nov 2018 11:33:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wAYMjrPKKbQr94XjexgMtdfF0iRwgNA5RXpe6DIkQbo=; b=Rfn9XfTuvbdS/dyUj9Eepu9+1qdLoN01eOB5EiLEA8CPjvrg4oB5j2044bTQdReLpJ PAvI4NK3Zk3EPqboKe7tm0V38Wh4ebU+opEWdtIdczbkyWdruymqSAoNAuaiWKPMF7s6 faL2bwkmrX94jJ+gpXZcrCvMM6Yi+3iCYoagKZbtGrWN3nwtC8iXAfKU25s5EVuNO5Iq k+SnNRYjQqFOtGDjD8j1TwFANvr+EqSclgRBgt8/iWYJluUrdWP1cjItizFK4PVaL0sH Eebf9rPIbmxnNQvZiz92le0+PtieqiA2LFoONS/UOLW8af8wxc0L7w/eebslDZXDjyS6 wEBw== 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=wAYMjrPKKbQr94XjexgMtdfF0iRwgNA5RXpe6DIkQbo=; b=iY2lxckuhTZOuYUUQwsNG+QhwfuCzQxHm616BS/AEvwcBQOQm4TLzYSszZA1dKJ2oV 5kTFKBOKuc9hZcgmWfy/WUqJhK/AAoF/MFL7RFCNh/ws4gTxRSjWb4s+PWCEuPpgezZy rWYrpmOq9bzLqjVBxTjF0WIB6HOCVqAziYd1i3pjAwAszQtPHPQpCIN2mOLjjrsQxvkB RkgEov38Ur8onnqxs4A+2BkNX43CMOp9DJtNUiSYTX+QLuriD5govCSurAS/0Gnb7nph PXKCXbVvurWZynemLHSijzwIrtEDcbVF70XzAAVrZhOI6wIlxsPv1E1xIguYo4sa+fFF dPPA== X-Gm-Message-State: AGRZ1gJ9T5+X7DQWX2TuJEHQnku8VUshQPLUsMVfbVb8GRRJX7rjvIN2 VLFPz09N+8uwqbIoA9K7ArQOyKMl6dO26JQidlcY7w== X-Google-Smtp-Source: AJdET5ccELwoFG7QOki0Ih8HNYcUktgy7SZoH8qr6dyQ+LA9zr8D1B7/lx6dBERZ6XLR39jzVwQEQI+CxWia7xvTnWY= X-Received: by 2002:a81:37d4:: with SMTP id e203-v6mr8361343ywa.79.1541097196003; Thu, 01 Nov 2018 11:33:16 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:b901:0:0:0:0:0 with HTTP; Thu, 1 Nov 2018 11:33:15 -0700 (PDT) In-Reply-To: <201810312037.w9VKbCCX029120@repo.freebsd.org> References: <201810312037.w9VKbCCX029120@repo.freebsd.org> From: Oliver Pinter Date: Thu, 1 Nov 2018 19:33:15 +0100 Message-ID: Subject: Re: svn commit: r339971 - in head: libexec/rc share/man/man5 share/man/man8 To: Devin Teske Cc: "src-committers@freebsd.org" , "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.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 18:33:17 -0000 On Wednesday, October 31, 2018, Devin Teske wrote: > Author: dteske > Date: Wed Oct 31 20:37:12 2018 > New Revision: 339971 > URL: https://svnweb.freebsd.org/changeset/base/339971 > > Log: > Add new rc keywords: enable, disable, delete > > This adds new keywords to rc/service to enable/disable a service's > rc.conf(5) variable and "delete" to remove the variable. > > When the "service_delete_empty" variable in rc.conf(5) is set to "YES" > (default is "NO") an rc.conf.d file (in /etc/ or /usr/local/etc) is > deleted if empty after modification using "service $foo delete". > > Submitted by: lme (modified) > Reviewed by: 0mp (previous version), lme, bcr > Relnotes: yes > Sponsored by: Smule, Inc. > Differential Revision: https://reviews.freebsd.org/D17113 Hi! Really nice. Do you plan to MFC this commit to stable branches? > > Modified: > head/libexec/rc/rc.conf > head/libexec/rc/rc.subr > head/share/man/man5/rc.conf.5 > head/share/man/man8/rc.8 > > Modified: head/libexec/rc/rc.conf > ============================================================ > ================== > --- head/libexec/rc/rc.conf Wed Oct 31 19:59:20 2018 (r339970) > +++ head/libexec/rc/rc.conf Wed Oct 31 20:37:12 2018 (r339971) > @@ -617,6 +617,7 @@ savecore_enable="YES" # Extract core from dump > devices > savecore_flags="-m 10" # Used if dumpdev is enabled above, and present. > # By default, only the 10 most recent kernel dumps > # are saved. > +service_delete_empty="NO" # Have 'service delete' remove empty rc.conf.d > files. > crashinfo_enable="YES" # Automatically generate crash dump summary. > crashinfo_program="/usr/sbin/crashinfo" # Script to generate > crash dump summary. > quota_enable="NO" # turn on quotas on startup (or NO). > > Modified: head/libexec/rc/rc.subr > ============================================================ > ================== > --- head/libexec/rc/rc.subr Wed Oct 31 19:59:20 2018 (r339970) > +++ head/libexec/rc/rc.subr Wed Oct 31 20:37:12 2018 (r339971) > @@ -922,7 +922,7 @@ run_rc_command() > eval _override_command=\$${name}_program > command=${_override_command:-$command} > > - _keywords="start stop restart rcvar enabled describe extracommands > $extra_commands" > + _keywords="start stop restart rcvar enable disable delete enabled > describe extracommands $extra_commands" > rc_pid= > _pidcmd= > _procname=${procname:-${command}} > @@ -977,12 +977,13 @@ run_rc_command() > if [ "$_elem" != "$rc_arg" ]; then > continue > fi > - # if ${rcvar} is set, $1 is not > "rcvar" and not "describe" > - # and ${rc_pid} is not set, then > run > + # if ${rcvar} is set, $1 is not > "rcvar", "describe", > + # "enable" or "delete", and > ${rc_pid} is not set, run: > # checkyesno ${rcvar} > # and return if that failed > # > if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" -a "$rc_arg" != > "stop" \ > + -a "$rc_arg" != "delete" -a "$rc_arg" != "enable" \ > -a "$rc_arg" != "describe" ] || > [ -n "${rcvar}" -a "$rc_arg" = "stop" -a -z > "${rc_pid}" ]; then > if ! checkyesno ${rcvar}; then > @@ -1028,6 +1029,31 @@ run_rc_command() > > extracommands) > echo "$extra_commands" > + ;; > + > + enable) > + _out=$(/usr/sbin/sysrc -vs "$name" "$rcvar=YES") && > + echo "$name enabled in ${_out%%:*}" > + ;; > + > + disable) > + _out=$(/usr/sbin/sysrc -vs "$name" "$rcvar=NO") && > + echo "$name disabled in ${_out%%:*}" > + ;; > + > + delete) > + _files= > + for _file in $(sysrc -lEs "$name"); do > + _out=$(sysrc -Fif $_file "$rcvar") && > _files="$_files $_file" > + done > + /usr/sbin/sysrc -x "$rcvar" && echo "$rcvar > deleted in ${_files# }" > + # delete file in rc.conf.d if desired and > empty. > + checkyesno service_delete_empty || _files= > + for _file in $_files; do > + [ "$_file" = "${_file#*/rc.conf.d/}" ] && > continue > + [ $(/usr/bin/stat -f%z $_file) -gt 0 ] && > continue > + /bin/rm "$_file" && echo "Empty file > $_file removed" > + done > ;; > > status) > > Modified: head/share/man/man5/rc.conf.5 > ============================================================ > ================== > --- head/share/man/man5/rc.conf.5 Wed Oct 31 19:59:20 2018 > (r339970) > +++ head/share/man/man5/rc.conf.5 Wed Oct 31 20:37:12 2018 > (r339971) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd August 22, 2018 > +.Dd October 24, 2018 > .Dt RC.CONF 5 > .Os > .Sh NAME > @@ -4509,6 +4509,14 @@ at boot time. > The directory where the files exported by USB LUN are located. > The default directory is > .Pa /var/cfumass . > +.It Va service_delete_empty > +.Pq Vt bool > +If set to > +.Dq Li YES , > +.Ql Li service delete > +removes empty > +.Dq Li rc.conf.d > +files. > .El > .Sh FILES > .Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact > @@ -4597,6 +4605,7 @@ The default directory is > .Xr rwhod 8 , > .Xr savecore 8 , > .Xr sdpd 8 , > +.Xr service 8 , > .Xr sshd 8 , > .Xr swapon 8 , > .Xr sysctl 8 , > > Modified: head/share/man/man8/rc.8 > ============================================================ > ================== > --- head/share/man/man8/rc.8 Wed Oct 31 19:59:20 2018 (r339970) > +++ head/share/man/man8/rc.8 Wed Oct 31 20:37:12 2018 (r339971) > @@ -31,7 +31,7 @@ > .\" @(#)rc.8 8.2 (Berkeley) 12/11/93 > .\" $FreeBSD$ > .\" > -.Dd April 25, 2017 > +.Dd September 18, 2018 > .Dt RC 8 > .Os > .Sh NAME > @@ -327,6 +327,21 @@ If the script starts a process (rather than performing > operation), show the status of the process. > Otherwise it is not necessary to support this argument. > Defaults to displaying the process ID of the program (if running). > +.It Cm enable > +Enable the service in > +.Xr rc.conf 5 . > +.It Cm disable > +Disable the service in > +.Xr rc.conf 5 . > +.It Cm delete > +Remove the service from > +.Xr rc.conf 5 . > +If > +.Ql Li service_delete_empty > +is set to > +.Dq Li YES , > +.Pa /etc/rc.conf.d/$servicename > +will be deleted if empty after modification. > .It Cm describe > Print a short description of what the script does. > .It Cm extracommands > _______________________________________________ > 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" > From owner-svn-src-head@freebsd.org Thu Nov 1 19:43:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F10810D48DD; Thu, 1 Nov 2018 19:43:14 +0000 (UTC) (envelope-from ml@vishwin.info) Received: from varun.vishwin.info (varun.vishwin.info [46.101.93.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "varun.vishwin.info", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC7C38972D; Thu, 1 Nov 2018 19:43:13 +0000 (UTC) (envelope-from ml@vishwin.info) Received: from varun.vishwin.info (fd35:9eae:7575::2 [IPv6:fd35:9eae:7575::2]) by varun.vishwin.info (OpenSMTPD) with ESMTP id 4347337f; Thu, 1 Nov 2018 15:43:08 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=vishwin.info; h=subject :to:cc:references:from:message-id:date:mime-version:in-reply-to :content-type; s=fuccboi12; bh=bhVMsJpaO2oQ2n/wXB6je2AOEW20Pk3Fy jbdY8hmU6k=; b=fsmvT5rPXn1l79yH64KA7TZYfT3cdJgU4tXHl4DB3SmwP3YKm EsnNmUtlDxDzpVcKGwUCUzCGZZS5pIWskIo0fkTzlzGslFBJTg8hYLmHN+L8EeQH HBREuI8KX8nMc74JCD/TGy6yq6WoqQXaAN/Sn/ehgLGOerYI7SI4oAFLeFel4b+3 uhd4N9QG+g8ejAMSBb+o61j2rxFeCehuSbruKMvXyJ6WmHQkkJSUVDPoFtcLqftG bBfSKTDVCMw6HesMjzc+DRXf1UAz/Ky59HRMWgkTGVLm7LjQ6KksGZde5DIO3rKE Qxk9xMR2jPa8xoWHobfk3T1osWOzjAFaKt1Nw== Received: from [IPv6:2001:470:8:6ca:cad7:19ff:fec0:a06d] (2001:470:8:6ca:cad7:19ff:fec0:a06d [IPv6:2001:470:8:6ca:cad7:19ff:fec0:a06d]) by varun.vishwin.info (OpenSMTPD) with ESMTPSA id af4c5057 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO; Thu, 1 Nov 2018 15:43:08 -0400 (EDT) Subject: Re: svn commit: r339898 - head/lib/libc/amd64/sys To: Brooks Davis Cc: svn-src-head@freebsd.org, toolchain@freebsd.org, Konstantin Belousov , current@freebsd.org References: <201810300011.w9U0BUui038857@repo.freebsd.org> <20181101160406.GA60233__23941.7825396687$1541088368$gmane$org@spindle.one-eyed-alien.net> From: Charlie Li Openpgp: preference=signencrypt Autocrypt: addr=ml@vishwin.info; keydata= xsFNBFt7iHUBEADCorTixbMGuHd9WYSKCELlv/TFcRtvpHUw/n9LtXzKixUUwl7iuMFMYTz3 QXePX0Twq4jCQYySfcxWbPkLsSYlPOkaGQ+XytfmIHoqG5ba4i1fp+F41is0oCtLt1+oL84j NKUd13em/JWd+PJeQbSTVnHbT2yaAi7vqWw5WKVaMExjfPGU5TArV46wSRU6Zuy1ZX66q0q5 dPzeBdeKYWJE8aGtyi3pYUpKUOX4gxiNetf6leDFZ4OsexWaRdU0n8fId5d1qwjAE3lOwV5z 0Ilt8t4iXtX3JL3DAQyLZIeXHIg9O3rrpPMXQWSp2/5g39PohNk7farbhcpIKxuDN+L5N6U9 OxNHBSCv9FGDO4R/mw3YwJCovDzsF7RSyXQDIY36yjdh2uTLZ0uD5Ci/DPmJUySFLRvpqWnQ M7V5cYhdqDfcElGpRbi8JZQVYRJjvI5Jj0byG98KeaD0YFxKqmmm+Oh+xWXE7xt/DsBoZeZJ BFP84LvFbwQqprvI+sg+1z2+JIgNbYwl8VaYzfyGnqTEXTOsQYEKTdKA9MODSAsN31MlQICe CIHZV+OwOqH1KQ/mZp59AnpXAmj4T94bnahE9yJtVW/qglX/nTeFNUdu5MyEgkeB0x7mx+t0 3hE20yp/NbyvG1T/o53NHwHiURC/8Fxd1NWPZ6n4X8npQn6iyQARAQABzSFDaGFybGllIExp IDx2aXNod2luQHZpc2h3aW4uaW5mbz7CwZEEEwEIADsCGyMFCwkIBwIGFQoJCAsCBBYCAwEC HgECF4AWIQT/f8Kqvlr7jU9sRv6OcHje8gOrbAUCW3uI+wIZAQAKCRCOcHje8gOrbNX8EACT HGo3AsShFj+AaUgD9V6wTMaR2w7ubIqbkn2ZqZZ1xWj3gM6VYRKHflj9LiYqFRO4wBteAq30 Snz6F93IG+u5B1uwlC58HDwCQaROaU5cHQ8UvGPSEv0XXCcYTaC3d5NMoIh/LdutVZz56LTx hWs5NHUCaG6FfGV9QplECRteQr2rMxHZxZ3ppSY9oev/wY3U3VRUGnhM2ZwGrpmjksC1HTBH Fw2XbYdVNCOYjQrTIulaYb3y0ssgsOhvSk9bPHSTsWSCQGJk0uFNXTvIq68GhkhOwAet6//w R2y1whg47r554pBManttODaQnmWmIWBM0bZMJrlNT8T/oXlG9nA0jrjA8LvTThrCAvMSMB0F 2FhStd/I2/Fs7T6Uk1BUpgCvFiDtE8Jt1W2yq2GLtPysGrJXyDaat8IuVUthnNVhoyZb9tZu sI/FFhfh9MkPmZDwCoTUJN2yU8QhxS1iJXfMZ1f06r1TYY9rwb8E/WCBJFbMzJs3VLj/TnHL N09J2zNZgTs7gewLn/2lEV1kOL/FxIDgN7ailcf3kcNdVUxr/pLbx3NZcDkXniPO0dzQpuRw q841wBT3uqdPFJwIl4pf1EYhLj89r2vOGnM2RChl1/t+wSqHhBji3R3uylzE0qbr8O/cgx/5 wlvZJiUhyu0hJ/JoJkF8WEFkesJrTZORGc7BTQRbe4h1ARAA12Xtgcbwk7IdsRi/7sTFKs73 qoFFq+DUWwMbSuIOaWw5J9nZ+ovr9gkXlax+xf335hJ0iItB8LhA7D9wD4wjrmmBjhwK7jYv tghb8BH6MHWEWD5D9xt47CO4o8Vi1m/F4OlKxoDqIhH6n63gNeSNaXzqDpZoUsL62KX+sKKU Udj/X/oz3XwXWCb/rEIgAMMW7QFcuQBJzkHgu69oUSIki4j1mhAMiBbGexfS1dcTfpLAr9eu jDNHOw5r7aI4cA8q7us8YfDLby87hPlSrtTKcxkbawrdFNs6KNrEvggkXhYxGqm4Z0FInixa avloimBf1q7kvVM0AAgsmkdeeS/6Tzbn71WBuEW0VgEcSSBS1dv7DfgmeQeiSmv0Dvx2lZv5 P6M4Q/plSAz7hVXL6EIKltwJUjY8Re7zDbPf7jJlbEgWbLxRhlGh5MwrNXbMt6KygDRcDyOP njxg0+ICXbQyPKiq7jZY2/Q/x8P08xNx8sUKPY+XE6G5QVohQfe3LT9s15KM+1Ur4v3Hhbft HtTW1iT60HkyU9qRCJJC11OgH7wrfiucG3/eQKgBgvsfKDD36rJmsQpkO0/kkp6R+CzLby3X PrrFYJTCr08e5QWKKPdyNvAhuyQj27Lb7EhNxe3hmpV+llx0aaN9t1M+QZ88famMOgIlp7Nh 1uFr/c5WGZUAEQEAAcLBdgQYAQgAIBYhBP9/wqq+WvuNT2xG/o5weN7yA6tsBQJbe4h1AhsM AAoJEI5weN7yA6tsTGcP/2rBIvgeKismZQQn7kJOHwgmqXg/N5ArwPH3eCJmzmNZWUIlOZyl A2KtYhkzZ5G3rsL/BMmMuYRUbPJJUukaJSqFep1E6AWYPC8Seakhu1ZbK8ayBI4KZmP+3PQY S0tKyMlxX+Qt9+S/tcQqS31mMgmcVhVhKi8MrWjY+g7pF+LkBYccHuNiGNIcm8mMPHTIKU72 ARiG3DtHrRg4sf5wqgOi72277jBHdDBGw0Y7rCvMsaGm3G4GsMwj4e47H6PAFOWK7O69muvL o50oMN2rkPi+9AKPi8WcrinstleEGyEIyguRagDQjZP5gX9Xk5vkS6+xMgKt7+k7+D3jWKlW R6G9U0CyKmVJoeNqwHUdLoFD3lywjwT9vo+cqb4gQKnZsA1ss/WOvEp4EaNSR7JHFOY5X8AN QgiPxLhrbI7FPGXKw3Y7nCpcIlzFph6UL9jhNRwvoQ3GfZ0sF0JgpASdrS4N3Fmnt9L6lc3q rIrxDPpDjYwcDEUBl0sp/prjh3gdC3qs9xZ0RNWWdUqcmvRv2SDkrVDw3iQ9WhMZWuQYBmGa MViypa6WrjjlVTjqZftZyqytnHwuo1PA/qLcF/vUUn0QHFPIDx8/yTSqiw/xTwPuOFxznHjJ VbxEEG0H5rmreh1Z0WeMwsSbjC3EEf+ZI39QpFwVIG8pDwXFOClfhjFz Message-ID: Date: Thu, 1 Nov 2018 15:43:02 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181101160406.GA60233__23941.7825396687$1541088368$gmane$org@spindle.one-eyed-alien.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="J7zO1OV5sr2KlTAfsSWm4GvnnVQxhZGao" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 19:43:14 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --J7zO1OV5sr2KlTAfsSWm4GvnnVQxhZGao Content-Type: multipart/mixed; boundary="VlfO2RE3ONQ0rsN77C61XpNal9OxMPZaN"; protected-headers="v1" From: Charlie Li To: Brooks Davis Cc: svn-src-head@freebsd.org, toolchain@freebsd.org, Konstantin Belousov , current@freebsd.org Message-ID: Subject: Re: svn commit: r339898 - head/lib/libc/amd64/sys References: <201810300011.w9U0BUui038857@repo.freebsd.org> <20181101160406.GA60233__23941.7825396687$1541088368$gmane$org@spindle.one-eyed-alien.net> In-Reply-To: <20181101160406.GA60233__23941.7825396687$1541088368$gmane$org@spindle.one-eyed-alien.net> --VlfO2RE3ONQ0rsN77C61XpNal9OxMPZaN Content-Type: text/plain; charset=utf-8 Content-Language: en-GB-large Content-Transfer-Encoding: quoted-printable On 01/11/2018 12:04, Brooks Davis wrote: > Is this failure with devel/llvm70? It's currently missing the patch > required to make this work. https://reviews.freebsd.org/D17709 contain= s > this patch among others. I'll see about getting it applied. >=20 Yes, devel/llvm70. Will build with your port commit at my next opportunit= y. --=20 Charlie Li Can't think of a witty .sigline today=E2=80=A6 (This email address is for mailing list use only; replace local-part with vishwin for off-list communication) --VlfO2RE3ONQ0rsN77C61XpNal9OxMPZaN-- --J7zO1OV5sr2KlTAfsSWm4GvnnVQxhZGao Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE/3/Cqr5a+41PbEb+jnB43vIDq2wFAlvbV0YACgkQjnB43vID q2zGiA//Qtsjp/+PDMU00MXD9r0Rzd5dkZxzE4phpBVqukKNecFDioac0fZ0HCXQ KGt8soscLIoC9LNc8n3UNXCxNR8BWZNjOquvcx21gJpGDJLe/fQtMkF6V4zYIQaF cPIA/zks2+LeagshG8AkOnly8zc6xqBV9Rjv86A1V2fgL3dQh170O0VTAGWkNMhL JhzpM3U27cpIDAJqT5EIdUycM50F8AvinUnFLnhou93zEqdzYPbExaeAUXPfjVRo A6ivAvyBLm/AJN++hkh1dXxs+A1e/Ekp4BOJclm2icA59AVMsHVvjUvykwiX4hsi Qd5qFRLWOTEd39bOdapC7lH5nKa5T14lcnwQl9D9ElfCXTejYrG/BwR29+h+S4px pN+a3Q3+9gdhHuC72bi62McyXelZyfOuyo5FqUZv9a1NplS8L5HYt2uF/RcJII0v O1vJu0EqedA12DHA6w6zIetV9BpLY/6LJfyRrYBYybScEYcFbBiy0PCEKPYe6nJZ So9i7SFdNULmCjzaGII13GthTw6FhSW2taeVcAI5TtO2lSk7/RRsGGj3Tm1dzmd2 wrTgvv9eoQ6NE+UrMCk6blG3aTTD1d6lg2P4ggOuDwqB+2vj2cb3+hRdlLsJ2YdE QjlNoa5Q0XEzGmUUOt8bg0uhvWxplnuFVVeJItBt17tmAZSlSu4= =flp3 -----END PGP SIGNATURE----- --J7zO1OV5sr2KlTAfsSWm4GvnnVQxhZGao-- From owner-svn-src-head@freebsd.org Thu Nov 1 20:09:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B41AB10D642C; Thu, 1 Nov 2018 20:09:47 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51EC38A5AB; Thu, 1 Nov 2018 20:09:47 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=49227 helo=[10.0.0.105]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gIJHO-000N6L-P3; Thu, 01 Nov 2018 20:09:22 +0000 From: Devin Teske Message-Id: <625D28F4-CF87-4823-85B2-61BABD636B00@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_086DCEDA-76D8-429B-A190-2F5E4DB94F1E"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r339971 - in head: libexec/rc share/man/man5 share/man/man8 Date: Thu, 1 Nov 2018 13:09:38 -0700 In-Reply-To: Cc: Devin Teske , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" To: Oliver Pinter References: <201810312037.w9VKbCCX029120@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.9.1) Sender: devin@shxd.cx X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 20:09:47 -0000 --Apple-Mail=_086DCEDA-76D8-429B-A190-2F5E4DB94F1E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Nov 1, 2018, at 11:33 AM, Oliver Pinter = wrote: >=20 >=20 >=20 > On Wednesday, October 31, 2018, Devin Teske > wrote: > Author: dteske > Date: Wed Oct 31 20:37:12 2018 > New Revision: 339971 > URL: https://svnweb.freebsd.org/changeset/base/339971 = >=20 > Log: > Add new rc keywords: enable, disable, delete >=20 > This adds new keywords to rc/service to enable/disable a service's > rc.conf(5) variable and "delete" to remove the variable. >=20 > When the "service_delete_empty" variable in rc.conf(5) is set to = "YES" > (default is "NO") an rc.conf.d file (in /etc/ or /usr/local/etc) is > deleted if empty after modification using "service $foo delete". >=20 > Submitted by: lme (modified) > Reviewed by: 0mp (previous version), lme, bcr > Relnotes: yes > Sponsored by: Smule, Inc. > Differential Revision: https://reviews.freebsd.org/D17113 = >=20 >=20 > Hi! >=20 > Really nice. Do you plan to MFC this commit to stable branches? >=20 It will be eligible for MFC on Nov 3. I'll submit the request, but it's = up to re@ -- Devin --Apple-Mail=_086DCEDA-76D8-429B-A190-2F5E4DB94F1E 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----- iQEzBAEBCAAdFiEE1dFm8oBcog41v+X3CTD6yeXHpjsFAlvbXYIACgkQCTD6yeXH pjvwJQgAwugFfmxRyXvHVrtrYD8sqqV5c+aGUy2ylgfKPOK8WIuJl+V/HNElYrqD bLYP+++InRBSPcA0QgOnXXyvYDEZsAqAkkWDki39zfoOqODFACy1QCJi68OrM214 Pz/cogGCyf+LK5ETAvMnK+qpxVPF3GiVnEaeekQVejwhLzp8NWdPwEf1moz0s32q P5BzNnjrhNIfVc/helNeziRm2WigpI7MjxWYzqLKuewFap/t9gRpNTA4ltJm+c9t RtbrulB2vkNtEnC7YCP/vdCndABzNtMj9BHs+wO+DhXahluakPppdVIEL8ve7REq q27fqh8Y3D8oJEPE9rPR7we5L0c4wA== =Txml -----END PGP SIGNATURE----- --Apple-Mail=_086DCEDA-76D8-429B-A190-2F5E4DB94F1E-- From owner-svn-src-head@freebsd.org Thu Nov 1 21:25:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B97A10D9216; Thu, 1 Nov 2018 21:25:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F40D8CCAB; Thu, 1 Nov 2018 21:25:27 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AC3A2148A; Thu, 1 Nov 2018 21:25:27 +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 wA1LPQVP007692; Thu, 1 Nov 2018 21:25:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1LPQDX007691; Thu, 1 Nov 2018 21:25:26 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811012125.wA1LPQDX007691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Nov 2018 21:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340018 - head/tools/tools/crypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/tools/tools/crypto X-SVN-Commit-Revision: 340018 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 21:25:27 -0000 Author: jhb Date: Thu Nov 1 21:25:26 2018 New Revision: 340018 URL: https://svnweb.freebsd.org/changeset/base/340018 Log: Compile cryptocheck with in-tree openssl again. Reviewed by: cem MFC after: 2 months Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D17767 Modified: head/tools/tools/crypto/Makefile Modified: head/tools/tools/crypto/Makefile ============================================================================== --- head/tools/tools/crypto/Makefile Thu Nov 1 20:42:54 2018 (r340017) +++ head/tools/tools/crypto/Makefile Thu Nov 1 21:25:26 2018 (r340018) @@ -32,10 +32,7 @@ MAN= BINDIR?= /usr/local/bin # cryptocheck: test symmetric crypto functions -# Use openssl from ports for Blake2 algorithms -CFLAGS.cryptocheck.c+= $$(pkg-config --cflags openssl) -LDFLAGS.cryptocheck+= $$(pkg-config --libs openssl) -LIBADD.cryptocheck+= util +LIBADD.cryptocheck+= crypto util # cryptokeytest: test asymmetric crypto functions LIBADD.cryptokeytest+= crypto From owner-svn-src-head@freebsd.org Thu Nov 1 21:34:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B10CB10D94FF; Thu, 1 Nov 2018 21:34:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 613068D2E1; Thu, 1 Nov 2018 21:34:20 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4220521629; Thu, 1 Nov 2018 21:34:20 +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 wA1LYKa6012809; Thu, 1 Nov 2018 21:34:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1LYIjm012800; Thu, 1 Nov 2018 21:34:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811012134.wA1LYIjm012800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Nov 2018 21:34:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340020 - in head/sys: amd64/amd64 arm/arm arm64/arm64 i386/i386 kern mips/mips powerpc/powerpc sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm/arm arm64/arm64 i386/i386 kern mips/mips powerpc/powerpc sys X-SVN-Commit-Revision: 340020 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 21:34:21 -0000 Author: jhb Date: Thu Nov 1 21:34:17 2018 New Revision: 340020 URL: https://svnweb.freebsd.org/changeset/base/340020 Log: Don't enter DDB for fatal traps before panic by default. Add a new 'debugger_on_trap' knob separate from 'debugger_on_panic' and make the calls to kdb_trap() in MD fatal trap handlers prior to calling panic() conditional on this new knob instead of 'debugger_on_panic'. Disable the new knob by default. Developers who wish to recover from a fatal fault by adjusting saved register state and retrying the faulting instruction can still do so by enabling the new knob. However, for the more common case this makes the user experience for panics due to a fatal fault match the user experience for other panics, e.g. 'c' in DDB will generate a crash dump and reboot the system rather than being stuck in an infinite loop of fatal fault messages and DDB prompts. Reviewed by: kib, avg MFC after: 2 months Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D17768 Modified: head/sys/amd64/amd64/trap.c head/sys/arm/arm/trap-v4.c head/sys/arm/arm/trap-v6.c head/sys/arm64/arm64/trap.c head/sys/i386/i386/trap.c head/sys/kern/kern_shutdown.c head/sys/mips/mips/trap.c head/sys/powerpc/powerpc/trap.c head/sys/sys/kdb.h Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Thu Nov 1 21:28:22 2018 (r340019) +++ head/sys/amd64/amd64/trap.c Thu Nov 1 21:34:17 2018 (r340020) @@ -916,7 +916,7 @@ trap_fatal(frame, eva) curproc->p_pid, curthread->td_name); #ifdef KDB - if (debugger_on_panic) { + if (debugger_on_trap) { kdb_why = KDB_WHY_TRAP; handled = kdb_trap(type, 0, frame); kdb_why = KDB_WHY_UNSET; Modified: head/sys/arm/arm/trap-v4.c ============================================================================== --- head/sys/arm/arm/trap-v4.c Thu Nov 1 21:28:22 2018 (r340019) +++ head/sys/arm/arm/trap-v4.c Thu Nov 1 21:34:17 2018 (r340020) @@ -456,7 +456,7 @@ dab_fatal(struct trapframe *tf, u_int fsr, u_int far, printf(", pc =%08x\n\n", tf->tf_pc); #ifdef KDB - if (debugger_on_panic) { + if (debugger_on_trap) { kdb_why = KDB_WHY_TRAP; handled = kdb_trap(fsr, 0, tf); kdb_why = KDB_WHY_UNSET; Modified: head/sys/arm/arm/trap-v6.c ============================================================================== --- head/sys/arm/arm/trap-v6.c Thu Nov 1 21:28:22 2018 (r340019) +++ head/sys/arm/arm/trap-v6.c Thu Nov 1 21:34:17 2018 (r340020) @@ -599,7 +599,7 @@ abort_fatal(struct trapframe *tf, u_int idx, u_int fsr printf(", pc =%08x\n\n", tf->tf_pc); #ifdef KDB - if (debugger_on_panic) { + if (debugger_on_trap) { kdb_why = KDB_WHY_TRAP; kdb_trap(fsr, 0, tf); kdb_why = KDB_WHY_UNSET; Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Thu Nov 1 21:28:22 2018 (r340019) +++ head/sys/arm64/arm64/trap.c Thu Nov 1 21:34:17 2018 (r340020) @@ -256,7 +256,7 @@ no_pmap_fault: printf(" esr: %.8lx\n", esr); #ifdef KDB - if (debugger_on_panic) { + if (debugger_on_trap) { kdb_why = KDB_WHY_TRAP; handled = kdb_trap(ESR_ELx_EXCEPTION(esr), 0, frame); Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Thu Nov 1 21:28:22 2018 (r340019) +++ head/sys/i386/i386/trap.c Thu Nov 1 21:34:17 2018 (r340020) @@ -977,7 +977,7 @@ trap_fatal(frame, eva) curproc->p_pid, curthread->td_name); #ifdef KDB - if (debugger_on_panic) { + if (debugger_on_trap) { kdb_why = KDB_WHY_TRAP; frame->tf_err = eva; /* smuggle fault address to ddb */ handled = kdb_trap(type, 0, frame); Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Thu Nov 1 21:28:22 2018 (r340019) +++ head/sys/kern/kern_shutdown.c Thu Nov 1 21:34:17 2018 (r340020) @@ -115,13 +115,18 @@ SYSCTL_INT(_kern, OID_AUTO, panic_reboot_wait_time, CT #ifdef KDB #ifdef KDB_UNATTENDED -int debugger_on_panic = 0; +static int debugger_on_panic = 0; #else -int debugger_on_panic = 1; +static int debugger_on_panic = 1; #endif SYSCTL_INT(_debug, OID_AUTO, debugger_on_panic, CTLFLAG_RWTUN | CTLFLAG_SECURE, &debugger_on_panic, 0, "Run debugger on kernel panic"); + +int debugger_on_trap = 0; +SYSCTL_INT(_debug, OID_AUTO, debugger_on_trap, + CTLFLAG_RWTUN | CTLFLAG_SECURE, + &debugger_on_trap, 0, "Run debugger on kernel trap before panic"); #ifdef KDB_TRACE static int trace_on_panic = 1; Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Thu Nov 1 21:28:22 2018 (r340019) +++ head/sys/mips/mips/trap.c Thu Nov 1 21:34:17 2018 (r340020) @@ -1100,7 +1100,7 @@ err: #endif #ifdef KDB - if (debugger_on_panic) { + if (debugger_on_trap) { kdb_why = KDB_WHY_TRAP; kdb_trap(type, 0, trapframe); kdb_why = KDB_WHY_UNSET; Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Thu Nov 1 21:28:22 2018 (r340019) +++ head/sys/powerpc/powerpc/trap.c Thu Nov 1 21:34:17 2018 (r340020) @@ -455,7 +455,7 @@ trap_fatal(struct trapframe *frame) printtrap(frame->exc, frame, 1, (frame->srr1 & PSL_PR)); #ifdef KDB - if (debugger_on_panic) { + if (debugger_on_trap) { kdb_why = KDB_WHY_TRAP; handled = kdb_trap(frame->exc, 0, frame); kdb_why = KDB_WHY_UNSET; Modified: head/sys/sys/kdb.h ============================================================================== --- head/sys/sys/kdb.h Thu Nov 1 21:28:22 2018 (r340019) +++ head/sys/sys/kdb.h Thu Nov 1 21:34:17 2018 (r340020) @@ -62,7 +62,7 @@ struct kdb_dbbe { DATA_SET(kdb_dbbe_set, name##_dbbe) extern u_char kdb_active; /* Non-zero while in debugger. */ -extern int debugger_on_panic; /* enter the debugger on panic. */ +extern int debugger_on_trap; /* enter the debugger on trap. */ extern struct kdb_dbbe *kdb_dbbe; /* Default debugger backend or NULL. */ extern struct trapframe *kdb_frame; /* Frame to kdb_trap(). */ extern struct pcb *kdb_thrctx; /* Current context. */ From owner-svn-src-head@freebsd.org Thu Nov 1 21:39:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7AB510D95D3; Thu, 1 Nov 2018 21:39:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 654688D4CE; Thu, 1 Nov 2018 21:39:34 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4213221633; Thu, 1 Nov 2018 21:39:34 +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 wA1LdY7v013068; Thu, 1 Nov 2018 21:39:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1LdYaK013067; Thu, 1 Nov 2018 21:39:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811012139.wA1LdYaK013067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Nov 2018 21:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340021 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 340021 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 21:39:34 -0000 Author: jhb Date: Thu Nov 1 21:39:33 2018 New Revision: 340021 URL: https://svnweb.freebsd.org/changeset/base/340021 Log: Assert that reclaim_tx_descs() is always making forward progress. MFC after: 2 months Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Nov 1 21:34:17 2018 (r340020) +++ head/sys/dev/cxgbe/t4_sge.c Thu Nov 1 21:39:33 2018 (r340021) @@ -5079,6 +5079,9 @@ reclaim_tx_descs(struct sge_txq *txq, u_int n) KASSERT(can_reclaim >= ndesc, ("%s: unexpected number of credits: %d, %d", __func__, can_reclaim, ndesc)); + KASSERT(ndesc != 0, + ("%s: descriptor with no credits: cidx %d", + __func__, eq->cidx)); for (m = txsd->m; m != NULL; m = nextpkt) { nextpkt = m->m_nextpkt; From owner-svn-src-head@freebsd.org Thu Nov 1 21:46:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 386CD10D9DE6; Thu, 1 Nov 2018 21:46:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E331C8DB41; Thu, 1 Nov 2018 21:46:37 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4643217C6; Thu, 1 Nov 2018 21:46:37 +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 wA1Lkb75018053; Thu, 1 Nov 2018 21:46:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1Lkbq5018052; Thu, 1 Nov 2018 21:46:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811012146.wA1Lkbq5018052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Nov 2018 21:46:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340022 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 340022 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 21:46:38 -0000 Author: jhb Date: Thu Nov 1 21:46:37 2018 New Revision: 340022 URL: https://svnweb.freebsd.org/changeset/base/340022 Log: Add support for port unit wiring to cxgbe(4). - Add a bus_child_location_str method to the nexus drivers that prints out 'port=N' as the location string exported via devinfo and the '%location' sysctl node. - We can't use a bus_hint_device_unit to wire the unit numbers of devices with a fixed devclass as the device gets assigned a unit in make_device() before the device creator can set softc, etc. Instead, when adding a child device, use a helper function much like a bus_hint_device_unit method to look for wiring hints or to return -1 to let the system choose a unit number. This function requires an "at" hint for the port pointing to the nexus device and a "port" hint listing the port number. For example: hint.cxl.4.at="t5nex0" hint.cxl.4.port="0" wires cxl4 to the first port on the t5nex0 adapter. Requested by: gallatin MFC after: 2 months Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Nov 1 21:39:33 2018 (r340021) +++ head/sys/dev/cxgbe/t4_main.c Thu Nov 1 21:46:37 2018 (r340022) @@ -92,6 +92,7 @@ __FBSDID("$FreeBSD$"); static int t4_probe(device_t); static int t4_attach(device_t); static int t4_detach(device_t); +static int t4_child_location_str(device_t, device_t, char *, size_t); static int t4_ready(device_t); static int t4_read_port_device(device_t, int, device_t *); static device_method_t t4_methods[] = { @@ -99,6 +100,8 @@ static device_method_t t4_methods[] = { DEVMETHOD(device_attach, t4_attach), DEVMETHOD(device_detach, t4_detach), + DEVMETHOD(bus_child_location_str, t4_child_location_str), + DEVMETHOD(t4_is_main_ready, t4_ready), DEVMETHOD(t4_read_port_device, t4_read_port_device), @@ -158,6 +161,8 @@ static device_method_t t5_methods[] = { DEVMETHOD(device_attach, t4_attach), DEVMETHOD(device_detach, t4_detach), + DEVMETHOD(bus_child_location_str, t4_child_location_str), + DEVMETHOD(t4_is_main_ready, t4_ready), DEVMETHOD(t4_read_port_device, t4_read_port_device), @@ -191,6 +196,8 @@ static device_method_t t6_methods[] = { DEVMETHOD(device_attach, t4_attach), DEVMETHOD(device_detach, t4_detach), + DEVMETHOD(bus_child_location_str, t4_child_location_str), + DEVMETHOD(t4_is_main_ready, t4_ready), DEVMETHOD(t4_read_port_device, t4_read_port_device), @@ -837,6 +844,24 @@ t4_init_devnames(struct adapter *sc) } static int +t4_ifnet_unit(struct adapter *sc, struct port_info *pi) +{ + const char *parent, *name; + long value; + int line, unit; + + line = 0; + parent = device_get_nameunit(sc->dev); + name = sc->names->ifnet_name; + while (resource_find_dev(&line, name, &unit, "at", parent) == 0) { + if (resource_long_value(name, unit, "port", &value) == 0 && + value == pi->port_id) + return (unit); + } + return (-1); +} + +static int t4_attach(device_t dev) { struct adapter *sc; @@ -1037,7 +1062,8 @@ t4_attach(device_t dev) pi->flags |= FIXED_IFMEDIA; PORT_UNLOCK(pi); - pi->dev = device_add_child(dev, sc->names->ifnet_name, -1); + pi->dev = device_add_child(dev, sc->names->ifnet_name, + t4_ifnet_unit(sc, pi)); if (pi->dev == NULL) { device_printf(dev, "failed to add device for port %d.\n", i); @@ -1250,6 +1276,16 @@ done: t4_sysctls(sc); return (rc); +} + +static int +t4_child_location_str(device_t bus, device_t dev, char *buf, size_t buflen) +{ + struct port_info *pi; + + pi = device_get_softc(dev); + snprintf(buf, buflen, "port=%d", pi->port_id); + return (0); } static int From owner-svn-src-head@freebsd.org Thu Nov 1 21:49:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 914E010D9F63; Thu, 1 Nov 2018 21:49:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3FC018DD8A; Thu, 1 Nov 2018 21:49:50 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1343B217D3; Thu, 1 Nov 2018 21:49:50 +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 wA1Lnnsp018221; Thu, 1 Nov 2018 21:49:49 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1LnnuB018220; Thu, 1 Nov 2018 21:49:49 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811012149.wA1LnnuB018220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Nov 2018 21:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340023 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 340023 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 21:49:50 -0000 Author: jhb Date: Thu Nov 1 21:49:49 2018 New Revision: 340023 URL: https://svnweb.freebsd.org/changeset/base/340023 Log: Check cannot_use_txpkts() rather than needs_tso() in add_to_txpkts(). Currently this is a no-op, but will matter in the future when cannot_use_txpkts() starts checking other conditions than just needs_tso(). Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Nov 1 21:46:37 2018 (r340022) +++ head/sys/dev/cxgbe/t4_sge.c Thu Nov 1 21:49:49 2018 (r340023) @@ -4725,8 +4725,11 @@ add_to_txpkts(struct mbuf *m, struct txpkts *txp, u_in MPASS(txp->wr_type == 0 || txp->wr_type == 1); + if (cannot_use_txpkts(m)) + return (1); + nsegs = mbuf_nsegs(m); - if (needs_tso(m) || (txp->wr_type == 1 && nsegs != 1)) + if (txp->wr_type == 1 && nsegs != 1) return (1); plen = txp->plen + m->m_pkthdr.len; From owner-svn-src-head@freebsd.org Thu Nov 1 21:51:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E470710DA452; Thu, 1 Nov 2018 21:51:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94D8B8E183; Thu, 1 Nov 2018 21:51:42 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74D352192A; Thu, 1 Nov 2018 21:51:42 +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 wA1LpgWG019846; Thu, 1 Nov 2018 21:51:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1Lpgtj019844; Thu, 1 Nov 2018 21:51:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811012151.wA1Lpgtj019844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 1 Nov 2018 21:51:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340024 - in head/sys/cam: . scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/cam: . scsi X-SVN-Commit-Revision: 340024 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 21:51:43 -0000 Author: imp Date: Thu Nov 1 21:51:41 2018 New Revision: 340024 URL: https://svnweb.freebsd.org/changeset/base/340024 Log: Add comments explaining what hold/unhold do They act as a simple one-deep semaphore to keep open/close/probe from running at the same time to avoid races that creates. Modified: head/sys/cam/cam_periph.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Thu Nov 1 21:49:49 2018 (r340023) +++ head/sys/cam/cam_periph.c Thu Nov 1 21:51:41 2018 (r340024) @@ -470,6 +470,12 @@ cam_periph_release(struct cam_periph *periph) mtx_unlock(mtx); } +/* + * hold/unhold act as mutual exclusion for sections of the code that + * need to sleep and want to make sure that other sections that + * will interfere are held off. This only protects exclusive sections + * from each other. + */ int cam_periph_hold(struct cam_periph *periph, int priority) { Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Nov 1 21:49:49 2018 (r340023) +++ head/sys/cam/scsi/scsi_da.c Thu Nov 1 21:51:41 2018 (r340024) @@ -2697,9 +2697,10 @@ daregister(struct cam_periph *periph, void *arg) TASK_INIT(&softc->sysctl_task, 0, dasysctlinit, periph); /* - * Take an exclusive refcount on the periph while dastart is called - * to finish the probe. The reference will be dropped in dadone at - * the end of probe. + * Take an exclusive section lock qon the periph while dastart is called + * to finish the probe. The lock will be dropped in dadone at the end + * of probe. This locks out daopen and daclose from racing with the + * probe. * * XXX if cam_periph_hold returns an error, we don't hold a refcount. */ From owner-svn-src-head@freebsd.org Thu Nov 1 22:11:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4BF010DAB81; Thu, 1 Nov 2018 22:11:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A3178EC32; Thu, 1 Nov 2018 22:11:26 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7ACBA21B61; Thu, 1 Nov 2018 22:11:26 +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 wA1MBQQx030300; Thu, 1 Nov 2018 22:11:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1MBQ7v030299; Thu, 1 Nov 2018 22:11:26 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811012211.wA1MBQ7v030299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Nov 2018 22:11:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340025 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 340025 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 22:11:27 -0000 Author: jhb Date: Thu Nov 1 22:11:26 2018 New Revision: 340025 URL: https://svnweb.freebsd.org/changeset/base/340025 Log: Implement ptrace_set_pc() and fail PT_*STEP requests explicitly. Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17769 Modified: head/sys/riscv/riscv/machdep.c Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Thu Nov 1 21:51:41 2018 (r340024) +++ head/sys/riscv/riscv/machdep.c Thu Nov 1 22:11:26 2018 (r340025) @@ -254,7 +254,7 @@ int ptrace_set_pc(struct thread *td, u_long addr) { - panic("ptrace_set_pc"); + td->td_frame->tf_sepc = addr; return (0); } @@ -263,7 +263,7 @@ ptrace_single_step(struct thread *td) { /* TODO; */ - return (0); + return (EOPNOTSUPP); } int @@ -271,7 +271,7 @@ ptrace_clear_single_step(struct thread *td) { /* TODO; */ - return (0); + return (EOPNOTSUPP); } void From owner-svn-src-head@freebsd.org Thu Nov 1 22:13:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9E7610DADA5; Thu, 1 Nov 2018 22:13:19 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F6778EE70; Thu, 1 Nov 2018 22:13:19 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42BA621CB7; Thu, 1 Nov 2018 22:13:19 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA1MDJqU033417; Thu, 1 Nov 2018 22:13:19 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1MDJjg033416; Thu, 1 Nov 2018 22:13:19 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201811012213.wA1MDJjg033416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 1 Nov 2018 22:13:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340026 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 340026 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 22:13:20 -0000 Author: tsoome Date: Thu Nov 1 22:13:18 2018 New Revision: 340026 URL: https://svnweb.freebsd.org/changeset/base/340026 Log: libsa: cstyle cleanup tftp.c No functinal changes intended. Modified: head/stand/libsa/tftp.c Modified: head/stand/libsa/tftp.c ============================================================================== --- head/stand/libsa/tftp.c Thu Nov 1 22:11:26 2018 (r340025) +++ head/stand/libsa/tftp.c Thu Nov 1 22:13:18 2018 (r340026) @@ -63,30 +63,29 @@ __FBSDID("$FreeBSD$"); struct tftp_handle; struct tftprecv_extra; -static ssize_t recvtftp(struct iodesc *d, void **pkt, void **payload, - time_t tleft, void *recv_extra); -static int tftp_open(const char *path, struct open_file *f); -static int tftp_close(struct open_file *f); -static int tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len); -static int tftp_read(struct open_file *f, void *buf, size_t size, size_t *resid); -static off_t tftp_seek(struct open_file *f, off_t offset, int where); -static int tftp_set_blksize(struct tftp_handle *h, const char *str); -static int tftp_stat(struct open_file *f, struct stat *sb); +static ssize_t recvtftp(struct iodesc *, void **, void **, time_t, void *); +static int tftp_open(const char *, struct open_file *); +static int tftp_close(struct open_file *); +static int tftp_parse_oack(struct tftp_handle *, char *, size_t); +static int tftp_read(struct open_file *, void *, size_t, size_t *); +static off_t tftp_seek(struct open_file *, off_t, int); +static int tftp_set_blksize(struct tftp_handle *, const char *); +static int tftp_stat(struct open_file *, struct stat *); struct fs_ops tftp_fsops = { - "tftp", - tftp_open, - tftp_close, - tftp_read, - null_write, - tftp_seek, - tftp_stat, - null_readdir + .fs_name = "tftp", + .fo_open = tftp_open, + .fo_close = tftp_close, + .fo_read = tftp_read, + .fo_write = null_write, + .fo_seek = tftp_seek, + .fo_stat = tftp_stat, + .fo_readdir = null_readdir }; extern struct in_addr servip; -static int tftpport = 2000; +static int tftpport = 2000; static int is_open = 0; /* @@ -94,21 +93,21 @@ static int is_open = 0; * TFTP_REQUESTED_BLKSIZE of 1428 is (Ethernet MTU, less the TFTP, UDP and * IP header lengths). */ -#define TFTP_REQUESTED_BLKSIZE 1428 +#define TFTP_REQUESTED_BLKSIZE 1428 /* * Choose a blksize big enough so we can test with Ethernet * Jumbo frames in the future. */ -#define TFTP_MAX_BLKSIZE 9008 +#define TFTP_MAX_BLKSIZE 9008 struct tftp_handle { struct iodesc *iodesc; - int currblock; /* contents of lastdata */ - int islastblock; /* flag */ - int validsize; - int off; - char *path; /* saved for re-requests */ + int currblock; /* contents of lastdata */ + int islastblock; /* flag */ + int validsize; + int off; + char *path; /* saved for re-requests */ unsigned int tftp_blksize; unsigned long tftp_tsize; void *pkt; @@ -117,7 +116,7 @@ struct tftp_handle { struct tftprecv_extra { struct tftp_handle *tftp_handle; - unsigned short rtype; /* Received type */ + unsigned short rtype; /* Received type */ }; #define TFTP_MAX_ERRCODE EOPTNEG @@ -141,25 +140,25 @@ tftp_senderr(struct tftp_handle *h, u_short errcode, c { struct { u_char header[HEADER_SIZE]; - struct tftphdr t; + struct tftphdr t; u_char space[63]; /* +1 from t */ } __packed __aligned(4) wbuf; - char *wtail; - int len; + char *wtail; + int len; len = strlen(msg); if (len > sizeof(wbuf.space)) len = sizeof(wbuf.space); - wbuf.t.th_opcode = htons((u_short) ERROR); - wbuf.t.th_code = htons(errcode); + wbuf.t.th_opcode = htons((u_short)ERROR); + wbuf.t.th_code = htons(errcode); wtail = wbuf.t.th_msg; bcopy(msg, wtail, len); wtail[len] = '\0'; wtail += len + 1; - sendudp(h->iodesc, &wbuf.t, wtail - (char *) &wbuf.t); + sendudp(h->iodesc, &wbuf.t, wtail - (char *)&wbuf.t); } static void @@ -169,14 +168,14 @@ tftp_sendack(struct tftp_handle *h, u_short block) u_char header[HEADER_SIZE]; struct tftphdr t; } __packed __aligned(4) wbuf; - char *wtail; + char *wtail; - wbuf.t.th_opcode = htons((u_short) ACK); - wtail = (char *) &wbuf.t.th_block; + wbuf.t.th_opcode = htons((u_short)ACK); + wtail = (char *)&wbuf.t.th_block; wbuf.t.th_block = htons(block); wtail += 2; - sendudp(h->iodesc, &wbuf.t, wtail - (char *) &wbuf.t); + sendudp(h->iodesc, &wbuf.t, wtail - (char *)&wbuf.t); } static ssize_t @@ -190,7 +189,7 @@ recvtftp(struct iodesc *d, void **pkt, void **payload, ssize_t len; errno = 0; - extra = (struct tftprecv_extra *)recv_extra; + extra = recv_extra; h = extra->tftp_handle; len = readudp(d, &ptr, (void **)&t, tleft); @@ -205,7 +204,7 @@ recvtftp(struct iodesc *d, void **pkt, void **payload, case DATA: { int got; - if (htons(t->th_block) < (u_short) d->xid) { + if (htons(t->th_block) < (u_short)d->xid) { /* * Apparently our ACK was missed, re-send. */ @@ -213,7 +212,7 @@ recvtftp(struct iodesc *d, void **pkt, void **payload, free(ptr); return (-1); } - if (htons(t->th_block) != (u_short) d->xid) { + if (htons(t->th_block) != (u_short)d->xid) { /* * Packet from the future, drop this. */ @@ -225,7 +224,7 @@ recvtftp(struct iodesc *d, void **pkt, void **payload, * First data packet from new port. */ struct udphdr *uh; - uh = (struct udphdr *) t - 1; + uh = (struct udphdr *)t - 1; d->destport = uh->uh_sport; } got = len - (t->th_data - (char *)t); @@ -234,7 +233,7 @@ recvtftp(struct iodesc *d, void **pkt, void **payload, return (got); } case ERROR: - if ((unsigned) ntohs(t->th_code) > TFTP_MAX_ERRCODE) { + if ((unsigned)ntohs(t->th_code) > TFTP_MAX_ERRCODE) { printf("illegal tftp error %d\n", ntohs(t->th_code)); errno = EIO; } else { @@ -249,8 +248,8 @@ recvtftp(struct iodesc *d, void **pkt, void **payload, struct udphdr *uh; int tftp_oack_len; - /* - * Unexpected OACK. TFTP transfer already in progress. + /* + * Unexpected OACK. TFTP transfer already in progress. * Drop the pkt. */ if (d->xid != 1) { @@ -262,9 +261,9 @@ recvtftp(struct iodesc *d, void **pkt, void **payload, * Remember which port this OACK came from, because we need * to send the ACK or errors back to it. */ - uh = (struct udphdr *) t - 1; + uh = (struct udphdr *)t - 1; d->destport = uh->uh_sport; - + /* Parse options ACK-ed by the server. */ tftp_oack_len = len - sizeof(t->th_opcode); if (tftp_parse_oack(h, t->th_u.tu_stuff, tftp_oack_len) != 0) { @@ -296,9 +295,9 @@ tftp_makereq(struct tftp_handle *h) u_char space[FNAME_SIZE + 6]; } __packed __aligned(4) wbuf; struct tftprecv_extra recv_extra; - char *wtail; - int l; - ssize_t res; + char *wtail; + int l; + ssize_t res; void *pkt; struct tftphdr *t; char *tftp_blksize = NULL; @@ -312,7 +311,7 @@ tftp_makereq(struct tftp_handle *h) tftp_set_blksize(h, tftp_blksize); } - wbuf.t.th_opcode = htons((u_short) RRQ); + wbuf.t.th_opcode = htons((u_short)RRQ); wtail = wbuf.t.th_stuff; l = strlen(h->path); #ifdef TFTP_PREPEND_PATH @@ -337,7 +336,6 @@ tftp_makereq(struct tftp_handle *h) bcopy("0", wtail, 2); wtail += 2; - /* h->iodesc->myport = htons(--tftpport); */ h->iodesc->myport = htons(tftpport + (getsecs() & 0x3ff)); h->iodesc->destport = htons(IPPORT_TFTP); h->iodesc->xid = 1; /* expected block */ @@ -348,8 +346,8 @@ tftp_makereq(struct tftp_handle *h) pkt = NULL; recv_extra.tftp_handle = h; - res = sendrecv(h->iodesc, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, - (void *)&recvtftp, &pkt, (void **)&t, &recv_extra); + res = sendrecv(h->iodesc, &sendudp, &wbuf.t, wtail - (char *)&wbuf.t, + &recvtftp, &pkt, (void **)&t, &recv_extra); if (res == -1) { free(pkt); return (errno); @@ -384,7 +382,7 @@ tftp_makereq(struct tftp_handle *h) } /* ack block, expect next */ -static int +static int tftp_getnextblock(struct tftp_handle *h) { struct { @@ -392,21 +390,22 @@ tftp_getnextblock(struct tftp_handle *h) struct tftphdr t; } __packed __aligned(4) wbuf; struct tftprecv_extra recv_extra; - char *wtail; - int res; + char *wtail; + int res; void *pkt; struct tftphdr *t; - wbuf.t.th_opcode = htons((u_short) ACK); - wtail = (char *) &wbuf.t.th_block; - wbuf.t.th_block = htons((u_short) h->currblock); + + wbuf.t.th_opcode = htons((u_short)ACK); + wtail = (char *)&wbuf.t.th_block; + wbuf.t.th_block = htons((u_short)h->currblock); wtail += 2; h->iodesc->xid = h->currblock + 1; /* expected block */ pkt = NULL; recv_extra.tftp_handle = h; - res = sendrecv(h->iodesc, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, - (void *)&recvtftp, &pkt, (void **)&t, &recv_extra); + res = sendrecv(h->iodesc, &sendudp, &wbuf.t, wtail - (char *)&wbuf.t, + &recvtftp, &pkt, (void **)&t, &recv_extra); if (res == -1) { /* 0 is OK! */ free(pkt); @@ -422,8 +421,8 @@ tftp_getnextblock(struct tftp_handle *h) h->islastblock = 1; /* EOF */ if (h->islastblock == 1) { - /* Send an ACK for the last block */ - wbuf.t.th_block = htons((u_short) h->currblock); + /* Send an ACK for the last block */ + wbuf.t.th_block = htons((u_short)h->currblock); sendudp(h->iodesc, &wbuf.t, wtail - (char *)&wbuf.t); } @@ -434,10 +433,10 @@ static int tftp_open(const char *path, struct open_file *f) { struct tftp_handle *tftpfile; - struct iodesc *io; - int res; - size_t pathsize; - const char *extraslash; + struct iodesc *io; + int res; + size_t pathsize; + const char *extraslash; if (netproto != NET_TFTP) return (EINVAL); @@ -453,7 +452,7 @@ tftp_open(const char *path, struct open_file *f) return (ENOMEM); tftpfile->tftp_blksize = TFTP_REQUESTED_BLKSIZE; - tftpfile->iodesc = io = socktodesc(*(int *) (f->f_devdata)); + tftpfile->iodesc = io = socktodesc(*(int *)(f->f_devdata)); if (io == NULL) { free(tftpfile); return (EINVAL); @@ -465,7 +464,7 @@ tftp_open(const char *path, struct open_file *f) tftpfile->path = malloc(pathsize); if (tftpfile->path == NULL) { free(tftpfile); - return(ENOMEM); + return (ENOMEM); } if (rootpath[strlen(rootpath) - 1] == '/' || path[0] == '/') extraslash = ""; @@ -476,7 +475,7 @@ tftp_open(const char *path, struct open_file *f) if (res < 0 || res > pathsize) { free(tftpfile->path); free(tftpfile); - return(ENOMEM); + return (ENOMEM); } res = tftp_makereq(tftpfile); @@ -487,7 +486,7 @@ tftp_open(const char *path, struct open_file *f) free(tftpfile); return (res); } - f->f_fsdata = (void *) tftpfile; + f->f_fsdata = tftpfile; is_open = 1; return (0); } @@ -502,7 +501,7 @@ tftp_read(struct open_file *f, void *addr, size_t size rc = 0; res = size; - tftpfile = (struct tftp_handle *) f->f_fsdata; + tftpfile = f->f_fsdata; /* Make sure we will not read past file end */ if (tftpfile->tftp_tsize > 0 && @@ -575,11 +574,11 @@ tftp_read(struct open_file *f, void *addr, size_t size return (rc); } -static int +static int tftp_close(struct open_file *f) { struct tftp_handle *tftpfile; - tftpfile = (struct tftp_handle *) f->f_fsdata; + tftpfile = f->f_fsdata; /* let it time out ... */ @@ -592,17 +591,17 @@ tftp_close(struct open_file *f) return (0); } -static int +static int tftp_stat(struct open_file *f, struct stat *sb) { struct tftp_handle *tftpfile; - tftpfile = (struct tftp_handle *) f->f_fsdata; + tftpfile = f->f_fsdata; sb->st_mode = 0444 | S_IFREG; sb->st_nlink = 1; sb->st_uid = 0; sb->st_gid = 0; - sb->st_size = (off_t) tftpfile->tftp_tsize; + sb->st_size = tftpfile->tftp_tsize; return (0); } @@ -610,7 +609,7 @@ static off_t tftp_seek(struct open_file *f, off_t offset, int where) { struct tftp_handle *tftpfile; - tftpfile = (struct tftp_handle *) f->f_fsdata; + tftpfile = f->f_fsdata; switch (where) { case SEEK_SET: @@ -629,7 +628,7 @@ tftp_seek(struct open_file *f, off_t offset, int where static int tftp_set_blksize(struct tftp_handle *h, const char *str) { - char *endptr; + char *endptr; int new_blksize; int ret = 0; @@ -644,8 +643,8 @@ tftp_set_blksize(struct tftp_handle *h, const char *st * RFC2348 specifies that acceptable values are 8-65464. * Let's choose a limit less than MAXRSPACE. */ - if (*endptr == '\0' && new_blksize >= 8 - && new_blksize <= TFTP_MAX_BLKSIZE) { + if (*endptr == '\0' && new_blksize >= 8 && + new_blksize <= TFTP_MAX_BLKSIZE) { h->tftp_blksize = new_blksize; ret = 1; } @@ -676,10 +675,10 @@ tftp_set_blksize(struct tftp_handle *h, const char *st * optN, valueN * The final option/value acknowledgment pair. */ -static int +static int tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len) { - /* + /* * We parse the OACK strings into an array * of name-value pairs. */ @@ -689,7 +688,7 @@ tftp_parse_oack(struct tftp_handle *h, char *buf, size int option_idx = 0; int blksize_is_set = 0; int tsize = 0; - + unsigned int orig_blksize; while (option_idx < 128 && i < len) { @@ -706,26 +705,30 @@ tftp_parse_oack(struct tftp_handle *h, char *buf, size /* Save the block size we requested for sanity check later. */ orig_blksize = h->tftp_blksize; - /* + /* * Parse individual TFTP options. * * "blksize" is specified in RFC2348. * * "tsize" is specified in RFC2349. - */ + */ for (i = 0; i < option_idx; i += 2) { - if (strcasecmp(tftp_options[i], "blksize") == 0) { - if (i + 1 < option_idx) - blksize_is_set = - tftp_set_blksize(h, tftp_options[i + 1]); - } else if (strcasecmp(tftp_options[i], "tsize") == 0) { - if (i + 1 < option_idx) - tsize = strtol(tftp_options[i + 1], (char **)NULL, 10); - if (tsize != 0) - h->tftp_tsize = tsize; - } else { - /* Do not allow any options we did not expect to be ACKed. */ - printf("unexpected tftp option '%s'\n", tftp_options[i]); - return (-1); - } + if (strcasecmp(tftp_options[i], "blksize") == 0) { + if (i + 1 < option_idx) + blksize_is_set = + tftp_set_blksize(h, tftp_options[i + 1]); + } else if (strcasecmp(tftp_options[i], "tsize") == 0) { + if (i + 1 < option_idx) + tsize = strtol(tftp_options[i + 1], NULL, 10); + if (tsize != 0) + h->tftp_tsize = tsize; + } else { + /* + * Do not allow any options we did not expect to be + * ACKed. + */ + printf("unexpected tftp option '%s'\n", + tftp_options[i]); + return (-1); + } } if (!blksize_is_set) { @@ -747,5 +750,5 @@ tftp_parse_oack(struct tftp_handle *h, char *buf, size printf("tftp_blksize: %u\n", h->tftp_blksize); printf("tftp_tsize: %lu\n", h->tftp_tsize); #endif - return 0; + return (0); } From owner-svn-src-head@freebsd.org Thu Nov 1 22:13:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3117D10DADC9; Thu, 1 Nov 2018 22:13:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D94268EE81; Thu, 1 Nov 2018 22:13:22 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAB9721CB8; Thu, 1 Nov 2018 22:13:22 +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 wA1MDM7I033464; Thu, 1 Nov 2018 22:13:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1MDMLV033463; Thu, 1 Nov 2018 22:13:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811012213.wA1MDMLV033463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Nov 2018 22:13:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340027 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 340027 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 22:13:23 -0000 Author: jhb Date: Thu Nov 1 22:13:22 2018 New Revision: 340027 URL: https://svnweb.freebsd.org/changeset/base/340027 Log: Don't allow debuggers to modify SSTATUS, only to read it. Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17771 Modified: head/sys/riscv/riscv/machdep.c Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Thu Nov 1 22:13:18 2018 (r340026) +++ head/sys/riscv/riscv/machdep.c Thu Nov 1 22:13:22 2018 (r340027) @@ -178,7 +178,6 @@ set_regs(struct thread *td, struct reg *regs) frame = td->td_frame; frame->tf_sepc = regs->sepc; - frame->tf_sstatus = regs->sstatus; frame->tf_ra = regs->ra; frame->tf_sp = regs->sp; frame->tf_gp = regs->gp; From owner-svn-src-head@freebsd.org Thu Nov 1 22:15:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2E6D10DAEFA; Thu, 1 Nov 2018 22:15:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 63BEC8F1A4; Thu, 1 Nov 2018 22:15:26 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44E5921CD7; Thu, 1 Nov 2018 22:15:26 +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 wA1MFQVM033599; Thu, 1 Nov 2018 22:15:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1MFPtx033595; Thu, 1 Nov 2018 22:15:25 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811012215.wA1MFPtx033595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Nov 2018 22:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340028 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 340028 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 22:15:26 -0000 Author: jhb Date: Thu Nov 1 22:15:25 2018 New Revision: 340028 URL: https://svnweb.freebsd.org/changeset/base/340028 Log: SBI calls expect a pointer to a u_long rather than a pointer. This is just cosmetic. A weirder issue is that the SBI doc claims the hart mask pointer should be a physical address, not a virtual address. However, the implementation in bbl seems to just dereference the address directly. Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17781 Modified: head/sys/riscv/riscv/intr_machdep.c head/sys/riscv/riscv/mp_machdep.c Modified: head/sys/riscv/riscv/intr_machdep.c ============================================================================== --- head/sys/riscv/riscv/intr_machdep.c Thu Nov 1 22:13:22 2018 (r340027) +++ head/sys/riscv/riscv/intr_machdep.c Thu Nov 1 22:15:25 2018 (r340028) @@ -202,7 +202,7 @@ riscv_unmask_ipi(void) static void ipi_send(struct pcpu *pc, int ipi) { - uintptr_t mask; + u_long mask; CTR3(KTR_SMP, "%s: cpu=%d, ipi=%x", __func__, pc->pc_cpuid, ipi); @@ -242,7 +242,7 @@ void ipi_selected(cpuset_t cpus, u_int ipi) { struct pcpu *pc; - uintptr_t mask; + u_long mask; CTR1(KTR_SMP, "ipi_selected: ipi: %x", ipi); Modified: head/sys/riscv/riscv/mp_machdep.c ============================================================================== --- head/sys/riscv/riscv/mp_machdep.c Thu Nov 1 22:13:22 2018 (r340027) +++ head/sys/riscv/riscv/mp_machdep.c Thu Nov 1 22:15:25 2018 (r340028) @@ -181,7 +181,7 @@ riscv64_cpu_attach(device_t dev) static void release_aps(void *dummy __unused) { - uintptr_t mask; + u_long mask; int cpu, i; if (mp_ncpus == 1) From owner-svn-src-head@freebsd.org Thu Nov 1 22:17:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E36610DAFD2; Thu, 1 Nov 2018 22:17:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBC378F33F; Thu, 1 Nov 2018 22:17:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACCDC21CE0; Thu, 1 Nov 2018 22:17:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA1MHpO7033730; Thu, 1 Nov 2018 22:17:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1MHpB7033729; Thu, 1 Nov 2018 22:17:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811012217.wA1MHpB7033729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Nov 2018 22:17:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340029 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 340029 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 22:17:52 -0000 Author: jhb Date: Thu Nov 1 22:17:51 2018 New Revision: 340029 URL: https://svnweb.freebsd.org/changeset/base/340029 Log: Set PTE_A and PTE_D for user mappings in pmap_enter(). This assumes that an access according to the prot in 'flags' triggered a fault and is going to be retried after the fault returns, so the two flags are set preemptively to avoid refaulting on the retry. While here, only bother setting PTE_D for kernel mappings in pmap_enter for writable mappings. Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17782 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Thu Nov 1 22:15:25 2018 (r340028) +++ head/sys/riscv/riscv/pmap.c Thu Nov 1 22:17:51 2018 (r340029) @@ -2088,13 +2088,15 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v pa = VM_PAGE_TO_PHYS(m); pn = (pa / PAGE_SIZE); - new_l3 = PTE_V | PTE_R | PTE_X; + new_l3 = PTE_V | PTE_R | PTE_X | PTE_A; + if (flags & VM_PROT_WRITE) + new_l3 |= PTE_D; if (prot & VM_PROT_WRITE) new_l3 |= PTE_W; if ((va >> 63) == 0) new_l3 |= PTE_U; - else - new_l3 |= PTE_A | PTE_D; + else if (prot & VM_PROT_WRITE) + new_l3 |= PTE_D; new_l3 |= (pn << PTE_PPN0_S); if ((flags & PMAP_ENTER_WIRED) != 0) From owner-svn-src-head@freebsd.org Thu Nov 1 22:23:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59EE610DB29D; Thu, 1 Nov 2018 22:23:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B48B8F78E; Thu, 1 Nov 2018 22:23:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E079121E7F; Thu, 1 Nov 2018 22:23:16 +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 wA1MNGrV038655; Thu, 1 Nov 2018 22:23:16 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1MNGHF038652; Thu, 1 Nov 2018 22:23:16 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811012223.wA1MNGHF038652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Nov 2018 22:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340030 - in head/sys/riscv: include riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/riscv: include riscv X-SVN-Commit-Revision: 340030 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 22:23:17 -0000 Author: jhb Date: Thu Nov 1 22:23:15 2018 New Revision: 340030 URL: https://svnweb.freebsd.org/changeset/base/340030 Log: Restrict setting PTE execute permissions on RISC-V. Previously, RISC-V was enabling execute permissions in PTEs for any readable page. Now, execute permissions are only enabled if they were explicitly specified (e.g. via PROT_EXEC to mmap). The one exception is that the initial kernel mapping in locore still maps all of the kernel RWX. While here, change the fault type passed to vm_fault and pmap_fault_fixup to only include a single VM_PROT_* value representing the faulting access to match other architectures rather than passing a bitmask. Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17783 Modified: head/sys/riscv/include/pte.h head/sys/riscv/riscv/locore.S head/sys/riscv/riscv/pmap.c head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/include/pte.h ============================================================================== --- head/sys/riscv/include/pte.h Thu Nov 1 22:17:51 2018 (r340029) +++ head/sys/riscv/include/pte.h Thu Nov 1 22:23:15 2018 (r340030) @@ -78,7 +78,7 @@ typedef uint64_t pn_t; /* page number */ #define PTE_V (1 << 0) /* Valid */ #define PTE_RWX (PTE_R | PTE_W | PTE_X) #define PTE_RX (PTE_R | PTE_X) -#define PTE_KERN (PTE_V | PTE_RWX | PTE_A | PTE_D) +#define PTE_KERN (PTE_V | PTE_R | PTE_W | PTE_A | PTE_D) #define PTE_PPN0_S 10 #define PTE_PPN1_S 19 Modified: head/sys/riscv/riscv/locore.S ============================================================================== --- head/sys/riscv/riscv/locore.S Thu Nov 1 22:17:51 2018 (r340029) +++ head/sys/riscv/riscv/locore.S Thu Nov 1 22:23:15 2018 (r340030) @@ -94,7 +94,7 @@ _start: add t3, t4, t2 li t5, 0 2: - li t0, (PTE_KERN) + li t0, (PTE_KERN | PTE_X) slli t2, t4, PTE_PPN1_S /* << PTE_PPN1_S */ or t5, t0, t2 sd t5, (s1) /* Store PTE entry to position */ Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Thu Nov 1 22:17:51 2018 (r340029) +++ head/sys/riscv/riscv/pmap.c Thu Nov 1 22:23:15 2018 (r340030) @@ -2010,7 +2010,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t } int -pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_t prot) +pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_t ftype) { pt_entry_t orig_l3; pt_entry_t new_l3; @@ -2027,12 +2027,13 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_ orig_l3 = pmap_load(l3); if ((orig_l3 & PTE_V) == 0 || - ((prot & VM_PROT_WRITE) != 0 && (orig_l3 & PTE_W) == 0) || - ((prot & VM_PROT_READ) != 0 && (orig_l3 & PTE_R) == 0)) + (ftype == VM_PROT_WRITE && (orig_l3 & PTE_W) == 0) || + (ftype == VM_PROT_EXECUTE && (orig_l3 & PTE_X) == 0) || + (ftype == VM_PROT_READ && (orig_l3 & PTE_R) == 0)) goto done; new_l3 = orig_l3 | PTE_A; - if ((prot & VM_PROT_WRITE) != 0) + if (ftype == VM_PROT_WRITE) new_l3 |= PTE_D; if (orig_l3 != new_l3) { @@ -2088,7 +2089,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v pa = VM_PAGE_TO_PHYS(m); pn = (pa / PAGE_SIZE); - new_l3 = PTE_V | PTE_R | PTE_X | PTE_A; + new_l3 = PTE_V | PTE_R | PTE_A; + if (prot & VM_PROT_EXECUTE) + new_l3 |= PTE_X; if (flags & VM_PROT_WRITE) new_l3 |= PTE_D; if (prot & VM_PROT_WRITE) @@ -2464,7 +2467,9 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v pa = VM_PAGE_TO_PHYS(m); pn = (pa / PAGE_SIZE); - entry = (PTE_V | PTE_R | PTE_X); + entry = PTE_V | PTE_R; + if (prot & VM_PROT_EXECUTE) + entry |= PTE_X; entry |= (pn << PTE_PPN0_S); /* Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Thu Nov 1 22:17:51 2018 (r340029) +++ head/sys/riscv/riscv/trap.c Thu Nov 1 22:23:15 2018 (r340030) @@ -207,9 +207,11 @@ data_abort(struct trapframe *frame, int lower) if ((frame->tf_scause == EXCP_FAULT_STORE) || (frame->tf_scause == EXCP_STORE_PAGE_FAULT)) { - ftype = (VM_PROT_READ | VM_PROT_WRITE); + ftype = VM_PROT_WRITE; + } else if (frame->tf_scause == EXCP_INST_PAGE_FAULT) { + ftype = VM_PROT_EXECUTE; } else { - ftype = (VM_PROT_READ); + ftype = VM_PROT_READ; } if (pmap_fault_fixup(map->pmap, va, ftype)) From owner-svn-src-head@freebsd.org Thu Nov 1 22:50:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81BA010DBA03; Thu, 1 Nov 2018 22:50:51 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37C2C69B29; Thu, 1 Nov 2018 22:50:51 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18D9522208; Thu, 1 Nov 2018 22:50:51 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA1MooJK049235; Thu, 1 Nov 2018 22:50:50 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1MooQP049234; Thu, 1 Nov 2018 22:50:50 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201811012250.wA1MooQP049234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Thu, 1 Nov 2018 22:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340031 - head/contrib/smbfs/mount_smbfs X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/contrib/smbfs/mount_smbfs X-SVN-Commit-Revision: 340031 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 22:50:51 -0000 Author: 0mp (ports committer) Date: Thu Nov 1 22:50:50 2018 New Revision: 340031 URL: https://svnweb.freebsd.org/changeset/base/340031 Log: mount_smbfs(8): Mention /etc/nsmb.conf, smbutil(1) and nsmb.conf(5) Reviewed by: bcr Approved by: krion (mentor, implicit), mat (mentor, implicit) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D17808 Modified: head/contrib/smbfs/mount_smbfs/mount_smbfs.8 Modified: head/contrib/smbfs/mount_smbfs/mount_smbfs.8 ============================================================================== --- head/contrib/smbfs/mount_smbfs/mount_smbfs.8 Thu Nov 1 22:23:15 2018 (r340030) +++ head/contrib/smbfs/mount_smbfs/mount_smbfs.8 Thu Nov 1 22:50:50 2018 (r340031) @@ -136,12 +136,14 @@ are 137. Path to mount point. .El .Sh FILES -.Bl -tag -width ".Pa ~/.nsmbrc" -compact +.Bl -tag -width ".Pa /etc/nsmb.conf" -compact .It Pa ~/.nsmbrc -Keeps static parameters for connections and other information. +Keeps user-specific static parameters for connections and other information. See .Pa /usr/share/examples/smbfs/dot.nsmbrc for details. +.It Pa /etc/nsmb.conf +Keeps system-wide static parameters for connections and other information. .El .Sh EXAMPLES The following example illustrates how to connect to SMB server @@ -163,7 +165,11 @@ for smbfs mounts (the example below does not prompt fo .Pp .Dl "//guest@samba/public /smb/public smbfs rw,noauto,-N 0 0" .Sh SEE ALSO -.Bl -dash +.Xr smbutil 1 , +.Xr nsmb.conf 5 +.Pp +Other resources: +.Bl -dash -compact .It Chapter dedicated to Samba configuration in the .Fx From owner-svn-src-head@freebsd.org Thu Nov 1 22:54:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68A1210DBECE; Thu, 1 Nov 2018 22:54:53 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E7806A0BF; Thu, 1 Nov 2018 22:54:53 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF60522392; Thu, 1 Nov 2018 22:54:52 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA1MsqsN054070; Thu, 1 Nov 2018 22:54:52 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1Msqsf054069; Thu, 1 Nov 2018 22:54:52 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201811012254.wA1Msqsf054069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Thu, 1 Nov 2018 22:54:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340032 - head/contrib/smbfs/smbutil X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/contrib/smbfs/smbutil X-SVN-Commit-Revision: 340032 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 22:54:53 -0000 Author: 0mp (ports committer) Date: Thu Nov 1 22:54:52 2018 New Revision: 340032 URL: https://svnweb.freebsd.org/changeset/base/340032 Log: smbutil(1): Reference nsmb.conf(5) and mount_smbfs(8) Reviewed by: bcr Approved by: krion (mentor, implicit), mat (mentor, implicit) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D17809 Modified: head/contrib/smbfs/smbutil/smbutil.1 Modified: head/contrib/smbfs/smbutil/smbutil.1 ============================================================================== --- head/contrib/smbfs/smbutil/smbutil.1 Thu Nov 1 22:50:50 2018 (r340031) +++ head/contrib/smbfs/smbutil/smbutil.1 Thu Nov 1 22:54:52 2018 (r340032) @@ -1,5 +1,5 @@ .\" $Id: smbutil.1,v 1.5 2002/04/16 02:48:16 bp Exp $ -.Dd February 14, 2000 +.Dd November 1, 2018 .Dt SMBUTIL 1 .Os .Sh NAME @@ -127,6 +127,9 @@ See .Pa ./examples/dot.nsmbrc for details. .El +.Sh SEE ALSO +.Xr nsmb.conf 5 , +.Xr mount_smbfs 8 .Sh AUTHORS .An Boris Popov Aq bp@butya.kz , .Aq bp@FreeBSD.org From owner-svn-src-head@freebsd.org Thu Nov 1 23:01:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93E5810DC1A7; Thu, 1 Nov 2018 23:01:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ABC26A3C3; Thu, 1 Nov 2018 23:01:25 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D110223EF; Thu, 1 Nov 2018 23:01:25 +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 wA1N1PTq058067; Thu, 1 Nov 2018 23:01:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1N1PWO058066; Thu, 1 Nov 2018 23:01:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811012301.wA1N1PWO058066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 1 Nov 2018 23:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340033 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 340033 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 23:01:25 -0000 Author: emaste Date: Thu Nov 1 23:01:24 2018 New Revision: 340033 URL: https://svnweb.freebsd.org/changeset/base/340033 Log: style: remove "All rights reserved" from comment imp removed it from the template in r333391, so remove it from the example license header in style.9 as well. Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/style.9 Modified: head/share/man/man9/style.9 ============================================================================== --- head/share/man/man9/style.9 Thu Nov 1 22:54:52 2018 (r340032) +++ head/share/man/man9/style.9 Thu Nov 1 23:01:24 2018 (r340033) @@ -26,7 +26,7 @@ .\" From: @(#)style 1.14 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd January 25, 2018 +.Dd November 1, 2018 .Dt STYLE 9 .Os .Sh NAME @@ -68,7 +68,6 @@ line of the comment having a dash after the star like * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1984-2025 John Q. Public - * All rights reserved. * * Long, boring license goes here, but trimmed for brevity */ From owner-svn-src-head@freebsd.org Thu Nov 1 23:06:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 945CE10DC2F4; Thu, 1 Nov 2018 23:06:51 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ADDA6A89E; Thu, 1 Nov 2018 23:06:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2809622545; Thu, 1 Nov 2018 23:06:51 +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 wA1N6oBf059105; Thu, 1 Nov 2018 23:06:50 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1N6oKi059102; Thu, 1 Nov 2018 23:06:50 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201811012306.wA1N6oKi059102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 1 Nov 2018 23:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340034 - in head/sys: compat/freebsd32 kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 340034 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 23:06:51 -0000 Author: brooks Date: Thu Nov 1 23:06:50 2018 New Revision: 340034 URL: https://svnweb.freebsd.org/changeset/base/340034 Log: Use mode_t when the documented signature does. This is more clear and produces better results when generating function stubs from syscalls.master. Reviewed by: kib, emaste Obtained from: CheribSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17784 Modified: head/sys/compat/freebsd32/syscalls.master head/sys/kern/syscalls.master Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Thu Nov 1 23:01:24 2018 (r340033) +++ head/sys/compat/freebsd32/syscalls.master Thu Nov 1 23:06:50 2018 (r340034) @@ -73,7 +73,7 @@ 4 AUE_WRITE NOPROTO { ssize_t write(int fd, const void *buf, \ size_t nbyte); } 5 AUE_OPEN_RWTC NOPROTO { int open(char *path, int flags, \ - int mode); } + mode_t mode); } 6 AUE_CLOSE NOPROTO { int close(int fd); } 7 AUE_WAIT4 STD { int freebsd32_wait4(int pid, int *status, \ int options, struct rusage32 *rusage); } @@ -85,7 +85,7 @@ 13 AUE_FCHDIR NOPROTO { int fchdir(int fd); } 14 AUE_MKNOD COMPAT11 { int freebsd32_mknod(char *path, \ int mode, int dev); } -15 AUE_CHMOD NOPROTO { int chmod(char *path, int mode); } +15 AUE_CHMOD NOPROTO { int chmod(char *path, mode_t mode); } 16 AUE_CHOWN NOPROTO { int chown(char *path, int uid, int gid); } 17 AUE_NULL NOPROTO { caddr_t break(char *nsize); } 18 AUE_GETFSSTAT COMPAT4 { int freebsd32_getfsstat( \ @@ -155,7 +155,7 @@ size_t count); } 59 AUE_EXECVE STD { int freebsd32_execve(char *fname, \ uint32_t *argv, uint32_t *envv); } -60 AUE_UMASK NOPROTO { int umask(int newmask); } +60 AUE_UMASK NOPROTO { int umask(mode_t newmask); } 61 AUE_CHROOT NOPROTO { int chroot(char *path); } 62 AUE_FSTAT COMPAT { int freebsd32_fstat(int fd, \ struct ostat32 *ub); } @@ -253,7 +253,7 @@ struct timeval32 *tv, \ struct timezone *tzp); } 123 AUE_FCHOWN NOPROTO { int fchown(int fd, int uid, int gid); } -124 AUE_FCHMOD NOPROTO { int fchmod(int fd, int mode); } +124 AUE_FCHMOD NOPROTO { int fchmod(int fd, mode_t mode); } 125 AUE_RECVFROM OBSOL orecvfrom 126 AUE_SETREUID NOPROTO { int setreuid(int ruid, int euid); } 127 AUE_SETREGID NOPROTO { int setregid(int rgid, int egid); } @@ -262,14 +262,14 @@ int length); } 130 AUE_FTRUNCATE COMPAT|NOPROTO { int ftruncate(int fd, int length); } 131 AUE_FLOCK NOPROTO { int flock(int fd, int how); } -132 AUE_MKFIFO NOPROTO { int mkfifo(char *path, int mode); } +132 AUE_MKFIFO NOPROTO { int mkfifo(char *path, mode_t mode); } 133 AUE_SENDTO NOPROTO { int sendto(int s, caddr_t buf, \ size_t len, int flags, caddr_t to, \ int tolen); } 134 AUE_SHUTDOWN NOPROTO { int shutdown(int s, int how); } 135 AUE_SOCKETPAIR NOPROTO { int socketpair(int domain, int type, \ int protocol, int *rsv); } -136 AUE_MKDIR NOPROTO { int mkdir(char *path, int mode); } +136 AUE_MKDIR NOPROTO { int mkdir(char *path, mode_t mode); } 137 AUE_RMDIR NOPROTO { int rmdir(char *path); } 138 AUE_UTIMES STD { int freebsd32_utimes(char *path, \ struct timeval32 *tptr); } Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Thu Nov 1 23:01:24 2018 (r340033) +++ head/sys/kern/syscalls.master Thu Nov 1 23:06:50 2018 (r340034) @@ -113,7 +113,7 @@ int open( _In_z_ char *path, int flags, - int mode + mode_t mode ); } ; XXX should be { int open(const char *path, int flags, ...); } @@ -170,7 +170,7 @@ 15 AUE_CHMOD STD { int chmod( _In_z_ char *path, - int mode + mode_t mode ); } 16 AUE_CHOWN STD { @@ -433,7 +433,7 @@ } 60 AUE_UMASK STD { int umask( - int newmask + mode_t newmask ); } 61 AUE_CHROOT STD { @@ -788,7 +788,7 @@ 124 AUE_FCHMOD STD { int fchmod( int fd, - int mode + mode_t mode ); } 125 AUE_RECVFROM COMPAT|NOARGS { @@ -840,7 +840,7 @@ 132 AUE_MKFIFO STD { int mkfifo( _In_z_ char *path, - int mode + mode_t mode ); } 133 AUE_SENDTO STD { @@ -870,7 +870,7 @@ 136 AUE_MKDIR STD { int mkdir( _In_z_ char *path, - int mode + mode_t mode ); } 137 AUE_RMDIR STD { From owner-svn-src-head@freebsd.org Thu Nov 1 23:10:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C894910DC525; Thu, 1 Nov 2018 23:10:54 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EBD36AD15; Thu, 1 Nov 2018 23:10:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FCF42256A; Thu, 1 Nov 2018 23:10:54 +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 wA1NAs2F059416; Thu, 1 Nov 2018 23:10:54 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1NArnb059413; Thu, 1 Nov 2018 23:10:53 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201811012310.wA1NArnb059413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 1 Nov 2018 23:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340035 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern sys X-SVN-Commit-Revision: 340035 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 23:10:55 -0000 Author: brooks Date: Thu Nov 1 23:10:53 2018 New Revision: 340035 URL: https://svnweb.freebsd.org/changeset/base/340035 Log: Regent after r340034: Use mode_t when the documented signature does. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17784 Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/systrace_args.c head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Nov 1 23:06:50 2018 (r340034) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Nov 1 23:10:53 2018 (r340035) @@ -54,7 +54,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg struct open_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ iarg[1] = p->flags; /* int */ - iarg[2] = p->mode; /* int */ + iarg[2] = p->mode; /* mode_t */ *n_args = 3; break; } @@ -108,7 +108,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 15: { struct chmod_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ - iarg[1] = p->mode; /* int */ + iarg[1] = p->mode; /* mode_t */ *n_args = 2; break; } @@ -396,7 +396,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* umask */ case 60: { struct umask_args *p = params; - iarg[0] = p->newmask; /* int */ + iarg[0] = p->newmask; /* mode_t */ *n_args = 1; break; } @@ -692,7 +692,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 124: { struct fchmod_args *p = params; iarg[0] = p->fd; /* int */ - iarg[1] = p->mode; /* int */ + iarg[1] = p->mode; /* mode_t */ *n_args = 2; break; } @@ -732,7 +732,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 132: { struct mkfifo_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ - iarg[1] = p->mode; /* int */ + iarg[1] = p->mode; /* mode_t */ *n_args = 2; break; } @@ -770,7 +770,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 136: { struct mkdir_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ - iarg[1] = p->mode; /* int */ + iarg[1] = p->mode; /* mode_t */ *n_args = 2; break; } @@ -3329,7 +3329,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "int"; break; case 2: - p = "int"; + p = "mode_t"; break; default: break; @@ -3414,7 +3414,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "userland char *"; break; case 1: - p = "int"; + p = "mode_t"; break; default: break; @@ -3864,7 +3864,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 60: switch(ndx) { case 0: - p = "int"; + p = "mode_t"; break; default: break; @@ -4353,7 +4353,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "int"; break; case 1: - p = "int"; + p = "mode_t"; break; default: break; @@ -4418,7 +4418,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "userland char *"; break; case 1: - p = "int"; + p = "mode_t"; break; default: break; @@ -4488,7 +4488,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "userland char *"; break; case 1: - p = "int"; + p = "mode_t"; break; default: break; Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Thu Nov 1 23:06:50 2018 (r340034) +++ head/sys/kern/systrace_args.c Thu Nov 1 23:10:53 2018 (r340035) @@ -51,7 +51,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg struct open_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ iarg[1] = p->flags; /* int */ - iarg[2] = p->mode; /* int */ + iarg[2] = p->mode; /* mode_t */ *n_args = 3; break; } @@ -105,7 +105,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 15: { struct chmod_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ - iarg[1] = p->mode; /* int */ + iarg[1] = p->mode; /* mode_t */ *n_args = 2; break; } @@ -393,7 +393,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* umask */ case 60: { struct umask_args *p = params; - iarg[0] = p->newmask; /* int */ + iarg[0] = p->newmask; /* mode_t */ *n_args = 1; break; } @@ -689,7 +689,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 124: { struct fchmod_args *p = params; iarg[0] = p->fd; /* int */ - iarg[1] = p->mode; /* int */ + iarg[1] = p->mode; /* mode_t */ *n_args = 2; break; } @@ -729,7 +729,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 132: { struct mkfifo_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ - iarg[1] = p->mode; /* int */ + iarg[1] = p->mode; /* mode_t */ *n_args = 2; break; } @@ -767,7 +767,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 136: { struct mkdir_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ - iarg[1] = p->mode; /* int */ + iarg[1] = p->mode; /* mode_t */ *n_args = 2; break; } @@ -3334,7 +3334,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "int"; break; case 2: - p = "int"; + p = "mode_t"; break; default: break; @@ -3419,7 +3419,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "userland char *"; break; case 1: - p = "int"; + p = "mode_t"; break; default: break; @@ -3869,7 +3869,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 60: switch(ndx) { case 0: - p = "int"; + p = "mode_t"; break; default: break; @@ -4358,7 +4358,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "int"; break; case 1: - p = "int"; + p = "mode_t"; break; default: break; @@ -4423,7 +4423,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "userland char *"; break; case 1: - p = "int"; + p = "mode_t"; break; default: break; @@ -4493,7 +4493,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "userland char *"; break; case 1: - p = "int"; + p = "mode_t"; break; default: break; Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Thu Nov 1 23:06:50 2018 (r340034) +++ head/sys/sys/sysproto.h Thu Nov 1 23:10:53 2018 (r340035) @@ -56,7 +56,7 @@ struct write_args { struct open_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; - char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; + char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)]; }; struct close_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; @@ -82,7 +82,7 @@ struct fchdir_args { }; struct chmod_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; + char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)]; }; struct chown_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; @@ -242,7 +242,7 @@ struct execve_args { char envv_l_[PADL_(char **)]; char ** envv; char envv_r_[PADR_(char **)]; }; struct umask_args { - char newmask_l_[PADL_(int)]; int newmask; char newmask_r_[PADR_(int)]; + char newmask_l_[PADL_(mode_t)]; mode_t newmask; char newmask_r_[PADR_(mode_t)]; }; struct chroot_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; @@ -406,7 +406,7 @@ struct fchown_args { }; struct fchmod_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; + char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)]; }; struct setreuid_args { char ruid_l_[PADL_(int)]; int ruid; char ruid_r_[PADR_(int)]; @@ -426,7 +426,7 @@ struct flock_args { }; struct mkfifo_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; + char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)]; }; struct sendto_args { char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; @@ -448,7 +448,7 @@ struct socketpair_args { }; struct mkdir_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; + char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)]; }; struct rmdir_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; From owner-svn-src-head@freebsd.org Thu Nov 1 23:11:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A47B10DC5C8; Thu, 1 Nov 2018 23:11:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E53826AF0A; Thu, 1 Nov 2018 23:11:48 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5DDC226B8; Thu, 1 Nov 2018 23:11:48 +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 wA1NBm8R062648; Thu, 1 Nov 2018 23:11:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1NBm4U062644; Thu, 1 Nov 2018 23:11:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811012311.wA1NBm4U062644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 1 Nov 2018 23:11:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340036 - in head/sys: conf modules/bios/smapi X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: conf modules/bios/smapi X-SVN-Commit-Revision: 340036 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 23:11:49 -0000 Author: emaste Date: Thu Nov 1 23:11:47 2018 New Revision: 340036 URL: https://svnweb.freebsd.org/changeset/base/340036 Log: Retire CLANG_NO_IAS34 CLANG_NO_IAS34 was introduced in r276696 to allow then-HEAD kernels to be built with clang 3.4 in FreeBSD 10. As FreeBSD 11 and later includes a version of Clang with a sufficiently capable integrated assembler we do not need the workaround any longer. Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/Makefile.amd64 head/sys/conf/Makefile.i386 head/sys/conf/kern.mk head/sys/modules/bios/smapi/Makefile Modified: head/sys/conf/Makefile.amd64 ============================================================================== --- head/sys/conf/Makefile.amd64 Thu Nov 1 23:10:53 2018 (r340035) +++ head/sys/conf/Makefile.amd64 Thu Nov 1 23:11:47 2018 (r340036) @@ -37,9 +37,6 @@ INCLUDES+= -I$S/contrib/libfdt CFLAGS+= -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer .endif -ASM_CFLAGS.acpi_wakecode.S= ${CLANG_NO_IAS34} -ASM_CFLAGS.mpboot.S= ${CLANG_NO_IAS34} - %BEFORE_DEPEND %OBJS Modified: head/sys/conf/Makefile.i386 ============================================================================== --- head/sys/conf/Makefile.i386 Thu Nov 1 23:10:53 2018 (r340035) +++ head/sys/conf/Makefile.i386 Thu Nov 1 23:11:47 2018 (r340036) @@ -32,9 +32,6 @@ S= ../../.. INCLUDES+= -I$S/contrib/libfdt -ASM_CFLAGS.acpi_wakecode.S= ${CLANG_NO_IAS34} -ASM_CFLAGS.mpboot.s= ${CLANG_NO_IAS34} - %BEFORE_DEPEND %OBJS Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Thu Nov 1 23:10:53 2018 (r340035) +++ head/sys/conf/kern.mk Thu Nov 1 23:11:47 2018 (r340036) @@ -39,10 +39,6 @@ CWARNEXTRA+= -Wno-address-of-packed-member .endif CLANG_NO_IAS= -no-integrated-as -.if ${COMPILER_VERSION} < 30500 -# XXX: clang < 3.5 integrated-as doesn't grok .codeNN directives -CLANG_NO_IAS34= -no-integrated-as -.endif .endif .if ${COMPILER_TYPE} == "gcc" Modified: head/sys/modules/bios/smapi/Makefile ============================================================================== --- head/sys/modules/bios/smapi/Makefile Thu Nov 1 23:10:53 2018 (r340035) +++ head/sys/modules/bios/smapi/Makefile Thu Nov 1 23:11:47 2018 (r340036) @@ -8,5 +8,3 @@ SRCS= smapi.c smapi_bios.S \ bus_if.h device_if.h .include - -CFLAGS.smapi_bios.S= ${CLANG_NO_IAS34} From owner-svn-src-head@freebsd.org Thu Nov 1 23:42:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BC0910DD200; Thu, 1 Nov 2018 23:42:37 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1C7C6BE09; Thu, 1 Nov 2018 23:42:36 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A196122BC6; Thu, 1 Nov 2018 23:42:36 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA1NgauX079618; Thu, 1 Nov 2018 23:42:36 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1NgZPh079612; Thu, 1 Nov 2018 23:42:35 GMT (envelope-from des@FreeBSD.org) Message-Id: <201811012342.wA1NgZPh079612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Thu, 1 Nov 2018 23:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340037 - in head/contrib/unbound: . util X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: in head/contrib/unbound: . util X-SVN-Commit-Revision: 340037 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 23:42:37 -0000 Author: des Date: Thu Nov 1 23:42:35 2018 New Revision: 340037 URL: https://svnweb.freebsd.org/changeset/base/340037 Log: Merge upstream r4932: turn so-reuseport option off by default. MFC after: 3 days Modified: head/contrib/unbound/config.h head/contrib/unbound/config.h.in head/contrib/unbound/configure head/contrib/unbound/configure.ac head/contrib/unbound/util/config_file.c Directory Properties: head/contrib/unbound/ (props changed) Modified: head/contrib/unbound/config.h ============================================================================== --- head/contrib/unbound/config.h Thu Nov 1 23:11:47 2018 (r340036) +++ head/contrib/unbound/config.h Thu Nov 1 23:42:35 2018 (r340037) @@ -664,6 +664,9 @@ /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void +/* if REUSEPORT is enabled by default */ +#define REUSEPORT_DEFAULT 0 + /* default rootkey location */ #define ROOT_ANCHOR_FILE "/var/unbound/root.key" Modified: head/contrib/unbound/config.h.in ============================================================================== --- head/contrib/unbound/config.h.in Thu Nov 1 23:11:47 2018 (r340036) +++ head/contrib/unbound/config.h.in Thu Nov 1 23:42:35 2018 (r340037) @@ -663,6 +663,9 @@ /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE +/* if REUSEPORT is enabled by default */ +#undef REUSEPORT_DEFAULT + /* default rootkey location */ #undef ROOT_ANCHOR_FILE Modified: head/contrib/unbound/configure ============================================================================== --- head/contrib/unbound/configure Thu Nov 1 23:11:47 2018 (r340036) +++ head/contrib/unbound/configure Thu Nov 1 23:42:35 2018 (r340037) @@ -15966,6 +15966,17 @@ fi done +# check if we can use SO_REUSEPORT +if echo "$host" | grep -i -e linux -e dragonfly >/dev/null; then + +$as_echo "#define REUSEPORT_DEFAULT 1" >>confdefs.h + +else + +$as_echo "#define REUSEPORT_DEFAULT 0" >>confdefs.h + +fi + # set memory allocation checking if requested # Check whether --enable-alloc-checks was given. if test "${enable_alloc_checks+set}" = set; then : Modified: head/contrib/unbound/configure.ac ============================================================================== --- head/contrib/unbound/configure.ac Thu Nov 1 23:11:47 2018 (r340036) +++ head/contrib/unbound/configure.ac Thu Nov 1 23:42:35 2018 (r340037) @@ -461,6 +461,13 @@ ACX_CHECK_NONBLOCKING_BROKEN ACX_MKDIR_ONE_ARG AC_CHECK_FUNCS([strptime],[AC_CHECK_STRPTIME_WORKS],[AC_LIBOBJ([strptime])]) +# check if we can use SO_REUSEPORT +if echo "$host" | grep -i -e linux -e dragonfly >/dev/null; then + AC_DEFINE(REUSEPORT_DEFAULT, 1, [if REUSEPORT is enabled by default]) +else + AC_DEFINE(REUSEPORT_DEFAULT, 0, [if REUSEPORT is enabled by default]) +fi + # set memory allocation checking if requested AC_ARG_ENABLE(alloc-checks, AC_HELP_STRING([--enable-alloc-checks], [ enable to memory allocation statistics, for debug purposes ]), Modified: head/contrib/unbound/util/config_file.c ============================================================================== --- head/contrib/unbound/util/config_file.c Thu Nov 1 23:11:47 2018 (r340036) +++ head/contrib/unbound/util/config_file.c Thu Nov 1 23:42:35 2018 (r340037) @@ -177,7 +177,7 @@ config_create(void) cfg->if_automatic = 0; cfg->so_rcvbuf = 0; cfg->so_sndbuf = 0; - cfg->so_reuseport = 1; + cfg->so_reuseport = REUSEPORT_DEFAULT; cfg->ip_transparent = 0; cfg->ip_freebind = 0; cfg->num_ifs = 0; From owner-svn-src-head@freebsd.org Thu Nov 1 23:46:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F61B10DD316; Thu, 1 Nov 2018 23:46:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FE176C087; Thu, 1 Nov 2018 23:46:24 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FAC322BCB; Thu, 1 Nov 2018 23:46:24 +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 wA1NkN84079847; Thu, 1 Nov 2018 23:46:23 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1NkNS5079845; Thu, 1 Nov 2018 23:46:23 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201811012346.wA1NkNS5079845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 1 Nov 2018 23:46:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340038 - in head: lib/libc/sys sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: lib/libc/sys sys/kern X-SVN-Commit-Revision: 340038 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 23:46:24 -0000 Author: cem Date: Thu Nov 1 23:46:23 2018 New Revision: 340038 URL: https://svnweb.freebsd.org/changeset/base/340038 Log: kern_poll: Restore explanatory comment removed in r177374 The comment isn't stale. The check is bogus in the sense that poll(2) does not require pollfd entries to be unique in fd space, so there is no reason there cannot be more pollfd entries than open or even allowed fds. The check is mostly a seatbelt against accidental misuse or abuse. FD_SETSIZE, while usually unrelated to poll, is used as an arbitrary floor for systems with very low kern.maxfilesperproc. Additionally, document this possible EINVAL condition in the poll.2 manual. No functional change. Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D17671 Modified: head/lib/libc/sys/poll.2 head/sys/kern/sys_generic.c Modified: head/lib/libc/sys/poll.2 ============================================================================== --- head/lib/libc/sys/poll.2 Thu Nov 1 23:42:35 2018 (r340037) +++ head/lib/libc/sys/poll.2 Thu Nov 1 23:46:23 2018 (r340038) @@ -28,7 +28,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 13, 2014 +.Dd November 1, 2018 .Dt POLL 2 .Os .Sh NAME @@ -232,7 +232,15 @@ points outside the process's allocated address space. A signal was delivered before the time limit expired and before any of the selected events occurred. .It Bq Er EINVAL -The specified time limit is invalid. One of its components is negative or too large. +The specified time limit is invalid. +One of its components is negative or too large. +.It Bq Er EINVAL +The number of pollfd structures specified by +.Fa nfds +exceeds the system tunable +.Va kern.maxfilesperproc +and +.Dv FD_SETSIZE . .El .Sh SEE ALSO .Xr accept 2 , Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Thu Nov 1 23:42:35 2018 (r340037) +++ head/sys/kern/sys_generic.c Thu Nov 1 23:46:23 2018 (r340038) @@ -1339,6 +1339,13 @@ kern_poll(struct thread *td, struct pollfd *ufds, u_in } else sbt = -1; + /* + * This is kinda bogus. We have fd limits, but that is not + * really related to the size of the pollfd array. Make sure + * we let the process use at least FD_SETSIZE entries and at + * least enough for the system-wide limits. We want to be reasonably + * safe, but not overly restrictive. + */ if (nfds > maxfilesperproc && nfds > FD_SETSIZE) return (EINVAL); if (nfds > nitems(stackfds)) From owner-svn-src-head@freebsd.org Fri Nov 2 00:41:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29ABA10DEE61 for ; Fri, 2 Nov 2018 00:41:14 +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 904556E745 for ; Fri, 2 Nov 2018 00:41:13 +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 wA20f15W006120 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 2 Nov 2018 02:41:04 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wA20f15W006120 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wA20f1T0006119; Fri, 2 Nov 2018 02:41:01 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 2 Nov 2018 02:41:01 +0200 From: Konstantin Belousov To: Mark Millard Cc: svn-src-head@freebsd.org Subject: Re: svn commit: r339876 - head/libexec/rtld-elf Message-ID: <20181102004101.GI5335@kib.kiev.ua> References: <8E5A5F3A-F1A7-4702-A2F7-65D74CC5B2E5@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8E5A5F3A-F1A7-4702-A2F7-65D74CC5B2E5@yahoo.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 00:41:14 -0000 On Tue, Oct 30, 2018 at 12:45:13PM -0700, Mark Millard wrote: > Konstantin Belousov kostikbel at gmail.com wrote on > Tue Oct 30 18:04:04 UTC 2018 : > > > On Tue, Oct 30, 2018 at 03:32:40PM +0000, Alexander Richardson wrote: > > > On Tue, 30 Oct 2018 at 10:17, Michael Tuexen > > > wrote: > > > > > > > > > On 29. Oct 2018, at 22:08, Alex Richardson wrote: > > > > > > > > > > Author: arichardson > > > > > Date: Mon Oct 29 21:08:02 2018 > > > > > New Revision: 339876 > > > > > URL: https://svnweb.freebsd.org/changeset/base/339876 > > > > > > > > > > Log: > > > > > rtld: set obj->textsize correctly > > > > > > > > > > With lld-generated binaries the first PT_LOAD will usually be a read-only > > > > > segment unless you pass --no-rosegment. For those binaries the textsize is > > > > > determined by the next PT_LOAD. To allow both LLD and bfd 2.17 binaries to > > > > > be parsed correctly use the end of the last PT_LOAD that is marked as > > > > > executable instead. > > > > > > > > > > I noticed that the value was wrong while adding some debug prints for some rtld > > > > > changes for CHERI binaries. `obj->textsize` only seems to be used by PPC so the > > > > > effect is untested. However, the value before was definitely wrong and the new > > > > > result matches the phdrs. > > > > I build kernel and world with a revision later than this on a PPC. Buildword > > > > ends up with a world where almost all binaries are segfaulting.... Especially gdb > > > > (but svn, ls or so all segfault). > > > > > > > > Best regards > > > > Michael > > > > > > This is rather surprising since if anything the range of the icache > > > flush should increase rather than decrease after this change. > > > > > > I can only see this causing a behaviour change if we actually need to > > > flush more than just the executable segments. > > > Is it possible that some binary/library contains a non-executable > > > segment as the first PT_LOAD? > > > Or is there some linker script that adds custom PHDRS? > > > > > Could it be that there is a hole between start of the object mapping and > > the last PT_LOADable segment eligible for execution ? > > [This note may be easier to deal with than the first > note that I sent out.] > > [My examples are from devel/powerpc64-xtoolchain-gcc used > to buildworld buildkernel targeting a head -r339076 based > powerpc64 environment. I do that on powerpc64 as well.] > > powerpc64 loads the readonly data and the readonly code in one PT_LOAD, > the first. The 2nd PT_LOAD is for sections without the readonly status, > that includes .got and .plt being spanned. See below from > objdump -ph for /bin/ls : > > Program Header: > PHDR off 0x0000000000000040 vaddr 0x0000000010000040 paddr 0x0000000010000040 align 2**3 > filesz 0x0000000000000188 memsz 0x0000000000000188 flags r-- > INTERP off 0x00000000000001c8 vaddr 0x00000000100001c8 paddr 0x00000000100001c8 align 2**0 > filesz 0x0000000000000015 memsz 0x0000000000000015 flags r-- > LOAD off 0x0000000000000000 vaddr 0x0000000010000000 paddr 0x0000000010000000 align 2**16 > filesz 0x000000000000910c memsz 0x000000000000910c flags r-x > LOAD off 0x0000000000009110 vaddr 0x0000000010019110 paddr 0x0000000010019110 align 2**16 > filesz 0x0000000000000ee0 memsz 0x00000000000010e8 flags rw- > DYNAMIC off 0x0000000000009138 vaddr 0x0000000010019138 paddr 0x0000000010019138 align 2**3 > filesz 0x00000000000001c0 memsz 0x00000000000001c0 flags rw- > NOTE off 0x00000000000001e0 vaddr 0x00000000100001e0 paddr 0x00000000100001e0 align 2**2 > filesz 0x0000000000000030 memsz 0x0000000000000030 flags r-- > STACK off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**4 > filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw- We only need program headers, and we only need them from the object which load causes the fault. It might be not the binary but some library that triggers the fault. So the backtrace and some information from the state of the image is needed. You can build only rtld and use it as the standalone program to initiate the image activation: /ld-elf.so.1 /bin/ls or similar. From owner-svn-src-head@freebsd.org Fri Nov 2 00:46:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B2D210DEF19; Fri, 2 Nov 2018 00:46:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95C816E9B8; Fri, 2 Nov 2018 00:46:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id wA20jtip007261 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 2 Nov 2018 02:45:58 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wA20jtip007261 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wA20jtMv007260; Fri, 2 Nov 2018 02:45:55 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 2 Nov 2018 02:45:55 +0200 From: Konstantin Belousov To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340038 - in head: lib/libc/sys sys/kern Message-ID: <20181102004555.GJ5335@kib.kiev.ua> References: <201811012346.wA1NkNS5079845@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201811012346.wA1NkNS5079845@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 00:46:11 -0000 On Thu, Nov 01, 2018 at 11:46:23PM +0000, Conrad Meyer wrote: > Author: cem > Date: Thu Nov 1 23:46:23 2018 > New Revision: 340038 > URL: https://svnweb.freebsd.org/changeset/base/340038 > > Log: > kern_poll: Restore explanatory comment removed in r177374 > > The comment isn't stale. The check is bogus in the sense that poll(2) > does not require pollfd entries to be unique in fd space, so there is no > reason there cannot be more pollfd entries than open or even allowed > fds. The check is mostly a seatbelt against accidental misuse or > abuse. FD_SETSIZE, while usually unrelated to poll, is used as an > arbitrary floor for systems with very low kern.maxfilesperproc. > > Additionally, document this possible EINVAL condition in the poll.2 > manual. > > No functional change. > > Reviewed by: markj > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D17671 > > Modified: > head/lib/libc/sys/poll.2 > head/sys/kern/sys_generic.c > > Modified: head/lib/libc/sys/poll.2 > ============================================================================== > --- head/lib/libc/sys/poll.2 Thu Nov 1 23:42:35 2018 (r340037) > +++ head/lib/libc/sys/poll.2 Thu Nov 1 23:46:23 2018 (r340038) > @@ -28,7 +28,7 @@ > .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > .\" > -.Dd November 13, 2014 > +.Dd November 1, 2018 > .Dt POLL 2 > .Os > .Sh NAME > @@ -232,7 +232,15 @@ points outside the process's allocated address space. > A signal was delivered before the time limit expired and > before any of the selected events occurred. > .It Bq Er EINVAL > -The specified time limit is invalid. One of its components is negative or too large. > +The specified time limit is invalid. > +One of its components is negative or too large. > +.It Bq Er EINVAL > +The number of pollfd structures specified by > +.Fa nfds > +exceeds the system tunable > +.Va kern.maxfilesperproc > +and > +.Dv FD_SETSIZE . This is somewhat confusing. Looking only at the man page text, most straight reading of it is that nfds cannot exceed min(maxfilesperproc, FD_SETSIZE). But in fact nfds cannot exceed max of it, which is significantly different, i.e. poll(2) does not suffer from the (userspace) FD_SETSIZE limitation of select(2). > .El > .Sh SEE ALSO > .Xr accept 2 , > > Modified: head/sys/kern/sys_generic.c > ============================================================================== > --- head/sys/kern/sys_generic.c Thu Nov 1 23:42:35 2018 (r340037) > +++ head/sys/kern/sys_generic.c Thu Nov 1 23:46:23 2018 (r340038) > @@ -1339,6 +1339,13 @@ kern_poll(struct thread *td, struct pollfd *ufds, u_in > } else > sbt = -1; > > + /* > + * This is kinda bogus. We have fd limits, but that is not > + * really related to the size of the pollfd array. Make sure > + * we let the process use at least FD_SETSIZE entries and at > + * least enough for the system-wide limits. We want to be reasonably > + * safe, but not overly restrictive. > + */ > if (nfds > maxfilesperproc && nfds > FD_SETSIZE) > return (EINVAL); > if (nfds > nitems(stackfds)) From owner-svn-src-head@freebsd.org Fri Nov 2 01:40:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A78410E06F6 for ; Fri, 2 Nov 2018 01:40:21 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic313-15.consmr.mail.bf2.yahoo.com (sonic313-15.consmr.mail.bf2.yahoo.com [74.6.133.125]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23E1E70671 for ; Fri, 2 Nov 2018 01:40:21 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: pJpfLW8VM1mD7PMFBol4lRIzfLOkQ5u.YPu3OejVbJRDKTpdsK_iwxfd9KcQbZL dCu90ADoBla3GrSh8xalvPVai4m84F184Sdb8svnU7PWsvoFnCj8J8S_FXDJRbupJeLBCpqR1rcc hgUvMbkodSED1oKARc_GL1kY3GB3CYlMmJnK5.mQEC8XvT7fzYkfJGCmB6vQJuZoLwu_J7EtyoYz NNsTMaL54MQnRDo4NUIFqcrur.19Y9CqAnGddYTmu2O.FxatRMfMiKoq4arWF_VMYGBXodwkpu5i I7U6.Vk8tJo8YboAfEebwIDpF4zIQ_ITYq8TFyfsx4z1CnjUW0wS6Wp49PCTcOc35.3wKYOYQK.3 TRND35KtcoFKjVfcx2xRyyqY5649RuNwmcyOVd4iSrMhK3l2Og1.THYg6aWunHXLsK8JEmAxtyRO eVTJf.hBbQ4wb.39dg3OIi12GB9J446r0BQvsk5mwJ_j_kS_qmsLucCf7zu9euKWn9UzlkTIuS9a tqHN7vhIsTM5eXF0_Vf3c9AFaUj3a6DDb.6eIr0MPCg0GcAaPC__nYnu8PQDEFSmU4QZWWhIpUoL _t0aGEeBN2BEcTF8GErVbtsrmbkhonld_.1YxdAqUYbXHUZqSjTb.v3p4U0uW7NVPZ8MECjum5oX Rpso_.OG9lLCFqfhBAPbKA.teucEBvRiGI_q2cYZUfUKuJ_LGd2SFRKIuzfiGBwQ9Xjd0AD776i4 RLmhyS4jzVP4TfbeQbwkoUW32uNggIFVVJEfP8TK0SHb6cPQUBCHeOKwPlbUV651JEBO8NOlbJ6w uvQUmLR665y7U0NBNbnUdfmvtxHxGyq7wVc8yHCYUiHbParKaWhQMxYll8Fxaw2WKgf3u4On8MSC 4SF5vsOKakzhShv6Mym5c7xe3E26xU5rlXvvYcuGbEnmI0V4pDPkh843JctcF4Ae.C74ynQ2AqkL Wb78onPezqG4PB.EiMqug5vZEbHxAoZRSIqMT3VLAh_loF7l3BMw5NypmU0SbrrepAw8023lqCZW xEDWI_A09oJ88K38uIQ_WiXvMg6oA9_KJZegG2kfIF_edww4sCA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.bf2.yahoo.com with HTTP; Fri, 2 Nov 2018 01:40:19 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp422.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID e5e1254626b6eda75affef81b941fd0b; Fri, 02 Nov 2018 01:40:15 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r339876 - head/libexec/rtld-elf From: Mark Millard In-Reply-To: <20181102004101.GI5335@kib.kiev.ua> Date: Thu, 1 Nov 2018 18:40:13 -0700 Cc: svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <8E5A5F3A-F1A7-4702-A2F7-65D74CC5B2E5@yahoo.com> <20181102004101.GI5335@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 01:40:21 -0000 On 2018-Nov-1, at 5:41 PM, Konstantin Belousov = wrote: > On Tue, Oct 30, 2018 at 12:45:13PM -0700, Mark Millard wrote: >> Konstantin Belousov kostikbel at gmail.com wrote on >> Tue Oct 30 18:04:04 UTC 2018 : >>=20 >>> On Tue, Oct 30, 2018 at 03:32:40PM +0000, Alexander Richardson = wrote: >>>> On Tue, 30 Oct 2018 at 10:17, Michael Tuexen >>>> wrote: >>>>>=20 >>>>>> On 29. Oct 2018, at 22:08, Alex Richardson wrote: >>>>>>=20 >>>>>> Author: arichardson >>>>>> Date: Mon Oct 29 21:08:02 2018 >>>>>> New Revision: 339876 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/339876 >>>>>>=20 >>>>>> Log: >>>>>> rtld: set obj->textsize correctly >>>>>>=20 >>>>>> With lld-generated binaries the first PT_LOAD will usually be a = read-only >>>>>> segment unless you pass --no-rosegment. For those binaries the = textsize is >>>>>> determined by the next PT_LOAD. To allow both LLD and bfd 2.17 = binaries to >>>>>> be parsed correctly use the end of the last PT_LOAD that is = marked as >>>>>> executable instead. >>>>>>=20 >>>>>> I noticed that the value was wrong while adding some debug prints = for some rtld >>>>>> changes for CHERI binaries. `obj->textsize` only seems to be used = by PPC so the >>>>>> effect is untested. However, the value before was definitely = wrong and the new >>>>>> result matches the phdrs. >>>>> I build kernel and world with a revision later than this on a PPC. = Buildword >>>>> ends up with a world where almost all binaries are segfaulting.... = Especially gdb >>>>> (but svn, ls or so all segfault). >>>>>=20 >>>>> Best regards >>>>> Michael >>>>=20 >>>> This is rather surprising since if anything the range of the icache >>>> flush should increase rather than decrease after this change. >>>>=20 >>>> I can only see this causing a behaviour change if we actually need = to >>>> flush more than just the executable segments. >>>> Is it possible that some binary/library contains a non-executable >>>> segment as the first PT_LOAD? >>>> Or is there some linker script that adds custom PHDRS? >>>>=20 >>> Could it be that there is a hole between start of the object mapping = and >>> the last PT_LOADable segment eligible for execution ? >>=20 >> [This note may be easier to deal with than the first >> note that I sent out.] >>=20 >> [My examples are from devel/powerpc64-xtoolchain-gcc used >> to buildworld buildkernel targeting a head -r339076 based >> powerpc64 environment. I do that on powerpc64 as well.] >>=20 >> powerpc64 loads the readonly data and the readonly code in one = PT_LOAD, >> the first. The 2nd PT_LOAD is for sections without the readonly = status, >> that includes .got and .plt being spanned. See below from >> objdump -ph for /bin/ls : >>=20 >> Program Header: >> PHDR off 0x0000000000000040 vaddr 0x0000000010000040 paddr = 0x0000000010000040 align 2**3 >> filesz 0x0000000000000188 memsz 0x0000000000000188 flags r-- >> INTERP off 0x00000000000001c8 vaddr 0x00000000100001c8 paddr = 0x00000000100001c8 align 2**0 >> filesz 0x0000000000000015 memsz 0x0000000000000015 flags r-- >> LOAD off 0x0000000000000000 vaddr 0x0000000010000000 paddr = 0x0000000010000000 align 2**16 >> filesz 0x000000000000910c memsz 0x000000000000910c flags r-x >> LOAD off 0x0000000000009110 vaddr 0x0000000010019110 paddr = 0x0000000010019110 align 2**16 >> filesz 0x0000000000000ee0 memsz 0x00000000000010e8 flags rw- >> DYNAMIC off 0x0000000000009138 vaddr 0x0000000010019138 paddr = 0x0000000010019138 align 2**3 >> filesz 0x00000000000001c0 memsz 0x00000000000001c0 flags rw- >> NOTE off 0x00000000000001e0 vaddr 0x00000000100001e0 paddr = 0x00000000100001e0 align 2**2 >> filesz 0x0000000000000030 memsz 0x0000000000000030 flags r-- >> STACK off 0x0000000000000000 vaddr 0x0000000000000000 paddr = 0x0000000000000000 align 2**4 >> filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw- >=20 > We only need program headers, and we only need them from the object > which load causes the fault. It might be not the binary but some = library > that triggers the fault. So the backtrace and some information from = the > state of the image is needed. >=20 > You can build only rtld and use it as the standalone program to = initiate > the image activation: > /ld-elf.so.1 /bin/ls > or similar. It will be a while before I can get an environment set up which allows me to get a backtrace from a 32-bit powerpc system. I have demonstrated that I get the crash with what I tried to verify such. I'll work on getting an environment in place that allows what you are asking for. Problem reproduction details (if you care) . . . I've been trying to provide evidence but my 32-bit powerpc environment is not as modern as has the problem. Also: the buildworld it was installed from was built via clang, which means that the libgcc_s.so that was built does not correctly support C++ exceptions. (clang's generated output is the source of that problem.) I did not build /libexec/gdb and the /usr/local/gdb uses C++ exceptions heavily and will not work. All I can report for now is how I reproduced the problem. . . # mkdir /339870 # cd /339870/ then I used wget to get: = https://artifact.ci.freebsd.org/snapshot/head/r339870/powerpc/powerpc/base= *.txz and expanded them in /339870/ and did: # ./libexec/ld-elf.so.1 /bin/ls Segmentation fault (core dumped) Looking at where my environment is putting cores: -rw------- 1 root wheel 2752512 Nov 1 18:12:40 2018 = /var/crash/ld-elf.so.1.9906.core So at least I know the problem reproduces via such a procedure. For reference for the above: # uname -apKU FreeBSD FBSDG4S 12.0-CURRENT FreeBSD 12.0-CURRENT r327364M powerpc = powerpc 1200054 1200054 =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Fri Nov 2 03:25:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 961A410E2D3C; Fri, 2 Nov 2018 03:25:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 43E5073CE2; Fri, 2 Nov 2018 03:25:24 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21DE825064; Fri, 2 Nov 2018 03:25:24 +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 wA23PNjs094801; Fri, 2 Nov 2018 03:25:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA23PNli094799; Fri, 2 Nov 2018 03:25:23 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811020325.wA23PNli094799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 2 Nov 2018 03:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340040 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 340040 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 03:25:24 -0000 Author: kevans Date: Fri Nov 2 03:25:23 2018 New Revision: 340040 URL: https://svnweb.freebsd.org/changeset/base/340040 Log: lualoader: Implement boot-conf MFC after: 3 days Modified: head/stand/lua/cli.lua head/stand/lua/cli.lua.8 Modified: head/stand/lua/cli.lua ============================================================================== --- head/stand/lua/cli.lua Thu Nov 1 23:56:10 2018 (r340039) +++ head/stand/lua/cli.lua Fri Nov 2 03:25:23 2018 (r340040) @@ -115,6 +115,16 @@ function cli.autoboot(...) core.autoboot(argstr) end +cli['boot-conf'] = function(...) + local _, argv = cli.arguments(...) + local kernel, argstr = parseBootArgs(argv) + if kernel ~= nil then + loader.perform("unload") + config.selectKernel(kernel) + end + core.autoboot(argstr) +end + -- Used for splitting cli varargs into cmd_name and the rest of argv function cli.arguments(...) local argv = {...} Modified: head/stand/lua/cli.lua.8 ============================================================================== --- head/stand/lua/cli.lua.8 Thu Nov 1 23:56:10 2018 (r340039) +++ head/stand/lua/cli.lua.8 Fri Nov 2 03:25:23 2018 (r340040) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 9, 2018 +.Dd October 31, 2018 .Dt CLI.LUA 8 .Os .Sh NAME @@ -80,10 +80,11 @@ Arguments may be passed to it as usual, space-delimite As of present, the .Nm module by default provides commands for -.Ic autoboot +.Ic autoboot , +.Ic boot , and -.Ic boot . -In both cases, the +.Ic boot-conf. +In all three cases, the .Xr core.lua 8 module will load all ELF modules as-needed before executing the equivalent built-in loader commands. From owner-svn-src-head@freebsd.org Fri Nov 2 03:37:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6032F10E30AD; Fri, 2 Nov 2018 03:37:57 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f180.google.com (mail-it1-f180.google.com [209.85.166.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F26B57435B; Fri, 2 Nov 2018 03:37:56 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f180.google.com with SMTP id t189-v6so519437itf.1; Thu, 01 Nov 2018 20:37:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=77outKWs1CYPSdg8hgSV55FTfxd5/L1YK5KD72W2Ylo=; b=Rle29Mj0nJhI1GGNv54GdbWUnpLGNuA6UUOOh5rDPRjz2tTXslw6dX5mMrT0V7uI6E +jEN+B0dK9YZckdYMGnkLex9TQJLq73uN28L8KL11UkvtkeqLqStA/UWQnfc+2ywztA5 esBsVyne4fTZWRHJdlaByvMvZpKxnB5Wl3Y64rDZoIYXBFA0X0HKNiaFVWjLiwS6tztO kKHfSRn31wZkuraeDyIPuT6QpiH3TzDUjS3oS7V+e9RzgvBRcMs6jDeY+yXufVTqjBz5 /cATo45tWbcfsHqaH8MUt4QgsbZ9Y4f45D6hTGeG8NgoJbyMwHassrCuuzM1c+DTJtdM deIw== X-Gm-Message-State: AGRZ1gJBvNL8XrBiXIqeOcDlQ5HOwik0QQfUsYIO5Ze49mYkQuebiK+Q uw8qXNJZiCEuBm6xhyaYVWc6nBC5 X-Google-Smtp-Source: AJdET5cml5DKDPVlf37aK0s/OIc0yxKCH69oen7VolURC4t9l562DsiDFExvMETax+F1ssS4eMHS2g== X-Received: by 2002:a02:15d3:: with SMTP id 80-v6mr9041947jaq.116.1541129379208; Thu, 01 Nov 2018 20:29:39 -0700 (PDT) Received: from mail-io1-f51.google.com (mail-io1-f51.google.com. [209.85.166.51]) by smtp.gmail.com with ESMTPSA id v21-v6sm10662975iob.7.2018.11.01.20.29.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Nov 2018 20:29:39 -0700 (PDT) Received: by mail-io1-f51.google.com with SMTP id o19-v6so437057iod.3; Thu, 01 Nov 2018 20:29:38 -0700 (PDT) X-Received: by 2002:a6b:1807:: with SMTP id 7-v6mr6902229ioy.143.1541129378288; Thu, 01 Nov 2018 20:29:38 -0700 (PDT) MIME-Version: 1.0 References: <201811012346.wA1NkNS5079845@repo.freebsd.org> <20181102004555.GJ5335@kib.kiev.ua> In-Reply-To: <20181102004555.GJ5335@kib.kiev.ua> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Thu, 1 Nov 2018 20:29:27 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r340038 - in head: lib/libc/sys sys/kern To: Konstantin Belousov Cc: src-committers , 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 03:37:57 -0000 On Thu, Nov 1, 2018 at 5:46 PM Konstantin Belousov wrote: > > On Thu, Nov 01, 2018 at 11:46:23PM +0000, Conrad Meyer wrote: > > ... > > @@ -232,7 +232,15 @@ points outside the process's allocated address space. > > A signal was delivered before the time limit expired and > > before any of the selected events occurred. > > .It Bq Er EINVAL > > -The specified time limit is invalid. One of its components is negative or too large. > > +The specified time limit is invalid. > > +One of its components is negative or too large. > > +.It Bq Er EINVAL > > +The number of pollfd structures specified by > > +.Fa nfds > > +exceeds the system tunable > > +.Va kern.maxfilesperproc > > +and > > +.Dv FD_SETSIZE . > > This is somewhat confusing. Looking only at the man page text, most > straight reading of it is that nfds cannot exceed min(maxfilesperproc, > FD_SETSIZE). But in fact nfds cannot exceed max of it, which is > significantly different, i.e. poll(2) does not suffer from the (userspace) > FD_SETSIZE limitation of select(2). min(maxfilesperproc, FD_SETSIZE) would be written as "nfds exceeds ... maxfilesperproc OR FD_SETSIZE," rather than "and." I think the sentence is unambiguous. Best, Conrad From owner-svn-src-head@freebsd.org Fri Nov 2 07:26:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F3C710EB9CE for ; Fri, 2 Nov 2018 07:26:39 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic303-21.consmr.mail.gq1.yahoo.com (sonic303-21.consmr.mail.gq1.yahoo.com [98.137.64.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C682A79F01 for ; Fri, 2 Nov 2018 07:26:38 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: ikN2PUoVM1n9yak7mhssWZhD5i7l47AfYFlkkKFqpwU7acYHC8g1e7jqlPvUAf7 SUaPg4Xj9doK5vGaOKWMjDWzMArrVxXed3qHcbnWbYxloYjOJSHc7ES4SQFEJfpcixemynmDzfFi koM3B6s4rUlStcAqWm_di_4Fe0.bxZRMr7915w1Au2Oloc2sEKh73zbGz1hEsxPjxb9BzNRG8KIG Z8y_4LWPYioJerDUgcOXvX29n1hwBzEJB7DiDKvl0jsMLPzntsj6yXY75D6rjN5KzLO4j9OEeeZw 4GxdnvyAwXtRmw9HjP8aiqiPmTt9oRABTK1IlpHV0LjXvLag0I6PbDSSHzJ92eQJqyiVzhihRn_U WCw3B30F2Hn.V_7kYSz2qR7HZ5HbGvgcVT672gVq7uztqbGZJaJGbsQFprw0vpb2Lf9TE_qZhWgv _VJGB8MiEEwyDB8eubxSpWMqGiMR6evw8Wrb58aC9wY8XCwod8mzRQxWQ8Hf9j7JnipRKulucQyC f0RFc7.OMQdKR4j1QPw7z5sabEzudo7JNGBLtV4H23vefWWNOjgkovePYVKJLv._lsMkznjtDpyK OHOZyl98q_L8GSvXOx5kqIjJMea29MxAo35thd8S1nc0wMftvNdAsz35bsozh0i_Mdx47rED2zmY kCpNHd7Bs3QYWT1dvJpYjHjPAb9_fsMtEYTCmsuwawND7czkbD.erdNGOT_fnBqroKEL1mErTr5q 4uqD8O1g7sZ7y9oIiq1rf5iRz_w2pxlwCHgx1ctxUzpZaMNa53Nda3DXmEXJ0cwt49s39VSH.zSa bRP0Wzin1VDD3X0opguleM37_gN3EdV64hTDKdgJAa._lgR3Od_k84Dvo88a9iqh3QCe37LgmHMT IVeqczny.pwhTEJLNjSRez5q0hlt28ILZp65oZByVLdBTeIIdq__SXLdEK.YbUAp3BoHSWjwBCNL 526imcvJeV09QHRab3Tsq5CXvWxBpBxb8rOjsPUBgse_ersuANKLmGZg9ccCsz8S0prZ0if3rNKv HYCui8gtJWegpXBltrW86p19OQzkVjow_E2c.D3QhN.Y.pGw- Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.gq1.yahoo.com with HTTP; Fri, 2 Nov 2018 07:26:35 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp430.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID a383864a705eded79eb5e434fc5403a8; Fri, 02 Nov 2018 07:16:23 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r339876 - head/libexec/rtld-elf From: Mark Millard In-Reply-To: Date: Fri, 2 Nov 2018 00:16:23 -0700 Cc: svn-src-head@freebsd.org, Alexander Richardson , Shawn Webb Content-Transfer-Encoding: quoted-printable Message-Id: <003A49D7-6E8B-4775-A70B-E0EB44505D4B@yahoo.com> References: <8E5A5F3A-F1A7-4702-A2F7-65D74CC5B2E5@yahoo.com> <20181102004101.GI5335@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 07:26:39 -0000 [The backtrace confirms what I reported to Alexander Richardson and Shawn Webb earlier.] On 2018-Nov-1, at 6:40 PM, Mark Millard = wrote: > On 2018-Nov-1, at 5:41 PM, Konstantin Belousov wrote: >=20 >> On Tue, Oct 30, 2018 at 12:45:13PM -0700, Mark Millard wrote: >>> Konstantin Belousov kostikbel at gmail.com wrote on >>> Tue Oct 30 18:04:04 UTC 2018 : >>>=20 >>>> On Tue, Oct 30, 2018 at 03:32:40PM +0000, Alexander Richardson = wrote: >>>>> On Tue, 30 Oct 2018 at 10:17, Michael Tuexen >>>>> wrote: >>>>>>=20 >>>>>>> On 29. Oct 2018, at 22:08, Alex Richardson wrote: >>>>>>>=20 >>>>>>> Author: arichardson >>>>>>> Date: Mon Oct 29 21:08:02 2018 >>>>>>> New Revision: 339876 >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/339876 >>>>>>>=20 >>>>>>> Log: >>>>>>> rtld: set obj->textsize correctly >>>>>>>=20 >>>>>>> With lld-generated binaries the first PT_LOAD will usually be a = read-only >>>>>>> segment unless you pass --no-rosegment. For those binaries the = textsize is >>>>>>> determined by the next PT_LOAD. To allow both LLD and bfd 2.17 = binaries to >>>>>>> be parsed correctly use the end of the last PT_LOAD that is = marked as >>>>>>> executable instead. >>>>>>>=20 >>>>>>> I noticed that the value was wrong while adding some debug = prints for some rtld >>>>>>> changes for CHERI binaries. `obj->textsize` only seems to be = used by PPC so the >>>>>>> effect is untested. However, the value before was definitely = wrong and the new >>>>>>> result matches the phdrs. >>>>>> I build kernel and world with a revision later than this on a = PPC. Buildword >>>>>> ends up with a world where almost all binaries are = segfaulting.... Especially gdb >>>>>> (but svn, ls or so all segfault). >>>>>>=20 >>>>>> Best regards >>>>>> Michael >>>>>=20 >>>>> This is rather surprising since if anything the range of the = icache >>>>> flush should increase rather than decrease after this change. >>>>>=20 >>>>> I can only see this causing a behaviour change if we actually need = to >>>>> flush more than just the executable segments. >>>>> Is it possible that some binary/library contains a non-executable >>>>> segment as the first PT_LOAD? >>>>> Or is there some linker script that adds custom PHDRS? >>>>>=20 >>>> Could it be that there is a hole between start of the object = mapping and >>>> the last PT_LOADable segment eligible for execution ? >>>=20 >>> [This note may be easier to deal with than the first >>> note that I sent out.] >>>=20 >>> [My examples are from devel/powerpc64-xtoolchain-gcc used >>> to buildworld buildkernel targeting a head -r339076 based >>> powerpc64 environment. I do that on powerpc64 as well.] >>>=20 >>> powerpc64 loads the readonly data and the readonly code in one = PT_LOAD, >>> the first. The 2nd PT_LOAD is for sections without the readonly = status, >>> that includes .got and .plt being spanned. See below from >>> objdump -ph for /bin/ls : >>>=20 >>> Program Header: >>> PHDR off 0x0000000000000040 vaddr 0x0000000010000040 paddr = 0x0000000010000040 align 2**3 >>> filesz 0x0000000000000188 memsz 0x0000000000000188 flags r-- >>> INTERP off 0x00000000000001c8 vaddr 0x00000000100001c8 paddr = 0x00000000100001c8 align 2**0 >>> filesz 0x0000000000000015 memsz 0x0000000000000015 flags r-- >>> LOAD off 0x0000000000000000 vaddr 0x0000000010000000 paddr = 0x0000000010000000 align 2**16 >>> filesz 0x000000000000910c memsz 0x000000000000910c flags r-x >>> LOAD off 0x0000000000009110 vaddr 0x0000000010019110 paddr = 0x0000000010019110 align 2**16 >>> filesz 0x0000000000000ee0 memsz 0x00000000000010e8 flags rw- >>> DYNAMIC off 0x0000000000009138 vaddr 0x0000000010019138 paddr = 0x0000000010019138 align 2**3 >>> filesz 0x00000000000001c0 memsz 0x00000000000001c0 flags rw- >>> NOTE off 0x00000000000001e0 vaddr 0x00000000100001e0 paddr = 0x00000000100001e0 align 2**2 >>> filesz 0x0000000000000030 memsz 0x0000000000000030 flags r-- >>> STACK off 0x0000000000000000 vaddr 0x0000000000000000 paddr = 0x0000000000000000 align 2**4 >>> filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw- >>=20 >> We only need program headers, and we only need them from the object >> which load causes the fault. It might be not the binary but some = library >> that triggers the fault. So the backtrace and some information from = the >> state of the image is needed. >>=20 >> You can build only rtld and use it as the standalone program to = initiate >> the image activation: >> /ld-elf.so.1 /bin/ls >> or similar. >=20 > . . . It stops when the dcbst in __syncicache runs into an address in the p_align 65536 caused hole between the two PT_LOAD's with PF_X. /bin/ls itself has such a hole, as do the .so libraries involved. Details follow. (gdb) run /bin/ls Starting program: = /usr/obj/powerpcvtsc_gcc421/powerpc.powerpc/usr/src/powerpc.powerpc/libexe= c/rtld-elf/ld-elf.so.1.full /bin/ls Program received signal SIGSEGV, Segmentation fault. __syncicache (from=3D0x1800000, len=3D102400) at = /usr/src/lib/libc/powerpc/gen/syncicache.c:94 94 __asm __volatile ("dcbst 0,%0" :: "r"(p)); (gdb) bt #0 __syncicache (from=3D0x1800000, len=3D102400) at = /usr/src/lib/libc/powerpc/gen/syncicache.c:94 #1 0x01012b58 in reloc_non_plt (obj=3D0x41041000, obj_rtld=3D, flags=3D4, lockstate=3D0x0) at = /usr/src/libexec/rtld-elf/powerpc/reloc.c:330 #2 0x010175f4 in relocate_object (obj=3D0x41041000, bind_now=3D0 = '\000', rtldobj=3D0x103ea88 , flags=3D4, lockstate=3D0x0) at = /usr/src/libexec/rtld-elf/rtld.c:2849 #3 0x0101776c in relocate_objects (first=3D, bind_now=3D0 = '\000', rtldobj=3D0x103ea88 , flags=3D4, lockstate=3D0x0) at = /usr/src/libexec/rtld-elf/rtld.c:2908 #4 0x0101beb0 in _rtld (sp=3D, exit_proc=3D0xffffdc08, = objp=3D0xffffdc0c) at /usr/src/libexec/rtld-elf/rtld.c:677 #5 0x0101217c in .rtld_start () at = /usr/src/libexec/rtld-elf/powerpc/rtld_start.S:98 Backtrace stopped: frame did not save the PC This is because there are 2 PT_LOAD's that have PF_X but for which there is an address range between that spans may pages for which there is no header entry for, in part a consequence of p_align being 65536 so forcing lots of space between entries 2 and 3 ( /bin/ls example): entry: 2 p_type: PT_LOAD p_offset: 0 p_vaddr: 0x1800000 p_paddr: 0x1800000 p_filesz: 34112 p_memsz: 34112 p_flags: PF_X|PF_R p_align: 65536 entry: 3 p_type: PT_LOAD p_offset: 34112 p_vaddr: 0x1818540 p_paddr: 0x1818540 p_filesz: 316 p_memsz: 1752 p_flags: PF_X|PF_W|PF_R p_align: 65536 ( check 2's p_paddr+ p_memsz vs. 3's p_vaddr Later below the failing address will be shown as between those. ) [powerpc64 only gets one PT_LOAD with PF_X and so can not have space between such PT_LOAD's as things currently are.] The source code related details are as follows and shows that it was processing /bin/ls itself ( obj_main->path =3D 0x41042000 "/bin/ls" and the failing address ) : [The presentation order is not necessarily the same as my exploration order.] (gdb) list 89 off =3D (u_int)from & (cacheline_size - 1); 90 l =3D len +=3D off; 91 p =3D (char *)from - off; 92=09 93 do { 94 __asm __volatile ("dcbst 0,%0" :: "r"(p)); 95 p +=3D cacheline_size; 96 } while ((l -=3D cacheline_size) > 0); 97 __asm __volatile ("sync"); 98 p =3D (char *)from - off; [Reminder for entry 2: p_vaddr: 0x1800000 p_memsz: 34112 0x1800000+34112 =3D 0x1808540 ] (gdb) print p $4 =3D 0x1809000 (gdb) up #1 0x01012b58 in reloc_non_plt (obj=3D0x41041000, obj_rtld=3D, flags=3D4, lockstate=3D0x0) at = /usr/src/libexec/rtld-elf/powerpc/reloc.c:330 330 __syncicache(obj->mapbase, obj->textsize); (gdb) list 325 done: 326 if (cache !=3D NULL) 327 free(cache); 328=09 329 /* Synchronize icache for text seg in case we made any = changes */ 330 __syncicache(obj->mapbase, obj->textsize); 331=09 332 return (r); 333 } 334=09 (gdb) up #2 0x010175f4 in relocate_object (obj=3D0x41041000, bind_now=3D0 = '\000', rtldobj=3D0x103ea88 , flags=3D4, lockstate=3D0x0) at = /usr/src/libexec/rtld-elf/rtld.c:2849 2849 if (reloc_non_plt(obj, rtldobj, flags, lockstate)) (gdb) list 2844 /* There are relocations to the write-protected text = segment. */ 2845 if (obj->textrel && reloc_textrel_prot(obj, true) !=3D = 0) 2846 return (-1); 2847=09 2848 /* Process the non-PLT non-IFUNC relocations. */ 2849 if (reloc_non_plt(obj, rtldobj, flags, lockstate)) 2850 return (-1); 2851=09 2852 /* Re-protected the text segment. */ 2853 if (obj->textrel && reloc_textrel_prot(obj, false) !=3D = 0) (gdb) up =20 #3 0x0101776c in relocate_objects (first=3D, bind_now=3D0 = '\000', rtldobj=3D0x103ea88 , flags=3D4, lockstate=3D0x0) at = /usr/src/libexec/rtld-elf/rtld.c:2908 2908 error =3D relocate_object(obj, bind_now, = rtldobj, flags, (gdb) list 2903=09 2904 for (error =3D 0, obj =3D first; obj !=3D NULL; 2905 obj =3D TAILQ_NEXT(obj, next)) { 2906 if (obj->marker) 2907 continue; 2908 error =3D relocate_object(obj, bind_now, = rtldobj, flags, 2909 lockstate); 2910 if (error =3D=3D -1) 2911 break; 2912 } (gdb) up #4 0x0101beb0 in _rtld (sp=3D, exit_proc=3D0xffffdc08, = objp=3D0xffffdc0c) at /usr/src/libexec/rtld-elf/rtld.c:677 677 if (relocate_objects(obj_main, (gdb) list 672 * block even if they didn't ask for it. 673 */ 674 allocate_tls_offset(entry->obj); 675 } 676=09 677 if (relocate_objects(obj_main, 678 ld_bind_now !=3D NULL && *ld_bind_now !=3D '\0', 679 &obj_rtld, SYMLOOK_EARLY, NULL) =3D=3D -1) 680 rtld_die(); 681=09 (gdb) up =20 #5 0x0101217c in .rtld_start () at = /usr/src/libexec/rtld-elf/powerpc/rtld_start.S:98 98 bl _rtld@plt /* &_start =3D _rtld(sp, = &exit_proc, &obj_main)*/ (gdb) list 93 addi %r3,%r4,-4 /* locate argc ptr, &argv[-1] */ 94=09 95 addi %r4,%r1,8 /* &exit_proc on stack */ 96 addi %r5,%r1,12 /* &obj_main on stack */ 97=09 98 bl _rtld@plt /* &_start =3D _rtld(sp, = &exit_proc, &obj_main)*/ 99 mtlr %r3 100=09 101 /* 102 * Restore args, with new obj/exit proc (gdb) down #4 0x0101beb0 in _rtld (sp=3D, exit_proc=3D0xffffdc08, = objp=3D0xffffdc0c) at /usr/src/libexec/rtld-elf/rtld.c:677 677 if (relocate_objects(obj_main, . . . (gdb) print *obj_main $3 =3D {magic =3D 0, version =3D 0, next =3D {tqe_next =3D 0x41041200, = tqe_prev =3D 0x103ea68 }, path =3D 0x41042000 "/bin/ls", = origin_path =3D 0x0, refcount =3D 1, holdcount =3D 0, dl_refcount =3D 0,=20= mapbase =3D 0x1800000 "\177ELF\001\002\001\t", mapsize =3D 102400, = textsize =3D 102400, vaddrbase =3D 25165824, relocbase =3D 0x0, dynamic = =3D 0x1818554,=20 entry =3D 0x18022e0 "|\b\002\246\224!\377\340=3D \001\202\223\241", = phdr =3D 0x1800034, phsize =3D 224, interp =3D 0x1800114 = "/libexec/ld-elf.so.1", stack_flags =3D 6, tlsindex =3D 0, tlsinit =3D = 0x0,=20 tlsinitsize =3D 0, tlssize =3D 0, tlsoffset =3D 0, tlsalign =3D 0, = relro_page =3D 0x0, relro_size =3D 0, pltgot =3D 0x18186f4, rel =3D 0x0, = relsize =3D 0, rela =3D 0x1801ebc, relasize =3D 1008, pltrel =3D 0x0,=20 pltrelsize =3D 0, pltrela =3D 0x1801f28, pltrelasize =3D 900, symtab =3D= 0x1800798, strtab =3D 0x1801418 "", strsize =3D 2241, verneed =3D = 0x1801e6c, verneednum =3D 1, verdef =3D 0x0, verdefnum =3D 0,=20 versyms =3D 0x1801cda, buckets =3D 0x1800164, nbuckets =3D 197, chains = =3D 0x1800478, nchains =3D 200, nbuckets_gnu =3D 0, symndx_gnu =3D 0, = maskwords_bm_gnu =3D 0, shift2_gnu =3D 0, dynsymcount =3D 200,=20 bloom_gnu =3D 0x0, buckets_gnu =3D 0x0, chain_zero_gnu =3D 0x0, rpath = =3D 0x0, runpath =3D 0x0, needed =3D 0x41042010, needed_filtees =3D 0x0, = needed_aux_filtees =3D 0x0, names =3D {stqh_first =3D 0x0,=20 stqh_last =3D 0x410410f8}, vertab =3D 0x41043080, vernum =3D 6, init = =3D 25174700, fini =3D 25197908, preinit_array =3D 0, init_array =3D 0, = fini_array =3D 0, preinit_array_num =3D 0, init_array_num =3D 0,=20 fini_array_num =3D 0, osrel =3D 1200084, mainprog =3D 1 '\001', rtld =3D= 0 '\000', relocated =3D 1 '\001', ver_checked =3D 1 '\001', textrel =3D = 0 '\000', symbolic =3D 0 '\000', bind_now =3D 0 '\000',=20 traced =3D 0 '\000', jmpslots_done =3D 0 '\000', init_done =3D 0 = '\000', tls_done =3D 1 '\001', phdr_alloc =3D 0 '\000', z_origin =3D 0 = '\000', z_nodelete =3D 0 '\000', z_noopen =3D 0 '\000',=20 z_loadfltr =3D 0 '\000', z_interpose =3D 0 '\000', z_nodeflib =3D 0 = '\000', z_global =3D 0 '\000', ref_nodel =3D 0 '\000', init_scanned =3D = 0 '\000', on_fini_list =3D 0 '\000', dag_inited =3D 0 '\000',=20 filtees_loaded =3D 0 '\000', irelative =3D 0 '\000', gnu_ifunc =3D 0 = '\000', non_plt_gnu_ifunc =3D 0 '\000', crt_no_init =3D 1 '\001', = valid_hash_sysv =3D 1 '\001', valid_hash_gnu =3D 0 '\000',=20 dlopened =3D 0 '\000', marker =3D 0 '\000', unholdfree =3D 0 '\000', = doomed =3D 0 '\000', linkmap =3D {l_addr =3D 0x1800000 = "\177ELF\001\002\001\t", l_name =3D 0x41042000 "/bin/ls", l_ld =3D = 0x1818554,=20 l_next =3D 0x41041334, l_prev =3D 0x0}, dldags =3D {stqh_first =3D = 0x0, stqh_last =3D 0x41041148}, dagmembers =3D {stqh_first =3D 0x0, = stqh_last =3D 0x41041150}, dev =3D 0, ino =3D 0, priv =3D 0x0} =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Fri Nov 2 07:48:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AA2310EC1FD; Fri, 2 Nov 2018 07:48:24 +0000 (UTC) (envelope-from miwi@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F192A7ADC2; Fri, 2 Nov 2018 07:48:23 +0000 (UTC) (envelope-from miwi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE78927A92; Fri, 2 Nov 2018 07:48:23 +0000 (UTC) (envelope-from miwi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA27mNqo028551; Fri, 2 Nov 2018 07:48:23 GMT (envelope-from miwi@FreeBSD.org) Received: (from miwi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA27mN4P028550; Fri, 2 Nov 2018 07:48:23 GMT (envelope-from miwi@FreeBSD.org) Message-Id: <201811020748.wA27mN4P028550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: miwi set sender to miwi@FreeBSD.org using -f From: Martin Wilke Date: Fri, 2 Nov 2018 07:48:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340041 - head/sys/dev/ahci X-SVN-Group: head X-SVN-Commit-Author: miwi X-SVN-Commit-Paths: head/sys/dev/ahci X-SVN-Commit-Revision: 340041 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 07:48:24 -0000 Author: miwi Date: Fri Nov 2 07:48:23 2018 New Revision: 340041 URL: https://svnweb.freebsd.org/changeset/base/340041 Log: - Add quirk for Samsung on Mac Mini 7,1 PR: 201676 Submitted by: Ruben Kerkhof Approved by: araujo (mentor) Obtained from: TrueOS Sponsored by: iXsystems Inc. Differential Revision: https://review.freebsd.org/D17815 Modified: head/sys/dev/ahci/ahci_pci.c Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Fri Nov 2 03:25:23 2018 (r340040) +++ head/sys/dev/ahci/ahci_pci.c Fri Nov 2 07:48:23 2018 (r340041) @@ -350,6 +350,7 @@ static const struct { {0x01861039, 0x00, "SiS 968", 0}, {0xa01c177d, 0x00, "ThunderX", AHCI_Q_ABAR0|AHCI_Q_1MSI}, {0x00311c36, 0x00, "Annapurna", AHCI_Q_FORCE_PI|AHCI_Q_RESTORE_CAP|AHCI_Q_NOMSIX}, + {0x1600144d, 0x00, "Samsung", AHCI_Q_NOMSI}, {0x00000000, 0x00, NULL, 0} }; From owner-svn-src-head@freebsd.org Fri Nov 2 07:57:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D36510EC606; Fri, 2 Nov 2018 07:57:29 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B71567B3FA; Fri, 2 Nov 2018 07:57:28 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C4BC27C49; Fri, 2 Nov 2018 07:57:28 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA27vSL5033849; Fri, 2 Nov 2018 07:57:28 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA27vSrk033848; Fri, 2 Nov 2018 07:57:28 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201811020757.wA27vSrk033848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 2 Nov 2018 07:57:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340042 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 340042 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 07:57:29 -0000 Author: araujo Date: Fri Nov 2 07:57:28 2018 New Revision: 340042 URL: https://svnweb.freebsd.org/changeset/base/340042 Log: Fix resource leak, variables cp, xopts and nopt going out of scope. Reported by: Coverity CID: 1305412 Sponsored by: iXsystems Inc. Modified: head/usr.sbin/bhyve/block_if.c Modified: head/usr.sbin/bhyve/block_if.c ============================================================================== --- head/usr.sbin/bhyve/block_if.c Fri Nov 2 07:48:23 2018 (r340041) +++ head/usr.sbin/bhyve/block_if.c Fri Nov 2 07:57:28 2018 (r340042) @@ -573,6 +573,9 @@ blockif_open(const char *optstr, const char *ident) err: if (fd >= 0) close(fd); + free(cp); + free(xopts); + free(nopt); return (NULL); } From owner-svn-src-head@freebsd.org Fri Nov 2 07:59:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 387E210EC6B3; Fri, 2 Nov 2018 07:59:29 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E06A97B565; Fri, 2 Nov 2018 07:59:28 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD35B27C4A; Fri, 2 Nov 2018 07:59:28 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA27xSs7033977; Fri, 2 Nov 2018 07:59:28 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA27xSgS033976; Fri, 2 Nov 2018 07:59:28 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201811020759.wA27xSgS033976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 2 Nov 2018 07:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340043 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 340043 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 07:59:29 -0000 Author: araujo Date: Fri Nov 2 07:59:28 2018 New Revision: 340043 URL: https://svnweb.freebsd.org/changeset/base/340043 Log: Fix resource leak, variable fd going out of scope. Reported by: Coverity CID: 1204383 Sponsored by: iXsystems Inc. Modified: head/usr.sbin/bhyve/pci_virtio_rnd.c Modified: head/usr.sbin/bhyve/pci_virtio_rnd.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_rnd.c Fri Nov 2 07:57:28 2018 (r340042) +++ head/usr.sbin/bhyve/pci_virtio_rnd.c Fri Nov 2 07:59:28 2018 (r340043) @@ -168,6 +168,7 @@ pci_vtrnd_init(struct vmctx *ctx, struct pci_devinst * len = read(fd, &v, sizeof(v)); if (len <= 0) { WPRINTF(("vtrnd: /dev/random not ready, read(): %d", len)); + close(fd); return (1); } From owner-svn-src-head@freebsd.org Fri Nov 2 08:01:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DCA610ECAB7; Fri, 2 Nov 2018 08:01:43 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7B987B7D3; Fri, 2 Nov 2018 08:01:42 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A03F27D9E; Fri, 2 Nov 2018 08:01:42 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA281gH3037785; Fri, 2 Nov 2018 08:01:42 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA281ghr037784; Fri, 2 Nov 2018 08:01:42 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201811020801.wA281ghr037784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 2 Nov 2018 08:01:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340044 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 340044 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 08:01:43 -0000 Author: araujo Date: Fri Nov 2 08:01:42 2018 New Revision: 340044 URL: https://svnweb.freebsd.org/changeset/base/340044 Log: Fix resource leak when using strdup(3). Reported by: Coverity CID: 1357336 Sponsored by: iXsystems Inc. Modified: head/usr.sbin/bhyve/pci_xhci.c Modified: head/usr.sbin/bhyve/pci_xhci.c ============================================================================== --- head/usr.sbin/bhyve/pci_xhci.c Fri Nov 2 07:59:28 2018 (r340043) +++ head/usr.sbin/bhyve/pci_xhci.c Fri Nov 2 08:01:42 2018 (r340044) @@ -2700,6 +2700,8 @@ pci_xhci_parse_opts(struct pci_xhci_softc *sc, char *o sc->ndevices++; } + if (uopt != NULL) + free(uopt); portsfinal: sc->portregs = calloc(XHCI_MAX_DEVS, sizeof(struct pci_xhci_portregs)); @@ -2729,6 +2731,7 @@ done: free(devices); } } + free(uopt); return (sc->ndevices); } From owner-svn-src-head@freebsd.org Fri Nov 2 08:03:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7624410ECB6A; Fri, 2 Nov 2018 08:03:20 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BDE97BADF; Fri, 2 Nov 2018 08:03:20 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0759F27DDC; Fri, 2 Nov 2018 08:03:20 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA283JGZ038680; Fri, 2 Nov 2018 08:03:19 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA283Jhv038679; Fri, 2 Nov 2018 08:03:19 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201811020803.wA283Jhv038679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 2 Nov 2018 08:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340045 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 340045 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 08:03:20 -0000 Author: araujo Date: Fri Nov 2 08:03:19 2018 New Revision: 340045 URL: https://svnweb.freebsd.org/changeset/base/340045 Log: Fix resource leak when using strdup(3). Reported by: Coverity CID: 1357337 Sponsored by: iXsystems Inc. Modified: head/usr.sbin/bhyve/pci_fbuf.c Modified: head/usr.sbin/bhyve/pci_fbuf.c ============================================================================== --- head/usr.sbin/bhyve/pci_fbuf.c Fri Nov 2 08:01:42 2018 (r340044) +++ head/usr.sbin/bhyve/pci_fbuf.c Fri Nov 2 08:03:19 2018 (r340045) @@ -319,6 +319,7 @@ pci_fbuf_parse_opts(struct pci_fbuf_softc *sc, char *o } done: + free(uopts); return (ret); } From owner-svn-src-head@freebsd.org Fri Nov 2 08:28:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 455A810ED36A; Fri, 2 Nov 2018 08:28:15 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBEB47C89F; Fri, 2 Nov 2018 08:28:14 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC717167; Fri, 2 Nov 2018 08:28:14 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA28SE78050296; Fri, 2 Nov 2018 08:28:14 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA28SEHG050295; Fri, 2 Nov 2018 08:28:14 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201811020828.wA28SEHG050295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 2 Nov 2018 08:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340046 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 340046 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 08:28:15 -0000 Author: araujo Date: Fri Nov 2 08:28:14 2018 New Revision: 340046 URL: https://svnweb.freebsd.org/changeset/base/340046 Log: Add support ps/2 scancodes for NumLock, ScrollLock and numerical keypad keys. PR: 213835 Submitted by: Vasily Postnicov MFC after: 4 weeks Relnotes: Yes Sponsored by: iXsystems Inc. Modified: head/usr.sbin/bhyve/ps2kbd.c Modified: head/usr.sbin/bhyve/ps2kbd.c ============================================================================== --- head/usr.sbin/bhyve/ps2kbd.c Fri Nov 2 08:03:19 2018 (r340045) +++ head/usr.sbin/bhyve/ps2kbd.c Fri Nov 2 08:28:14 2018 (r340046) @@ -76,6 +76,107 @@ struct ps2kbd_softc { uint8_t curcmd; /* current command for next byte */ }; +#define SCANCODE_E0_PREFIX 1 +struct extended_translation { + uint32_t keysym; + uint8_t scancode; + int flags; +}; + +/* + * FIXME: Pause/break and Print Screen/SysRq require special handling. + */ +static const struct extended_translation extended_translations[] = { + {0xff08, 0x66}, /* Back space */ + {0xff09, 0x0d}, /* Tab */ + {0xff0d, 0x5a}, /* Return */ + {0xff1b, 0x76}, /* Escape */ + {0xff50, 0x6c, SCANCODE_E0_PREFIX}, /* Home */ + {0xff51, 0x6b, SCANCODE_E0_PREFIX}, /* Left arrow */ + {0xff52, 0x75, SCANCODE_E0_PREFIX}, /* Up arrow */ + {0xff53, 0x74, SCANCODE_E0_PREFIX}, /* Right arrow */ + {0xff54, 0x72, SCANCODE_E0_PREFIX}, /* Down arrow */ + {0xff55, 0x7d, SCANCODE_E0_PREFIX}, /* PgUp */ + {0xff56, 0x7a, SCANCODE_E0_PREFIX}, /* PgDown */ + {0xff57, 0x69, SCANCODE_E0_PREFIX}, /* End */ + {0xff63, 0x70, SCANCODE_E0_PREFIX}, /* Ins */ + {0xff8d, 0x5a, SCANCODE_E0_PREFIX}, /* Keypad Enter */ + {0xffe1, 0x12}, /* Left shift */ + {0xffe2, 0x59}, /* Right shift */ + {0xffe3, 0x14}, /* Left control */ + {0xffe4, 0x14, SCANCODE_E0_PREFIX}, /* Right control */ + /* {0xffe7, XXX}, Left meta */ + /* {0xffe8, XXX}, Right meta */ + {0xffe9, 0x11}, /* Left alt */ + {0xfe03, 0x11, SCANCODE_E0_PREFIX}, /* AltGr */ + {0xffea, 0x11, SCANCODE_E0_PREFIX}, /* Right alt */ + {0xffeb, 0x1f, SCANCODE_E0_PREFIX}, /* Left Windows */ + {0xffec, 0x27, SCANCODE_E0_PREFIX}, /* Right Windows */ + {0xffbe, 0x05}, /* F1 */ + {0xffbf, 0x06}, /* F2 */ + {0xffc0, 0x04}, /* F3 */ + {0xffc1, 0x0c}, /* F4 */ + {0xffc2, 0x03}, /* F5 */ + {0xffc3, 0x0b}, /* F6 */ + {0xffc4, 0x83}, /* F7 */ + {0xffc5, 0x0a}, /* F8 */ + {0xffc6, 0x01}, /* F9 */ + {0xffc7, 0x09}, /* F10 */ + {0xffc8, 0x78}, /* F11 */ + {0xffc9, 0x07}, /* F12 */ + {0xffff, 0x71, SCANCODE_E0_PREFIX}, /* Del */ + {0xff14, 0x7e}, /* ScrollLock */ + /* NumLock and Keypads*/ + {0xff7f, 0x77}, /* NumLock */ + {0xffaf, 0x4a, SCANCODE_E0_PREFIX}, /* Keypad slash */ + {0xffaa, 0x7c}, /* Keypad asterisk */ + {0xffad, 0x7b}, /* Keypad minus */ + {0xffab, 0x79}, /* Keypad plus */ + {0xffb7, 0x6c}, /* Keypad 7 */ + {0xff95, 0x6c}, /* Keypad home */ + {0xffb8, 0x75}, /* Keypad 8 */ + {0xff97, 0x75}, /* Keypad up arrow */ + {0xffb9, 0x7d}, /* Keypad 9 */ + {0xff9a, 0x7d}, /* Keypad PgUp */ + {0xffb4, 0x6b}, /* Keypad 4 */ + {0xff96, 0x6b}, /* Keypad left arrow */ + {0xffb5, 0x73}, /* Keypad 5 */ + {0xff9d, 0x73}, /* Keypad empty */ + {0xffb6, 0x74}, /* Keypad 6 */ + {0xff98, 0x74}, /* Keypad right arrow */ + {0xffb1, 0x69}, /* Keypad 1 */ + {0xff9c, 0x69}, /* Keypad end */ + {0xffb2, 0x72}, /* Keypad 2 */ + {0xff99, 0x72}, /* Keypad down arrow */ + {0xffb3, 0x7a}, /* Keypad 3 */ + {0xff9b, 0x7a}, /* Keypad PgDown */ + {0xffb0, 0x70}, /* Keypad 0 */ + {0xff9e, 0x70}, /* Keypad ins */ + {0xffae, 0x71}, /* Keypad . */ + {0xff9f, 0x71}, /* Keypad del */ + {0, 0, 0} /* Terminator */ +}; + +/* ASCII to type 2 scancode lookup table */ +static const uint8_t ascii_translations[128] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x29, 0x16, 0x52, 0x26, 0x25, 0x2e, 0x3d, 0x52, + 0x46, 0x45, 0x3e, 0x55, 0x41, 0x4e, 0x49, 0x4a, + 0x45, 0x16, 0x1e, 0x26, 0x25, 0x2e, 0x36, 0x3d, + 0x3e, 0x46, 0x4c, 0x4c, 0x41, 0x55, 0x49, 0x4a, + 0x1e, 0x1c, 0x32, 0x21, 0x23, 0x24, 0x2b, 0x34, + 0x33, 0x43, 0x3b, 0x42, 0x4b, 0x3a, 0x31, 0x44, + 0x4d, 0x15, 0x2d, 0x1b, 0x2c, 0x3c, 0x2a, 0x1d, + 0x22, 0x35, 0x1a, 0x54, 0x5d, 0x5b, 0x36, 0x4e, + 0x0e, 0x1c, 0x32, 0x21, 0x23, 0x24, 0x2b, 0x34, + 0x33, 0x43, 0x3b, 0x42, 0x4b, 0x3a, 0x31, 0x44, + 0x4d, 0x15, 0x2d, 0x1b, 0x2c, 0x3c, 0x2a, 0x1d, + 0x22, 0x35, 0x1a, 0x54, 0x5d, 0x5b, 0x0e, 0x00, +}; + static void fifo_init(struct ps2kbd_softc *sc) { @@ -212,236 +313,39 @@ static void ps2kbd_keysym_queue(struct ps2kbd_softc *sc, int down, uint32_t keysym) { - /* ASCII to type 2 scancode lookup table */ - const uint8_t translation[128] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x29, 0x16, 0x52, 0x26, 0x25, 0x2e, 0x3d, 0x52, - 0x46, 0x45, 0x3e, 0x55, 0x41, 0x4e, 0x49, 0x4a, - 0x45, 0x16, 0x1e, 0x26, 0x25, 0x2e, 0x36, 0x3d, - 0x3e, 0x46, 0x4c, 0x4c, 0x41, 0x55, 0x49, 0x4a, - 0x1e, 0x1c, 0x32, 0x21, 0x23, 0x24, 0x2b, 0x34, - 0x33, 0x43, 0x3b, 0x42, 0x4b, 0x3a, 0x31, 0x44, - 0x4d, 0x15, 0x2d, 0x1b, 0x2c, 0x3c, 0x2a, 0x1d, - 0x22, 0x35, 0x1a, 0x54, 0x5d, 0x5b, 0x36, 0x4e, - 0x0e, 0x1c, 0x32, 0x21, 0x23, 0x24, 0x2b, 0x34, - 0x33, 0x43, 0x3b, 0x42, 0x4b, 0x3a, 0x31, 0x44, - 0x4d, 0x15, 0x2d, 0x1b, 0x2c, 0x3c, 0x2a, 0x1d, - 0x22, 0x35, 0x1a, 0x54, 0x5d, 0x5b, 0x0e, 0x00, - }; - assert(pthread_mutex_isowned_np(&sc->mtx)); + int e0_prefix, found; + uint8_t code; + const struct extended_translation *trans; - switch (keysym) { - case 0x0 ... 0x7f: - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, translation[keysym]); - break; - case 0xff08: /* Back space */ - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x66); - break; - case 0xff09: /* Tab */ - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x0d); - break; - case 0xff0d: /* Return */ - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x5a); - break; - case 0xff1b: /* Escape */ - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x76); - break; - case 0xff50: /* Home */ - fifo_put(sc, 0xe0); - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x6c); - break; - case 0xff51: /* Left arrow */ - fifo_put(sc, 0xe0); - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x6b); - break; - case 0xff52: /* Up arrow */ - fifo_put(sc, 0xe0); - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x75); - break; - case 0xff53: /* Right arrow */ - fifo_put(sc, 0xe0); - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x74); - break; - case 0xff54: /* Down arrow */ - fifo_put(sc, 0xe0); - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x72); - break; - case 0xff55: /* PgUp */ - fifo_put(sc, 0xe0); - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x7d); - break; - case 0xff56: /* PgDwn */ - fifo_put(sc, 0xe0); - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x7a); - break; - case 0xff57: /* End */ - fifo_put(sc, 0xe0); - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x69); - break; - case 0xff63: /* Ins */ - fifo_put(sc, 0xe0); - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x70); - break; - case 0xff8d: /* Keypad Enter */ - fifo_put(sc, 0xe0); - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x5a); - break; - case 0xffe1: /* Left shift */ - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x12); - break; - case 0xffe2: /* Right shift */ - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x59); - break; - case 0xffe3: /* Left control */ - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x14); - break; - case 0xffe4: /* Right control */ - fifo_put(sc, 0xe0); - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x14); - break; - case 0xffe7: /* Left meta */ - /* XXX */ - break; - case 0xffe8: /* Right meta */ - /* XXX */ - break; - case 0xffe9: /* Left alt */ - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x11); - break; - case 0xfe03: /* AltGr */ - case 0xffea: /* Right alt */ - fifo_put(sc, 0xe0); - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x11); - break; - case 0xffeb: /* Left Windows */ - fifo_put(sc, 0xe0); - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x1f); - break; - case 0xffec: /* Right Windows */ - fifo_put(sc, 0xe0); - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x27); - break; - case 0xffbe: /* F1 */ - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x05); - break; - case 0xffbf: /* F2 */ - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x06); - break; - case 0xffc0: /* F3 */ - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x04); - break; - case 0xffc1: /* F4 */ - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x0C); - break; - case 0xffc2: /* F5 */ - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x03); - break; - case 0xffc3: /* F6 */ - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x0B); - break; - case 0xffc4: /* F7 */ - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x83); - break; - case 0xffc5: /* F8 */ - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x0A); - break; - case 0xffc6: /* F9 */ - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x01); - break; - case 0xffc7: /* F10 */ - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x09); - break; - case 0xffc8: /* F11 */ - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x78); - break; - case 0xffc9: /* F12 */ - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x07); - break; - case 0xffff: /* Del */ - fifo_put(sc, 0xe0); - if (!down) - fifo_put(sc, 0xf0); - fifo_put(sc, 0x71); - break; - default: - fprintf(stderr, "Unhandled ps2 keyboard keysym 0x%x\n", - keysym); - break; + found = 0; + printf("keysym 0x%x\n", keysym); + if (keysym < 0x80) { + code = ascii_translations[keysym]; + e0_prefix = 0; + found = 1; + } else { + for (trans = &(extended_translations[0]); trans->keysym != 0; + trans++) { + if (keysym == trans->keysym) { + code = trans->scancode; + e0_prefix = trans->flags & SCANCODE_E0_PREFIX; + found = 1; + break; + } + } } + + if (!found) { + fprintf(stderr, "Unhandled ps2 keyboard keysym 0x%x\n", keysym); + return; + } + + if (e0_prefix) + fifo_put(sc, 0xe0); + if (!down) + fifo_put(sc, 0xf0); + fifo_put(sc, code); } static void From owner-svn-src-head@freebsd.org Fri Nov 2 08:46:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 631E210EDC6B; Fri, 2 Nov 2018 08:46:21 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF1317D44E; Fri, 2 Nov 2018 08:46:20 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wr1-x441.google.com with SMTP id y16so1140659wrw.3; Fri, 02 Nov 2018 01:46:20 -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=zDPEB1Rdi3c52hUFDWSrrw5W3wE4bvh126HBwBZ/VWw=; b=EdwtNhf9WtWl3WGC8nqDj+OvbhoeQOIbm5ctH4XqvCzm5m21s+b3dd6YspJHe4UI8B F8r2wSwEFk6frmhOLE9cOd9iSDzIsf+qfOYXBOL5xTgAN2Xs2vI6GTxi87994PPGzcuj WW8uoZ0ejOq7bIHNx+CigS87+teYFR7tD1HtWB7qIYZmuUVgvaZYluLSTgVOpqcGlutd rtVT/Ig7q4sZVKDUk17jwK6KPtk+LzkNnwG6Unj4esWQLTG8dBx5V41Ys4n0WA3KTagc aXP1RJ70o4WjdnolLqvpKCJJxq8V//yZNJKaikfMpZWoI91OY8/ZC2Aq0TEEeda410ff 8lzA== 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=zDPEB1Rdi3c52hUFDWSrrw5W3wE4bvh126HBwBZ/VWw=; b=E/56xsrSgQta2nzbse4hywjnFYrOUgh7PkS5LkkFOgJYS7ZupxOB4M44LV7WPTQRY2 Le/3uVtQiCaG911CY90+XhMxmrR56UpBAr1V5j9rq9w8WxmORedxV1GzUGEln9to/vqN MERZ/SY3JCWsHac1OF8OYpUwKE5BCKwm2uy9jfTW7NPCdk6gRKrLNOBd4bsztf3vJkew DD2FU3M4A3a83kOx3ovVCWLGlOlIOzmA+NGQf46d5bzTFXlaZtlxZMOVJkYkP1bUufcp t01obqpk7c0wREo6RcCk/qRMWtmefKQnt3UD+cS0aDTpqrhpUSBq9MAVgxrWrp+cnxJl y1IQ== X-Gm-Message-State: AGRZ1gKZy80Mhr1CDo18tzJkO5trM2apE8GcdW8ysy2xYb2oNjYYWDdM hc86N+7gdtF1zrqQidWjSUOxzvRd X-Google-Smtp-Source: AJdET5dMu/ypPUNKXVXNhFTBAMWcENHiau5qWw1mZ87VhhNx9dwPAdFFNxK57CcVY/Rzxd92/nCTiQ== X-Received: by 2002:adf:ead0:: with SMTP id o16-v6mr9912197wrn.287.1541148379420; Fri, 02 Nov 2018 01:46:19 -0700 (PDT) Received: from ernst.home (p5B02380D.dip0.t-ipconnect.de. [91.2.56.13]) by smtp.gmail.com with ESMTPSA id e8-v6sm6823877wrw.75.2018.11.02.01.46.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Nov 2018 01:46:18 -0700 (PDT) Date: Fri, 2 Nov 2018 09:46:17 +0100 From: Gary Jennejohn To: Conrad Meyer Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r340038 - in head: lib/libc/sys sys/kern Message-ID: <20181102094617.7340e6f2@ernst.home> In-Reply-To: References: <201811012346.wA1NkNS5079845@repo.freebsd.org> <20181102004555.GJ5335@kib.kiev.ua> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 08:46:21 -0000 On Thu, 1 Nov 2018 20:29:27 -0700 Conrad Meyer wrote: > On Thu, Nov 1, 2018 at 5:46 PM Konstantin Belousov wrote: > > > > On Thu, Nov 01, 2018 at 11:46:23PM +0000, Conrad Meyer wrote: > > > ... > > > @@ -232,7 +232,15 @@ points outside the process's allocated address space. > > > A signal was delivered before the time limit expired and > > > before any of the selected events occurred. > > > .It Bq Er EINVAL > > > -The specified time limit is invalid. One of its components is negative or too large. > > > +The specified time limit is invalid. > > > +One of its components is negative or too large. > > > +.It Bq Er EINVAL > > > +The number of pollfd structures specified by > > > +.Fa nfds > > > +exceeds the system tunable > > > +.Va kern.maxfilesperproc > > > +and > > > +.Dv FD_SETSIZE . > > > > This is somewhat confusing. Looking only at the man page text, most > > straight reading of it is that nfds cannot exceed min(maxfilesperproc, > > FD_SETSIZE). But in fact nfds cannot exceed max of it, which is > > significantly different, i.e. poll(2) does not suffer from the (userspace) > > FD_SETSIZE limitation of select(2). > > min(maxfilesperproc, FD_SETSIZE) would be written as "nfds exceeds ... > maxfilesperproc OR FD_SETSIZE," rather than "and." I think the > sentence is unambiguous. > Based on Konstantin's comment I'd have to say that it is not unambiguous. As a native English speaker I had to read it several times to understand it. I think something like "exceeds both" might be clearer. -- Gary Jennejohn From owner-svn-src-head@freebsd.org Fri Nov 2 09:47:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0E3C10EF77C; Fri, 2 Nov 2018 09:47:18 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 877957FD12; Fri, 2 Nov 2018 09:47:18 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68CC0EAE; Fri, 2 Nov 2018 09:47:18 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA29lIf9092809; Fri, 2 Nov 2018 09:47:18 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA29lIdJ092808; Fri, 2 Nov 2018 09:47:18 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201811020947.wA29lIdJ092808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 2 Nov 2018 09:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340047 - head/stand/i386/loader X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/loader X-SVN-Commit-Revision: 340047 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 09:47:19 -0000 Author: tsoome Date: Fri Nov 2 09:47:18 2018 New Revision: 340047 URL: https://svnweb.freebsd.org/changeset/base/340047 Log: loader: do not probe floppy devices for zfs The subject is telling it all. Modified: head/stand/i386/loader/main.c Modified: head/stand/i386/loader/main.c ============================================================================== --- head/stand/i386/loader/main.c Fri Nov 2 08:28:14 2018 (r340046) +++ head/stand/i386/loader/main.c Fri Nov 2 09:47:18 2018 (r340047) @@ -399,6 +399,8 @@ i386_zfs_probe(void) for (unit = 0; unit < MAXBDDEV; unit++) { if (bd_unit2bios(unit) == -1) break; + if (bd_unit2bios(unit) < 0x80) + continue; sprintf(devname, "disk%d:", unit); zfs_probe_dev(devname, NULL); } From owner-svn-src-head@freebsd.org Fri Nov 2 10:18:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C38B10F0FE2; Fri, 2 Nov 2018 10:18:57 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37AE9811E2; Fri, 2 Nov 2018 10:18:57 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19A3613A8; Fri, 2 Nov 2018 10:18:57 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA2AIubg008554; Fri, 2 Nov 2018 10:18:56 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2AIuuI008553; Fri, 2 Nov 2018 10:18:56 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201811021018.wA2AIuuI008553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Fri, 2 Nov 2018 10:18:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340048 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 340048 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 10:18:57 -0000 Author: 0mp (ports committer) Date: Fri Nov 2 10:18:56 2018 New Revision: 340048 URL: https://svnweb.freebsd.org/changeset/base/340048 Log: nsmb.conf(5): Document the order of configuration loading Based on the comments in /etc/nsmb.conf. Reviewed by: bcr Approved by: krion (mentor, implicit), mat (mentor, implicit) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D17810 Modified: head/share/man/man5/nsmb.conf.5 Modified: head/share/man/man5/nsmb.conf.5 ============================================================================== --- head/share/man/man5/nsmb.conf.5 Fri Nov 2 09:47:18 2018 (r340047) +++ head/share/man/man5/nsmb.conf.5 Fri Nov 2 10:18:56 2018 (r340048) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 2016 +.Dd November 2, 2018 .Dt NSMB.CONF 5 .Os .Sh NAME @@ -40,6 +40,21 @@ file contains information about the computers, users, or mount points for the .Tn SMB network protocol. +.Pp +The configuration files are loaded in the following order: +.Pp +.Bl -enum -offset indent -width "" -compact +.It +.Pa ~/.nsmbrc +.It +.Pa /etc/nsmb.conf +.El +.Pp +As a result, +.Pa /etc/nsmb.conf +settings +override those in +.Pa ~/.nsmbrc . .Pp The configuration hierarchy is made up of several sections, each section containing a few or several lines of parameters From owner-svn-src-head@freebsd.org Fri Nov 2 11:38:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6688910F313E for ; Fri, 2 Nov 2018 11:38:38 +0000 (UTC) (envelope-from kib@freebsd.org) 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 E571C84289; Fri, 2 Nov 2018 11:38:37 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id wA2BcR3s057012 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 2 Nov 2018 13:38:30 +0200 (EET) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wA2BcR3s057012 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wA2BcRTn057011; Fri, 2 Nov 2018 13:38:27 +0200 (EET) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Fri, 2 Nov 2018 13:38:27 +0200 From: Konstantin Belousov To: Mark Millard Cc: svn-src-head@freebsd.org, Alexander Richardson Subject: Re: svn commit: r339876 - head/libexec/rtld-elf Message-ID: <20181102113827.GM5335@kib.kiev.ua> References: <8E5A5F3A-F1A7-4702-A2F7-65D74CC5B2E5@yahoo.com> <20181102004101.GI5335@kib.kiev.ua> <003A49D7-6E8B-4775-A70B-E0EB44505D4B@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <003A49D7-6E8B-4775-A70B-E0EB44505D4B@yahoo.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 11:38:38 -0000 On Fri, Nov 02, 2018 at 12:16:23AM -0700, Mark Millard wrote: > It stops when the dcbst in __syncicache runs into an address in > the p_align 65536 caused hole between the two PT_LOAD's with PF_X. > /bin/ls itself has such a hole, as do the .so libraries involved. Try this. I only compile-tested the change. diff --git a/libexec/rtld-elf/powerpc/reloc.c b/libexec/rtld-elf/powerpc/reloc.c index e921a4dc7d1..5f21e33bee3 100644 --- a/libexec/rtld-elf/powerpc/reloc.c +++ b/libexec/rtld-elf/powerpc/reloc.c @@ -294,6 +294,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, { const Elf_Rela *relalim; const Elf_Rela *rela; + const Elf_Phdr *phdr; SymCache *cache; int r = -1; @@ -327,8 +328,18 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, if (cache != NULL) free(cache); - /* Synchronize icache for text seg in case we made any changes */ - __syncicache(obj->mapbase, obj->textsize); + /* + * Synchronize icache for executable segments in case we made + * any changes. + */ + for (phdr = obj->phdr; + (const char *)phdr < (const char *)obj->phdr + obj->phsize; + phdr++) { + if (phdr->p_type == PT_LOAD && (phdr->p_flags & PF_X) != 0) { + __syncicache(obj->mapbase + phdr->p_vaddr, + phdr->p_memsz); + } + } return (r); } diff --git a/libexec/rtld-elf/powerpc64/reloc.c b/libexec/rtld-elf/powerpc64/reloc.c index c2d6dac13b1..980b4933afe 100644 --- a/libexec/rtld-elf/powerpc64/reloc.c +++ b/libexec/rtld-elf/powerpc64/reloc.c @@ -291,6 +291,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, { const Elf_Rela *relalim; const Elf_Rela *rela; + const Elf_Phdr *phdr; SymCache *cache; int bytes = obj->dynsymcount * sizeof(SymCache); int r = -1; @@ -327,8 +328,18 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, if (cache) munmap(cache, bytes); - /* Synchronize icache for text seg in case we made any changes */ - __syncicache(obj->mapbase, obj->textsize); + /* + * Synchronize icache for executable segments in case we made + * any changes. + */ + for (phdr = obj->phdr; + (const char *)phdr < (const char *)obj->phdr + obj->phsize; + phdr++) { + if (phdr->p_type == PT_LOAD && (phdr->p_flags & PF_X) != 0) { + __syncicache(obj->mapbase + phdr->p_vaddr, + phdr->p_memsz); + } + } return (r); } From owner-svn-src-head@freebsd.org Fri Nov 2 11:41:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BAE210F33FA; Fri, 2 Nov 2018 11:41:59 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3709845B3; Fri, 2 Nov 2018 11:41:58 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5E89220F; Fri, 2 Nov 2018 11:41:58 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA2BfwMu053020; Fri, 2 Nov 2018 11:41:58 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2BfwuU053019; Fri, 2 Nov 2018 11:41:58 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201811021141.wA2BfwuU053019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 2 Nov 2018 11:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340049 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 340049 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 11:41:59 -0000 Author: tsoome Date: Fri Nov 2 11:41:58 2018 New Revision: 340049 URL: https://svnweb.freebsd.org/changeset/base/340049 Log: loader: biosdisk should check if the media is present The bd_print/bd_open/bd_strategy need to make sure the device does have media, before getting into performing IO operations. Some systems can hung if the device without a media is accessed. Reported by: yuripv Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Fri Nov 2 10:18:56 2018 (r340048) +++ head/stand/i386/libi386/biosdisk.c Fri Nov 2 11:41:58 2018 (r340049) @@ -418,6 +418,9 @@ bd_print(int verbose) if ((ret = pager_output(line)) != 0) break; + if ((bdinfo[i].bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) + continue; + dev.dd.d_dev = &biosdisk; dev.dd.d_unit = i; dev.d_slice = -1; @@ -464,6 +467,8 @@ bd_open(struct open_file *f, ...) if ((BD(dev).bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) { if (!bd_int13probe(&BD(dev))) return (EIO); + if ((BD(dev).bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) + return (EIO); } BD(dev).bd_open++; if (BD(dev).bd_bcache == NULL) @@ -568,6 +573,9 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s size_t blks, blkoff, bsize, rest; caddr_t bbuf; int rc; + + if ((BD(dev).bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) + return (EIO); /* * First make sure the IO size is a multiple of 512 bytes. While we do From owner-svn-src-head@freebsd.org Fri Nov 2 13:35:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 774F910F712B for ; Fri, 2 Nov 2018 13:35:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x12d.google.com (mail-it1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5F8A6AC6D for ; Fri, 2 Nov 2018 13:35:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x12d.google.com with SMTP id w7-v6so3205315itd.1 for ; Fri, 02 Nov 2018 06:35:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TH9JcfjSyk++ayNaRyp1mIk6oV2pu18EDAoHkvGjO4Q=; b=xjvEN/pk8lU551/CQ+2TeVfksGqpJxVBI7R8fv+Qgl5eacLW6HCcHj/IEv7L5O2UZW +chEMUVPt2TtdVkjNWrd1EJOKoJpJ+qjBbyA6eJlWuevDI6B8RRrw4G7gugBhVgEXb+w UMCYzuFruuPSJ5iqYnDvjT+OkozX4HY1Y4wwxtpJofUY8007F/ApuyRuf6+mZvk/gQNk s9ndZ0aqkyKSirQv9J+WLrQdMmi8PbEUZjkIVFr4RnqdB1S/dtMr+Fpn8oFUaHisIImR mPi/3nX0Mo+0A44pdlzbBUyv8dak1vd1WLfuqiN33XAHNANrz9lsQSXCkVPKJwVJrg1+ +axw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TH9JcfjSyk++ayNaRyp1mIk6oV2pu18EDAoHkvGjO4Q=; b=NcU/P11TKbLs0nGK7FEmnjaWwF8E34WNR4QBF78LzXcXrms9S/rb0nzENZ/QWM5TdO oM/nXUPVy9rfiezlBzQ/IVQmyfqP7ahL7Qi3yFyn5u/PD5MIqcoY7nQhcAwRIlDa6t64 tITnvKpAJK3ui231X7nzJDd3u6iw83sKWxgqEG6+3/9StgrOIx2zDzLeWLtCQF7r+ghL J/K7gOOd906VY6jq9x6dOkF5lJjAL1B6LaPtzdepbpmTVv+eK52zOYwMG/twQ2b1Y0Vv X3dY8Anr1Ie7lrfWKthUue8I+4yTTpJCDHt4IWMXfQAvurlSvVWV+gjQqW+5XYayUnwZ FTLA== X-Gm-Message-State: AGRZ1gInZNZT6MNIVwi76ZaunGjhxhWxqXebNLBzTPU1uvbNNjemf1CS QZrqjnlDH7U3avK2oscvE0ldHITJV6tjb58D/LYcqQ== X-Google-Smtp-Source: AJdET5c4unsQtyf2bMMxt4sku74jFuTLTgvQBa5m9vFO7U8cQwP33r1SGIzNpIgrJ7IjGuBBS5Soi6XifWIW9A01nuY= X-Received: by 2002:a02:2708:: with SMTP id g8-v6mr9876691jaa.93.1541165741168; Fri, 02 Nov 2018 06:35:41 -0700 (PDT) MIME-Version: 1.0 References: <201811012346.wA1NkNS5079845@repo.freebsd.org> <20181102004555.GJ5335@kib.kiev.ua> <20181102094617.7340e6f2@ernst.home> In-Reply-To: <20181102094617.7340e6f2@ernst.home> From: Warner Losh Date: Fri, 2 Nov 2018 07:35:29 -0600 Message-ID: Subject: Re: svn commit: r340038 - in head: lib/libc/sys sys/kern To: Gary Jennejohn Cc: "Conrad E. Meyer" , Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 13:35:42 -0000 On Fri, Nov 2, 2018 at 2:46 AM Gary Jennejohn wrote: > On Thu, 1 Nov 2018 20:29:27 -0700 > Conrad Meyer wrote: > > > On Thu, Nov 1, 2018 at 5:46 PM Konstantin Belousov > wrote: > > > > > > On Thu, Nov 01, 2018 at 11:46:23PM +0000, Conrad Meyer wrote: > > > > ... > > > > @@ -232,7 +232,15 @@ points outside the process's allocated address > space. > > > > A signal was delivered before the time limit expired and > > > > before any of the selected events occurred. > > > > .It Bq Er EINVAL > > > > -The specified time limit is invalid. One of its components is > negative or too large. > > > > +The specified time limit is invalid. > > > > +One of its components is negative or too large. > > > > +.It Bq Er EINVAL > > > > +The number of pollfd structures specified by > > > > +.Fa nfds > > > > +exceeds the system tunable > > > > +.Va kern.maxfilesperproc > > > > +and > > > > +.Dv FD_SETSIZE . > > > > > > This is somewhat confusing. Looking only at the man page text, most > > > straight reading of it is that nfds cannot exceed min(maxfilesperproc, > > > FD_SETSIZE). But in fact nfds cannot exceed max of it, which is > > > significantly different, i.e. poll(2) does not suffer from the > (userspace) > > > FD_SETSIZE limitation of select(2). > > > > min(maxfilesperproc, FD_SETSIZE) would be written as "nfds exceeds ... > > maxfilesperproc OR FD_SETSIZE," rather than "and." I think the > > sentence is unambiguous. > > > > Based on Konstantin's comment I'd have to say that it is not > unambiguous. > > As a native English speaker I had to read it several times to > understand it. > > I think something like "exceeds both" might be clearer. > "The number of pollfd structures specified by nfds exceeds both the system tunable and FD_SETSIZE" Or even "nfds is larger than both the system tunable and FD_SETSIZE" since the 'The number of pollfd structures" is repetitive given one can go look up what it specifies. Warner From owner-svn-src-head@freebsd.org Fri Nov 2 13:48:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5026D10F767D; Fri, 2 Nov 2018 13:48:07 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05EFB6B761; Fri, 2 Nov 2018 13:48:07 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAE94395F; Fri, 2 Nov 2018 13:48:06 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA2Dm68Z031014; Fri, 2 Nov 2018 13:48:06 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2Dm6fH031013; Fri, 2 Nov 2018 13:48:06 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201811021348.wA2Dm6fH031013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 2 Nov 2018 13:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340050 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 340050 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 13:48:07 -0000 Author: araujo Date: Fri Nov 2 13:48:06 2018 New Revision: 340050 URL: https://svnweb.freebsd.org/changeset/base/340050 Log: Remove printf for debug purpose forgotten on r340046. Reported by: Dmitry Luhtionov Modified: head/usr.sbin/bhyve/ps2kbd.c Modified: head/usr.sbin/bhyve/ps2kbd.c ============================================================================== --- head/usr.sbin/bhyve/ps2kbd.c Fri Nov 2 11:41:58 2018 (r340049) +++ head/usr.sbin/bhyve/ps2kbd.c Fri Nov 2 13:48:06 2018 (r340050) @@ -319,7 +319,6 @@ ps2kbd_keysym_queue(struct ps2kbd_softc *sc, const struct extended_translation *trans; found = 0; - printf("keysym 0x%x\n", keysym); if (keysym < 0x80) { code = ascii_translations[keysym]; e0_prefix = 0; From owner-svn-src-head@freebsd.org Fri Nov 2 14:42:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2905110F994A; Fri, 2 Nov 2018 14:42:40 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDC656E7BF; Fri, 2 Nov 2018 14:42:39 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D05DC4421; Fri, 2 Nov 2018 14:42:39 +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 wA2EgdQE062111; Fri, 2 Nov 2018 14:42:39 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2EgbVc062099; Fri, 2 Nov 2018 14:42:37 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201811021442.wA2EgbVc062099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 2 Nov 2018 14:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340055 - in head: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/ext2fs sys/fs/fuse sys/fs/nandfs sys/fs/nfs sys/fs/nfsclient sys/fs/tmpfs sys/kern sys/sys sys/uf... X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/ext2fs sys/fs/fuse sys/fs/nandfs sys/fs/nfs sys/fs/nfsclient sys/fs/tmpfs sys/kern sys/sys sys/ufs/ufs X-SVN-Commit-Revision: 340055 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 14:42:40 -0000 Author: brooks Date: Fri Nov 2 14:42:36 2018 New Revision: 340055 URL: https://svnweb.freebsd.org/changeset/base/340055 Log: Make vop_symlink take a const target path. This will enable callers to take const paths as part of syscall decleration improvements. Where doing so is easy and non-distruptive carry the const through implementations. In UFS the value is passed to an interface that must take non-const values. In ZFS, const poisoning would touch code shared with upstream and it's not worth adding diffs. Bump __FreeBSD_version for external API consumers. Reviewed by: kib (prior version) Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17805 Modified: head/share/man/man9/VOP_CREATE.9 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/fuse/fuse_vnops.c head/sys/fs/nandfs/nandfs_vnops.c head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/kern/vnode_if.src head/sys/sys/param.h head/sys/ufs/ufs/ufs_vnops.c Modified: head/share/man/man9/VOP_CREATE.9 ============================================================================== --- head/share/man/man9/VOP_CREATE.9 Fri Nov 2 14:15:52 2018 (r340054) +++ head/share/man/man9/VOP_CREATE.9 Fri Nov 2 14:42:36 2018 (r340055) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 1996 +.Dd November 2, 2018 .Dt VOP_CREATE 9 .Os .Sh NAME @@ -48,7 +48,7 @@ .Ft int .Fn VOP_MKDIR "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap" .Ft int -.Fn VOP_SYMLINK "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap" "char *target" +.Fn VOP_SYMLINK "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap" "const char *target" .Sh DESCRIPTION These entry points create a new file, socket, fifo, device, directory or symlink in a given directory. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Nov 2 14:15:52 2018 (r340054) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Nov 2 14:42:36 2018 (r340055) @@ -5314,7 +5314,7 @@ zfs_freebsd_symlink(ap) vattr_init_mask(vap); return (zfs_symlink(ap->a_dvp, ap->a_vpp, cnp->cn_nameptr, vap, - ap->a_target, cnp->cn_cred, cnp->cn_thread)); + __DECONST(char *, ap->a_target), cnp->cn_cred, cnp->cn_thread)); } static int Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Fri Nov 2 14:15:52 2018 (r340054) +++ head/sys/fs/ext2fs/ext2_vnops.c Fri Nov 2 14:42:36 2018 (r340055) @@ -1521,8 +1521,8 @@ ext2_symlink(struct vop_symlink_args *ap) ip->i_size = len; ip->i_flag |= IN_CHANGE | IN_UPDATE; } else - error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0, - UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, + error = vn_rdwr(UIO_WRITE, vp, __DECONST(void *, ap->a_target), + len, (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, ap->a_cnp->cn_cred, NOCRED, NULL, NULL); if (error) vput(vp); Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Fri Nov 2 14:15:52 2018 (r340054) +++ head/sys/fs/fuse/fuse_vnops.c Fri Nov 2 14:42:36 2018 (r340055) @@ -1708,7 +1708,7 @@ fuse_vnop_symlink(struct vop_symlink_args *ap) struct vnode *dvp = ap->a_dvp; struct vnode **vpp = ap->a_vpp; struct componentname *cnp = ap->a_cnp; - char *target = ap->a_target; + const char *target = ap->a_target; struct fuse_dispatcher fdi; Modified: head/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vnops.c Fri Nov 2 14:15:52 2018 (r340054) +++ head/sys/fs/nandfs/nandfs_vnops.c Fri Nov 2 14:42:36 2018 (r340055) @@ -1939,8 +1939,8 @@ nandfs_symlink(struct vop_symlink_args *ap) len = strlen(ap->a_target); - error = vn_rdwr(UIO_WRITE, *vpp, ap->a_target, len, (off_t)0, - UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, + error = vn_rdwr(UIO_WRITE, *vpp, __DECONST(void *, ap->a_target), + len, (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, cnp->cn_cred, NOCRED, NULL, NULL); if (error) vput(*vpp); Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Fri Nov 2 14:15:52 2018 (r340054) +++ head/sys/fs/nfs/nfs_var.h Fri Nov 2 14:42:36 2018 (r340055) @@ -474,7 +474,7 @@ int nfsrpc_rename(vnode_t, vnode_t, char *, int, vnode int nfsrpc_link(vnode_t, vnode_t, char *, int, struct ucred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *, int *, int *, void *); -int nfsrpc_symlink(vnode_t, char *, int, char *, struct vattr *, +int nfsrpc_symlink(vnode_t, char *, int, const char *, struct vattr *, struct ucred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *, struct nfsfh **, int *, int *, void *); int nfsrpc_mkdir(vnode_t, char *, int, struct vattr *, Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Fri Nov 2 14:15:52 2018 (r340054) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Fri Nov 2 14:42:36 2018 (r340055) @@ -2627,7 +2627,7 @@ nfsmout: * nfs symbolic link create rpc */ APPLESTATIC int -nfsrpc_symlink(vnode_t dvp, char *name, int namelen, char *target, +nfsrpc_symlink(vnode_t dvp, char *name, int namelen, const char *target, struct vattr *vap, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, int *attrflagp, int *dattrflagp, void *dstuff) Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Fri Nov 2 14:15:52 2018 (r340054) +++ head/sys/fs/tmpfs/tmpfs.h Fri Nov 2 14:42:36 2018 (r340055) @@ -411,7 +411,7 @@ void tmpfs_ref_node(struct tmpfs_node *node); void tmpfs_ref_node_locked(struct tmpfs_node *node); int tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *, enum vtype, uid_t uid, gid_t gid, mode_t mode, struct tmpfs_node *, - char *, dev_t, struct tmpfs_node **); + const char *, dev_t, struct tmpfs_node **); void tmpfs_free_node(struct tmpfs_mount *, struct tmpfs_node *); bool tmpfs_free_node_locked(struct tmpfs_mount *, struct tmpfs_node *, bool); void tmpfs_free_tmp(struct tmpfs_mount *); @@ -424,7 +424,7 @@ int tmpfs_alloc_vp(struct mount *, struct tmpfs_node * struct vnode **); void tmpfs_free_vp(struct vnode *); int tmpfs_alloc_file(struct vnode *, struct vnode **, struct vattr *, - struct componentname *, char *); + struct componentname *, const char *); void tmpfs_check_mtime(struct vnode *); void tmpfs_dir_attach(struct vnode *, struct tmpfs_dirent *); void tmpfs_dir_detach(struct vnode *, struct tmpfs_dirent *); Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Fri Nov 2 14:15:52 2018 (r340054) +++ head/sys/fs/tmpfs/tmpfs_subr.c Fri Nov 2 14:42:36 2018 (r340055) @@ -182,7 +182,7 @@ tmpfs_ref_node_locked(struct tmpfs_node *node) int tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *tmp, enum vtype type, uid_t uid, gid_t gid, mode_t mode, struct tmpfs_node *parent, - char *target, dev_t rdev, struct tmpfs_node **node) + const char *target, dev_t rdev, struct tmpfs_node **node) { struct tmpfs_node *nnode; vm_object_t obj; @@ -717,7 +717,7 @@ tmpfs_free_vp(struct vnode *vp) */ int tmpfs_alloc_file(struct vnode *dvp, struct vnode **vpp, struct vattr *vap, - struct componentname *cnp, char *target) + struct componentname *cnp, const char *target) { int error; struct tmpfs_dirent *de; Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Fri Nov 2 14:15:52 2018 (r340054) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Fri Nov 2 14:42:36 2018 (r340055) @@ -1176,7 +1176,7 @@ tmpfs_symlink(struct vop_symlink_args *v) struct vnode **vpp = v->a_vpp; struct componentname *cnp = v->a_cnp; struct vattr *vap = v->a_vap; - char *target = v->a_target; + const char *target = v->a_target; #ifdef notyet /* XXX FreeBSD BUG: kern_symlink is not setting VLNK */ MPASS(vap->va_type == VLNK); Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Fri Nov 2 14:15:52 2018 (r340054) +++ head/sys/kern/vnode_if.src Fri Nov 2 14:42:36 2018 (r340055) @@ -325,7 +325,7 @@ vop_symlink { OUT struct vnode **vpp; IN struct componentname *cnp; IN struct vattr *vap; - IN char *target; + IN const char *target; }; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Nov 2 14:15:52 2018 (r340054) +++ head/sys/sys/param.h Fri Nov 2 14:42:36 2018 (r340055) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300002 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300003 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Fri Nov 2 14:15:52 2018 (r340054) +++ head/sys/ufs/ufs/ufs_vnops.c Fri Nov 2 14:42:36 2018 (r340055) @@ -2095,7 +2095,7 @@ ufs_symlink(ap) struct vnode **a_vpp; struct componentname *a_cnp; struct vattr *a_vap; - char *a_target; + const char *a_target; } */ *ap; { struct vnode *vp, **vpp = ap->a_vpp; @@ -2116,8 +2116,8 @@ ufs_symlink(ap) ip->i_flag |= IN_CHANGE | IN_UPDATE; error = UFS_UPDATE(vp, 0); } else - error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0, - UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, + error = vn_rdwr(UIO_WRITE, vp, __DECONST(void *, ap->a_target), + len, (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, ap->a_cnp->cn_cred, NOCRED, NULL, NULL); if (error) vput(vp); From owner-svn-src-head@freebsd.org Fri Nov 2 14:49:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF44D10F9CBF; Fri, 2 Nov 2018 14:49:10 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A0A76EBDF; Fri, 2 Nov 2018 14:49:10 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f182.google.com with SMTP id k19-v6so1967076lji.11; Fri, 02 Nov 2018 07:49:10 -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:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=/gxW1YxXD2icFXePuK6+yeY+1IyJv/53f/NA28n2/JA=; b=Gr4gLE+Djmk5alpeCcAH2AGm+ULhUXD4zfhj/WjL23PVC4x+ltbiTOLYnUnCa5Grw1 Vg4ymkuTHJ6TdThU3E6FefrqYDNrKhyURlAauyJhHIn0ury2f74phLoV/INxHwMGlBfe XJISRqWL5sHYYPlxkeGTBSavsaFhPDs7CRVc2iP0GbfNVMpMZk/mKidlDDIeemcTuUvJ OLRztKfmFDHNlbyiG/Eui2IngqAkNpWSHQ+5cgyWmPV+XzZYB1BGYasPzTVON1oJq/Ox k5OtIKBoYX2llHeMQrdeNwzzyKcSESsTklKGFJ5NkWG5L98k5mlRoIqcgrvXddr+FZBn W58A== X-Gm-Message-State: AGRZ1gJKLXcyCQqMflIiIU1DzcM+Uojz3PpuK3YmHdlUIdSjo2YWnZHG p+Q7lU7403VfFwBQIWI3qWDnMqz1 X-Google-Smtp-Source: AJdET5eh/oRZsPIFtKrveHjtfFVfzV0I6bogxwF8dweVq8BFiJTdXuOg2FAnH/DpMAJE6InL1qE/sA== X-Received: by 2002:a2e:92:: with SMTP id e18-v6mr8520170lji.130.1541170143033; Fri, 02 Nov 2018 07:49:03 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id j20sm2526878lfg.69.2018.11.02.07.49.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Nov 2018 07:49:01 -0700 (PDT) Subject: Re: svn commit: r340055 - in head: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/ext2fs sys/fs/fuse sys/fs/nandfs sys/fs/nfs sys/fs/nfsclient sys/fs/tmpfs sys/kern sys/sys sys/uf... To: Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811021442.wA2EgbVc062099@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: Date: Fri, 2 Nov 2018 16:49:00 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201811021442.wA2EgbVc062099@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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 14:49:11 -0000 On 02/11/2018 16:42, Brooks Davis wrote: > Author: brooks > Date: Fri Nov 2 14:42:36 2018 > New Revision: 340055 > URL: https://svnweb.freebsd.org/changeset/base/340055 > > Log: > Make vop_symlink take a const target path. > > This will enable callers to take const paths as part of syscall > decleration improvements. > > Where doing so is easy and non-distruptive carry the const through > implementations. In UFS the value is passed to an interface that must > take non-const values. In ZFS, const poisoning would touch code shared > with upstream and it's not worth adding diffs. zfs_vnops.c is already sufficiently different from upstream (because of quite different VFS models), so a small difference in zfs_symlink's signature would not be too bad. > Bump __FreeBSD_version for external API consumers. > > Reviewed by: kib (prior version) > Obtained from: CheriBSD > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D17805 > > Modified: > head/share/man/man9/VOP_CREATE.9 > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c -- Andriy Gapon From owner-svn-src-head@freebsd.org Fri Nov 2 15:02:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38FC810FA4AF; Fri, 2 Nov 2018 15:02:00 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E28216F76A; Fri, 2 Nov 2018 15:01:59 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3887463A; Fri, 2 Nov 2018 15:01:59 +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 wA2F1xB3069904; Fri, 2 Nov 2018 15:01:59 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2F1xSU069903; Fri, 2 Nov 2018 15:01:59 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811021501.wA2F1xSU069903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 2 Nov 2018 15:01:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340057 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 340057 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 15:02:00 -0000 Author: kp Date: Fri Nov 2 15:01:59 2018 New Revision: 340057 URL: https://svnweb.freebsd.org/changeset/base/340057 Log: Revert "pf: Limit the maximum number of fragments per packet" This reverts commit r337969. We'll handle this the OpenBSD way, in upcoming commits. Modified: head/sys/netpfil/pf/pf_norm.c Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Fri Nov 2 14:59:52 2018 (r340056) +++ head/sys/netpfil/pf/pf_norm.c Fri Nov 2 15:01:59 2018 (r340057) @@ -91,10 +91,8 @@ struct pf_fragment { TAILQ_ENTRY(pf_fragment) frag_next; uint32_t fr_timeout; uint16_t fr_maxlen; /* maximum length of single fragment */ - uint16_t fr_entries; /* Total number of pf_fragment entries */ TAILQ_HEAD(pf_fragq, pf_frent) fr_queue; }; -#define PF_MAX_FRENT_PER_FRAGMENT 64 struct pf_fragment_tag { uint16_t ft_hdrlen; /* header length of reassembled pkt */ @@ -386,7 +384,6 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct *(struct pf_fragment_cmp *)frag = *key; frag->fr_timeout = time_uptime; frag->fr_maxlen = frent->fe_len; - frag->fr_entries = 0; TAILQ_INIT(&frag->fr_queue); RB_INSERT(pf_frag_tree, &V_pf_frag_tree, frag); @@ -398,9 +395,6 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct return (frag); } - if (frag->fr_entries >= PF_MAX_FRENT_PER_FRAGMENT) - goto bad_fragment; - KASSERT(!TAILQ_EMPTY(&frag->fr_queue), ("!TAILQ_EMPTY()->fr_queue")); /* Remember maximum fragment len for refragmentation. */ @@ -472,8 +466,6 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct TAILQ_INSERT_HEAD(&frag->fr_queue, frent, fr_next); else TAILQ_INSERT_AFTER(&frag->fr_queue, prev, frent, fr_next); - - frag->fr_entries++; return (frag); From owner-svn-src-head@freebsd.org Fri Nov 2 15:03:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58AEB10FA63C; Fri, 2 Nov 2018 15:03:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D81E6FCAB; Fri, 2 Nov 2018 15:03:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2DFC4771; Fri, 2 Nov 2018 15:03:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA2F3qjE072493; Fri, 2 Nov 2018 15:03:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2F3qib072492; Fri, 2 Nov 2018 15:03:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811021503.wA2F3qib072492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 2 Nov 2018 15:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340059 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 340059 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 15:03:53 -0000 Author: hselasky Date: Fri Nov 2 15:03:52 2018 New Revision: 340059 URL: https://svnweb.freebsd.org/changeset/base/340059 Log: Add new USB v2.0 PCI ID. Submitted by: Dmitry Luhtionov Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/controller/ehci_pci.c Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Fri Nov 2 15:02:44 2018 (r340058) +++ head/sys/dev/usb/controller/ehci_pci.c Fri Nov 2 15:03:52 2018 (r340059) @@ -210,6 +210,9 @@ ehci_pci_match(device_t self) case 0x15621131: return "Philips ISP156x USB 2.0 controller"; + case 0x70021039: + return "SiS 968 USB 2.0 controller"; + case 0x31041106: return ("VIA VT6202 USB 2.0 controller"); From owner-svn-src-head@freebsd.org Fri Nov 2 15:23:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8791910FAE6B; Fri, 2 Nov 2018 15:23:58 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34DC870A77; Fri, 2 Nov 2018 15:23:58 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16A124A9A; Fri, 2 Nov 2018 15:23:58 +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 wA2FNvC7083173; Fri, 2 Nov 2018 15:23:57 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2FNveB083172; Fri, 2 Nov 2018 15:23:57 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811021523.wA2FNveB083172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 2 Nov 2018 15:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340060 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 340060 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 15:23:58 -0000 Author: kp Date: Fri Nov 2 15:23:57 2018 New Revision: 340060 URL: https://svnweb.freebsd.org/changeset/base/340060 Log: pf: Count holes rather than fragments for reassembly Avoid traversing the list of fragment entris to check whether the pf(4) reassembly is complete. Instead count the holes that are created when inserting a fragment. If there are no holes left, the fragments are continuous. Obtained from: OpenBSD Differential Revision: https://reviews.freebsd.org/D17732 Modified: head/sys/netpfil/pf/pf_norm.c Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Fri Nov 2 15:03:52 2018 (r340059) +++ head/sys/netpfil/pf/pf_norm.c Fri Nov 2 15:23:57 2018 (r340060) @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright 2001 Niels Provos - * Copyright 2011 Alexander Bluhm + * Copyright 2011-2018 Alexander Bluhm * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -91,6 +91,7 @@ struct pf_fragment { TAILQ_ENTRY(pf_fragment) frag_next; uint32_t fr_timeout; uint16_t fr_maxlen; /* maximum length of single fragment */ + u_int16_t fr_holes; /* number of holes in the queue */ TAILQ_HEAD(pf_fragq, pf_frent) fr_queue; }; @@ -132,11 +133,11 @@ static void pf_remove_fragment(struct pf_fragment *); static int pf_normalize_tcpopt(struct pf_rule *, struct mbuf *, struct tcphdr *, int, sa_family_t); static struct pf_frent *pf_create_fragment(u_short *); +static int pf_frent_holes(struct pf_frent *frent); static struct pf_fragment *pf_find_fragment(struct pf_fragment_cmp *key, struct pf_frag_tree *tree); static struct pf_fragment *pf_fillup_fragment(struct pf_fragment_cmp *, struct pf_frent *, u_short *); -static int pf_isfull_fragment(struct pf_fragment *); static struct mbuf *pf_join_fragment(struct pf_fragment *); #ifdef INET static void pf_scrub_ip(struct mbuf **, uint32_t, uint8_t, uint8_t); @@ -333,6 +334,39 @@ pf_create_fragment(u_short *reason) return (frent); } +/* + * Calculate the additional holes that were created in the fragment + * queue by inserting this fragment. A fragment in the middle + * creates one more hole by splitting. For each connected side, + * it loses one hole. + * Fragment entry must be in the queue when calling this function. + */ +static int +pf_frent_holes(struct pf_frent *frent) +{ + struct pf_frent *prev = TAILQ_PREV(frent, pf_fragq, fr_next); + struct pf_frent *next = TAILQ_NEXT(frent, fr_next); + int holes = 1; + + if (prev == NULL) { + if (frent->fe_off == 0) + holes--; + } else { + KASSERT(frent->fe_off != 0, ("frent->fe_off != 0")); + if (frent->fe_off == prev->fe_off + prev->fe_len) + holes--; + } + if (next == NULL) { + if (!frent->fe_mff) + holes--; + } else { + KASSERT(frent->fe_mff, ("frent->fe_mff")); + if (next->fe_off == frent->fe_off + frent->fe_len) + holes--; + } + return holes; +} + static struct pf_fragment * pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, u_short *reason) @@ -384,6 +418,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct *(struct pf_fragment_cmp *)frag = *key; frag->fr_timeout = time_uptime; frag->fr_maxlen = frent->fe_len; + frag->fr_holes = 1; TAILQ_INIT(&frag->fr_queue); RB_INSERT(pf_frag_tree, &V_pf_frag_tree, frag); @@ -391,6 +426,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct /* We do not have a previous fragment. */ TAILQ_INSERT_HEAD(&frag->fr_queue, frent, fr_next); + frag->fr_holes += pf_frent_holes(frent); return (frag); } @@ -457,6 +493,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct /* This fragment is completely overlapped, lose it. */ next = TAILQ_NEXT(after, fr_next); + frag->fr_holes -= pf_frent_holes(after); m_freem(after->fe_m); TAILQ_REMOVE(&frag->fr_queue, after, fr_next); uma_zfree(V_pf_frent_z, after); @@ -466,6 +503,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct TAILQ_INSERT_HEAD(&frag->fr_queue, frent, fr_next); else TAILQ_INSERT_AFTER(&frag->fr_queue, prev, frent, fr_next); + frag->fr_holes += pf_frent_holes(frent); return (frag); @@ -476,40 +514,6 @@ drop_fragment: return (NULL); } -static int -pf_isfull_fragment(struct pf_fragment *frag) -{ - struct pf_frent *frent, *next; - uint16_t off, total; - - /* Check if we are completely reassembled */ - if (TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_mff) - return (0); - - /* Maximum data we have seen already */ - total = TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_off + - TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_len; - - /* Check if we have all the data */ - off = 0; - for (frent = TAILQ_FIRST(&frag->fr_queue); frent; frent = next) { - next = TAILQ_NEXT(frent, fr_next); - - off += frent->fe_len; - if (off < total && (next == NULL || next->fe_off != off)) { - DPFPRINTF(("missing fragment at %d, next %d, total %d", - off, next == NULL ? -1 : next->fe_off, total)); - return (0); - } - } - DPFPRINTF(("%d < %d?", off, total)); - if (off < total) - return (0); - KASSERT(off == total, ("off == total")); - - return (1); -} - static struct mbuf * pf_join_fragment(struct pf_fragment *frag) { @@ -570,8 +574,10 @@ pf_reassemble(struct mbuf **m0, struct ip *ip, int dir /* The mbuf is part of the fragment entry, no direct free or access */ m = *m0 = NULL; - if (!pf_isfull_fragment(frag)) + if (frag->fr_holes) { + DPFPRINTF(("frag %d, holes %d", frag->fr_id, frag->fr_holes)); return (PF_PASS); /* drop because *m0 is NULL, no error */ + } /* We have all the data */ frent = TAILQ_FIRST(&frag->fr_queue); @@ -654,7 +660,8 @@ pf_reassemble6(struct mbuf **m0, struct ip6_hdr *ip6, /* The mbuf is part of the fragment entry, no direct free or access. */ m = *m0 = NULL; - if (!pf_isfull_fragment(frag)) { + if (frag->fr_holes) { + DPFPRINTF(("frag %d, holes %d", frag->fr_id, frag->fr_holes)); PF_FRAG_UNLOCK(); return (PF_PASS); /* Drop because *m0 is NULL, no error. */ } From owner-svn-src-head@freebsd.org Fri Nov 2 15:26:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EC7F10FAF64; Fri, 2 Nov 2018 15:26:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54BED70CE7; Fri, 2 Nov 2018 15:26:52 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 335254ABC; Fri, 2 Nov 2018 15:26:52 +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 wA2FQpQk083339; Fri, 2 Nov 2018 15:26:51 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2FQpqs083337; Fri, 2 Nov 2018 15:26:51 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811021526.wA2FQpqs083337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 2 Nov 2018 15:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340061 - in head/sys: net netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head/sys: net netpfil/pf X-SVN-Commit-Revision: 340061 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 15:26:52 -0000 Author: kp Date: Fri Nov 2 15:26:51 2018 New Revision: 340061 URL: https://svnweb.freebsd.org/changeset/base/340061 Log: pf: Split the fragment reassembly queue into smaller parts Remember 16 entry points based on the fragment offset. Instead of a worst case of 8196 list traversals we now check a maximum of 512 list entries or 16 array elements. Obtained from: OpenBSD Differential Revision: https://reviews.freebsd.org/D17733 Modified: head/sys/net/pfvar.h head/sys/netpfil/pf/pf_norm.c Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Fri Nov 2 15:23:57 2018 (r340060) +++ head/sys/net/pfvar.h Fri Nov 2 15:26:51 2018 (r340061) @@ -1205,6 +1205,12 @@ struct pf_divert { #define PFR_KENTRY_HIWAT 200000 /* Number of table entries */ /* + * Limit the length of the fragment queue traversal. Remember + * search entry points based on the fragment offset. + */ +#define PF_FRAG_ENTRY_POINTS 16 + +/* * ioctl parameter structures */ Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Fri Nov 2 15:23:57 2018 (r340060) +++ head/sys/netpfil/pf/pf_norm.c Fri Nov 2 15:26:51 2018 (r340061) @@ -87,6 +87,7 @@ struct pf_fragment { #define fr_af fr_key.frc_af #define fr_proto fr_key.frc_proto + struct pf_frent *fr_firstoff[PF_FRAG_ENTRY_POINTS]; RB_ENTRY(pf_fragment) fr_entry; TAILQ_ENTRY(pf_fragment) frag_next; uint32_t fr_timeout; @@ -136,6 +137,13 @@ static struct pf_frent *pf_create_fragment(u_short *); static int pf_frent_holes(struct pf_frent *frent); static struct pf_fragment *pf_find_fragment(struct pf_fragment_cmp *key, struct pf_frag_tree *tree); +static inline int pf_frent_index(struct pf_frent *); +static void pf_frent_insert(struct pf_fragment *, + struct pf_frent *, struct pf_frent *); +void pf_frent_remove(struct pf_fragment *, + struct pf_frent *); +struct pf_frent *pf_frent_previous(struct pf_fragment *, + struct pf_frent *); static struct pf_fragment *pf_fillup_fragment(struct pf_fragment_cmp *, struct pf_frent *, u_short *); static struct mbuf *pf_join_fragment(struct pf_fragment *); @@ -308,6 +316,7 @@ pf_remove_fragment(struct pf_fragment *frag) { PF_FRAG_ASSERT(); + KASSERT(frag, ("frag != NULL")); RB_REMOVE(pf_frag_tree, &V_pf_frag_tree, frag); TAILQ_REMOVE(&V_pf_fragqueue, frag, frag_next); @@ -367,9 +376,150 @@ pf_frent_holes(struct pf_frent *frent) return holes; } +static inline int +pf_frent_index(struct pf_frent *frent) +{ + /* + * We have an array of 16 entry points to the queue. A full size + * 65535 octet IP packet can have 8192 fragments. So the queue + * traversal length is at most 512 and at most 16 entry points are + * checked. We need 128 additional bytes on a 64 bit architecture. + */ + CTASSERT(((u_int16_t)0xffff &~ 7) / (0x10000 / PF_FRAG_ENTRY_POINTS) == + 16 - 1); + CTASSERT(((u_int16_t)0xffff >> 3) / PF_FRAG_ENTRY_POINTS == 512 - 1); + + return frent->fe_off / (0x10000 / PF_FRAG_ENTRY_POINTS); +} + +static void +pf_frent_insert(struct pf_fragment *frag, struct pf_frent *frent, + struct pf_frent *prev) +{ + int index; + + if (prev == NULL) { + TAILQ_INSERT_HEAD(&frag->fr_queue, frent, fr_next); + } else { + KASSERT(prev->fe_off + prev->fe_len <= frent->fe_off, + ("overlapping fragment")); + TAILQ_INSERT_AFTER(&frag->fr_queue, prev, frent, fr_next); + } + + index = pf_frent_index(frent); + if (frag->fr_firstoff[index] == NULL) { + KASSERT(prev == NULL || pf_frent_index(prev) < index, + ("prev == NULL || pf_frent_index(pref) < index")); + frag->fr_firstoff[index] = frent; + } else { + if (frent->fe_off < frag->fr_firstoff[index]->fe_off) { + KASSERT(prev == NULL || pf_frent_index(prev) < index, + ("prev == NULL || pf_frent_index(pref) < index")); + frag->fr_firstoff[index] = frent; + } else { + KASSERT(prev != NULL, ("prev != NULL")); + KASSERT(pf_frent_index(prev) == index, + ("pf_frent_index(prev) == index")); + } + } + + frag->fr_holes += pf_frent_holes(frent); +} + +void +pf_frent_remove(struct pf_fragment *frag, struct pf_frent *frent) +{ + struct pf_frent *prev = TAILQ_PREV(frent, pf_fragq, fr_next); + struct pf_frent *next = TAILQ_NEXT(frent, fr_next); + int index; + + frag->fr_holes -= pf_frent_holes(frent); + + index = pf_frent_index(frent); + KASSERT(frag->fr_firstoff[index] != NULL, ("frent not found")); + if (frag->fr_firstoff[index]->fe_off == frent->fe_off) { + if (next == NULL) { + frag->fr_firstoff[index] = NULL; + } else { + KASSERT(frent->fe_off + frent->fe_len <= next->fe_off, + ("overlapping fragment")); + if (pf_frent_index(next) == index) { + frag->fr_firstoff[index] = next; + } else { + frag->fr_firstoff[index] = NULL; + } + } + } else { + KASSERT(frag->fr_firstoff[index]->fe_off < frent->fe_off, + ("frag->fr_firstoff[index]->fe_off < frent->fe_off")); + KASSERT(prev != NULL, ("prev != NULL")); + KASSERT(prev->fe_off + prev->fe_len <= frent->fe_off, + ("overlapping fragment")); + KASSERT(pf_frent_index(prev) == index, + ("pf_frent_index(prev) == index")); + } + + TAILQ_REMOVE(&frag->fr_queue, frent, fr_next); +} + +struct pf_frent * +pf_frent_previous(struct pf_fragment *frag, struct pf_frent *frent) +{ + struct pf_frent *prev, *next; + int index; + + /* + * If there are no fragments after frag, take the final one. Assume + * that the global queue is not empty. + */ + prev = TAILQ_LAST(&frag->fr_queue, pf_fragq); + KASSERT(prev != NULL, ("prev != NULL")); + if (prev->fe_off <= frent->fe_off) + return prev; + /* + * We want to find a fragment entry that is before frag, but still + * close to it. Find the first fragment entry that is in the same + * entry point or in the first entry point after that. As we have + * already checked that there are entries behind frag, this will + * succeed. + */ + for (index = pf_frent_index(frent); index < PF_FRAG_ENTRY_POINTS; + index++) { + prev = frag->fr_firstoff[index]; + if (prev != NULL) + break; + } + KASSERT(prev != NULL, ("prev != NULL")); + /* + * In prev we may have a fragment from the same entry point that is + * before frent, or one that is just one position behind frent. + * In the latter case, we go back one step and have the predecessor. + * There may be none if the new fragment will be the first one. + */ + if (prev->fe_off > frent->fe_off) { + prev = TAILQ_PREV(prev, pf_fragq, fr_next); + if (prev == NULL) + return NULL; + KASSERT(prev->fe_off <= frent->fe_off, + ("prev->fe_off <= frent->fe_off")); + return prev; + } + /* + * In prev is the first fragment of the entry point. The offset + * of frag is behind it. Find the closest previous fragment. + */ + for (next = TAILQ_NEXT(prev, fr_next); next != NULL; + next = TAILQ_NEXT(next, fr_next)) { + if (next->fe_off > frent->fe_off) + break; + prev = next; + } + return prev; +} + static struct pf_fragment * pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, - u_short *reason) + u_short *reason) { struct pf_frent *after, *next, *prev; struct pf_fragment *frag; @@ -416,6 +566,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct } *(struct pf_fragment_cmp *)frag = *key; + memset(frag->fr_firstoff, 0, sizeof(frag->fr_firstoff)); frag->fr_timeout = time_uptime; frag->fr_maxlen = frent->fe_len; frag->fr_holes = 1; @@ -425,8 +576,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct TAILQ_INSERT_HEAD(&V_pf_fragqueue, frag, frag_next); /* We do not have a previous fragment. */ - TAILQ_INSERT_HEAD(&frag->fr_queue, frent, fr_next); - frag->fr_holes += pf_frent_holes(frent); + pf_frent_insert(frag, frent, NULL); return (frag); } @@ -455,17 +605,15 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct goto bad_fragment; } - /* Find a fragment after the current one. */ - prev = NULL; - TAILQ_FOREACH(after, &frag->fr_queue, fr_next) { - if (after->fe_off > frent->fe_off) - break; - prev = after; + /* Find neighbors for newly inserted fragment */ + prev = pf_frent_previous(frag, frent); + if (prev == NULL) { + after = TAILQ_FIRST(&frag->fr_queue); + KASSERT(after != NULL, ("after != NULL")); + } else { + after = TAILQ_NEXT(prev, fr_next); } - KASSERT(prev != NULL || after != NULL, - ("prev != NULL || after != NULL")); - if (prev != NULL && prev->fe_off + prev->fe_len > frent->fe_off) { uint16_t precut; @@ -493,17 +641,12 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct /* This fragment is completely overlapped, lose it. */ next = TAILQ_NEXT(after, fr_next); - frag->fr_holes -= pf_frent_holes(after); + pf_frent_remove(frag, after); m_freem(after->fe_m); - TAILQ_REMOVE(&frag->fr_queue, after, fr_next); uma_zfree(V_pf_frent_z, after); } - if (prev == NULL) - TAILQ_INSERT_HEAD(&frag->fr_queue, frent, fr_next); - else - TAILQ_INSERT_AFTER(&frag->fr_queue, prev, frent, fr_next); - frag->fr_holes += pf_frent_holes(frent); + pf_frent_insert(frag, frent, prev); return (frag); From owner-svn-src-head@freebsd.org Fri Nov 2 15:30:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE75410FB08C for ; Fri, 2 Nov 2018 15:30:27 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic309-13.consmr.mail.bf2.yahoo.com (sonic309-13.consmr.mail.bf2.yahoo.com [74.6.129.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 861D870F87 for ; Fri, 2 Nov 2018 15:30:27 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: troOBP4VM1mbUta_g9Ygl_aGMRGJ6r2xC8txOk.7kX2T_H7PJvXR9As9E_jcOFC D_wwPI.MI2wUnh1RPgLEfhwwuFEbEVhmNbz5xyvL38SgcohvaGzCEcdNKlfsfEN2SHUMLZLZYFdG ZW0nxaVDzGiywzc1cYpGwmBNgHfXmFWL3xM8nlmoIbKX2z9HFXXY4srLmedWmI4pp4.xYizm0cWw u8IugVZqz6zWdH2zlTubtE58Vdp4SPuBWdDPtSpQCpero2MbBlND92TfJZBEgEjj_shJFOEHCk76 jMKr5PrTZbcns4T4zOBwhSq7rc_sac7OGXbp2WmRr4ZXGZzSH95UiVmSscUfRtLWA1OsVTDNHq.M nt9OfW_0rZSZ88gsKiXDwupYEcgeFf.Ns6H9iOTecyZ14s_dTZXFg0ocWxv1Z3YgM.6rqjUDp3.Z dQ9jrs2cs902.TtiwQrGfND5XnFHBd6o5rZgL.kLrSblXzM36JrpIHCbUIFDG_4yo9MkssDdSNj8 jy_Hq.QC_xcU06r8_u_QtzyBzDxMDG7XQXtA4k6fm4HoDiTsWyJMMba3SHInbVFpHkd8QaSwlfo0 pLDQU8GTOetRkxqzCXsKYgF2FitJOi3l.WTwfDVkm5w9YZLGtPqvpPsf17pQsMCJ9qqpx5divHsX UC0oCwlz15eK6oD208w1Dk3iHo2b.RlJgKq0Vd.HLlA4mKU41WonSRcL8bCjRGB5_JNyyqeF0NlX nczxV8mA9EcxaI_IBHQbro2W15LKGuivykcQnM6DOmHzJ.rkb223zfbk3j9lGldMxLFoNnhAKF.a y8mQVFaL0zg7Z4ug6W03CI4GXI1zCCAqjO.0pSZr6ff1qij_2mTBq9PPMggWwPLPZXId231F0kge shfsts0FmgrvZPfAPQzyWLZFSQIfCWhQMG.WKYjyRzXAPB9jb9TFmWtf5t8cLQDTsq84FOKqSApQ II7dehbQ9pJ48I72.qoqpfcqvNkgPxnJEy1bTrwuY8dkEqfMMBliWf9z3r0DBoRIsFSTPEVte7hR GfvXIBtSv6R2vReJkhU66dysmj_SmG5GEfnp7B.KTkgSQ_FG8h1d3 Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.bf2.yahoo.com with HTTP; Fri, 2 Nov 2018 15:30:20 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp403.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 89b5998a80528e3d8a876e5dfa458a70; Fri, 02 Nov 2018 15:30:19 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r339876 - head/libexec/rtld-elf From: Mark Millard In-Reply-To: <20181102113827.GM5335@kib.kiev.ua> Date: Fri, 2 Nov 2018 08:30:17 -0700 Cc: svn-src-head@freebsd.org, Alexander Richardson Content-Transfer-Encoding: quoted-printable Message-Id: <7B29A4C8-228D-41CB-B594-98DFA456E9C8@yahoo.com> References: <8E5A5F3A-F1A7-4702-A2F7-65D74CC5B2E5@yahoo.com> <20181102004101.GI5335@kib.kiev.ua> <003A49D7-6E8B-4775-A70B-E0EB44505D4B@yahoo.com> <20181102113827.GM5335@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 15:30:28 -0000 On 2018-Nov-2, at 4:38 AM, Konstantin Belousov = wrote: > On Fri, Nov 02, 2018 at 12:16:23AM -0700, Mark Millard wrote: >> It stops when the dcbst in __syncicache runs into an address in >> the p_align 65536 caused hole between the two PT_LOAD's with PF_X. >> /bin/ls itself has such a hole, as do the .so libraries involved. >=20 > Try this. I only compile-tested the change. >=20 > diff --git a/libexec/rtld-elf/powerpc/reloc.c = b/libexec/rtld-elf/powerpc/reloc.c > index e921a4dc7d1..5f21e33bee3 100644 > --- a/libexec/rtld-elf/powerpc/reloc.c > +++ b/libexec/rtld-elf/powerpc/reloc.c > @@ -294,6 +294,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, = int flags, > { > const Elf_Rela *relalim; > const Elf_Rela *rela; > + const Elf_Phdr *phdr; > SymCache *cache; > int r =3D -1; >=20 > @@ -327,8 +328,18 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry = *obj_rtld, int flags, > if (cache !=3D NULL) > free(cache); >=20 > - /* Synchronize icache for text seg in case we made any changes = */ > - __syncicache(obj->mapbase, obj->textsize); > + /* > + * Synchronize icache for executable segments in case we made > + * any changes. > + */ > + for (phdr =3D obj->phdr; > + (const char *)phdr < (const char *)obj->phdr + obj->phsize; > + phdr++) { > + if (phdr->p_type =3D=3D PT_LOAD && (phdr->p_flags & = PF_X) !=3D 0) { > + __syncicache(obj->mapbase + phdr->p_vaddr, > + phdr->p_memsz); > + } > + } >=20 > return (r); > } > diff --git a/libexec/rtld-elf/powerpc64/reloc.c = b/libexec/rtld-elf/powerpc64/reloc.c > index c2d6dac13b1..980b4933afe 100644 > --- a/libexec/rtld-elf/powerpc64/reloc.c > +++ b/libexec/rtld-elf/powerpc64/reloc.c > @@ -291,6 +291,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, = int flags, > { > const Elf_Rela *relalim; > const Elf_Rela *rela; > + const Elf_Phdr *phdr; > SymCache *cache; > int bytes =3D obj->dynsymcount * sizeof(SymCache); > int r =3D -1; > @@ -327,8 +328,18 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry = *obj_rtld, int flags, > if (cache) > munmap(cache, bytes); >=20 > - /* Synchronize icache for text seg in case we made any changes = */ > - __syncicache(obj->mapbase, obj->textsize); > + /* > + * Synchronize icache for executable segments in case we made > + * any changes. > + */ > + for (phdr =3D obj->phdr; > + (const char *)phdr < (const char *)obj->phdr + obj->phsize; > + phdr++) { > + if (phdr->p_type =3D=3D PT_LOAD && (phdr->p_flags & = PF_X) !=3D 0) { > + __syncicache(obj->mapbase + phdr->p_vaddr, > + phdr->p_memsz); > + } > + } >=20 > return (r); > } >=20 Unfortunately, that failed: (gdb) run The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: = /usr/obj/powerpcvtsc_gcc421/powerpc.powerpc/usr/src/powerpc.powerpc/libexe= c/rtld-elf/ld-elf.so.1.full /bin/ls Breakpoint 4, reloc_non_plt (obj=3D0x41041000, obj_rtld=3D0x1801cc7, = flags=3D4, lockstate=3D0x0) at = /usr/src/libexec/rtld-elf/powerpc/reloc.c:338 338 __syncicache(obj->mapbase + = phdr->p_vaddr, 1: x/i $pc =3D> 0x1012b90 : lwz r0,36(r29) (gdb) print/x obj->mapbase+phdr->p_vaddr $17 =3D 0x3000000 (gdb) print/x obj->mapbase =20 $18 =3D 0x1800000 (gdb) print/x phdr->p_vaddr $19 =3D 0x1800000 (gdb) c Continuing. Program received signal SIGSEGV, Segmentation fault. __syncicache (from=3D0x3000000, len=3D34112) at = /usr/src/lib/libc/powerpc/gen/syncicache.c:94 94 __asm __volatile ("dcbst 0,%0" :: "r"(p)); 1: x/i $pc =3D> 0x10228b8 <__syncicache+96>: dcbst 0,r11 It looks to me like the 0x1800000 component of the overall figure was double counted. ( phdr->p_vaddr would vary but obj->mapbase would not. ) Omit "obj->mapbase + "? =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Fri Nov 2 15:32:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE51910FB21F; Fri, 2 Nov 2018 15:32:05 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 914FC71201; Fri, 2 Nov 2018 15:32:05 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71A1F4B58; Fri, 2 Nov 2018 15:32:05 +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 wA2FW5Mk088179; Fri, 2 Nov 2018 15:32:05 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2FW58o088177; Fri, 2 Nov 2018 15:32:05 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811021532.wA2FW58o088177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 2 Nov 2018 15:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340062 - in head/sys: net netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head/sys: net netpfil/pf X-SVN-Commit-Revision: 340062 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 15:32:06 -0000 Author: kp Date: Fri Nov 2 15:32:04 2018 New Revision: 340062 URL: https://svnweb.freebsd.org/changeset/base/340062 Log: pf: Limit the fragment entry queue length to 64 per bucket. So we have a global limit of 1024 fragments, but it is fine grained to the region of the packet. Smaller packets may have less fragments. This costs another 16 bytes of memory per reassembly and devides the worst case for searching by 8. Obtained from: OpenBSD Differential Revision: https://reviews.freebsd.org/D17734 Modified: head/sys/net/pfvar.h head/sys/netpfil/pf/pf_norm.c Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Fri Nov 2 15:26:51 2018 (r340061) +++ head/sys/net/pfvar.h Fri Nov 2 15:32:04 2018 (r340062) @@ -1211,6 +1211,13 @@ struct pf_divert { #define PF_FRAG_ENTRY_POINTS 16 /* + * The number of entries in the fragment queue must be limited + * to avoid DoS by linear seaching. Instead of a global limit, + * use a limit per entry point. For large packets these sum up. + */ +#define PF_FRAG_ENTRY_LIMIT 64 + +/* * ioctl parameter structures */ Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Fri Nov 2 15:26:51 2018 (r340061) +++ head/sys/netpfil/pf/pf_norm.c Fri Nov 2 15:32:04 2018 (r340062) @@ -87,7 +87,10 @@ struct pf_fragment { #define fr_af fr_key.frc_af #define fr_proto fr_key.frc_proto + /* pointers to queue element */ struct pf_frent *fr_firstoff[PF_FRAG_ENTRY_POINTS]; + /* count entries between pointers */ + uint8_t fr_entries[PF_FRAG_ENTRY_POINTS]; RB_ENTRY(pf_fragment) fr_entry; TAILQ_ENTRY(pf_fragment) frag_next; uint32_t fr_timeout; @@ -138,7 +141,7 @@ static int pf_frent_holes(struct pf_frent *frent); static struct pf_fragment *pf_find_fragment(struct pf_fragment_cmp *key, struct pf_frag_tree *tree); static inline int pf_frent_index(struct pf_frent *); -static void pf_frent_insert(struct pf_fragment *, +static int pf_frent_insert(struct pf_fragment *, struct pf_frent *, struct pf_frent *); void pf_frent_remove(struct pf_fragment *, struct pf_frent *); @@ -392,12 +395,24 @@ pf_frent_index(struct pf_frent *frent) return frent->fe_off / (0x10000 / PF_FRAG_ENTRY_POINTS); } -static void +static int pf_frent_insert(struct pf_fragment *frag, struct pf_frent *frent, struct pf_frent *prev) { int index; + CTASSERT(PF_FRAG_ENTRY_LIMIT <= 0xff); + + /* + * A packet has at most 65536 octets. With 16 entry points, each one + * spawns 4096 octets. We limit these to 64 fragments each, which + * means on average every fragment must have at least 64 octets. + */ + index = pf_frent_index(frent); + if (frag->fr_entries[index] >= PF_FRAG_ENTRY_LIMIT) + return ENOBUFS; + frag->fr_entries[index]++; + if (prev == NULL) { TAILQ_INSERT_HEAD(&frag->fr_queue, frent, fr_next); } else { @@ -406,7 +421,6 @@ pf_frent_insert(struct pf_fragment *frag, struct pf_fr TAILQ_INSERT_AFTER(&frag->fr_queue, prev, frent, fr_next); } - index = pf_frent_index(frent); if (frag->fr_firstoff[index] == NULL) { KASSERT(prev == NULL || pf_frent_index(prev) < index, ("prev == NULL || pf_frent_index(pref) < index")); @@ -424,6 +438,8 @@ pf_frent_insert(struct pf_fragment *frag, struct pf_fr } frag->fr_holes += pf_frent_holes(frent); + + return 0; } void @@ -460,6 +476,9 @@ pf_frent_remove(struct pf_fragment *frag, struct pf_fr } TAILQ_REMOVE(&frag->fr_queue, frent, fr_next); + + KASSERT(frag->fr_entries[index] > 0, ("No fragments remaining")); + frag->fr_entries[index]--; } struct pf_frent * @@ -567,6 +586,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct *(struct pf_fragment_cmp *)frag = *key; memset(frag->fr_firstoff, 0, sizeof(frag->fr_firstoff)); + memset(frag->fr_entries, 0, sizeof(frag->fr_entries)); frag->fr_timeout = time_uptime; frag->fr_maxlen = frent->fe_len; frag->fr_holes = 1; @@ -575,7 +595,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct RB_INSERT(pf_frag_tree, &V_pf_frag_tree, frag); TAILQ_INSERT_HEAD(&V_pf_fragqueue, frag, frag_next); - /* We do not have a previous fragment. */ + /* We do not have a previous fragment, cannot fail. */ pf_frent_insert(frag, frent, NULL); return (frag); @@ -646,7 +666,11 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct uma_zfree(V_pf_frent_z, after); } - pf_frent_insert(frag, frent, prev); + /* If part of the queue gets too long, there is not way to recover. */ + if (pf_frent_insert(frag, frent, prev)) { + DPFPRINTF(("fragment queue limit exceeded")); + goto bad_fragment; + } return (frag); From owner-svn-src-head@freebsd.org Fri Nov 2 15:52:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97C0610FB9A3 for ; Fri, 2 Nov 2018 15:52:45 +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 2AE5371FB9; Fri, 2 Nov 2018 15:52:45 +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 wA2FqYbE016932 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 2 Nov 2018 17:52:37 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wA2FqYbE016932 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wA2FqYN8016931; Fri, 2 Nov 2018 17:52:34 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 2 Nov 2018 17:52:34 +0200 From: Konstantin Belousov To: Mark Millard Cc: svn-src-head@freebsd.org, Alexander Richardson Subject: Re: svn commit: r339876 - head/libexec/rtld-elf Message-ID: <20181102155234.GN5335@kib.kiev.ua> References: <8E5A5F3A-F1A7-4702-A2F7-65D74CC5B2E5@yahoo.com> <20181102004101.GI5335@kib.kiev.ua> <003A49D7-6E8B-4775-A70B-E0EB44505D4B@yahoo.com> <20181102113827.GM5335@kib.kiev.ua> <7B29A4C8-228D-41CB-B594-98DFA456E9C8@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7B29A4C8-228D-41CB-B594-98DFA456E9C8@yahoo.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 15:52:45 -0000 On Fri, Nov 02, 2018 at 08:30:17AM -0700, Mark Millard wrote: > Breakpoint 4, reloc_non_plt (obj=0x41041000, obj_rtld=0x1801cc7, flags=4, lockstate=0x0) at /usr/src/libexec/rtld-elf/powerpc/reloc.c:338 > 338 __syncicache(obj->mapbase + phdr->p_vaddr, > 1: x/i $pc > => 0x1012b90 : lwz r0,36(r29) > (gdb) print/x obj->mapbase+phdr->p_vaddr > $17 = 0x3000000 > (gdb) print/x obj->mapbase > $18 = 0x1800000 > (gdb) print/x phdr->p_vaddr > $19 = 0x1800000 > (gdb) c > Continuing. > > Program received signal SIGSEGV, Segmentation fault. > __syncicache (from=0x3000000, len=34112) at /usr/src/lib/libc/powerpc/gen/syncicache.c:94 > 94 __asm __volatile ("dcbst 0,%0" :: "r"(p)); > 1: x/i $pc > => 0x10228b8 <__syncicache+96>: dcbst 0,r11 > > > > It looks to me like the 0x1800000 component of the > overall figure was double counted. ( phdr->p_vaddr > would vary but obj->mapbase would not. ) > > Omit "obj->mapbase + "? I used the wrong addend. Try this fix. diff --git a/libexec/rtld-elf/powerpc/reloc.c b/libexec/rtld-elf/powerpc/reloc.c index e921a4dc7d1..fae28dd9224 100644 --- a/libexec/rtld-elf/powerpc/reloc.c +++ b/libexec/rtld-elf/powerpc/reloc.c @@ -294,6 +294,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, { const Elf_Rela *relalim; const Elf_Rela *rela; + const Elf_Phdr *phdr; SymCache *cache; int r = -1; @@ -327,8 +328,18 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, if (cache != NULL) free(cache); - /* Synchronize icache for text seg in case we made any changes */ - __syncicache(obj->mapbase, obj->textsize); + /* + * Synchronize icache for executable segments in case we made + * any changes. + */ + for (phdr = obj->phdr; + (const char *)phdr < (const char *)obj->phdr + obj->phsize; + phdr++) { + if (phdr->p_type == PT_LOAD && (phdr->p_flags & PF_X) != 0) { + __syncicache(obj->relocbase + phdr->p_vaddr, + phdr->p_memsz); + } + } return (r); } diff --git a/libexec/rtld-elf/powerpc64/reloc.c b/libexec/rtld-elf/powerpc64/reloc.c index c2d6dac13b1..15f31738ab7 100644 --- a/libexec/rtld-elf/powerpc64/reloc.c +++ b/libexec/rtld-elf/powerpc64/reloc.c @@ -291,6 +291,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, { const Elf_Rela *relalim; const Elf_Rela *rela; + const Elf_Phdr *phdr; SymCache *cache; int bytes = obj->dynsymcount * sizeof(SymCache); int r = -1; @@ -327,8 +328,18 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, if (cache) munmap(cache, bytes); - /* Synchronize icache for text seg in case we made any changes */ - __syncicache(obj->mapbase, obj->textsize); + /* + * Synchronize icache for executable segments in case we made + * any changes. + */ + for (phdr = obj->phdr; + (const char *)phdr < (const char *)obj->phdr + obj->phsize; + phdr++) { + if (phdr->p_type == PT_LOAD && (phdr->p_flags & PF_X) != 0) { + __syncicache(obj->relocbase + phdr->p_vaddr, + phdr->p_memsz); + } + } return (r); } From owner-svn-src-head@freebsd.org Fri Nov 2 16:18:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE2E410FC392; Fri, 2 Nov 2018 16:18:59 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78DF672CD2; Fri, 2 Nov 2018 16:18:59 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 9063E3C475F; Fri, 2 Nov 2018 16:18:58 +0000 (UTC) Date: Fri, 2 Nov 2018 16:18:58 +0000 From: Brooks Davis To: Andriy Gapon Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340055 - in head: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/ext2fs sys/fs/fuse sys/fs/nandfs sys/fs/nfs sys/fs/nfsclient sys/fs/tmpfs sys/kern sys/sys sys/uf... Message-ID: <20181102161858.GC79858@spindle.one-eyed-alien.net> References: <201811021442.wA2EgbVc062099@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qcHopEYAB45HaUaB" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 16:19:00 -0000 --qcHopEYAB45HaUaB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 02, 2018 at 04:49:00PM +0200, Andriy Gapon wrote: > On 02/11/2018 16:42, Brooks Davis wrote: > > Author: brooks > > Date: Fri Nov 2 14:42:36 2018 > > New Revision: 340055 > > URL: https://svnweb.freebsd.org/changeset/base/340055 > >=20 > > Log: > > Make vop_symlink take a const target path. > > =20 > > This will enable callers to take const paths as part of syscall > > decleration improvements. > > =20 > > Where doing so is easy and non-distruptive carry the const through > > implementations. In UFS the value is passed to an interface that must > > take non-const values. In ZFS, const poisoning would touch code shared > > with upstream and it's not worth adding diffs. >=20 > zfs_vnops.c is already sufficiently different from upstream (because of q= uite > different VFS models), so a small difference in zfs_symlink's signature w= ould > not be too bad. Good to know. When I hit modifying three files I stopped. I'll keep this in the back of my mind as a possible improvement. Thanks, Brooks --qcHopEYAB45HaUaB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJb3HjxAAoJEKzQXbSebgfAcgAH/0SKXqqU3WlIpQvG3m0CFuAw tZbiyp/ZRhrbltGmTps9R8i3cAvc7b7LEDbiUffJdwg7JY+OsdTW2zXHOPHSPMl0 IZDfyYixhCvQhGh0EQq6VZESUB67ff0oz5yg6N/i8f7P8pJbrc1hEz2VpLEPCJhL /fE65yYG/CmuHaHtLEmfU8aWIr/CrNI0SYrfA/V2YCYflugmegG8lT8qO0SdtA0R VdW1EbrawpD14cFgm/3Rg3K+FV6xqbuuGLnLYXNN16d1KRJ0IIpxVsrZsu+7GMHx g5iSFO+xkvD+VETvfkNajwTXjxWpC26TFTuOT1UsQWSlZdIbI6zBe3reJXrdVlo= =p3Up -----END PGP SIGNATURE----- --qcHopEYAB45HaUaB-- From owner-svn-src-head@freebsd.org Fri Nov 2 16:21:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7598610FC474; Fri, 2 Nov 2018 16:21:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28D8873097; Fri, 2 Nov 2018 16:21:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 098B3545C; Fri, 2 Nov 2018 16:21:45 +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 wA2GLiCo013255; Fri, 2 Nov 2018 16:21:44 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2GLifu013253; Fri, 2 Nov 2018 16:21:44 GMT (envelope-from np@FreeBSD.org) Message-Id: <201811021621.wA2GLifu013253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 2 Nov 2018 16:21:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340063 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 340063 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 16:21:45 -0000 Author: np Date: Fri Nov 2 16:21:44 2018 New Revision: 340063 URL: https://svnweb.freebsd.org/changeset/base/340063 Log: cxgbe/iw_cxgbe: Suppress spurious "Unexpected streaming data ..." messages. Submitted by: Krishnamraju Eraparaju @ Chelsio MFC after: 1 month Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c head/sys/dev/cxgbe/iw_cxgbe/qp.c Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Fri Nov 2 15:32:04 2018 (r340062) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Fri Nov 2 16:21:44 2018 (r340063) @@ -174,7 +174,6 @@ static void process_newconn(struct c4iw_listen_ep *mas free(__a, M_SONAME); \ } while (0) -#ifdef KTR static char *states[] = { "idle", "listen", @@ -190,7 +189,6 @@ static char *states[] = { "dead", NULL, }; -#endif static void deref_cm_id(struct c4iw_ep_common *epc) { @@ -883,7 +881,9 @@ uninit_iwarp_socket(struct socket *so) static void process_data(struct c4iw_ep *ep) { + int ret = 0; int disconnect = 0; + struct c4iw_qp_attributes attrs = {0}; CTR5(KTR_IW_CXGBE, "%s: so %p, ep %p, state %s, sbused %d", __func__, ep->com.so, ep, states[ep->com.state], sbused(&ep->com.so->so_rcv)); @@ -898,9 +898,16 @@ process_data(struct c4iw_ep *ep) /* Refered in process_newconn() */ c4iw_put_ep(&ep->parent_ep->com); break; + case FPDU_MODE: + MPASS(ep->com.qp != NULL); + attrs.next_state = C4IW_QP_STATE_TERMINATE; + ret = c4iw_modify_qp(ep->com.dev, ep->com.qp, + C4IW_QP_ATTR_NEXT_STATE, &attrs, 1); + if (ret != -EINPROGRESS) + disconnect = 1; + break; default: - if (sbused(&ep->com.so->so_rcv)) - log(LOG_ERR, "%s: Unexpected streaming data. ep %p, " + log(LOG_ERR, "%s: Unexpected streaming data. ep %p, " "state %d, so %p, so_state 0x%x, sbused %u\n", __func__, ep, ep->com.state, ep->com.so, ep->com.so->so_state, sbused(&ep->com.so->so_rcv)); @@ -1180,7 +1187,24 @@ process_socket_event(struct c4iw_ep *ep) } /* rx data */ - process_data(ep); + if (sbused(&ep->com.so->so_rcv)) { + process_data(ep); + return; + } + + /* Socket events for 'MPA Request Received' and 'Close Complete' + * were already processed earlier in their previous events handlers. + * Hence, these socket events are skipped. + * And any other socket events must have handled above. + */ + MPASS((ep->com.state == MPA_REQ_RCVD) || (ep->com.state == MORIBUND)); + + if ((ep->com.state != MPA_REQ_RCVD) && (ep->com.state != MORIBUND)) + log(LOG_ERR, "%s: Unprocessed socket event so %p, " + "so_state 0x%x, so_err %d, sb_state 0x%x, ep %p, ep_state %s\n", + __func__, so, so->so_state, so->so_error, so->so_rcv.sb_state, + ep, states[state]); + } SYSCTL_NODE(_hw, OID_AUTO, iw_cxgbe, CTLFLAG_RD, 0, "iw_cxgbe driver parameters"); @@ -1633,6 +1657,7 @@ send_abort(struct c4iw_ep *ep) * handler(not yet implemented) of iw_cxgbe driver. */ release_ep_resources(ep); + ep->com.state = DEAD; return (0); } Modified: head/sys/dev/cxgbe/iw_cxgbe/qp.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/qp.c Fri Nov 2 15:32:04 2018 (r340062) +++ head/sys/dev/cxgbe/iw_cxgbe/qp.c Fri Nov 2 16:21:44 2018 (r340063) @@ -1475,6 +1475,22 @@ int c4iw_modify_qp(struct c4iw_dev *rhp, struct c4iw_q if (qhp->attr.state == attrs->next_state) goto out; + /* Return EINPROGRESS if QP is already in transition state. + * Eg: CLOSING->IDLE transition or *->ERROR transition. + * This can happen while connection is switching(due to rdma_fini) + * from iWARP/RDDP to TOE mode and any inflight RDMA RX data will + * reach TOE driver -> TCP stack -> iWARP driver. In this way + * iWARP driver keep receiving inflight RDMA RX data until socket + * is closed or aborted. And if iWARP CM is in FPDU sate, then + * it tries to put QP in TERM state and disconnects endpoint. + * But as QP is already in transition state, this event is ignored. + */ + if ((qhp->attr.state >= C4IW_QP_STATE_ERROR) && + (attrs->next_state == C4IW_QP_STATE_TERMINATE)) { + ret = -EINPROGRESS; + goto out; + } + switch (qhp->attr.state) { case C4IW_QP_STATE_IDLE: switch (attrs->next_state) { From owner-svn-src-head@freebsd.org Fri Nov 2 16:26:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21DB010FC774; Fri, 2 Nov 2018 16:26:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBA2673485; Fri, 2 Nov 2018 16:26:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC9A054A1; Fri, 2 Nov 2018 16:26:45 +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 wA2GQjcl014204; Fri, 2 Nov 2018 16:26:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2GQjlW014202; Fri, 2 Nov 2018 16:26:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811021626.wA2GQjlW014202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 2 Nov 2018 16:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340064 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 340064 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 16:26:46 -0000 Author: markj Date: Fri Nov 2 16:26:44 2018 New Revision: 340064 URL: https://svnweb.freebsd.org/changeset/base/340064 Log: Initialize the eflags field of vm_map headers. Initializing the eflags field of the map->header entry to a value with a unique new bit set makes a few comparisons to &map->header unnecessary. Submitted by: Doug Moore Reviewed by: alc, kib Tested by: pho MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D14005 Modified: head/sys/kern/sys_process.c head/sys/vm/vm_map.c head/sys/vm/vm_map.h Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Fri Nov 2 16:21:44 2018 (r340063) +++ head/sys/kern/sys_process.c Fri Nov 2 16:26:44 2018 (r340064) @@ -387,8 +387,9 @@ ptrace_vm_entry(struct thread *td, struct proc *p, str error = EINVAL; break; } - while (entry != &map->header && - (entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0) { + KASSERT((map->header.eflags & MAP_ENTRY_IS_SUB_MAP) == 0, + ("Submap in map header")); + while ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0) { entry = entry->next; index++; } Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Fri Nov 2 16:21:44 2018 (r340063) +++ head/sys/vm/vm_map.c Fri Nov 2 16:26:44 2018 (r340064) @@ -796,6 +796,7 @@ _vm_map_init(vm_map_t map, pmap_t pmap, vm_offset_t mi { map->header.next = map->header.prev = &map->header; + map->header.eflags = MAP_ENTRY_HEADER; map->needs_wakeup = FALSE; map->system_map = 0; map->pmap = pmap; @@ -1277,8 +1278,8 @@ charged: if (object->ref_count > 1 || object->shadow_count != 0) vm_object_clear_flag(object, OBJ_ONEMAPPING); VM_OBJECT_WUNLOCK(object); - } else if (prev_entry != &map->header && - (prev_entry->eflags & ~MAP_ENTRY_USER_WIRED) == protoeflags && + } else if ((prev_entry->eflags & ~MAP_ENTRY_USER_WIRED) == + protoeflags && (cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 && prev_entry->end == start && (prev_entry->cred == cred || (prev_entry->object.vm_object != NULL && @@ -1708,8 +1709,7 @@ vm_map_simplify_entry(vm_map_t map, vm_map_entry_t ent return; prev = entry->prev; - if (prev != &map->header && - vm_map_mergeable_neighbors(prev, entry)) { + if (vm_map_mergeable_neighbors(prev, entry)) { vm_map_entry_unlink(map, prev); entry->start = prev->start; entry->offset = prev->offset; @@ -1719,8 +1719,7 @@ vm_map_simplify_entry(vm_map_t map, vm_map_entry_t ent } next = entry->next; - if (next != &map->header && - vm_map_mergeable_neighbors(entry, next)) { + if (vm_map_mergeable_neighbors(entry, next)) { vm_map_entry_unlink(map, next); entry->end = next->end; vm_map_entry_resize_free(map, entry); Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Fri Nov 2 16:21:44 2018 (r340063) +++ head/sys/vm/vm_map.h Fri Nov 2 16:26:44 2018 (r340064) @@ -146,6 +146,7 @@ struct vm_map_entry { #define MAP_ENTRY_GUARD 0x10000 #define MAP_ENTRY_STACK_GAP_DN 0x20000 #define MAP_ENTRY_STACK_GAP_UP 0x40000 +#define MAP_ENTRY_HEADER 0x80000 #ifdef _KERNEL static __inline u_char @@ -175,24 +176,22 @@ vm_map_entry_system_wired_count(vm_map_entry_t entry) * list. Both structures are ordered based upon the start and * end addresses contained within each map entry. * - * Counterintuitively, the map's min offset value is stored in - * map->header.end, and its max offset value is stored in - * map->header.start. - * - * The list header has max start value and min end value to act - * as sentinels for sequential search of the doubly-linked list. * Sleator and Tarjan's top-down splay algorithm is employed to * control height imbalance in the binary search tree. * + * The map's min offset value is stored in map->header.end, and + * its max offset value is stored in map->header.start. These + * values act as sentinels for any forward or backward address + * scan of the list. The map header has a special value for the + * eflags field, MAP_ENTRY_HEADER, that is set initially, is + * never changed, and prevents an eflags match of the header + * with any other map entry. + * * List of locks * (c) const until freed */ struct vm_map { struct vm_map_entry header; /* List of entries */ -/* - map min_offset header.end (c) - map max_offset header.start (c) -*/ struct sx lock; /* Lock for map data */ struct mtx system_mtx; int nentries; /* Number of entries */ From owner-svn-src-head@freebsd.org Fri Nov 2 16:47:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1BB110FCDD5; Fri, 2 Nov 2018 16:47:09 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA6E773FA1; Fri, 2 Nov 2018 16:47:08 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B639057F5; Fri, 2 Nov 2018 16:47:08 +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 wA2Gl8CW024756; Fri, 2 Nov 2018 16:47:08 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2Gl76P024752; Fri, 2 Nov 2018 16:47:07 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811021647.wA2Gl76P024752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 2 Nov 2018 16:47:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340065 - in head/sys: net netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head/sys: net netpfil/pf X-SVN-Commit-Revision: 340065 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 16:47:09 -0000 Author: kp Date: Fri Nov 2 16:47:07 2018 New Revision: 340065 URL: https://svnweb.freebsd.org/changeset/base/340065 Log: pfsync: Make pfsync callbacks per-vnet The callbacks are installed and removed depending on the state of the pfsync device, which is per-vnet. The callbacks must also be per-vnet. MFC after: 2 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D17499 Modified: head/sys/net/pfvar.h head/sys/netpfil/pf/if_pfsync.c head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Fri Nov 2 16:26:44 2018 (r340064) +++ head/sys/net/pfvar.h Fri Nov 2 16:47:07 2018 (r340065) @@ -825,12 +825,18 @@ typedef void pfsync_delete_state_t(struct pf_state *) typedef void pfsync_clear_states_t(u_int32_t, const char *); typedef int pfsync_defer_t(struct pf_state *, struct mbuf *); -extern pfsync_state_import_t *pfsync_state_import_ptr; -extern pfsync_insert_state_t *pfsync_insert_state_ptr; -extern pfsync_update_state_t *pfsync_update_state_ptr; -extern pfsync_delete_state_t *pfsync_delete_state_ptr; -extern pfsync_clear_states_t *pfsync_clear_states_ptr; -extern pfsync_defer_t *pfsync_defer_ptr; +VNET_DECLARE(pfsync_state_import_t *, pfsync_state_import_ptr); +#define V_pfsync_state_import_ptr VNET(pfsync_state_import_ptr) +VNET_DECLARE(pfsync_insert_state_t *, pfsync_insert_state_ptr); +#define V_pfsync_insert_state_ptr VNET(pfsync_insert_state_ptr) +VNET_DECLARE(pfsync_update_state_t *, pfsync_update_state_ptr); +#define V_pfsync_update_state_ptr VNET(pfsync_update_state_ptr) +VNET_DECLARE(pfsync_delete_state_t *, pfsync_delete_state_ptr); +#define V_pfsync_delete_state_ptr VNET(pfsync_delete_state_ptr) +VNET_DECLARE(pfsync_clear_states_t *, pfsync_clear_states_ptr); +#define V_pfsync_clear_states_ptr VNET(pfsync_clear_states_ptr) +VNET_DECLARE(pfsync_defer_t *, pfsync_defer_ptr); +#define V_pfsync_defer_ptr VNET(pfsync_defer_ptr) void pfsync_state_export(struct pfsync_state *, struct pf_state *); Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Fri Nov 2 16:26:44 2018 (r340064) +++ head/sys/netpfil/pf/if_pfsync.c Fri Nov 2 16:47:07 2018 (r340065) @@ -1362,10 +1362,10 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t dat sc->sc_maxupdates = pfsyncr.pfsyncr_maxupdates; if (pfsyncr.pfsyncr_defer) { sc->sc_flags |= PFSYNCF_DEFER; - pfsync_defer_ptr = pfsync_defer; + V_pfsync_defer_ptr = pfsync_defer; } else { sc->sc_flags &= ~PFSYNCF_DEFER; - pfsync_defer_ptr = NULL; + V_pfsync_defer_ptr = NULL; } if (sifp == NULL) { @@ -2311,12 +2311,12 @@ pfsync_pointers_init() { PF_RULES_WLOCK(); - pfsync_state_import_ptr = pfsync_state_import; - pfsync_insert_state_ptr = pfsync_insert_state; - pfsync_update_state_ptr = pfsync_update_state; - pfsync_delete_state_ptr = pfsync_delete_state; - pfsync_clear_states_ptr = pfsync_clear_states; - pfsync_defer_ptr = pfsync_defer; + V_pfsync_state_import_ptr = pfsync_state_import; + V_pfsync_insert_state_ptr = pfsync_insert_state; + V_pfsync_update_state_ptr = pfsync_update_state; + V_pfsync_delete_state_ptr = pfsync_delete_state; + V_pfsync_clear_states_ptr = pfsync_clear_states; + V_pfsync_defer_ptr = pfsync_defer; PF_RULES_WUNLOCK(); } @@ -2325,12 +2325,12 @@ pfsync_pointers_uninit() { PF_RULES_WLOCK(); - pfsync_state_import_ptr = NULL; - pfsync_insert_state_ptr = NULL; - pfsync_update_state_ptr = NULL; - pfsync_delete_state_ptr = NULL; - pfsync_clear_states_ptr = NULL; - pfsync_defer_ptr = NULL; + V_pfsync_state_import_ptr = NULL; + V_pfsync_insert_state_ptr = NULL; + V_pfsync_update_state_ptr = NULL; + V_pfsync_delete_state_ptr = NULL; + V_pfsync_clear_states_ptr = NULL; + V_pfsync_defer_ptr = NULL; PF_RULES_WUNLOCK(); } @@ -2347,6 +2347,8 @@ vnet_pfsync_init(const void *unused __unused) if_clone_detach(V_pfsync_cloner); log(LOG_INFO, "swi_add() failed in %s\n", __func__); } + + pfsync_pointers_init(); } VNET_SYSINIT(vnet_pfsync_init, SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY, vnet_pfsync_init, NULL); @@ -2355,6 +2357,8 @@ static void vnet_pfsync_uninit(const void *unused __unused) { + pfsync_pointers_uninit(); + if_clone_detach(V_pfsync_cloner); swi_remove(V_pfsync_swi_cookie); } @@ -2380,7 +2384,6 @@ pfsync_init() return (error); } #endif - pfsync_pointers_init(); return (0); } @@ -2388,8 +2391,6 @@ pfsync_init() static void pfsync_uninit() { - - pfsync_pointers_uninit(); #ifdef INET ipproto_unregister(IPPROTO_PFSYNC); Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Fri Nov 2 16:26:44 2018 (r340064) +++ head/sys/netpfil/pf/pf.c Fri Nov 2 16:47:07 2018 (r340065) @@ -1268,8 +1268,8 @@ pf_state_insert(struct pfi_kif *kif, struct pf_state_k refcount_init(&s->refs, 2); counter_u64_add(V_pf_status.fcounters[FCNT_STATE_INSERT], 1); - if (pfsync_insert_state_ptr != NULL) - pfsync_insert_state_ptr(s); + if (V_pfsync_insert_state_ptr != NULL) + V_pfsync_insert_state_ptr(s); /* Returns locked. */ return (0); @@ -1672,8 +1672,8 @@ pf_unlink_state(struct pf_state *s, u_int flags) LIST_REMOVE(s, entry); pf_src_tree_remove_state(s); - if (pfsync_delete_state_ptr != NULL) - pfsync_delete_state_ptr(s); + if (V_pfsync_delete_state_ptr != NULL) + V_pfsync_delete_state_ptr(s); STATE_DEC_COUNTERS(s); @@ -3582,7 +3582,7 @@ pf_test_rule(struct pf_rule **rm, struct pf_state **sm if (*sm != NULL && !((*sm)->state_flags & PFSTATE_NOSYNC) && direction == PF_OUT && - pfsync_defer_ptr != NULL && pfsync_defer_ptr(*sm, m)) + V_pfsync_defer_ptr != NULL && V_pfsync_defer_ptr(*sm, m)) /* * We want the state created, but we dont * want to send this in case a partner @@ -5996,8 +5996,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct action = pf_test_state_tcp(&s, dir, kif, m, off, h, &pd, &reason); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6025,8 +6025,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct } action = pf_test_state_udp(&s, dir, kif, m, off, h, &pd); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6048,8 +6048,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct action = pf_test_state_icmp(&s, dir, kif, m, off, h, &pd, &reason); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6071,8 +6071,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct default: action = pf_test_state_other(&s, dir, kif, m, &pd); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6435,8 +6435,8 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struc action = pf_test_state_tcp(&s, dir, kif, m, off, h, &pd, &reason); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6464,8 +6464,8 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struc } action = pf_test_state_udp(&s, dir, kif, m, off, h, &pd); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6494,8 +6494,8 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struc action = pf_test_state_icmp(&s, dir, kif, m, off, h, &pd, &reason); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6508,8 +6508,8 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struc default: action = pf_test_state_other(&s, dir, kif, m, &pd); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Fri Nov 2 16:26:44 2018 (r340064) +++ head/sys/netpfil/pf/pf_ioctl.c Fri Nov 2 16:47:07 2018 (r340065) @@ -212,12 +212,13 @@ struct sx pf_ioctl_lock; struct sx pf_end_lock; /* pfsync */ -pfsync_state_import_t *pfsync_state_import_ptr = NULL; -pfsync_insert_state_t *pfsync_insert_state_ptr = NULL; -pfsync_update_state_t *pfsync_update_state_ptr = NULL; -pfsync_delete_state_t *pfsync_delete_state_ptr = NULL; -pfsync_clear_states_t *pfsync_clear_states_ptr = NULL; -pfsync_defer_t *pfsync_defer_ptr = NULL; +VNET_DEFINE(pfsync_state_import_t *, pfsync_state_import_ptr); +VNET_DEFINE(pfsync_insert_state_t *, pfsync_insert_state_ptr); +VNET_DEFINE(pfsync_update_state_t *, pfsync_update_state_ptr); +VNET_DEFINE(pfsync_delete_state_t *, pfsync_delete_state_ptr); +VNET_DEFINE(pfsync_clear_states_t *, pfsync_clear_states_ptr); +VNET_DEFINE(pfsync_defer_t *, pfsync_defer_ptr); + /* pflog */ pflog_packet_t *pflog_packet_ptr = NULL; @@ -1873,8 +1874,8 @@ relock_DIOCCLRSTATES: PF_HASHROW_UNLOCK(ih); } psk->psk_killed = killed; - if (pfsync_clear_states_ptr != NULL) - pfsync_clear_states_ptr(V_pf_status.hostid, psk->psk_ifname); + if (V_pfsync_clear_states_ptr != NULL) + V_pfsync_clear_states_ptr(V_pf_status.hostid, psk->psk_ifname); break; } @@ -1961,9 +1962,9 @@ relock_DIOCKILLSTATES: error = EINVAL; break; } - if (pfsync_state_import_ptr != NULL) { + if (V_pfsync_state_import_ptr != NULL) { PF_RULES_RLOCK(); - error = pfsync_state_import_ptr(sp, PFSYNC_SI_IOCTL); + error = V_pfsync_state_import_ptr(sp, PFSYNC_SI_IOCTL); PF_RULES_RUNLOCK(); } else error = EOPNOTSUPP; From owner-svn-src-head@freebsd.org Fri Nov 2 16:50:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1B0810FCEB2; Fri, 2 Nov 2018 16:50:18 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 551AD74181; Fri, 2 Nov 2018 16:50:18 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32177581A; Fri, 2 Nov 2018 16:50:18 +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 wA2GoITb024952; Fri, 2 Nov 2018 16:50:18 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2GoIWf024951; Fri, 2 Nov 2018 16:50:18 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811021650.wA2GoIWf024951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 2 Nov 2018 16:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340066 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 340066 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 16:50:18 -0000 Author: kp Date: Fri Nov 2 16:50:17 2018 New Revision: 340066 URL: https://svnweb.freebsd.org/changeset/base/340066 Log: Notify that the ifnet will go away, even on vnet shutdown pf subscribes to ifnet_departure_event events, so it can clean up the ifg_pf_kif and if_pf_kif pointers in the ifnet. During vnet shutdown interfaces could go away without sending the event, so pf ends up cleaning these up as part of its shutdown sequence, which happens after the ifnet has already been freed. Send the ifnet_departure_event during vnet shutdown, allowing pf to clean up correctly. MFC after: 2 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D17500 Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri Nov 2 16:47:07 2018 (r340065) +++ head/sys/net/if.c Fri Nov 2 16:50:17 2018 (r340066) @@ -1122,6 +1122,9 @@ if_detach_internal(struct ifnet *ifp, int vmove, struc * the work top-down for us. */ if (shutdown) { + /* Give interface users the chance to clean up. */ + EVENTHANDLER_INVOKE(ifnet_departure_event, ifp); + /* * In case of a vmove we are done here without error. * If we would signal an error it would lead to the same From owner-svn-src-head@freebsd.org Fri Nov 2 16:53:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 870F710FD144; Fri, 2 Nov 2018 16:53:16 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DBB3746D0; Fri, 2 Nov 2018 16:53: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EE9A59C7; Fri, 2 Nov 2018 16:53: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 wA2GrGDk029728; Fri, 2 Nov 2018 16:53:16 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2GrF2D029727; Fri, 2 Nov 2018 16:53:16 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811021653.wA2GrF2D029727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 2 Nov 2018 16:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340067 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 340067 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 16:53:16 -0000 Author: kp Date: Fri Nov 2 16:53:15 2018 New Revision: 340067 URL: https://svnweb.freebsd.org/changeset/base/340067 Log: pfsync: Ensure uninit is done before pf pfsync touches pf memory (for pf_state and the pfsync callback pointers), not the other way around. We need to ensure that pfsync is torn down before pf. MFC after: 2 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D17501 Modified: head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Fri Nov 2 16:50:17 2018 (r340066) +++ head/sys/netpfil/pf/if_pfsync.c Fri Nov 2 16:53:15 2018 (r340067) @@ -2362,11 +2362,8 @@ vnet_pfsync_uninit(const void *unused __unused) if_clone_detach(V_pfsync_cloner); swi_remove(V_pfsync_swi_cookie); } -/* - * Detach after pf is gone; otherwise we might touch pfsync memory - * from within pf after freeing pfsync. - */ -VNET_SYSUNINIT(vnet_pfsync_uninit, SI_SUB_INIT_IF, SI_ORDER_SECOND, + +VNET_SYSUNINIT(vnet_pfsync_uninit, SI_SUB_PROTO_FIREWALL, SI_ORDER_FOURTH, vnet_pfsync_uninit, NULL); static int From owner-svn-src-head@freebsd.org Fri Nov 2 16:57:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03A6810FD2CC; Fri, 2 Nov 2018 16:57:25 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC50374980; Fri, 2 Nov 2018 16:57:24 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88F3359E9; Fri, 2 Nov 2018 16:57:24 +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 wA2GvOSw029960; Fri, 2 Nov 2018 16:57:24 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2GvNub029956; Fri, 2 Nov 2018 16:57:23 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811021657.wA2GvNub029956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 2 Nov 2018 16:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340068 - in head/sys: net netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head/sys: net netpfil/pf X-SVN-Commit-Revision: 340068 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 16:57:25 -0000 Author: kp Date: Fri Nov 2 16:57:23 2018 New Revision: 340068 URL: https://svnweb.freebsd.org/changeset/base/340068 Log: pfsync: Handle syncdev going away If the syncdev is removed we no longer need to clean up the multicast entry we've got set up for that device. Pass the ifnet detach event through pf to pfsync, and remove our multicast handle, and mark us as no longer having a syncdev. Note that this callback is always installed, even if the pfsync interface is disabled (and thus it's not a per-vnet callback pointer). MFC after: 2 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D17502 Modified: head/sys/net/pfvar.h head/sys/netpfil/pf/if_pfsync.c head/sys/netpfil/pf/pf_if.c head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Fri Nov 2 16:53:15 2018 (r340067) +++ head/sys/net/pfvar.h Fri Nov 2 16:57:23 2018 (r340068) @@ -824,6 +824,7 @@ typedef void pfsync_update_state_t(struct pf_state *) typedef void pfsync_delete_state_t(struct pf_state *); typedef void pfsync_clear_states_t(u_int32_t, const char *); typedef int pfsync_defer_t(struct pf_state *, struct mbuf *); +typedef void pfsync_detach_ifnet_t(struct ifnet *); VNET_DECLARE(pfsync_state_import_t *, pfsync_state_import_ptr); #define V_pfsync_state_import_ptr VNET(pfsync_state_import_ptr) @@ -837,6 +838,7 @@ VNET_DECLARE(pfsync_clear_states_t *, pfsync_clear_sta #define V_pfsync_clear_states_ptr VNET(pfsync_clear_states_ptr) VNET_DECLARE(pfsync_defer_t *, pfsync_defer_ptr); #define V_pfsync_defer_ptr VNET(pfsync_defer_ptr) +extern pfsync_detach_ifnet_t *pfsync_detach_ifnet_ptr; void pfsync_state_export(struct pfsync_state *, struct pf_state *); Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Fri Nov 2 16:53:15 2018 (r340067) +++ head/sys/netpfil/pf/if_pfsync.c Fri Nov 2 16:57:23 2018 (r340068) @@ -281,6 +281,7 @@ static void pfsync_bulk_status(u_int8_t); static void pfsync_bulk_update(void *); static void pfsync_bulk_fail(void *); +static void pfsync_detach_ifnet(struct ifnet *); #ifdef IPSEC static void pfsync_update_net_tdb(struct pfsync_tdb *); #endif @@ -2292,6 +2293,29 @@ pfsync_multicast_cleanup(struct pfsync_softc *sc) imo->imo_multicast_ifp = NULL; } +void +pfsync_detach_ifnet(struct ifnet *ifp) +{ + struct pfsync_softc *sc = V_pfsyncif; + + if (sc == NULL) + return; + + PFSYNC_LOCK(sc); + + if (sc->sc_sync_if == ifp) { + /* We don't need mutlicast cleanup here, because the interface + * is going away. We do need to ensure we don't try to do + * cleanup later. + */ + sc->sc_imo.imo_membership = NULL; + sc->sc_imo.imo_multicast_ifp = NULL; + sc->sc_sync_if = NULL; + } + + PFSYNC_UNLOCK(sc); +} + #ifdef INET extern struct domain inetdomain; static struct protosw in_pfsync_protosw = { @@ -2372,6 +2396,8 @@ pfsync_init() #ifdef INET int error; + pfsync_detach_ifnet_ptr = pfsync_detach_ifnet; + error = pf_proto_register(PF_INET, &in_pfsync_protosw); if (error) return (error); @@ -2388,6 +2414,7 @@ pfsync_init() static void pfsync_uninit() { + pfsync_detach_ifnet_ptr = NULL; #ifdef INET ipproto_unregister(IPPROTO_PFSYNC); Modified: head/sys/netpfil/pf/pf_if.c ============================================================================== --- head/sys/netpfil/pf/pf_if.c Fri Nov 2 16:53:15 2018 (r340067) +++ head/sys/netpfil/pf/pf_if.c Fri Nov 2 16:57:23 2018 (r340068) @@ -834,6 +834,9 @@ pfi_detach_ifnet_event(void *arg __unused, struct ifne { struct pfi_kif *kif = (struct pfi_kif *)ifp->if_pf_kif; + if (pfsync_detach_ifnet_ptr) + pfsync_detach_ifnet_ptr(ifp); + if (kif == NULL) return; @@ -841,6 +844,7 @@ pfi_detach_ifnet_event(void *arg __unused, struct ifne /* Avoid teardown race in the least expensive way. */ return; } + PF_RULES_WLOCK(); V_pfi_update++; pfi_kif_update(kif); Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Fri Nov 2 16:53:15 2018 (r340067) +++ head/sys/netpfil/pf/pf_ioctl.c Fri Nov 2 16:57:23 2018 (r340068) @@ -218,6 +218,7 @@ VNET_DEFINE(pfsync_update_state_t *, pfsync_update_sta VNET_DEFINE(pfsync_delete_state_t *, pfsync_delete_state_ptr); VNET_DEFINE(pfsync_clear_states_t *, pfsync_clear_states_ptr); VNET_DEFINE(pfsync_defer_t *, pfsync_defer_ptr); +pfsync_detach_ifnet_t *pfsync_detach_ifnet_ptr; /* pflog */ pflog_packet_t *pflog_packet_ptr = NULL; From owner-svn-src-head@freebsd.org Fri Nov 2 16:59:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EE7A10FD4B2; Fri, 2 Nov 2018 16:59:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3215074C38; Fri, 2 Nov 2018 16:59:56 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13F0D5A0C; Fri, 2 Nov 2018 16:59:56 +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 wA2Gxt6U030106; Fri, 2 Nov 2018 16:59:55 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2GxtTb030104; Fri, 2 Nov 2018 16:59:55 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811021659.wA2GxtTb030104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 2 Nov 2018 16:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340069 - 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: 340069 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 16:59:56 -0000 Author: kp Date: Fri Nov 2 16:59:55 2018 New Revision: 340069 URL: https://svnweb.freebsd.org/changeset/base/340069 Log: pf tests: Basic pfsync test Set up two jails, configure pfsync between them and create state in one of them, verify that this state is copied to the other jail. MFC after: 2 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D17504 Added: head/tests/sys/netpfil/pf/pfsync.sh (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 Nov 2 16:57:23 2018 (r340068) +++ head/tests/sys/netpfil/pf/Makefile Fri Nov 2 16:59:55 2018 (r340069) @@ -11,7 +11,8 @@ ATF_TESTS_SH+= pass_block \ set_tos \ route_to \ synproxy \ - set_skip + set_skip \ + pfsync ${PACKAGE}FILES+= utils.subr \ echo_inetd.conf \ Added: head/tests/sys/netpfil/pf/pfsync.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/pf/pfsync.sh Fri Nov 2 16:59:55 2018 (r340069) @@ -0,0 +1,70 @@ +# $FreeBSD$ + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "basic" "cleanup" +basic_head() +{ + atf_set descr 'Basic pfsync test' + atf_set require.user root + + atf_set require.progs scapy +} + +basic_body() +{ + pfsynct_init + + epair_sync=$(pft_mkepair) + epair_one=$(pft_mkepair) + epair_two=$(pft_mkepair) + + pft_mkjail one ${epair_one}a ${epair_sync}a + pft_mkjail two ${epair_two}a ${epair_sync}b + + # pfsync interface + jexec one ifconfig ${epair_sync}a 192.0.2.1/24 up + jexec one ifconfig ${epair_one}a 198.51.100.1/24 up + jexec one ifconfig pfsync0 \ + syncdev ${epair_sync}a \ + maxupd 1 \ + up + jexec two ifconfig ${epair_two}a 198.51.100.2/24 up + jexec two ifconfig ${epair_sync}b 192.0.2.2/24 up + jexec two ifconfig pfsync0 \ + syncdev ${epair_sync}b \ + maxupd 1 \ + up + + # Enable pf! + jexec one pfctl -e + pft_set_rules one \ + "set skip on ${epair_sync}a" \ + "pass keep state" + jexec two pfctl -e + pft_set_rules two \ + "set skip on ${epair_sync}b" \ + "pass keep state" + + ifconfig ${epair_one}b 198.51.100.254/24 up + + ping -c 1 -S 198.51.100.254 198.51.100.1 + + # Give pfsync time to do its thing + sleep 2 + + if ! jexec two pfctl -s states | grep icmp | grep 198.51.100.1 | \ + grep 198.51.100.2 ; then + atf_fail "state not found on synced host" + fi +} + +basic_cleanup() +{ + pfsynct_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "basic" +} Modified: head/tests/sys/netpfil/pf/utils.subr ============================================================================== --- head/tests/sys/netpfil/pf/utils.subr Fri Nov 2 16:57:23 2018 (r340068) +++ head/tests/sys/netpfil/pf/utils.subr Fri Nov 2 16:59:55 2018 (r340069) @@ -13,6 +13,15 @@ pft_init() fi } +pfsynct_init() +{ + pft_init + + if ! kldstat -q -m pfsync; then + atf_skip "This test requires pfsync" + fi +} + pft_mkepair() { ifname=$(ifconfig epair create) @@ -66,4 +75,9 @@ pft_cleanup() done rm created_interfaces.lst fi +} + +pfsynct_cleanup() +{ + pft_cleanup } From owner-svn-src-head@freebsd.org Fri Nov 2 17:01:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6D2610FD66C; Fri, 2 Nov 2018 17:01:19 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DF0874F86; Fri, 2 Nov 2018 17:01:19 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F33D5A6B; Fri, 2 Nov 2018 17:01:19 +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 wA2H1Jb5030297; Fri, 2 Nov 2018 17:01:19 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2H1JV1030296; Fri, 2 Nov 2018 17:01:19 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811021701.wA2H1JV1030296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 2 Nov 2018 17:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340070 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 340070 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 17:01:19 -0000 Author: kp Date: Fri Nov 2 17:01:18 2018 New Revision: 340070 URL: https://svnweb.freebsd.org/changeset/base/340070 Log: pfsync: Allow module to be unloaded MFC after: 2 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D17505 Modified: head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Fri Nov 2 16:59:55 2018 (r340069) +++ head/sys/netpfil/pf/if_pfsync.c Fri Nov 2 17:01:18 2018 (r340070) @@ -2431,12 +2431,6 @@ pfsync_modevent(module_t mod, int type, void *data) case MOD_LOAD: error = pfsync_init(); break; - case MOD_QUIESCE: - /* - * Module should not be unloaded due to race conditions. - */ - error = EBUSY; - break; case MOD_UNLOAD: pfsync_uninit(); break; From owner-svn-src-head@freebsd.org Fri Nov 2 17:02:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D00E10FD800; Fri, 2 Nov 2018 17:02:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7C2A7527E; Fri, 2 Nov 2018 17:02:10 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8D225BBD; Fri, 2 Nov 2018 17:02:10 +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 wA2H2Aax032699; Fri, 2 Nov 2018 17:02:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2H2AYI032684; Fri, 2 Nov 2018 17:02:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201811021702.wA2H2AYI032684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 2 Nov 2018 17:02:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340071 - head/sys/dev/sound/pci/hda X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 340071 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 17:02:11 -0000 Author: mav Date: Fri Nov 2 17:02:10 2018 New Revision: 340071 URL: https://svnweb.freebsd.org/changeset/base/340071 Log: Adjust SiS 966/968 HDA controller naming. Submitted by: Dmitry Luhtionov Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Fri Nov 2 17:01:18 2018 (r340070) +++ head/sys/dev/sound/pci/hda/hdac.c Fri Nov 2 17:02:10 2018 (r340071) @@ -171,7 +171,7 @@ static const struct { { HDA_AMD_HUDSON2, "AMD Hudson-2", 0, 0 }, { HDA_RDC_M3010, "RDC M3010", 0, 0 }, { HDA_VIA_VT82XX, "VIA VT8251/8237A",0, 0 }, - { HDA_SIS_966, "SiS 966", 0, 0 }, + { HDA_SIS_966, "SiS 966/968", 0, 0 }, { HDA_ULI_M5461, "ULI M5461", 0, 0 }, /* Unknown */ { HDA_INTEL_ALL, "Intel", 0, 0 }, From owner-svn-src-head@freebsd.org Fri Nov 2 17:03:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1325910FDB8E; Fri, 2 Nov 2018 17:03:55 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8576A7562E; Fri, 2 Nov 2018 17:03:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66A6C5BDF; Fri, 2 Nov 2018 17:03:54 +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 wA2H3sc9035239; Fri, 2 Nov 2018 17:03:54 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2H3swP035238; Fri, 2 Nov 2018 17:03:54 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811021703.wA2H3swP035238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 2 Nov 2018 17:03:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340072 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 340072 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 17:03:55 -0000 Author: kp Date: Fri Nov 2 17:03:53 2018 New Revision: 340072 URL: https://svnweb.freebsd.org/changeset/base/340072 Log: pfsync: Add missing unlock If we fail to set up the multicast entry for pfsync and return an error we must release the pfsync lock first. MFC after: 2 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D17506 Modified: head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Fri Nov 2 17:02:10 2018 (r340071) +++ head/sys/netpfil/pf/if_pfsync.c Fri Nov 2 17:03:53 2018 (r340072) @@ -1394,6 +1394,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t dat if (error) { if_rele(sifp); free(mship, M_PFSYNC); + PFSYNC_UNLOCK(sc); return (error); } } From owner-svn-src-head@freebsd.org Fri Nov 2 17:05:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAE2A10FDD17; Fri, 2 Nov 2018 17:05:41 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C167758F8; Fri, 2 Nov 2018 17:05:41 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EE345C01; Fri, 2 Nov 2018 17:05:41 +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 wA2H5fYw035360; Fri, 2 Nov 2018 17:05:41 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2H5fNE035359; Fri, 2 Nov 2018 17:05:41 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811021705.wA2H5fNE035359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 2 Nov 2018 17:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340073 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 340073 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 17:05:42 -0000 Author: kp Date: Fri Nov 2 17:05:40 2018 New Revision: 340073 URL: https://svnweb.freebsd.org/changeset/base/340073 Log: pf: Keep a reference to struct ifnets we're using Ensure that the struct ifnet we use can't go away until we're done with it. Modified: head/sys/netpfil/pf/pf_if.c Modified: head/sys/netpfil/pf/pf_if.c ============================================================================== --- head/sys/netpfil/pf/pf_if.c Fri Nov 2 17:03:53 2018 (r340072) +++ head/sys/netpfil/pf/pf_if.c Fri Nov 2 17:05:40 2018 (r340073) @@ -165,8 +165,10 @@ pfi_cleanup_vnet(void) RB_REMOVE(pfi_ifhead, &V_pfi_ifs, kif); if (kif->pfik_group) kif->pfik_group->ifg_pf_kif = NULL; - if (kif->pfik_ifp) + if (kif->pfik_ifp) { + if_rele(kif->pfik_ifp); kif->pfik_ifp->if_pf_kif = NULL; + } free(kif, PFI_MTYPE); } @@ -322,6 +324,8 @@ pfi_attach_ifnet(struct ifnet *ifp) V_pfi_update++; kif = pfi_kif_attach(kif, ifp->if_xname); + if_ref(ifp); + kif->pfik_ifp = ifp; ifp->if_pf_kif = kif; @@ -848,6 +852,8 @@ pfi_detach_ifnet_event(void *arg __unused, struct ifne PF_RULES_WLOCK(); V_pfi_update++; pfi_kif_update(kif); + + if_rele(kif->pfik_ifp); kif->pfik_ifp = NULL; ifp->if_pf_kif = NULL; From owner-svn-src-head@freebsd.org Fri Nov 2 17:38:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01C7210D4742 for ; Fri, 2 Nov 2018 17:38:19 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic301-4.consmr.mail.bf2.yahoo.com (sonic301-4.consmr.mail.bf2.yahoo.com [74.6.129.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 995A776A0E for ; Fri, 2 Nov 2018 17:38:18 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: fzw_qB4VM1ka5fiBsyn.fq8GhmegxCkqIqNbiwxI6rN6nO4y5TgwNWxm8SY6T5u 8uCLJCHme.X5ph.a2Y1_x_dmLbj9IZLLiHUeQLw1El0Cdji6fi_KJwc4uD2Dn78rQ82nEju.4C_1 _wDTxfFOzKk4UeNE5DxP4u_dsfuRDzCBTb72Fs4eGLs0D9zpq6zS9XsOIaqJ6R70bAFQS0TJFQNt yd3bcN8KD99Ge5z7H2e.SCFR2Op4UUpjlrI_f6rArz2ofwW.hZVwNZt7GOgVUwapRBJaRcLZU1IS VTI6vBty2Qnya0Q0pSMpFxefpDfzPw73HTgmzGDPx97Vn13uZgI_VJAc_z0KsOOoFPTcWYv8vFwq ynQUj0WeOra8e0CrhwKZ87Qip6vA70rAiGviewk9BtDzZznXh4tnX.jxVim84H5JkcbE1mNrRQYr m3wEgG9510heLo1GuWZB0nEu7YRBXQiR4n7qu9P2jYA7dhiXpkT_hmQLkaY7PmZuaf2mnsoEuD7d wsxoYPfQKxavaY5u3k99Nmn4ZBp1roBzEzC_Tdl2IxTX3F2wXllGNUEhPAPK7lkppvZD2L_Ti.o3 Z8uZvyD5cBXioizzPIoIVdDF5VTtZCD_vFWxa4bUp8cTYQKVFoYZl3QBXHWp6gw9Yf2ClmWxuRwt 5JlBEMb0XsCwTFUg8noSRJtFYW_OaR1S2HBNWvVs88PFz71r3okcMuc4OM5isYDnBhBJEl8YdDTg 2JDrVCA6HRVySQtwf6GiJVbtdKEh7niH929Clvcxf4z0zMIEb79L_Ffl5YD08dQbiGDH7z4PK84H kXkIoOOrxUmkG0iBmCQecmdO5KmnmZPa0_EjXA4Xg48Kawc9utNLT5unqLM0nbxOPzZ3w5GDrMys MgJV0WTXcnhBsKedELv0wyqYIWNvdIToQU8fw3dxtYRcsm2ZdUr3.s.AQEQeqpAGvzJFpkrXXEwU eKo_soLCYmzC_bRF9xb0KkTVcz4EUq5jb8B70umGcsq32LeSGyKdqhABW6r807CH_S7WAVh3cFRY JutpgA.2.wrtfMeUatEYIi6AoGeUuL56U6HWdIXnX1lc3DcBhn00- Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.bf2.yahoo.com with HTTP; Fri, 2 Nov 2018 17:38:12 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp408.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 7da7d10dc28628332706b651793b3a3b; Fri, 02 Nov 2018 17:38:10 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r339876 - head/libexec/rtld-elf From: Mark Millard In-Reply-To: <20181102155234.GN5335@kib.kiev.ua> Date: Fri, 2 Nov 2018 10:38:08 -0700 Cc: svn-src-head@freebsd.org, Alexander Richardson Content-Transfer-Encoding: quoted-printable Message-Id: References: <8E5A5F3A-F1A7-4702-A2F7-65D74CC5B2E5@yahoo.com> <20181102004101.GI5335@kib.kiev.ua> <003A49D7-6E8B-4775-A70B-E0EB44505D4B@yahoo.com> <20181102113827.GM5335@kib.kiev.ua> <7B29A4C8-228D-41CB-B594-98DFA456E9C8@yahoo.com> <20181102155234.GN5335@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 17:38:19 -0000 On 2018-Nov-2, at 8:52 AM, Konstantin Belousov = wrote: > On Fri, Nov 02, 2018 at 08:30:17AM -0700, Mark Millard wrote: >> Breakpoint 4, reloc_non_plt (obj=3D0x41041000, obj_rtld=3D0x1801cc7, = flags=3D4, lockstate=3D0x0) at = /usr/src/libexec/rtld-elf/powerpc/reloc.c:338 >> 338 __syncicache(obj->mapbase + = phdr->p_vaddr, >> 1: x/i $pc >> =3D> 0x1012b90 : lwz r0,36(r29) >> (gdb) print/x obj->mapbase+phdr->p_vaddr >> $17 =3D 0x3000000 >> (gdb) print/x obj->mapbase =20 >> $18 =3D 0x1800000 >> (gdb) print/x phdr->p_vaddr >> $19 =3D 0x1800000 >> (gdb) c >> Continuing. >>=20 >> Program received signal SIGSEGV, Segmentation fault. >> __syncicache (from=3D0x3000000, len=3D34112) at = /usr/src/lib/libc/powerpc/gen/syncicache.c:94 >> 94 __asm __volatile ("dcbst 0,%0" :: "r"(p)); >> 1: x/i $pc >> =3D> 0x10228b8 <__syncicache+96>: dcbst 0,r11 >>=20 >>=20 >>=20 >> It looks to me like the 0x1800000 component of the >> overall figure was double counted. ( phdr->p_vaddr >> would vary but obj->mapbase would not. ) >>=20 >> Omit "obj->mapbase + "? > I used the wrong addend. Try this fix. >=20 > diff --git a/libexec/rtld-elf/powerpc/reloc.c = b/libexec/rtld-elf/powerpc/reloc.c > index e921a4dc7d1..fae28dd9224 100644 > --- a/libexec/rtld-elf/powerpc/reloc.c > +++ b/libexec/rtld-elf/powerpc/reloc.c > @@ -294,6 +294,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, = int flags, > { > const Elf_Rela *relalim; > const Elf_Rela *rela; > + const Elf_Phdr *phdr; > SymCache *cache; > int r =3D -1; >=20 > @@ -327,8 +328,18 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry = *obj_rtld, int flags, > if (cache !=3D NULL) > free(cache); >=20 > - /* Synchronize icache for text seg in case we made any changes = */ > - __syncicache(obj->mapbase, obj->textsize); > + /* > + * Synchronize icache for executable segments in case we made > + * any changes. > + */ > + for (phdr =3D obj->phdr; > + (const char *)phdr < (const char *)obj->phdr + obj->phsize; > + phdr++) { > + if (phdr->p_type =3D=3D PT_LOAD && (phdr->p_flags & = PF_X) !=3D 0) { > + __syncicache(obj->relocbase + phdr->p_vaddr, > + phdr->p_memsz); > + } > + } >=20 > return (r); > } > diff --git a/libexec/rtld-elf/powerpc64/reloc.c = b/libexec/rtld-elf/powerpc64/reloc.c > index c2d6dac13b1..15f31738ab7 100644 > --- a/libexec/rtld-elf/powerpc64/reloc.c > +++ b/libexec/rtld-elf/powerpc64/reloc.c > @@ -291,6 +291,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, = int flags, > { > const Elf_Rela *relalim; > const Elf_Rela *rela; > + const Elf_Phdr *phdr; > SymCache *cache; > int bytes =3D obj->dynsymcount * sizeof(SymCache); > int r =3D -1; > @@ -327,8 +328,18 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry = *obj_rtld, int flags, > if (cache) > munmap(cache, bytes); >=20 > - /* Synchronize icache for text seg in case we made any changes = */ > - __syncicache(obj->mapbase, obj->textsize); > + /* > + * Synchronize icache for executable segments in case we made > + * any changes. > + */ > + for (phdr =3D obj->phdr; > + (const char *)phdr < (const char *)obj->phdr + obj->phsize; > + phdr++) { > + if (phdr->p_type =3D=3D PT_LOAD && (phdr->p_flags & = PF_X) !=3D 0) { > + __syncicache(obj->relocbase + phdr->p_vaddr, > + phdr->p_memsz); > + } > + } >=20 > return (r); > } That seems better. But it crashes during /bin/ls execution ( 0x0180???? addresses ), apparently in a library routine ( 0x41?????? addresses ): Program received signal SIGSEGV, Segmentation fault. 0x411220b4 in ?? () (gdb) bt #0 0x411220b4 in ?? () #1 0x4112200c in ?? () #2 0x01803c84 in ?? () #3 0x018023b4 in ?? () #4 0x010121a0 in .rtld_start () at = /usr/src/libexec/rtld-elf/powerpc/rtld_start.S:112 Using a normal gdb run of /bin/ls suggests: #2 0x01803c84 in ?? () should be in main and seems to be: bl 0x1818914 = #3 0x018023b4 in ?? () should be in _start Looking in the test context: 0x1803c80: bl 0x1818914 0x1803c84: cmpwi cr7,r3,-1 and: 0x1818914: li r11,59 0x1818918: b 0x18186f4 and: 0x18186f4: rlwinm r11,r11,2,0,29 0x18186f8: addis r11,r11,386 0x18186fc: lwz r11,-30316(r11) 0x1818700: mtctr r11 0x1818704: bctr Breaking at the bctr and using info reg: r11 0x4125ffa0 1093009312 It looks like there is some amount of activity before the traceback addresses show up. I've not found a good way to fill in the "in ??()" (or analogous) information. The addresses 0x411220?? do not match up with a normal run of /bin/ls from gdb: the addresses can not be accessed. It does appear that the code is in /lib/libc.so.7 in the test context: Breakpoint 2, reloc_non_plt (obj=3D0x41041600, obj_rtld=3D0x41104b57, = flags=3D4, lockstate=3D0x0) at = /usr/src/libexec/rtld-elf/powerpc/reloc.c:338 338 __syncicache(obj->relocbase + = phdr->p_vaddr, 1: /x obj->relocbase + phdr->p_vaddr =3D 0x410ec000 2: /x obj->relocbase + phdr->p_vaddr + phdr->p_memsz =3D 0x4127f9d0 4: *obj =3D {magic =3D 0, version =3D 0, next =3D {tqe_next =3D 0x0, = tqe_prev =3D 0x41041408}, path =3D 0x4103f100 "/lib/libc.so.7", = origin_path =3D 0x0, refcount =3D 1, holdcount =3D 0, dl_refcount =3D 0,=20= mapbase =3D 0x410ec000 "\177ELF\001\002\001\t", mapsize =3D 1908736, = textsize =3D 1908736, vaddrbase =3D 0, relocbase =3D 0x410ec000 = "\177ELF\001\002\001\t", dynamic =3D 0x412938e0,=20 entry =3D 0x41119d20 "\224!\377\340|\b\002\246H\027\374\001\223\301", = phdr =3D 0x410ec034, phsize =3D 192, interp =3D 0x0, stack_flags =3D 6, = tlsindex =3D 2, tlsinit =3D 0x4128f9d0, tlsinitsize =3D 2832,=20 tlssize =3D 2860, tlsoffset =3D 8, tlsalign =3D 16, relro_page =3D = 0x410ec000 "\177ELF\001\002\001\t", relro_size =3D 0, pltgot =3D = 0x41299ba8, rel =3D 0x0, relsize =3D 0, rela =3D 0x41106530, relasize =3D = 79800,=20 pltrel =3D 0x0, pltrelsize =3D 0, pltrela =3D 0x41116d6c, pltrelasize = =3D 12156, symtab =3D 0x410f12a0, strtab =3D 0x410fd8e0 "", strsize =3D = 29303, verneed =3D 0x0, verneednum =3D 0, verdef =3D 0x41106420,=20 verdefnum =3D 8, versyms =3D 0x41104b58, buckets =3D 0x410ec0fc, = nbuckets =3D 2053, chains =3D 0x410ee110, nchains =3D 3172, nbuckets_gnu = =3D 0, symndx_gnu =3D 0, maskwords_bm_gnu =3D 0, shift2_gnu =3D 0,=20 dynsymcount =3D 3172, bloom_gnu =3D 0x0, buckets_gnu =3D 0x0, = chain_zero_gnu =3D 0x0, rpath =3D 0x0, runpath =3D 0x0, needed =3D 0x0, = needed_filtees =3D 0x0, needed_aux_filtees =3D 0x0, names =3D { stqh_first =3D 0x4103f120, stqh_last =3D 0x4103f140}, vertab =3D = 0x41040400, vernum =3D 9, init =3D 1091673320, fini =3D 1093063668, = preinit_array =3D 0, init_array =3D 0, fini_array =3D 0, = preinit_array_num =3D 0,=20 init_array_num =3D 0, fini_array_num =3D 0, osrel =3D 0, mainprog =3D = 0 '\000', rtld =3D 0 '\000', relocated =3D 1 '\001', ver_checked =3D 1 = '\001', textrel =3D 0 '\000', symbolic =3D 0 '\000', bind_now =3D 0 = '\000',=20 traced =3D 0 '\000', jmpslots_done =3D 0 '\000', init_done =3D 0 = '\000', tls_done =3D 1 '\001', phdr_alloc =3D 0 '\000', z_origin =3D 0 = '\000', z_nodelete =3D 0 '\000', z_noopen =3D 0 '\000',=20 z_loadfltr =3D 0 '\000', z_interpose =3D 0 '\000', z_nodeflib =3D 0 = '\000', z_global =3D 0 '\000', ref_nodel =3D 0 '\000', init_scanned =3D = 0 '\000', on_fini_list =3D 0 '\000', dag_inited =3D 0 '\000',=20 filtees_loaded =3D 0 '\000', irelative =3D 0 '\000', gnu_ifunc =3D 0 = '\000', non_plt_gnu_ifunc =3D 0 '\000', crt_no_init =3D 0 '\000', = valid_hash_sysv =3D 1 '\001', valid_hash_gnu =3D 0 '\000',=20 dlopened =3D 0 '\000', marker =3D 0 '\000', unholdfree =3D 0 '\000', = doomed =3D 0 '\000', linkmap =3D {l_addr =3D 0x410ec000 = "\177ELF\001\002\001\t", l_name =3D 0x4103f100 "/lib/libc.so.7", l_ld =3D = 0x412938e0,=20 l_next =3D 0x103ec1c , l_prev =3D 0x41041534}, dldags = =3D {stqh_first =3D 0x0, stqh_last =3D 0x41041748}, dagmembers =3D = {stqh_first =3D 0x0, stqh_last =3D 0x41041750}, dev =3D 137, ino =3D = 3370513,=20 priv =3D 0x0} (gdb) c Continuing. Breakpoint 2, reloc_non_plt (obj=3D0x41041600, obj_rtld=3D0xffffff50, = flags=3D4, lockstate=3D0x0) at = /usr/src/libexec/rtld-elf/powerpc/reloc.c:338 338 __syncicache(obj->relocbase + = phdr->p_vaddr, 1: /x obj->relocbase + phdr->p_vaddr =3D 0x4128f9d0 2: /x obj->relocbase + phdr->p_vaddr + phdr->p_memsz =3D 0x412bdef0 4: *obj =3D {magic =3D 0, version =3D 0, next =3D {tqe_next =3D 0x0, = tqe_prev =3D 0x41041408}, path =3D 0x4103f100 "/lib/libc.so.7", = origin_path =3D 0x0, refcount =3D 1, holdcount =3D 0, dl_refcount =3D 0,=20= mapbase =3D 0x410ec000 "\177ELF\001\002\001\t", mapsize =3D 1908736, = textsize =3D 1908736, vaddrbase =3D 0, relocbase =3D 0x410ec000 = "\177ELF\001\002\001\t", dynamic =3D 0x412938e0,=20 entry =3D 0x41119d20 "\224!\377\340|\b\002\246H\027\374\001\223\301", = phdr =3D 0x410ec034, phsize =3D 192, interp =3D 0x0, stack_flags =3D 6, = tlsindex =3D 2, tlsinit =3D 0x4128f9d0, tlsinitsize =3D 2832,=20 tlssize =3D 2860, tlsoffset =3D 8, tlsalign =3D 16, relro_page =3D = 0x410ec000 "\177ELF\001\002\001\t", relro_size =3D 0, pltgot =3D = 0x41299ba8, rel =3D 0x0, relsize =3D 0, rela =3D 0x41106530, relasize =3D = 79800,=20 pltrel =3D 0x0, pltrelsize =3D 0, pltrela =3D 0x41116d6c, pltrelasize = =3D 12156, symtab =3D 0x410f12a0, strtab =3D 0x410fd8e0 "", strsize =3D = 29303, verneed =3D 0x0, verneednum =3D 0, verdef =3D 0x41106420,=20 verdefnum =3D 8, versyms =3D 0x41104b58, buckets =3D 0x410ec0fc, = nbuckets =3D 2053, chains =3D 0x410ee110, nchains =3D 3172, nbuckets_gnu = =3D 0, symndx_gnu =3D 0, maskwords_bm_gnu =3D 0, shift2_gnu =3D 0,=20 dynsymcount =3D 3172, bloom_gnu =3D 0x0, buckets_gnu =3D 0x0, = chain_zero_gnu =3D 0x0, rpath =3D 0x0, runpath =3D 0x0, needed =3D 0x0, = needed_filtees =3D 0x0, needed_aux_filtees =3D 0x0, names =3D { stqh_first =3D 0x4103f120, stqh_last =3D 0x4103f140}, vertab =3D = 0x41040400, vernum =3D 9, init =3D 1091673320, fini =3D 1093063668, = preinit_array =3D 0, init_array =3D 0, fini_array =3D 0, = preinit_array_num =3D 0,=20 init_array_num =3D 0, fini_array_num =3D 0, osrel =3D 0, mainprog =3D = 0 '\000', rtld =3D 0 '\000', relocated =3D 1 '\001', ver_checked =3D 1 = '\001', textrel =3D 0 '\000', symbolic =3D 0 '\000', bind_now =3D 0 = '\000',=20 traced =3D 0 '\000', jmpslots_done =3D 0 '\000', init_done =3D 0 = '\000', tls_done =3D 1 '\001', phdr_alloc =3D 0 '\000', z_origin =3D 0 = '\000', z_nodelete =3D 0 '\000', z_noopen =3D 0 '\000',=20 z_loadfltr =3D 0 '\000', z_interpose =3D 0 '\000', z_nodeflib =3D 0 = '\000', z_global =3D 0 '\000', ref_nodel =3D 0 '\000', init_scanned =3D = 0 '\000', on_fini_list =3D 0 '\000', dag_inited =3D 0 '\000',=20 filtees_loaded =3D 0 '\000', irelative =3D 0 '\000', gnu_ifunc =3D 0 = '\000', non_plt_gnu_ifunc =3D 0 '\000', crt_no_init =3D 0 '\000', = valid_hash_sysv =3D 1 '\001', valid_hash_gnu =3D 0 '\000',=20 dlopened =3D 0 '\000', marker =3D 0 '\000', unholdfree =3D 0 '\000', = doomed =3D 0 '\000', linkmap =3D {l_addr =3D 0x410ec000 = "\177ELF\001\002\001\t", l_name =3D 0x4103f100 "/lib/libc.so.7", l_ld =3D = 0x412938e0,=20 l_next =3D 0x103ec1c , l_prev =3D 0x41041534}, dldags = =3D {stqh_first =3D 0x0, stqh_last =3D 0x41041748}, dagmembers =3D = {stqh_first =3D 0x0, stqh_last =3D 0x41041750}, dev =3D 137, ino =3D = 3370513,=20 priv =3D 0x0} I'm going to at least go eat before investigating more. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Fri Nov 2 17:50:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6CA410D4B61; Fri, 2 Nov 2018 17:50:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 613237700C; Fri, 2 Nov 2018 17:50: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43EB862B9; Fri, 2 Nov 2018 17:50: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 wA2HowA5058505; Fri, 2 Nov 2018 17:50:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2Hov5O058503; Fri, 2 Nov 2018 17:50:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811021750.wA2Hov5O058503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 2 Nov 2018 17:50:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340074 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 340074 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 17:50:59 -0000 Author: imp Date: Fri Nov 2 17:50:57 2018 New Revision: 340074 URL: https://svnweb.freebsd.org/changeset/base/340074 Log: Add sysctl_usec_to_sbintime and sysctl_msec_to_sbintime. These functions are used to present a sbintime_t as either a number of microseconds or a number of milliseconds respectively. Sponsored by: Netflix Modified: head/sys/kern/kern_sysctl.c head/sys/sys/sysctl.h Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Fri Nov 2 17:05:40 2018 (r340073) +++ head/sys/kern/kern_sysctl.c Fri Nov 2 17:50:57 2018 (r340074) @@ -1692,6 +1692,53 @@ retry: } /* + * Based on on sysctl_handle_int() convert microseconds to a sbintime. + */ +int +sysctl_usec_to_sbintime(SYSCTL_HANDLER_ARGS) +{ + int error; + int64_t tt; + sbintime_t sb; + + tt = *(int64_t *)arg1; + sb = ustosbt(tt); + + error = sysctl_handle_64(oidp, &sb, 0, req); + if (error || !req->newptr) + return (error); + + tt = sbttous(sb); + *(int64_t *)arg1 = tt; + + return (0); +} + +/* + * Based on on sysctl_handle_int() convert milliseconds to a sbintime. + */ +int +sysctl_msec_to_sbintime(SYSCTL_HANDLER_ARGS) +{ + int error; + int64_t tt; + sbintime_t sb; + + tt = *(int64_t *)arg1; + sb = mstosbt(tt); + + error = sysctl_handle_64(oidp, &sb, 0, req); + if (error || !req->newptr) + return (error); + + tt = sbttoms(sb); + *(int64_t *)arg1 = tt; + + return (0); +} + + +/* * Transfer functions to/from kernel space. * XXX: rather untested at this point */ Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Fri Nov 2 17:05:40 2018 (r340073) +++ head/sys/sys/sysctl.h Fri Nov 2 17:50:57 2018 (r340074) @@ -216,6 +216,9 @@ int sysctl_handle_counter_u64_array(SYSCTL_HANDLER_ARG int sysctl_handle_uma_zone_max(SYSCTL_HANDLER_ARGS); int sysctl_handle_uma_zone_cur(SYSCTL_HANDLER_ARGS); +int sysctl_msec_to_sbintime(SYSCTL_HANDLER_ARGS); +int sysctl_usec_to_sbintime(SYSCTL_HANDLER_ARGS); + int sysctl_dpcpu_int(SYSCTL_HANDLER_ARGS); int sysctl_dpcpu_long(SYSCTL_HANDLER_ARGS); int sysctl_dpcpu_quad(SYSCTL_HANDLER_ARGS); @@ -796,6 +799,42 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); sysctl_add_oid(ctx, parent, nbr, name, \ CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \ __ptr, 0, sysctl_handle_uma_zone_cur, "I", __DESCR(descr), \ + NULL); \ +}) + +/* OID expressing a sbintime_t as microseconds */ +#define SYSCTL_SBINTIME_USEC(parent, nbr, name, access, ptr, descr) \ + SYSCTL_OID(parent, nbr, name, \ + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \ + (ptr), 0, sysctl_usec_to_sbintime, "Q", descr); \ + CTASSERT(((access) & CTLTYPE) == 0 || \ + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S64) +#define SYSCTL_ADD_SBINTIME_USEC(ctx, parent, nbr, name, access, ptr, descr) \ +({ \ + sbintime_t *__ptr = (ptr); \ + CTASSERT(((access) & CTLTYPE) == 0 || \ + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S64); \ + sysctl_add_oid(ctx, parent, nbr, name, \ + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \ + __ptr, 0, sysctl_usec_to_sbintime, "Q", __DESCR(descr), \ + NULL); \ +}) + +/* OID expressing a sbintime_t as milliseconds */ +#define SYSCTL_SBINTIME_MSEC(parent, nbr, name, access, ptr, descr) \ + SYSCTL_OID(parent, nbr, name, \ + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \ + (ptr), 0, sysctl_msec_to_sbintime, "Q", descr); \ + CTASSERT(((access) & CTLTYPE) == 0 || \ + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S64) +#define SYSCTL_ADD_SBINTIME_MSEC(ctx, parent, nbr, name, access, ptr, descr) \ +({ \ + sbintime_t *__ptr = (ptr); \ + CTASSERT(((access) & CTLTYPE) == 0 || \ + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S64); \ + sysctl_add_oid(ctx, parent, nbr, name, \ + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \ + __ptr, 0, sysctl_msec_to_sbintime, "Q", __DESCR(descr), \ NULL); \ }) From owner-svn-src-head@freebsd.org Fri Nov 2 18:40:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFA4810D6C54; Fri, 2 Nov 2018 18:40:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A26D78E07; Fri, 2 Nov 2018 18:40:01 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 775106AA2; Fri, 2 Nov 2018 18:40:01 +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 wA2Ie1vW082284; Fri, 2 Nov 2018 18:40:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2Ie1vk082283; Fri, 2 Nov 2018 18:40:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811021840.wA2Ie1vk082283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 2 Nov 2018 18:40:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340075 - head/contrib/elftoolchain/libelftc X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/libelftc X-SVN-Commit-Revision: 340075 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 18:40:02 -0000 Author: emaste Date: Fri Nov 2 18:40:01 2018 New Revision: 340075 URL: https://svnweb.freebsd.org/changeset/base/340075 Log: readelf: decode R_MIPS_HIGHER and R_MIPS_HIGHEST relocation types Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Modified: head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Fri Nov 2 17:50:57 2018 (r340074) +++ head/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c Fri Nov 2 18:40:01 2018 (r340075) @@ -402,6 +402,8 @@ elftc_reloc_type_str(unsigned int mach, unsigned int t case 22: return "R_MIPS_GOT_HI16"; case 23: return "R_MIPS_GOT_LO16"; case 24: return "R_MIPS_SUB"; + case 28: return "R_MIPS_HIGHER"; + case 29: return "R_MIPS_HIGHEST"; case 30: return "R_MIPS_CALLHI16"; case 31: return "R_MIPS_CALLLO16"; case 37: return "R_MIPS_JALR"; From owner-svn-src-head@freebsd.org Fri Nov 2 18:50:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F22E310D6EFD for ; Fri, 2 Nov 2018 18:50:26 +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 2BA0E79471; Fri, 2 Nov 2018 18:50:26 +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 wA2IoE4T057729 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 2 Nov 2018 20:50:18 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wA2IoE4T057729 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wA2IoEC0057726; Fri, 2 Nov 2018 20:50:14 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 2 Nov 2018 20:50:14 +0200 From: Konstantin Belousov To: Mark Millard Cc: svn-src-head@freebsd.org, Alexander Richardson Subject: Re: svn commit: r339876 - head/libexec/rtld-elf Message-ID: <20181102185014.GP5335@kib.kiev.ua> References: <8E5A5F3A-F1A7-4702-A2F7-65D74CC5B2E5@yahoo.com> <20181102004101.GI5335@kib.kiev.ua> <003A49D7-6E8B-4775-A70B-E0EB44505D4B@yahoo.com> <20181102113827.GM5335@kib.kiev.ua> <7B29A4C8-228D-41CB-B594-98DFA456E9C8@yahoo.com> <20181102155234.GN5335@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 18:50:27 -0000 On Fri, Nov 02, 2018 at 10:38:08AM -0700, Mark Millard wrote: > On 2018-Nov-2, at 8:52 AM, Konstantin Belousov wrote: > > > On Fri, Nov 02, 2018 at 08:30:17AM -0700, Mark Millard wrote: > >> Breakpoint 4, reloc_non_plt (obj=0x41041000, obj_rtld=0x1801cc7, flags=4, lockstate=0x0) at /usr/src/libexec/rtld-elf/powerpc/reloc.c:338 > >> 338 __syncicache(obj->mapbase + phdr->p_vaddr, > >> 1: x/i $pc > >> => 0x1012b90 : lwz r0,36(r29) > >> (gdb) print/x obj->mapbase+phdr->p_vaddr > >> $17 = 0x3000000 > >> (gdb) print/x obj->mapbase > >> $18 = 0x1800000 > >> (gdb) print/x phdr->p_vaddr > >> $19 = 0x1800000 > >> (gdb) c > >> Continuing. > >> > >> Program received signal SIGSEGV, Segmentation fault. > >> __syncicache (from=0x3000000, len=34112) at /usr/src/lib/libc/powerpc/gen/syncicache.c:94 > >> 94 __asm __volatile ("dcbst 0,%0" :: "r"(p)); > >> 1: x/i $pc > >> => 0x10228b8 <__syncicache+96>: dcbst 0,r11 > >> > >> > >> > >> It looks to me like the 0x1800000 component of the > >> overall figure was double counted. ( phdr->p_vaddr > >> would vary but obj->mapbase would not. ) > >> > >> Omit "obj->mapbase + "? > > I used the wrong addend. Try this fix. > > > > diff --git a/libexec/rtld-elf/powerpc/reloc.c b/libexec/rtld-elf/powerpc/reloc.c > > index e921a4dc7d1..fae28dd9224 100644 > > --- a/libexec/rtld-elf/powerpc/reloc.c > > +++ b/libexec/rtld-elf/powerpc/reloc.c > > @@ -294,6 +294,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, > > { > > const Elf_Rela *relalim; > > const Elf_Rela *rela; > > + const Elf_Phdr *phdr; > > SymCache *cache; > > int r = -1; > > > > @@ -327,8 +328,18 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, > > if (cache != NULL) > > free(cache); > > > > - /* Synchronize icache for text seg in case we made any changes */ > > - __syncicache(obj->mapbase, obj->textsize); > > + /* > > + * Synchronize icache for executable segments in case we made > > + * any changes. > > + */ > > + for (phdr = obj->phdr; > > + (const char *)phdr < (const char *)obj->phdr + obj->phsize; > > + phdr++) { > > + if (phdr->p_type == PT_LOAD && (phdr->p_flags & PF_X) != 0) { > > + __syncicache(obj->relocbase + phdr->p_vaddr, > > + phdr->p_memsz); > > + } > > + } > > > > return (r); > > } > > diff --git a/libexec/rtld-elf/powerpc64/reloc.c b/libexec/rtld-elf/powerpc64/reloc.c > > index c2d6dac13b1..15f31738ab7 100644 > > --- a/libexec/rtld-elf/powerpc64/reloc.c > > +++ b/libexec/rtld-elf/powerpc64/reloc.c > > @@ -291,6 +291,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, > > { > > const Elf_Rela *relalim; > > const Elf_Rela *rela; > > + const Elf_Phdr *phdr; > > SymCache *cache; > > int bytes = obj->dynsymcount * sizeof(SymCache); > > int r = -1; > > @@ -327,8 +328,18 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, > > if (cache) > > munmap(cache, bytes); > > > > - /* Synchronize icache for text seg in case we made any changes */ > > - __syncicache(obj->mapbase, obj->textsize); > > + /* > > + * Synchronize icache for executable segments in case we made > > + * any changes. > > + */ > > + for (phdr = obj->phdr; > > + (const char *)phdr < (const char *)obj->phdr + obj->phsize; > > + phdr++) { > > + if (phdr->p_type == PT_LOAD && (phdr->p_flags & PF_X) != 0) { > > + __syncicache(obj->relocbase + phdr->p_vaddr, > > + phdr->p_memsz); > > + } > > + } > > > > return (r); > > } > > That seems better. But it crashes during /bin/ls execution > ( 0x0180???? addresses ), apparently in a library routine > ( 0x41?????? addresses ): > > Program received signal SIGSEGV, Segmentation fault. > 0x411220b4 in ?? () > (gdb) bt > #0 0x411220b4 in ?? () > #1 0x4112200c in ?? () > #2 0x01803c84 in ?? () > #3 0x018023b4 in ?? () > #4 0x010121a0 in .rtld_start () at /usr/src/libexec/rtld-elf/powerpc/rtld_start.S:112 > > Using a normal gdb run of /bin/ls suggests: > > #2 0x01803c84 in ?? () should be in main and seems to be: bl 0x1818914 > #3 0x018023b4 in ?? () should be in _start > > Looking in the test context: > > 0x1803c80: bl 0x1818914 > 0x1803c84: cmpwi cr7,r3,-1 > > and: > > 0x1818914: li r11,59 > 0x1818918: b 0x18186f4 > > and: > > 0x18186f4: rlwinm r11,r11,2,0,29 > 0x18186f8: addis r11,r11,386 > 0x18186fc: lwz r11,-30316(r11) > 0x1818700: mtctr r11 > 0x1818704: bctr > > Breaking at the bctr and using info reg: > > r11 0x4125ffa0 1093009312 > > It looks like there is some amount of > activity before the traceback addresses > show up. > > I've not found a good way to fill in the "in ??()" > (or analogous) information. The addresses 0x411220?? > do not match up with a normal run of /bin/ls from > gdb: the addresses can not be accessed. > > > > It does appear that the code is in /lib/libc.so.7 in the > test context: > > Breakpoint 2, reloc_non_plt (obj=0x41041600, obj_rtld=0x41104b57, flags=4, lockstate=0x0) at /usr/src/libexec/rtld-elf/powerpc/reloc.c:338 > 338 __syncicache(obj->relocbase + phdr->p_vaddr, > 1: /x obj->relocbase + phdr->p_vaddr = 0x410ec000 > 2: /x obj->relocbase + phdr->p_vaddr + phdr->p_memsz = 0x4127f9d0 > 4: *obj = {magic = 0, version = 0, next = {tqe_next = 0x0, tqe_prev = 0x41041408}, path = 0x4103f100 "/lib/libc.so.7", origin_path = 0x0, refcount = 1, holdcount = 0, dl_refcount = 0, > mapbase = 0x410ec000 "\177ELF\001\002\001\t", mapsize = 1908736, textsize = 1908736, vaddrbase = 0, relocbase = 0x410ec000 "\177ELF\001\002\001\t", dynamic = 0x412938e0, > entry = 0x41119d20 "\224!\377\340|\b\002\246H\027\374\001\223\301", phdr = 0x410ec034, phsize = 192, interp = 0x0, stack_flags = 6, tlsindex = 2, tlsinit = 0x4128f9d0, tlsinitsize = 2832, > tlssize = 2860, tlsoffset = 8, tlsalign = 16, relro_page = 0x410ec000 "\177ELF\001\002\001\t", relro_size = 0, pltgot = 0x41299ba8, rel = 0x0, relsize = 0, rela = 0x41106530, relasize = 79800, > pltrel = 0x0, pltrelsize = 0, pltrela = 0x41116d6c, pltrelasize = 12156, symtab = 0x410f12a0, strtab = 0x410fd8e0 "", strsize = 29303, verneed = 0x0, verneednum = 0, verdef = 0x41106420, > verdefnum = 8, versyms = 0x41104b58, buckets = 0x410ec0fc, nbuckets = 2053, chains = 0x410ee110, nchains = 3172, nbuckets_gnu = 0, symndx_gnu = 0, maskwords_bm_gnu = 0, shift2_gnu = 0, > dynsymcount = 3172, bloom_gnu = 0x0, buckets_gnu = 0x0, chain_zero_gnu = 0x0, rpath = 0x0, runpath = 0x0, needed = 0x0, needed_filtees = 0x0, needed_aux_filtees = 0x0, names = { > stqh_first = 0x4103f120, stqh_last = 0x4103f140}, vertab = 0x41040400, vernum = 9, init = 1091673320, fini = 1093063668, preinit_array = 0, init_array = 0, fini_array = 0, preinit_array_num = 0, > init_array_num = 0, fini_array_num = 0, osrel = 0, mainprog = 0 '\000', rtld = 0 '\000', relocated = 1 '\001', ver_checked = 1 '\001', textrel = 0 '\000', symbolic = 0 '\000', bind_now = 0 '\000', > traced = 0 '\000', jmpslots_done = 0 '\000', init_done = 0 '\000', tls_done = 1 '\001', phdr_alloc = 0 '\000', z_origin = 0 '\000', z_nodelete = 0 '\000', z_noopen = 0 '\000', > z_loadfltr = 0 '\000', z_interpose = 0 '\000', z_nodeflib = 0 '\000', z_global = 0 '\000', ref_nodel = 0 '\000', init_scanned = 0 '\000', on_fini_list = 0 '\000', dag_inited = 0 '\000', > filtees_loaded = 0 '\000', irelative = 0 '\000', gnu_ifunc = 0 '\000', non_plt_gnu_ifunc = 0 '\000', crt_no_init = 0 '\000', valid_hash_sysv = 1 '\001', valid_hash_gnu = 0 '\000', > dlopened = 0 '\000', marker = 0 '\000', unholdfree = 0 '\000', doomed = 0 '\000', linkmap = {l_addr = 0x410ec000 "\177ELF\001\002\001\t", l_name = 0x4103f100 "/lib/libc.so.7", l_ld = 0x412938e0, > l_next = 0x103ec1c , l_prev = 0x41041534}, dldags = {stqh_first = 0x0, stqh_last = 0x41041748}, dagmembers = {stqh_first = 0x0, stqh_last = 0x41041750}, dev = 137, ino = 3370513, > priv = 0x0} > (gdb) c > Continuing. > > Breakpoint 2, reloc_non_plt (obj=0x41041600, obj_rtld=0xffffff50, flags=4, lockstate=0x0) at /usr/src/libexec/rtld-elf/powerpc/reloc.c:338 > 338 __syncicache(obj->relocbase + phdr->p_vaddr, > 1: /x obj->relocbase + phdr->p_vaddr = 0x4128f9d0 > 2: /x obj->relocbase + phdr->p_vaddr + phdr->p_memsz = 0x412bdef0 > 4: *obj = {magic = 0, version = 0, next = {tqe_next = 0x0, tqe_prev = 0x41041408}, path = 0x4103f100 "/lib/libc.so.7", origin_path = 0x0, refcount = 1, holdcount = 0, dl_refcount = 0, > mapbase = 0x410ec000 "\177ELF\001\002\001\t", mapsize = 1908736, textsize = 1908736, vaddrbase = 0, relocbase = 0x410ec000 "\177ELF\001\002\001\t", dynamic = 0x412938e0, > entry = 0x41119d20 "\224!\377\340|\b\002\246H\027\374\001\223\301", phdr = 0x410ec034, phsize = 192, interp = 0x0, stack_flags = 6, tlsindex = 2, tlsinit = 0x4128f9d0, tlsinitsize = 2832, > tlssize = 2860, tlsoffset = 8, tlsalign = 16, relro_page = 0x410ec000 "\177ELF\001\002\001\t", relro_size = 0, pltgot = 0x41299ba8, rel = 0x0, relsize = 0, rela = 0x41106530, relasize = 79800, > pltrel = 0x0, pltrelsize = 0, pltrela = 0x41116d6c, pltrelasize = 12156, symtab = 0x410f12a0, strtab = 0x410fd8e0 "", strsize = 29303, verneed = 0x0, verneednum = 0, verdef = 0x41106420, > verdefnum = 8, versyms = 0x41104b58, buckets = 0x410ec0fc, nbuckets = 2053, chains = 0x410ee110, nchains = 3172, nbuckets_gnu = 0, symndx_gnu = 0, maskwords_bm_gnu = 0, shift2_gnu = 0, > dynsymcount = 3172, bloom_gnu = 0x0, buckets_gnu = 0x0, chain_zero_gnu = 0x0, rpath = 0x0, runpath = 0x0, needed = 0x0, needed_filtees = 0x0, needed_aux_filtees = 0x0, names = { > stqh_first = 0x4103f120, stqh_last = 0x4103f140}, vertab = 0x41040400, vernum = 9, init = 1091673320, fini = 1093063668, preinit_array = 0, init_array = 0, fini_array = 0, preinit_array_num = 0, > init_array_num = 0, fini_array_num = 0, osrel = 0, mainprog = 0 '\000', rtld = 0 '\000', relocated = 1 '\001', ver_checked = 1 '\001', textrel = 0 '\000', symbolic = 0 '\000', bind_now = 0 '\000', > traced = 0 '\000', jmpslots_done = 0 '\000', init_done = 0 '\000', tls_done = 1 '\001', phdr_alloc = 0 '\000', z_origin = 0 '\000', z_nodelete = 0 '\000', z_noopen = 0 '\000', > z_loadfltr = 0 '\000', z_interpose = 0 '\000', z_nodeflib = 0 '\000', z_global = 0 '\000', ref_nodel = 0 '\000', init_scanned = 0 '\000', on_fini_list = 0 '\000', dag_inited = 0 '\000', > filtees_loaded = 0 '\000', irelative = 0 '\000', gnu_ifunc = 0 '\000', non_plt_gnu_ifunc = 0 '\000', crt_no_init = 0 '\000', valid_hash_sysv = 1 '\001', valid_hash_gnu = 0 '\000', > dlopened = 0 '\000', marker = 0 '\000', unholdfree = 0 '\000', doomed = 0 '\000', linkmap = {l_addr = 0x410ec000 "\177ELF\001\002\001\t", l_name = 0x4103f100 "/lib/libc.so.7", l_ld = 0x412938e0, > l_next = 0x103ec1c , l_prev = 0x41041534}, dldags = {stqh_first = 0x0, stqh_last = 0x41041748}, dagmembers = {stqh_first = 0x0, stqh_last = 0x41041750}, dev = 137, ino = 3370513, > priv = 0x0} > > > I'm going to at least go eat before investigating more. > There seems to be an issue with the direct execution mode on ppc. Even otherwise working ld-elf.so.1 segfaults if I try to use it as standalone binary. But if I specify patched ld-elf.so.1 as the interpreter for some program, using 'cc -Wl,-I,/ld-elf.so.1' it works. So I see there two bugs, one is regression due to textsize calculation, which should be fixed by my patch. Another is the direct exec problem. From owner-svn-src-head@freebsd.org Fri Nov 2 19:02:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4197A10D7458; Fri, 2 Nov 2018 19:02:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E74A479C93; Fri, 2 Nov 2018 19:02:03 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C86E56F46; Fri, 2 Nov 2018 19:02:03 +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 wA2J232s097128; Fri, 2 Nov 2018 19:02:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2J2393097127; Fri, 2 Nov 2018 19:02:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811021902.wA2J2393097127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 2 Nov 2018 19:02:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340076 - in head: contrib/elftoolchain/readelf sys/sys X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: contrib/elftoolchain/readelf sys/sys X-SVN-Commit-Revision: 340076 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 19:02:04 -0000 Author: emaste Date: Fri Nov 2 19:02:03 2018 New Revision: 340076 URL: https://svnweb.freebsd.org/changeset/base/340076 Log: Define NT_FREEBSD_FEATURE_CTL ELF note type This ELF note will be used to allow binaries to opt out of, or in to, upcoming vulnerability mitigation and other features. Committing the definition and readelf change separately to allow independent MFC. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/readelf/readelf.c head/sys/sys/elf_common.h Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Fri Nov 2 18:40:01 2018 (r340075) +++ head/contrib/elftoolchain/readelf/readelf.c Fri Nov 2 19:02:03 2018 (r340076) @@ -1121,6 +1121,7 @@ note_type_freebsd(unsigned int nt) case 1: return "NT_FREEBSD_ABI_TAG"; case 2: return "NT_FREEBSD_NOINIT_TAG"; case 3: return "NT_FREEBSD_ARCH_TAG"; + case 4: return "NT_FREEBSD_FEATURE_CTL"; default: return (note_type_unknown(nt)); } } Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Fri Nov 2 18:40:01 2018 (r340075) +++ head/sys/sys/elf_common.h Fri Nov 2 19:02:03 2018 (r340076) @@ -759,6 +759,7 @@ typedef struct { #define NT_FREEBSD_ABI_TAG 1 #define NT_FREEBSD_NOINIT_TAG 2 #define NT_FREEBSD_ARCH_TAG 3 +#define NT_FREEBSD_FEATURE_CTL 4 /* Values for n_type. Used in core files. */ #define NT_PRSTATUS 1 /* Process status. */ From owner-svn-src-head@freebsd.org Fri Nov 2 19:14:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E25410D7AD3; Fri, 2 Nov 2018 19:14:16 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2DBD97A59B; Fri, 2 Nov 2018 19:14:16 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A7EC711A; Fri, 2 Nov 2018 19:14:16 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA2JEF4B002777; Fri, 2 Nov 2018 19:14:15 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2JEFXM002776; Fri, 2 Nov 2018 19:14:15 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201811021914.wA2JEFXM002776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Fri, 2 Nov 2018 19:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340077 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 340077 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 19:14:16 -0000 Author: jtl Date: Fri Nov 2 19:14:15 2018 New Revision: 340077 URL: https://svnweb.freebsd.org/changeset/base/340077 Log: m_pulldown() may reallocate n. Update the oip pointer after the m_pulldown() call. MFC after: 2 weeks Sponsored by: Netflix Modified: head/sys/netinet/ip_icmp.c Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Fri Nov 2 19:02:03 2018 (r340076) +++ head/sys/netinet/ip_icmp.c Fri Nov 2 19:14:15 2018 (r340077) @@ -264,6 +264,7 @@ icmp_error(struct mbuf *n, int type, int code, uint32_ if (n->m_len < oiphlen + tcphlen && (n = m_pullup(n, oiphlen + tcphlen)) == NULL) goto freeit; + oip = mtod(n, struct ip *); icmpelen = max(tcphlen, min(V_icmp_quotelen, ntohs(oip->ip_len) - oiphlen)); } else if (oip->ip_p == IPPROTO_SCTP) { From owner-svn-src-head@freebsd.org Fri Nov 2 19:23:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CAE110D9157; Fri, 2 Nov 2018 19:23:51 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47E557ADA6; Fri, 2 Nov 2018 19:23:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24BF572AC; Fri, 2 Nov 2018 19:23:51 +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 wA2JNoIa008547; Fri, 2 Nov 2018 19:23:50 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2JNogn008546; Fri, 2 Nov 2018 19:23:50 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811021923.wA2JNogn008546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 2 Nov 2018 19:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340078 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 340078 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 19:23:51 -0000 Author: kp Date: Fri Nov 2 19:23:50 2018 New Revision: 340078 URL: https://svnweb.freebsd.org/changeset/base/340078 Log: pf: Fix build if INVARIANTS is not set r340061 included a number of assertions pf_frent_remove(), but these assertions were the only use of the 'prev' variable. As a result builds without INVARIANTS had an unused variable, and failed. Reported by: vangyzen@ Modified: head/sys/netpfil/pf/pf_norm.c Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Fri Nov 2 19:14:15 2018 (r340077) +++ head/sys/netpfil/pf/pf_norm.c Fri Nov 2 19:23:50 2018 (r340078) @@ -445,7 +445,9 @@ pf_frent_insert(struct pf_fragment *frag, struct pf_fr void pf_frent_remove(struct pf_fragment *frag, struct pf_frent *frent) { +#ifdef INVARIANTS struct pf_frent *prev = TAILQ_PREV(frent, pf_fragq, fr_next); +#endif struct pf_frent *next = TAILQ_NEXT(frent, fr_next); int index; From owner-svn-src-head@freebsd.org Fri Nov 2 20:48:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE3AD10DAF47; Fri, 2 Nov 2018 20:48:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 584B47D850; Fri, 2 Nov 2018 20:48:30 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34B697F73; Fri, 2 Nov 2018 20:48:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA2KmUmV050687; Fri, 2 Nov 2018 20:48:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2KmUiZ050686; Fri, 2 Nov 2018 20:48:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811022048.wA2KmUiZ050686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 2 Nov 2018 20:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340079 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 340079 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 20:48:30 -0000 Author: emaste Date: Fri Nov 2 20:48:29 2018 New Revision: 340079 URL: https://svnweb.freebsd.org/changeset/base/340079 Log: sys/types.h: avoid using terse macro _M Although _M is reserved for use by the implemenation it is rather non- descriptive and conflicted with a libc++ test. Just rename to _Major and _Minor to avoid conflicts. Reviewed by: dim Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D16734 Modified: head/sys/sys/types.h Modified: head/sys/sys/types.h ============================================================================== --- head/sys/sys/types.h Fri Nov 2 19:23:50 2018 (r340078) +++ head/sys/sys/types.h Fri Nov 2 20:48:29 2018 (r340079) @@ -400,10 +400,10 @@ __minor(dev_t _d) } #define makedev(M, m) __makedev((M), (m)) static __inline dev_t -__makedev(int _M, int _m) +__makedev(int _Major, int _Minor) { - return (((dev_t)(_M & 0xffffff00) << 32) | ((_M & 0xff) << 8) | - ((dev_t)(_m & 0xff00) << 24) | (_m & 0xffff00ff)); + return (((dev_t)(_Major & 0xffffff00) << 32) | ((_Major & 0xff) << 8) | + ((dev_t)(_Minor & 0xff00) << 24) | (_Minor & 0xffff00ff)); } /* From owner-svn-src-head@freebsd.org Fri Nov 2 20:50:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F0E410DAFDF; Fri, 2 Nov 2018 20:50:24 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8F3A7D9DF; Fri, 2 Nov 2018 20:50:23 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FB407F7A; Fri, 2 Nov 2018 20:50:23 +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 wA2KoNMZ050838; Fri, 2 Nov 2018 20:50:23 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2KoMZd050830; Fri, 2 Nov 2018 20:50:22 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201811022050.wA2KoMZd050830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 2 Nov 2018 20:50:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340080 - in head/sys: compat/freebsd32 dev/filemon kern security/audit sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: compat/freebsd32 dev/filemon kern security/audit sys X-SVN-Commit-Revision: 340080 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 20:50:24 -0000 Author: brooks Date: Fri Nov 2 20:50:22 2018 New Revision: 340080 URL: https://svnweb.freebsd.org/changeset/base/340080 Log: Add const to input-only char * arguments. These arguments are mostly paths handled by NAMEI*() macros which already take const char * arguments. This change improves the match between syscalls.master and the public declerations of system calls. Reviewed by: kib (prior version) Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17812 Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/freebsd32_util.h head/sys/compat/freebsd32/syscalls.master head/sys/dev/filemon/filemon_wrapper.c head/sys/kern/kern_exec.c head/sys/kern/syscalls.master head/sys/kern/vfs_syscalls.c head/sys/security/audit/audit.h head/sys/security/audit/audit_arg.c head/sys/sys/imgact.h head/sys/sys/syscallsubr.h Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Fri Nov 2 20:48:29 2018 (r340079) +++ head/sys/compat/freebsd32/freebsd32_misc.c Fri Nov 2 20:50:22 2018 (r340080) @@ -332,7 +332,7 @@ freebsd32_sigaltstack(struct thread *td, * the pointers. */ int -freebsd32_exec_copyin_args(struct image_args *args, char *fname, +freebsd32_exec_copyin_args(struct image_args *args, const char *fname, enum uio_seg segflg, u_int32_t *argv, u_int32_t *envv) { char *argp, *envp; Modified: head/sys/compat/freebsd32/freebsd32_util.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_util.h Fri Nov 2 20:48:29 2018 (r340079) +++ head/sys/compat/freebsd32/freebsd32_util.h Fri Nov 2 20:50:22 2018 (r340080) @@ -118,7 +118,7 @@ int freebsd32_copyiniov(struct iovec32 *iovp, u_int io void freebsd32_rusage_out(const struct rusage *s, struct rusage32 *s32); struct image_args; -int freebsd32_exec_copyin_args(struct image_args *args, char *fname, +int freebsd32_exec_copyin_args(struct image_args *args, const char *fname, enum uio_seg segflg, u_int32_t *argv, u_int32_t *envv); #endif /* !_COMPAT_FREEBSD32_FREEBSD32_UTIL_H_ */ Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Fri Nov 2 20:48:29 2018 (r340079) +++ head/sys/compat/freebsd32/syscalls.master Fri Nov 2 20:50:22 2018 (r340080) @@ -72,21 +72,22 @@ size_t nbyte); } 4 AUE_WRITE NOPROTO { ssize_t write(int fd, const void *buf, \ size_t nbyte); } -5 AUE_OPEN_RWTC NOPROTO { int open(char *path, int flags, \ +5 AUE_OPEN_RWTC NOPROTO { int open(const char *path, int flags, \ mode_t mode); } 6 AUE_CLOSE NOPROTO { int close(int fd); } 7 AUE_WAIT4 STD { int freebsd32_wait4(int pid, int *status, \ int options, struct rusage32 *rusage); } 8 AUE_CREAT OBSOL old creat -9 AUE_LINK NOPROTO { int link(char *path, char *link); } -10 AUE_UNLINK NOPROTO { int unlink(char *path); } +9 AUE_LINK NOPROTO { int link(const char *path, \ + const char *link); } +10 AUE_UNLINK NOPROTO { int unlink(const char *path); } 11 AUE_NULL OBSOL execv -12 AUE_CHDIR NOPROTO { int chdir(char *path); } +12 AUE_CHDIR NOPROTO { int chdir(const char *path); } 13 AUE_FCHDIR NOPROTO { int fchdir(int fd); } -14 AUE_MKNOD COMPAT11 { int freebsd32_mknod(char *path, \ +14 AUE_MKNOD COMPAT11 { int freebsd32_mknod(const char *path, \ int mode, int dev); } -15 AUE_CHMOD NOPROTO { int chmod(char *path, mode_t mode); } -16 AUE_CHOWN NOPROTO { int chown(char *path, int uid, int gid); } +15 AUE_CHMOD NOPROTO { int chmod(const char *path, mode_t mode); } +16 AUE_CHOWN NOPROTO { int chown(const char *path, int uid, int gid); } 17 AUE_NULL NOPROTO { caddr_t break(char *nsize); } 18 AUE_GETFSSTAT COMPAT4 { int freebsd32_getfsstat( \ struct statfs32 *buf, long bufsize, \ @@ -94,9 +95,10 @@ 19 AUE_LSEEK COMPAT { int freebsd32_lseek(int fd, int offset, \ int whence); } 20 AUE_GETPID NOPROTO { pid_t getpid(void); } -21 AUE_MOUNT NOPROTO { int mount(char *type, char *path, \ +21 AUE_MOUNT NOPROTO { int mount(const char *type, \ + const char *path, \ int flags, caddr_t data); } -22 AUE_UMOUNT NOPROTO { int unmount(char *path, int flags); } +22 AUE_UMOUNT NOPROTO { int unmount(const char *path, int flags); } 23 AUE_SETUID NOPROTO { int setuid(uid_t uid); } 24 AUE_GETUID NOPROTO { uid_t getuid(void); } 25 AUE_GETEUID NOPROTO { uid_t geteuid(void); } @@ -115,15 +117,15 @@ int *alen); } 32 AUE_GETSOCKNAME NOPROTO { int getsockname(int fdes, caddr_t asa, \ int *alen); } -33 AUE_ACCESS NOPROTO { int access(char *path, int amode); } +33 AUE_ACCESS NOPROTO { int access(const char *path, int amode); } 34 AUE_CHFLAGS NOPROTO { int chflags(const char *path, u_long flags); } 35 AUE_FCHFLAGS NOPROTO { int fchflags(int fd, u_long flags); } 36 AUE_SYNC NOPROTO { int sync(void); } 37 AUE_KILL NOPROTO { int kill(int pid, int signum); } -38 AUE_STAT COMPAT { int freebsd32_stat(char *path, \ +38 AUE_STAT COMPAT { int freebsd32_stat(const char *path, \ struct ostat32 *ub); } 39 AUE_GETPPID NOPROTO { pid_t getppid(void); } -40 AUE_LSTAT COMPAT { int freebsd32_lstat(char *path, \ +40 AUE_LSTAT COMPAT { int freebsd32_lstat(const char *path, \ struct ostat *ub); } 41 AUE_DUP NOPROTO { int dup(u_int fd); } 42 AUE_PIPE COMPAT10 { int freebsd32_pipe(void); } @@ -140,8 +142,8 @@ osigset_t mask); } 49 AUE_GETLOGIN NOPROTO { int getlogin(char *namebuf, \ u_int namelen); } -50 AUE_SETLOGIN NOPROTO { int setlogin(char *namebuf); } -51 AUE_ACCT NOPROTO { int acct(char *path); } +50 AUE_SETLOGIN NOPROTO { int setlogin(const char *namebuf); } +51 AUE_ACCT NOPROTO { int acct(const char *path); } 52 AUE_SIGPENDING COMPAT { int freebsd32_sigpending(void); } 53 AUE_SIGALTSTACK STD { int freebsd32_sigaltstack( \ struct sigaltstack32 *ss, \ @@ -149,14 +151,15 @@ 54 AUE_IOCTL STD { int freebsd32_ioctl(int fd, uint32_t com, \ struct md_ioctl32 *data); } 55 AUE_REBOOT NOPROTO { int reboot(int opt); } -56 AUE_REVOKE NOPROTO { int revoke(char *path); } -57 AUE_SYMLINK NOPROTO { int symlink(char *path, char *link); } -58 AUE_READLINK NOPROTO { ssize_t readlink(char *path, char *buf, \ +56 AUE_REVOKE NOPROTO { int revoke(const char *path); } +57 AUE_SYMLINK NOPROTO { int symlink(const char *path, \ + const char *link); } +58 AUE_READLINK NOPROTO { ssize_t readlink(const char *path, char *buf, \ size_t count); } -59 AUE_EXECVE STD { int freebsd32_execve(char *fname, \ +59 AUE_EXECVE STD { int freebsd32_execve(const char *fname, \ uint32_t *argv, uint32_t *envv); } 60 AUE_UMASK NOPROTO { int umask(mode_t newmask); } -61 AUE_CHROOT NOPROTO { int chroot(char *path); } +61 AUE_CHROOT NOPROTO { int chroot(const char *path); } 62 AUE_FSTAT COMPAT { int freebsd32_fstat(int fd, \ struct ostat32 *ub); } 63 AUE_NULL OBSOL ogetkerninfo @@ -192,7 +195,7 @@ struct itimerval32 *oitv); } 84 AUE_NULL OBSOL owait ; XXX implement -85 AUE_SWAPON NOPROTO { int swapon(char *name); } +85 AUE_SWAPON NOPROTO { int swapon(const char *name); } 86 AUE_GETITIMER STD { int freebsd32_getitimer(u_int which, \ struct itimerval32 *itv); } 87 AUE_O_GETHOSTNAME OBSOL ogethostname @@ -257,21 +260,22 @@ 125 AUE_RECVFROM OBSOL orecvfrom 126 AUE_SETREUID NOPROTO { int setreuid(int ruid, int euid); } 127 AUE_SETREGID NOPROTO { int setregid(int rgid, int egid); } -128 AUE_RENAME NOPROTO { int rename(char *from, char *to); } -129 AUE_TRUNCATE COMPAT|NOPROTO { int truncate(char *path, \ +128 AUE_RENAME NOPROTO { int rename(const char *from, \ + const char *to); } +129 AUE_TRUNCATE COMPAT|NOPROTO { int truncate(const char *path, \ int length); } 130 AUE_FTRUNCATE COMPAT|NOPROTO { int ftruncate(int fd, int length); } 131 AUE_FLOCK NOPROTO { int flock(int fd, int how); } -132 AUE_MKFIFO NOPROTO { int mkfifo(char *path, mode_t mode); } +132 AUE_MKFIFO NOPROTO { int mkfifo(const char *path, mode_t mode); } 133 AUE_SENDTO NOPROTO { int sendto(int s, caddr_t buf, \ size_t len, int flags, caddr_t to, \ int tolen); } 134 AUE_SHUTDOWN NOPROTO { int shutdown(int s, int how); } 135 AUE_SOCKETPAIR NOPROTO { int socketpair(int domain, int type, \ int protocol, int *rsv); } -136 AUE_MKDIR NOPROTO { int mkdir(char *path, mode_t mode); } -137 AUE_RMDIR NOPROTO { int rmdir(char *path); } -138 AUE_UTIMES STD { int freebsd32_utimes(char *path, \ +136 AUE_MKDIR NOPROTO { int mkdir(const char *path, mode_t mode); } +137 AUE_RMDIR NOPROTO { int rmdir(const char *path); } +138 AUE_UTIMES STD { int freebsd32_utimes(const char *path, \ struct timeval32 *tptr); } 139 AUE_NULL OBSOL 4.2 sigreturn 140 AUE_ADJTIME STD { int freebsd32_adjtime( \ @@ -284,8 +288,8 @@ 145 AUE_SETRLIMIT OBSOL setrlimit 146 AUE_KILLPG OBSOL killpg 147 AUE_SETSID NOPROTO { int setsid(void); } -148 AUE_QUOTACTL NOPROTO { int quotactl(char *path, int cmd, int uid, \ - caddr_t arg); } +148 AUE_QUOTACTL NOPROTO { int quotactl(const char *path, int cmd, \ + int uid, caddr_t arg); } 149 AUE_O_QUOTA OBSOL oquota 150 AUE_GETSOCKNAME OBSOL ogetsockname @@ -303,13 +307,13 @@ 155 AUE_NFS_SVC UNIMPL nfssvc 156 AUE_GETDIRENTRIES COMPAT { int freebsd32_getdirentries(int fd, \ char *buf, u_int count, uint32_t *basep); } -157 AUE_STATFS COMPAT4 { int freebsd32_statfs(char *path, \ +157 AUE_STATFS COMPAT4 { int freebsd32_statfs(const char *path, \ struct statfs32 *buf); } 158 AUE_FSTATFS COMPAT4 { int freebsd32_fstatfs(int fd, \ struct statfs32 *buf); } 159 AUE_NULL UNIMPL nosys 160 AUE_LGETFH UNIMPL lgetfh -161 AUE_NFS_GETFH NOPROTO { int getfh(char *fname, \ +161 AUE_NFS_GETFH NOPROTO { int getfh(const char *fname, \ struct fhandle *fhp); } 162 AUE_SYSCTL OBSOL getdomainname 163 AUE_SYSCTL OBSOL setdomainname @@ -347,13 +351,13 @@ 185 AUE_NULL OBSOL lfs_markv 186 AUE_NULL OBSOL lfs_segclean 187 AUE_NULL OBSOL lfs_segwait -188 AUE_STAT COMPAT11 { int freebsd32_stat(char *path, \ +188 AUE_STAT COMPAT11 { int freebsd32_stat(const char *path, \ struct freebsd11_stat32 *ub); } 189 AUE_FSTAT COMPAT11 { int freebsd32_fstat(int fd, \ struct freebsd11_stat32 *ub); } -190 AUE_LSTAT COMPAT11 { int freebsd32_lstat(char *path, \ +190 AUE_LSTAT COMPAT11 { int freebsd32_lstat(const char *path, \ struct freebsd11_stat32 *ub); } -191 AUE_PATHCONF NOPROTO { int pathconf(char *path, int name); } +191 AUE_PATHCONF NOPROTO { int pathconf(const char *path, int name); } 192 AUE_FPATHCONF NOPROTO { int fpathconf(int fd, int name); } 193 AUE_NULL UNIMPL nosys 194 AUE_GETRLIMIT NOPROTO { int getrlimit(u_int which, \ @@ -372,7 +376,7 @@ 199 AUE_LSEEK COMPAT6 { off_t freebsd32_lseek(int fd, int pad, \ uint32_t offset1, uint32_t offset2, \ int whence); } -200 AUE_TRUNCATE COMPAT6 { int freebsd32_truncate(char *path, \ +200 AUE_TRUNCATE COMPAT6 { int freebsd32_truncate(const char *path, \ int pad, uint32_t length1, \ uint32_t length2); } 201 AUE_FTRUNCATE COMPAT6 { int freebsd32_ftruncate(int fd, int pad, \ @@ -385,7 +389,7 @@ size_t len); } 204 AUE_MUNLOCK NOPROTO { int munlock(const void *addr, \ size_t len); } -205 AUE_UNDELETE NOPROTO { int undelete(char *path); } +205 AUE_UNDELETE NOPROTO { int undelete(const char *path); } 206 AUE_FUTIMES STD { int freebsd32_futimes(int fd, \ struct timeval32 *tptr); } 207 AUE_GETPGID NOPROTO { int getpgid(pid_t pid); } @@ -473,7 +477,8 @@ 251 AUE_RFORK NOPROTO { int rfork(int flags); } 252 AUE_POLL OBSOL openbsd_poll 253 AUE_ISSETUGID NOPROTO { int issetugid(void); } -254 AUE_LCHOWN NOPROTO { int lchown(char *path, int uid, int gid); } +254 AUE_LCHOWN NOPROTO { int lchown(const char *path, int uid, \ + int gid); } 255 AUE_AIO_READ STD { int freebsd32_aio_read( \ struct aiocb32 *aiocbp); } 256 AUE_AIO_WRITE STD { int freebsd32_aio_write( \ @@ -498,14 +503,16 @@ 272 AUE_O_GETDENTS COMPAT11 { int freebsd32_getdents(int fd, char *buf, \ int count); } 273 AUE_NULL UNIMPL nosys -274 AUE_LCHMOD NOPROTO { int lchmod(char *path, mode_t mode); } +274 AUE_LCHMOD NOPROTO { int lchmod(const char *path, mode_t mode); } 275 AUE_NULL OBSOL netbsd_lchown -276 AUE_LUTIMES STD { int freebsd32_lutimes(char *path, \ +276 AUE_LUTIMES STD { int freebsd32_lutimes(const char *path, \ struct timeval32 *tptr); } 277 AUE_NULL OBSOL netbsd_msync -278 AUE_STAT COMPAT11|NOPROTO { int nstat(char *path, struct nstat *ub); } +278 AUE_STAT COMPAT11|NOPROTO { int nstat(const char *path, \ + struct nstat *ub); } 279 AUE_FSTAT COMPAT11|NOPROTO { int nfstat(int fd, struct nstat *sb); } -280 AUE_LSTAT COMPAT11|NOPROTO { int nlstat(char *path, struct nstat *ub); } +280 AUE_LSTAT COMPAT11|NOPROTO { int nlstat(const char *path, \ + struct nstat *ub); } 281 AUE_NULL UNIMPL nosys 282 AUE_NULL UNIMPL nosys 283 AUE_NULL UNIMPL nosys @@ -680,7 +687,7 @@ const char *attrname); } 374 AUE_SETUGID NOPROTO { int __setugid(int flag); } 375 AUE_NULL OBSOL nfsclnt -376 AUE_EACCESS NOPROTO { int eaccess(char *path, int amode); } +376 AUE_EACCESS NOPROTO { int eaccess(const char *path, int amode); } 377 AUE_NULL UNIMPL afs_syscall 378 AUE_NMOUNT STD { int freebsd32_nmount(struct iovec32 *iovp, \ unsigned int iovcnt, int flags); } @@ -709,7 +716,7 @@ 395 AUE_GETFSSTAT COMPAT11|NOPROTO { int getfsstat( \ struct freebsd11_statfs *buf, \ long bufsize, int mode); } -396 AUE_STATFS COMPAT11|NOPROTO { int statfs(char *path, \ +396 AUE_STATFS COMPAT11|NOPROTO { int statfs(const char *path, \ struct statfs *buf); } 397 AUE_FSTATFS COMPAT11|NOPROTO { int fstatfs(int fd, \ struct freebsd11_statfs *buf); } @@ -808,7 +815,7 @@ 452 AUE_SETAUDIT_ADDR NOPROTO { int setaudit_addr( \ struct auditinfo_addr *auditinfo_addr, \ u_int length); } -453 AUE_AUDITCTL NOPROTO { int auditctl(char *path); } +453 AUE_AUDITCTL NOPROTO { int auditctl(const char *path); } 454 AUE_NULL STD { int freebsd32_umtx_op(void *obj, int op,\ u_long val, void *uaddr, \ void *uaddr2); } @@ -871,7 +878,7 @@ int pad, \ uint32_t offset1, uint32_t offset2, \ int whence); } -479 AUE_TRUNCATE STD { int freebsd32_truncate(char *path, \ +479 AUE_TRUNCATE STD { int freebsd32_truncate(const char *path, \ int pad, \ uint32_t length1, uint32_t length2); } 480 AUE_FTRUNCATE STD { int freebsd32_ftruncate(int fd, \ @@ -890,7 +897,7 @@ 478 AUE_LSEEK STD { off_t freebsd32_lseek(int fd, \ uint32_t offset1, uint32_t offset2, \ int whence); } -479 AUE_TRUNCATE STD { int freebsd32_truncate(char *path, \ +479 AUE_TRUNCATE STD { int freebsd32_truncate(const char *path, \ uint32_t length1, uint32_t length2); } 480 AUE_FTRUNCATE STD { int freebsd32_ftruncate(int fd, \ uint32_t length1, uint32_t length2); } @@ -924,36 +931,39 @@ uint32_t id1, uint32_t id2, \ size_t cpusetsize, \ const cpuset_t *mask); } -489 AUE_FACCESSAT NOPROTO { int faccessat(int fd, char *path, int amode, \ - int flag); } +489 AUE_FACCESSAT NOPROTO { int faccessat(int fd, const char *path, \ + int amode, int flag); } 490 AUE_FCHMODAT NOPROTO { int fchmodat(int fd, const char *path, \ mode_t mode, int flag); } -491 AUE_FCHOWNAT NOPROTO { int fchownat(int fd, char *path, uid_t uid, \ - gid_t gid, int flag); } +491 AUE_FCHOWNAT NOPROTO { int fchownat(int fd, const char *path, \ + uid_t uid, gid_t gid, int flag); } 492 AUE_FEXECVE STD { int freebsd32_fexecve(int fd, \ uint32_t *argv, uint32_t *envv); } 493 AUE_FSTATAT COMPAT11 { int freebsd32_fstatat(int fd, \ - char *path, struct freebsd11_stat32 *buf, \ + const char *path, \ + struct freebsd11_stat32 *buf, \ int flag); } -494 AUE_FUTIMESAT STD { int freebsd32_futimesat(int fd, char *path, \ +494 AUE_FUTIMESAT STD { int freebsd32_futimesat(int fd, \ + const char *path, \ struct timeval *times); } -495 AUE_LINKAT NOPROTO { int linkat(int fd1, char *path1, int fd2, \ - char *path2, int flag); } -496 AUE_MKDIRAT NOPROTO { int mkdirat(int fd, char *path, \ +495 AUE_LINKAT NOPROTO { int linkat(int fd1, const char *path1, \ + int fd2, const char *path2, int flag); } +496 AUE_MKDIRAT NOPROTO { int mkdirat(int fd, const char *path, \ mode_t mode); } -497 AUE_MKFIFOAT NOPROTO { int mkfifoat(int fd, char *path, \ +497 AUE_MKFIFOAT NOPROTO { int mkfifoat(int fd, const char *path, \ mode_t mode); } -498 AUE_MKNODAT COMPAT11 { int freebsd32_mknodat(int fd, char *path, \ - mode_t mode, uint32_t dev); } -499 AUE_OPENAT_RWTC NOPROTO { int openat(int fd, char *path, int flag, \ - mode_t mode); } -500 AUE_READLINKAT NOPROTO { int readlinkat(int fd, char *path, char *buf, \ - size_t bufsize); } -501 AUE_RENAMEAT NOPROTO { int renameat(int oldfd, char *old, int newfd, \ - const char *new); } -502 AUE_SYMLINKAT NOPROTO { int symlinkat(char *path1, int fd, \ - char *path2); } -503 AUE_UNLINKAT NOPROTO { int unlinkat(int fd, char *path, \ +498 AUE_MKNODAT COMPAT11 { int freebsd32_mknodat(int fd, \ + const char *path, mode_t mode, \ + uint32_t dev); } +499 AUE_OPENAT_RWTC NOPROTO { int openat(int fd, const char *path, \ + int flag, mode_t mode); } +500 AUE_READLINKAT NOPROTO { int readlinkat(int fd, const char *path, \ + char *buf, size_t bufsize); } +501 AUE_RENAMEAT NOPROTO { int renameat(int oldfd, const char *old, \ + int newfd, const char *new); } +502 AUE_SYMLINKAT NOPROTO { int symlinkat(const char *path1, int fd, \ + const char *path2); } +503 AUE_UNLINKAT NOPROTO { int unlinkat(int fd, const char *path, \ int flag); } 504 AUE_POSIX_OPENPT NOPROTO { int posix_openpt(int flags); } ; 505 is initialised by the kgssapi code, if present. @@ -970,7 +980,7 @@ struct msqid_ds32 *buf); } 512 AUE_SHMCTL NOSTD { int freebsd32_shmctl(int shmid, int cmd, \ struct shmid_ds32 *buf); } -513 AUE_LPATHCONF NOPROTO { int lpathconf(char *path, int name); } +513 AUE_LPATHCONF NOPROTO { int lpathconf(const char *path, int name); } 514 AUE_NULL OBSOL cap_new 515 AUE_CAP_RIGHTS_GET NOPROTO { int __cap_rights_get(int version, \ int fd, cap_rights_t *rightsp); } @@ -1072,7 +1082,7 @@ 546 AUE_FUTIMES STD { int freebsd32_futimens(int fd, \ struct timespec *times); } 547 AUE_FUTIMESAT STD { int freebsd32_utimensat(int fd, \ - char *path, \ + const char *path, \ struct timespec *times, int flag); } 548 AUE_NULL OBSOL numa_getaffinity 549 AUE_NULL OBSOL numa_setaffinity @@ -1080,7 +1090,7 @@ 551 AUE_FSTAT STD { int freebsd32_fstat(int fd, \ struct stat32 *ub); } 552 AUE_FSTATAT STD { int freebsd32_fstatat(int fd, \ - char *path, struct stat32 *buf, \ + const char *path, struct stat32 *buf, \ int flag); } 553 AUE_FHSTAT STD { int freebsd32_fhstat( \ const struct fhandle *u_fhp, \ @@ -1088,15 +1098,15 @@ 554 AUE_GETDIRENTRIES NOPROTO { ssize_t getdirentries( \ int fd, char *buf, size_t count, \ off_t *basep); } -555 AUE_STATFS NOPROTO { int statfs(char *path, \ +555 AUE_STATFS NOPROTO { int statfs(const char *path, \ struct statfs32 *buf); } 556 AUE_FSTATFS NOPROTO { int fstatfs(int fd, struct statfs32 *buf); } 557 AUE_GETFSSTAT NOPROTO { int getfsstat(struct statfs32 *buf, \ long bufsize, int mode); } 558 AUE_FHSTATFS NOPROTO { int fhstatfs(const struct fhandle *u_fhp, \ struct statfs32 *buf); } -559 AUE_MKNODAT NOPROTO { int mknodat(int fd, char *path, mode_t mode, \ - dev_t dev); } +559 AUE_MKNODAT NOPROTO { int mknodat(int fd, const char *path, \ + mode_t mode, dev_t dev); } 560 AUE_KEVENT STD { int freebsd32_kevent(int fd, \ const struct kevent32 *changelist, \ int nchanges, \ Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Fri Nov 2 20:48:29 2018 (r340079) +++ head/sys/dev/filemon/filemon_wrapper.c Fri Nov 2 20:50:22 2018 (r340080) @@ -149,7 +149,8 @@ filemon_event_process_exec(void *arg __unused, struct } static void -_filemon_wrapper_openat(struct thread *td, char *upath, int flags, int fd) +_filemon_wrapper_openat(struct thread *td, const char *upath, int flags, + int fd) { int error; struct file *fp; @@ -262,7 +263,8 @@ copyfail: } static void -_filemon_wrapper_link(struct thread *td, char *upath1, char *upath2) +_filemon_wrapper_link(struct thread *td, const char *upath1, + const char *upath2) { struct filemon *filemon; int error; Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Fri Nov 2 20:48:29 2018 (r340079) +++ head/sys/kern/kern_exec.c Fri Nov 2 20:50:22 2018 (r340080) @@ -1167,7 +1167,7 @@ exec_new_vmspace(struct image_params *imgp, struct sys * space into the temporary string buffer. */ int -exec_copyin_args(struct image_args *args, char *fname, +exec_copyin_args(struct image_args *args, const char *fname, enum uio_seg segflg, char **argv, char **envv) { u_long argp, envp; Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Fri Nov 2 20:48:29 2018 (r340079) +++ head/sys/kern/syscalls.master Fri Nov 2 20:50:22 2018 (r340080) @@ -111,7 +111,7 @@ } 5 AUE_OPEN_RWTC STD { int open( - _In_z_ char *path, + _In_z_ const char *path, int flags, mode_t mode ); @@ -134,25 +134,25 @@ } 8 AUE_CREAT COMPAT { int creat( - _In_z_ char *path, + _In_z_ const char *path, int mode ); } 9 AUE_LINK STD { int link( - _In_z_ char *path, - _In_z_ char *link + _In_z_ const char *path, + _In_z_ const char *link ); } 10 AUE_UNLINK STD { int unlink( - _In_z_ char *path + _In_z_ const char *path ); } 11 AUE_NULL OBSOL execv 12 AUE_CHDIR STD { int chdir( - _In_z_ char *path + _In_z_ const char *path ); } 13 AUE_FCHDIR STD { @@ -162,20 +162,20 @@ } 14 AUE_MKNOD COMPAT11 { int mknod( - _In_z_ char *path, + _In_z_ const char *path, int mode, int dev ); } 15 AUE_CHMOD STD { int chmod( - _In_z_ char *path, + _In_z_ const char *path, mode_t mode ); } 16 AUE_CHOWN STD { int chown( - _In_z_ char *path, + _In_z_ const char *path, int uid, int gid ); @@ -204,8 +204,8 @@ } 21 AUE_MOUNT STD { int mount( - _In_z_ char *type, - _In_z_ char *path, + _In_z_ const char *type, + _In_z_ const char *path, int flags, _In_opt_ caddr_t data ); @@ -213,7 +213,7 @@ ; XXX `path' should have type `const char *' but we're not ready for that. 22 AUE_UMOUNT STD { int unmount( - _In_z_ char *path, + _In_z_ const char *path, int flags ); } @@ -283,7 +283,7 @@ } 33 AUE_ACCESS STD { int access( - _In_z_ char *path, + _In_z_ const char *path, int amode ); } @@ -310,7 +310,7 @@ } 38 AUE_STAT COMPAT { int stat( - _In_z_ char *path, + _In_z_ const char *path, _Out_ struct ostat *ub ); } @@ -319,7 +319,7 @@ } 40 AUE_LSTAT COMPAT { int lstat( - _In_z_ char *path, + _In_z_ const char *path, _Out_ struct ostat *ub ); } @@ -377,12 +377,12 @@ } 50 AUE_SETLOGIN STD { int setlogin( - _In_z_ char *namebuf + _In_z_ const char *namebuf ); } 51 AUE_ACCT STD { int acct( - _In_z_ char *path + _In_z_ const char *path ); } 52 AUE_SIGPENDING COMPAT { @@ -408,25 +408,25 @@ } 56 AUE_REVOKE STD { int revoke( - _In_z_ char *path + _In_z_ const char *path ); } 57 AUE_SYMLINK STD { int symlink( - _In_z_ char *path, - _In_z_ char *link + _In_z_ const char *path, + _In_z_ const char *link ); } 58 AUE_READLINK STD { ssize_t readlink( - _In_z_ char *path, + _In_z_ const char *path, _Out_writes_z_(count) char *buf, size_t count ); } 59 AUE_EXECVE STD { int execve( - _In_z_ char *fname, + _In_z_ const char *fname, _In_z_ char **argv, _In_z_ char **envv ); @@ -438,7 +438,7 @@ } 61 AUE_CHROOT STD { int chroot( - _In_z_ char *path + _In_z_ const char *path ); } 62 AUE_FSTAT COMPAT { @@ -558,7 +558,7 @@ } 85 AUE_SWAPON STD { int swapon( - _In_z_ char *name + _In_z_ const char *name ); } 86 AUE_GETITIMER STD { @@ -815,13 +815,13 @@ } 128 AUE_RENAME STD { int rename( - _In_z_ char *from, - _In_z_ char *to + _In_z_ const char *from, + _In_z_ const char *to ); } 129 AUE_TRUNCATE COMPAT { int truncate( - _In_z_ char *path, + _In_z_ const char *path, long length ); } @@ -839,7 +839,7 @@ } 132 AUE_MKFIFO STD { int mkfifo( - _In_z_ char *path, + _In_z_ const char *path, mode_t mode ); } @@ -869,18 +869,18 @@ } 136 AUE_MKDIR STD { int mkdir( - _In_z_ char *path, + _In_z_ const char *path, mode_t mode ); } 137 AUE_RMDIR STD { int rmdir( - _In_z_ char *path + _In_z_ const char *path ); } 138 AUE_UTIMES STD { int utimes( - _In_z_ char *path, + _In_z_ const char *path, _In_ struct timeval *tptr ); } @@ -929,7 +929,7 @@ } 148 AUE_QUOTACTL STD { int quotactl( - _In_z_ char *path, + _In_z_ const char *path, int cmd, int uid, _In_ caddr_t arg @@ -979,7 +979,7 @@ } 157 AUE_STATFS COMPAT4 { int statfs( - _In_z_ char *path, + _In_z_ const char *path, _Out_ struct ostatfs *buf ); } @@ -992,13 +992,13 @@ 159 AUE_NULL UNIMPL nosys 160 AUE_LGETFH STD { int lgetfh( - _In_z_ char *fname, + _In_z_ const char *fname, _Out_ struct fhandle *fhp ); } 161 AUE_NFS_GETFH STD { int getfh( - _In_z_ char *fname, + _In_z_ const char *fname, _Out_ struct fhandle *fhp ); } @@ -1120,7 +1120,7 @@ 187 AUE_NULL OBSOL lfs_segwait 188 AUE_STAT COMPAT11 { int stat( - _In_z_ char *path, + _In_z_ const char *path, _Out_ struct freebsd11_stat *ub ); } @@ -1132,13 +1132,13 @@ } 190 AUE_LSTAT COMPAT11 { int lstat( - _In_z_ char *path, + _In_z_ const char *path, _Out_ struct freebsd11_stat *ub ); } 191 AUE_PATHCONF STD { int pathconf( - _In_z_ char *path, + _In_z_ const char *path, int name ); } @@ -1193,7 +1193,7 @@ } 200 AUE_TRUNCATE COMPAT6 { int truncate( - _In_z_ char *path, + _In_z_ const char *path, int pad, off_t length ); @@ -1229,7 +1229,7 @@ } 205 AUE_UNDELETE STD { int undelete( - _In_z_ char *path + _In_z_ const char *path ); } 206 AUE_FUTIMES STD { @@ -1455,7 +1455,7 @@ } 254 AUE_LCHOWN STD { int lchown( - _In_z_ char *path, + _In_z_ const char *path, int uid, int gid ); @@ -1489,21 +1489,21 @@ 273 AUE_NULL UNIMPL nosys 274 AUE_LCHMOD STD { int lchmod( - _In_z_ char *path, + _In_z_ const char *path, mode_t mode ); } 275 AUE_NULL OBSOL netbsd_lchown 276 AUE_LUTIMES STD { int lutimes( - _In_z_ char *path, + _In_z_ const char *path, _In_ struct timeval *tptr ); } 277 AUE_NULL OBSOL netbsd_msync 278 AUE_STAT COMPAT11 { int nstat( - _In_z_ char *path, + _In_z_ const char *path, _Out_ struct nstat *ub ); } @@ -1515,7 +1515,7 @@ } 280 AUE_LSTAT COMPAT11 { int nlstat( - _In_z_ char *path, + _In_z_ const char *path, _Out_ struct nstat *ub ); } @@ -1970,7 +1970,7 @@ 375 AUE_NULL OBSOL nfsclnt 376 AUE_EACCESS STD { int eaccess( - _In_z_ char *path, + _In_z_ const char *path, int amode ); } @@ -2078,7 +2078,7 @@ } 396 AUE_STATFS COMPAT11 { int statfs( - _In_z_ char *path, + _In_z_ const char *path, _Out_ struct freebsd11_statfs *buf ); } @@ -2191,7 +2191,7 @@ } 415 AUE_NULL STD { int __mac_execve( - _In_z_ char *fname, + _In_z_ const char *fname, _In_ char **argv, _In_ char **envv, _In_ struct mac *mac_p @@ -2390,7 +2390,7 @@ } 453 AUE_AUDITCTL STD { int auditctl( - _In_z_ char *path + _In_z_ const char *path ); } 454 AUE_NULL STD { @@ -2563,7 +2563,7 @@ } 479 AUE_TRUNCATE STD { int truncate( - _In_z_ char *path, + _In_z_ const char *path, off_t length ); } @@ -2633,7 +2633,7 @@ 489 AUE_FACCESSAT STD { int faccessat( int fd, - _In_z_ char *path, + _In_z_ const char *path, int amode, int flag ); @@ -2641,7 +2641,7 @@ 490 AUE_FCHMODAT STD { int fchmodat( int fd, - _In_z_ char *path, + _In_z_ const char *path, mode_t mode, int flag ); @@ -2649,7 +2649,7 @@ 491 AUE_FCHOWNAT STD { int fchownat( int fd, - _In_z_ char *path, + _In_z_ const char *path, uid_t uid, gid_t gid, int flag @@ -2665,7 +2665,7 @@ 493 AUE_FSTATAT COMPAT11 { int fstatat( int fd, - _In_z_ char *path, + _In_z_ const char *path, _Out_ struct freebsd11_stat *buf, int flag ); @@ -2673,37 +2673,37 @@ 494 AUE_FUTIMESAT STD { int futimesat( int fd, - _In_z_ char *path, + _In_z_ const char *path, _In_reads_(2) struct timeval *times ); } 495 AUE_LINKAT STD { int linkat( int fd1, - _In_z_ char *path1, + _In_z_ const char *path1, int fd2, - _In_z_ char *path2, + _In_z_ const char *path2, int flag ); } 496 AUE_MKDIRAT STD { int mkdirat( int fd, - _In_z_ char *path, + _In_z_ const char *path, mode_t mode ); } 497 AUE_MKFIFOAT STD { int mkfifoat( int fd, - _In_z_ char *path, + _In_z_ const char *path, mode_t mode ); } 498 AUE_MKNODAT COMPAT11 { int mknodat( int fd, - _In_z_ char *path, + _In_z_ const char *path, mode_t mode, uint32_t dev ); @@ -2712,7 +2712,7 @@ 499 AUE_OPENAT_RWTC STD { int openat( int fd, - _In_z_ char *path, + _In_z_ const char *path, int flag, mode_t mode ); @@ -2720,7 +2720,7 @@ 500 AUE_READLINKAT STD { int readlinkat( int fd, - _In_z_ char *path, + _In_z_ const char *path, _Out_writes_bytes_(bufsize) char *buf, size_t bufsize ); @@ -2728,22 +2728,22 @@ 501 AUE_RENAMEAT STD { int renameat( int oldfd, - _In_z_ char *old, + _In_z_ const char *old, int newfd, - _In_z_ char *new + _In_z_ const char *new ); } 502 AUE_SYMLINKAT STD { int symlinkat( - _In_z_ char *path1, + _In_z_ const char *path1, int fd, - _In_z_ char *path2 + _In_z_ const char *path2 ); } 503 AUE_UNLINKAT STD { int unlinkat( int fd, - _In_z_ char *path, + _In_z_ const char *path, int flag ); } @@ -2755,7 +2755,7 @@ ; 505 is initialised by the kgssapi code, if present. 505 AUE_NULL NOSTD { int gssd_syscall( - _In_z_ char *path + _In_z_ const char *path ); } 506 AUE_JAIL_GET STD { @@ -2806,7 +2806,7 @@ } 513 AUE_LPATHCONF STD { int lpathconf( - _In_z_ char *path, + _In_z_ const char *path, int name ); } @@ -3031,7 +3031,7 @@ 547 AUE_FUTIMESAT STD { int utimensat( int fd, - _In_z_ char *path, + _In_z_ const char *path, _In_reads_(2) struct timespec *times, int flag ); @@ -3052,7 +3052,7 @@ 552 AUE_FSTATAT STD { int fstatat( int fd, - _In_z_ char *path, + _In_z_ const char *path, _Out_ struct stat *buf, int flag ); @@ -3073,7 +3073,7 @@ } 555 AUE_STATFS STD { int statfs( - _In_z_ char *path, + _In_z_ const char *path, _Out_ struct statfs *buf ); } @@ -3099,7 +3099,7 @@ 559 AUE_MKNODAT STD { int mknodat( int fd, - _In_z_ char *path, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Nov 2 20:56:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3452F10DB2A7; Fri, 2 Nov 2018 20:56:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D11597DF94; Fri, 2 Nov 2018 20:56:19 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADAF410120; Fri, 2 Nov 2018 20:56:19 +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 wA2KuJjP055994; Fri, 2 Nov 2018 20:56:19 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2KuJFI055991; Fri, 2 Nov 2018 20:56:19 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201811022056.wA2KuJFI055991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 2 Nov 2018 20:56:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340081 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern sys X-SVN-Commit-Revision: 340081 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 20:56:20 -0000 Author: brooks Date: Fri Nov 2 20:56:19 2018 New Revision: 340081 URL: https://svnweb.freebsd.org/changeset/base/340081 Log: Regen after r340080: Add const to input-only char * arguments. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17812 Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/systrace_args.c head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Fri Nov 2 20:50:22 2018 (r340080) +++ head/sys/compat/freebsd32/freebsd32_proto.h Fri Nov 2 20:56:19 2018 (r340081) @@ -77,7 +77,7 @@ struct freebsd32_ioctl_args { char data_l_[PADL_(struct md_ioctl32 *)]; struct md_ioctl32 * data; char data_r_[PADR_(struct md_ioctl32 *)]; }; struct freebsd32_execve_args { - char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)]; + char fname_l_[PADL_(const char *)]; const char * fname; char fname_r_[PADR_(const char *)]; char argv_l_[PADL_(uint32_t *)]; uint32_t * argv; char argv_r_[PADR_(uint32_t *)]; char envv_l_[PADL_(uint32_t *)]; uint32_t * envv; char envv_r_[PADR_(uint32_t *)]; }; @@ -130,7 +130,7 @@ struct freebsd32_settimeofday_args { char tzp_l_[PADL_(struct timezone *)]; struct timezone * tzp; char tzp_r_[PADR_(struct timezone *)]; }; struct freebsd32_utimes_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char tptr_l_[PADL_(struct timeval32 *)]; struct timeval32 * tptr; char tptr_r_[PADR_(struct timeval32 *)]; }; struct freebsd32_adjtime_args { @@ -243,7 +243,7 @@ struct freebsd32_lio_listio_args { char sig_l_[PADL_(struct sigevent32 *)]; struct sigevent32 * sig; char sig_r_[PADR_(struct sigevent32 *)]; }; struct freebsd32_lutimes_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char tptr_l_[PADL_(struct timeval32 *)]; struct timeval32 * tptr; char tptr_r_[PADR_(struct timeval32 *)]; }; struct freebsd32_preadv_args { @@ -434,7 +434,7 @@ struct freebsd32_lseek_args { char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)]; }; struct freebsd32_truncate_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; char length1_l_[PADL_(uint32_t)]; uint32_t length1; char length1_r_[PADR_(uint32_t)]; char length2_l_[PADL_(uint32_t)]; uint32_t length2; char length2_r_[PADR_(uint32_t)]; @@ -476,7 +476,7 @@ struct freebsd32_lseek_args { char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)]; }; struct freebsd32_truncate_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char length1_l_[PADL_(uint32_t)]; uint32_t length1; char length1_r_[PADR_(uint32_t)]; char length2_l_[PADL_(uint32_t)]; uint32_t length2; char length2_r_[PADR_(uint32_t)]; }; @@ -532,7 +532,7 @@ struct freebsd32_fexecve_args { }; struct freebsd32_futimesat_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char times_l_[PADL_(struct timeval *)]; struct timeval * times; char times_r_[PADR_(struct timeval *)]; }; struct freebsd32_jail_get_args { @@ -666,7 +666,7 @@ struct freebsd32_futimens_args { }; struct freebsd32_utimensat_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char times_l_[PADL_(struct timespec *)]; struct timespec * times; char times_r_[PADR_(struct timespec *)]; char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; }; @@ -676,7 +676,7 @@ struct freebsd32_fstat_args { }; struct freebsd32_fstatat_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char buf_l_[PADL_(struct stat32 *)]; struct stat32 * buf; char buf_r_[PADR_(struct stat32 *)]; char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; }; @@ -854,11 +854,11 @@ struct ofreebsd32_lseek_args { char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)]; }; struct ofreebsd32_stat_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char ub_l_[PADL_(struct ostat32 *)]; struct ostat32 * ub; char ub_r_[PADR_(struct ostat32 *)]; }; struct ofreebsd32_lstat_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char ub_l_[PADL_(struct ostat *)]; struct ostat * ub; char ub_r_[PADR_(struct ostat *)]; }; struct ofreebsd32_sigaction_args { @@ -946,7 +946,7 @@ struct freebsd4_freebsd32_getfsstat_args { char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; }; struct freebsd4_freebsd32_statfs_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char buf_l_[PADL_(struct statfs32 *)]; struct statfs32 * buf; char buf_r_[PADR_(struct statfs32 *)]; }; struct freebsd4_freebsd32_fstatfs_args { @@ -1037,7 +1037,7 @@ struct freebsd6_freebsd32_lseek_args { char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)]; }; struct freebsd6_freebsd32_truncate_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; char length1_l_[PADL_(uint32_t)]; uint32_t length1; char length1_r_[PADR_(uint32_t)]; char length2_l_[PADL_(uint32_t)]; uint32_t length2; char length2_r_[PADR_(uint32_t)]; @@ -1153,12 +1153,12 @@ int freebsd10_freebsd32_pipe(struct thread *, struct f #define PAD64_REQUIRED #endif struct freebsd11_freebsd32_mknod_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; char dev_l_[PADL_(int)]; int dev; char dev_r_[PADR_(int)]; }; struct freebsd11_freebsd32_stat_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char ub_l_[PADL_(struct freebsd11_stat32 *)]; struct freebsd11_stat32 * ub; char ub_r_[PADR_(struct freebsd11_stat32 *)]; }; struct freebsd11_freebsd32_fstat_args { @@ -1166,7 +1166,7 @@ struct freebsd11_freebsd32_fstat_args { char ub_l_[PADL_(struct freebsd11_stat32 *)]; struct freebsd11_stat32 * ub; char ub_r_[PADR_(struct freebsd11_stat32 *)]; }; struct freebsd11_freebsd32_lstat_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char ub_l_[PADL_(struct freebsd11_stat32 *)]; struct freebsd11_stat32 * ub; char ub_r_[PADR_(struct freebsd11_stat32 *)]; }; struct freebsd11_freebsd32_getdirentries_args { @@ -1200,13 +1200,13 @@ struct freebsd11_freebsd32_kevent_args { #endif struct freebsd11_freebsd32_fstatat_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char buf_l_[PADL_(struct freebsd11_stat32 *)]; struct freebsd11_stat32 * buf; char buf_r_[PADR_(struct freebsd11_stat32 *)]; char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; }; struct freebsd11_freebsd32_mknodat_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)]; char dev_l_[PADL_(uint32_t)]; uint32_t dev; char dev_r_[PADR_(uint32_t)]; }; Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Fri Nov 2 20:50:22 2018 (r340080) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Fri Nov 2 20:56:19 2018 (r340081) @@ -52,7 +52,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* open */ case 5: { struct open_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ iarg[1] = p->flags; /* int */ iarg[2] = p->mode; /* mode_t */ *n_args = 3; @@ -78,22 +78,22 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* link */ case 9: { struct link_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ - uarg[1] = (intptr_t) p->link; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ + uarg[1] = (intptr_t) p->link; /* const char * */ *n_args = 2; break; } /* unlink */ case 10: { struct unlink_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ *n_args = 1; break; } /* chdir */ case 12: { struct chdir_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ *n_args = 1; break; } @@ -107,7 +107,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* chmod */ case 15: { struct chmod_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ iarg[1] = p->mode; /* mode_t */ *n_args = 2; break; @@ -115,7 +115,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* chown */ case 16: { struct chown_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ iarg[1] = p->uid; /* int */ iarg[2] = p->gid; /* int */ *n_args = 3; @@ -136,8 +136,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* mount */ case 21: { struct mount_args *p = params; - uarg[0] = (intptr_t) p->type; /* char * */ - uarg[1] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->type; /* const char * */ + uarg[1] = (intptr_t) p->path; /* const char * */ iarg[2] = p->flags; /* int */ uarg[3] = (intptr_t) p->data; /* caddr_t */ *n_args = 4; @@ -146,7 +146,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* unmount */ case 22: { struct unmount_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ iarg[1] = p->flags; /* int */ *n_args = 2; break; @@ -238,7 +238,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* access */ case 33: { struct access_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ iarg[1] = p->amode; /* int */ *n_args = 2; break; @@ -325,14 +325,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* setlogin */ case 50: { struct setlogin_args *p = params; - uarg[0] = (intptr_t) p->namebuf; /* char * */ + uarg[0] = (intptr_t) p->namebuf; /* const char * */ *n_args = 1; break; } /* acct */ case 51: { struct acct_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ *n_args = 1; break; } @@ -363,22 +363,22 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* revoke */ case 56: { struct revoke_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ *n_args = 1; break; } /* symlink */ case 57: { struct symlink_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ - uarg[1] = (intptr_t) p->link; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ + uarg[1] = (intptr_t) p->link; /* const char * */ *n_args = 2; break; } /* readlink */ case 58: { struct readlink_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ uarg[1] = (intptr_t) p->buf; /* char * */ uarg[2] = p->count; /* size_t */ *n_args = 3; @@ -387,7 +387,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* freebsd32_execve */ case 59: { struct freebsd32_execve_args *p = params; - uarg[0] = (intptr_t) p->fname; /* char * */ + uarg[0] = (intptr_t) p->fname; /* const char * */ uarg[1] = (intptr_t) p->argv; /* uint32_t * */ uarg[2] = (intptr_t) p->envv; /* uint32_t * */ *n_args = 3; @@ -403,7 +403,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* chroot */ case 61: { struct chroot_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ *n_args = 1; break; } @@ -511,7 +511,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* swapon */ case 85: { struct swapon_args *p = params; - uarg[0] = (intptr_t) p->name; /* char * */ + uarg[0] = (intptr_t) p->name; /* const char * */ *n_args = 1; break; } @@ -715,8 +715,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* rename */ case 128: { struct rename_args *p = params; - uarg[0] = (intptr_t) p->from; /* char * */ - uarg[1] = (intptr_t) p->to; /* char * */ + uarg[0] = (intptr_t) p->from; /* const char * */ + uarg[1] = (intptr_t) p->to; /* const char * */ *n_args = 2; break; } @@ -731,7 +731,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* mkfifo */ case 132: { struct mkfifo_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ iarg[1] = p->mode; /* mode_t */ *n_args = 2; break; @@ -769,7 +769,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* mkdir */ case 136: { struct mkdir_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ iarg[1] = p->mode; /* mode_t */ *n_args = 2; break; @@ -777,14 +777,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* rmdir */ case 137: { struct rmdir_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ *n_args = 1; break; } /* freebsd32_utimes */ case 138: { struct freebsd32_utimes_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ uarg[1] = (intptr_t) p->tptr; /* struct timeval32 * */ *n_args = 2; break; @@ -805,7 +805,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* quotactl */ case 148: { struct quotactl_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ iarg[1] = p->cmd; /* int */ iarg[2] = p->uid; /* int */ uarg[3] = (intptr_t) p->arg; /* caddr_t */ @@ -815,7 +815,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* getfh */ case 161: { struct getfh_args *p = params; - uarg[0] = (intptr_t) p->fname; /* char * */ + uarg[0] = (intptr_t) p->fname; /* const char * */ uarg[1] = (intptr_t) p->fhp; /* struct fhandle * */ *n_args = 2; break; @@ -901,7 +901,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* pathconf */ case 191: { struct pathconf_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ iarg[1] = p->name; /* int */ *n_args = 2; break; @@ -966,7 +966,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* undelete */ case 205: { struct undelete_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ *n_args = 1; break; } @@ -1254,7 +1254,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* lchown */ case 254: { struct lchown_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ iarg[1] = p->uid; /* int */ iarg[2] = p->gid; /* int */ *n_args = 3; @@ -1287,7 +1287,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* lchmod */ case 274: { struct lchmod_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ iarg[1] = p->mode; /* mode_t */ *n_args = 2; break; @@ -1295,7 +1295,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* freebsd32_lutimes */ case 276: { struct freebsd32_lutimes_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ uarg[1] = (intptr_t) p->tptr; /* struct timeval32 * */ *n_args = 2; break; @@ -1790,7 +1790,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* eaccess */ case 376: { struct eaccess_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ iarg[1] = p->amode; /* int */ *n_args = 2; break; @@ -2178,7 +2178,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* auditctl */ case 453: { struct auditctl_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ *n_args = 1; break; } @@ -2400,7 +2400,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* freebsd32_truncate */ case 479: { struct freebsd32_truncate_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ iarg[1] = p->pad; /* int */ uarg[2] = p->length1; /* uint32_t */ uarg[3] = p->length2; /* uint32_t */ @@ -2466,7 +2466,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* freebsd32_truncate */ case 479: { struct freebsd32_truncate_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ uarg[1] = p->length1; /* uint32_t */ uarg[2] = p->length2; /* uint32_t */ *n_args = 3; @@ -2577,7 +2577,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 489: { struct faccessat_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->path; /* char * */ + uarg[1] = (intptr_t) p->path; /* const char * */ iarg[2] = p->amode; /* int */ iarg[3] = p->flag; /* int */ *n_args = 4; @@ -2597,7 +2597,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 491: { struct fchownat_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->path; /* char * */ + uarg[1] = (intptr_t) p->path; /* const char * */ uarg[2] = p->uid; /* uid_t */ iarg[3] = p->gid; /* gid_t */ iarg[4] = p->flag; /* int */ @@ -2617,7 +2617,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 494: { struct freebsd32_futimesat_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->path; /* char * */ + uarg[1] = (intptr_t) p->path; /* const char * */ uarg[2] = (intptr_t) p->times; /* struct timeval * */ *n_args = 3; break; @@ -2626,9 +2626,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 495: { struct linkat_args *p = params; iarg[0] = p->fd1; /* int */ - uarg[1] = (intptr_t) p->path1; /* char * */ + uarg[1] = (intptr_t) p->path1; /* const char * */ iarg[2] = p->fd2; /* int */ - uarg[3] = (intptr_t) p->path2; /* char * */ + uarg[3] = (intptr_t) p->path2; /* const char * */ iarg[4] = p->flag; /* int */ *n_args = 5; break; @@ -2637,7 +2637,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 496: { struct mkdirat_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->path; /* char * */ + uarg[1] = (intptr_t) p->path; /* const char * */ iarg[2] = p->mode; /* mode_t */ *n_args = 3; break; @@ -2646,7 +2646,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 497: { struct mkfifoat_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->path; /* char * */ + uarg[1] = (intptr_t) p->path; /* const char * */ iarg[2] = p->mode; /* mode_t */ *n_args = 3; break; @@ -2655,7 +2655,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 499: { struct openat_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->path; /* char * */ + uarg[1] = (intptr_t) p->path; /* const char * */ iarg[2] = p->flag; /* int */ iarg[3] = p->mode; /* mode_t */ *n_args = 4; @@ -2665,7 +2665,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 500: { struct readlinkat_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->path; /* char * */ + uarg[1] = (intptr_t) p->path; /* const char * */ uarg[2] = (intptr_t) p->buf; /* char * */ uarg[3] = p->bufsize; /* size_t */ *n_args = 4; @@ -2675,7 +2675,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 501: { struct renameat_args *p = params; iarg[0] = p->oldfd; /* int */ - uarg[1] = (intptr_t) p->old; /* char * */ + uarg[1] = (intptr_t) p->old; /* const char * */ iarg[2] = p->newfd; /* int */ uarg[3] = (intptr_t) p->new; /* const char * */ *n_args = 4; @@ -2684,9 +2684,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* symlinkat */ case 502: { struct symlinkat_args *p = params; - uarg[0] = (intptr_t) p->path1; /* char * */ + uarg[0] = (intptr_t) p->path1; /* const char * */ iarg[1] = p->fd; /* int */ - uarg[2] = (intptr_t) p->path2; /* char * */ + uarg[2] = (intptr_t) p->path2; /* const char * */ *n_args = 3; break; } @@ -2694,7 +2694,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 503: { struct unlinkat_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->path; /* char * */ + uarg[1] = (intptr_t) p->path; /* const char * */ iarg[2] = p->flag; /* int */ *n_args = 3; break; @@ -2769,7 +2769,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* lpathconf */ case 513: { struct lpathconf_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ iarg[1] = p->name; /* int */ *n_args = 2; break; @@ -3119,7 +3119,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 547: { struct freebsd32_utimensat_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->path; /* char * */ + uarg[1] = (intptr_t) p->path; /* const char * */ uarg[2] = (intptr_t) p->times; /* struct timespec * */ iarg[3] = p->flag; /* int */ *n_args = 4; @@ -3144,7 +3144,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 552: { struct freebsd32_fstatat_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->path; /* char * */ + uarg[1] = (intptr_t) p->path; /* const char * */ uarg[2] = (intptr_t) p->buf; /* struct stat32 * */ iarg[3] = p->flag; /* int */ *n_args = 4; @@ -3171,7 +3171,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* statfs */ case 555: { struct statfs_args *p = params; - uarg[0] = (intptr_t) p->path; /* char * */ + uarg[0] = (intptr_t) p->path; /* const char * */ uarg[1] = (intptr_t) p->buf; /* struct statfs32 * */ *n_args = 2; break; @@ -3205,7 +3205,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 559: { struct mknodat_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->path; /* char * */ + uarg[1] = (intptr_t) p->path; /* const char * */ iarg[2] = p->mode; /* mode_t */ iarg[3] = p->dev; /* dev_t */ *n_args = 4; @@ -3323,7 +3323,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 5: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: p = "int"; @@ -3368,10 +3368,10 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 9: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: - p = "userland char *"; + p = "userland const char *"; break; default: break; @@ -3381,7 +3381,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 10: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; default: break; @@ -3391,7 +3391,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 12: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; default: break; @@ -3411,7 +3411,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 15: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: p = "mode_t"; @@ -3424,7 +3424,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 16: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: p = "int"; @@ -3453,10 +3453,10 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 21: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: - p = "userland char *"; + p = "userland const char *"; break; case 2: p = "int"; @@ -3472,7 +3472,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 22: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: p = "int"; @@ -3625,7 +3625,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 33: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: p = "int"; @@ -3750,7 +3750,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 50: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; default: break; @@ -3760,7 +3760,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 51: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; default: break; @@ -3809,7 +3809,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 56: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; default: break; @@ -3819,10 +3819,10 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 57: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: - p = "userland char *"; + p = "userland const char *"; break; default: break; @@ -3832,7 +3832,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 58: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: p = "userland char *"; @@ -3848,7 +3848,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 59: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: p = "userland uint32_t *"; @@ -3874,7 +3874,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 61: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; default: break; @@ -4042,7 +4042,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 85: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; default: break; @@ -4389,10 +4389,10 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 128: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: - p = "userland char *"; + p = "userland const char *"; break; default: break; @@ -4415,7 +4415,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 132: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: p = "mode_t"; @@ -4485,7 +4485,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 136: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: p = "mode_t"; @@ -4498,7 +4498,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 137: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; default: break; @@ -4508,7 +4508,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 138: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: p = "userland struct timeval32 *"; @@ -4537,7 +4537,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 148: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: p = "int"; @@ -4556,7 +4556,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 161: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: p = "userland struct fhandle *"; @@ -4704,7 +4704,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 191: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: p = "int"; @@ -4810,7 +4810,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 205: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; default: break; @@ -5234,7 +5234,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 254: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: p = "int"; @@ -5289,7 +5289,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 274: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: p = "mode_t"; @@ -5302,7 +5302,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 276: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: p = "userland struct timeval32 *"; @@ -6112,7 +6112,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 376: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: p = "int"; @@ -6759,7 +6759,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 453: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; default: break; @@ -7181,7 +7181,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 479: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: p = "int"; @@ -7311,7 +7311,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 479: switch(ndx) { case 0: - p = "userland char *"; + p = "userland const char *"; break; case 1: p = "uint32_t"; @@ -7515,7 +7515,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "int"; break; case 1: - p = "userland char *"; + p = "userland const char *"; break; case 2: p = "int"; @@ -7553,7 +7553,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "int"; break; case 1: - p = "userland char *"; + p = "userland const char *"; break; case 2: p = "uid_t"; @@ -7591,7 +7591,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "int"; break; case 1: - p = "userland char *"; + p = "userland const char *"; break; case 2: p = "userland struct timeval *"; @@ -7607,13 +7607,13 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "int"; break; case 1: - p = "userland char *"; + p = "userland const char *"; break; case 2: p = "int"; break; case 3: - p = "userland char *"; + p = "userland const char *"; break; case 4: p = "int"; @@ -7629,7 +7629,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "int"; break; case 1: - p = "userland char *"; + p = "userland const char *"; break; case 2: p = "mode_t"; @@ -7645,7 +7645,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "int"; break; case 1: - p = "userland char *"; + p = "userland const char *"; break; case 2: p = "mode_t"; @@ -7661,7 +7661,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "int"; break; case 1: - p = "userland char *"; + p = "userland const char *"; break; case 2: p = "int"; @@ -7680,7 +7680,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "int"; break; case 1: - p = "userland char *"; + p = "userland const char *"; break; case 2: p = "userland char *"; @@ -7699,7 +7699,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "int"; break; case 1: - p = "userland char *"; + p = "userland const char *"; break; case 2: p = "int"; @@ -7715,13 +7715,13 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 502: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Nov 2 21:07:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6917A10DB626; Fri, 2 Nov 2018 21:07:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F3407E5B2; Fri, 2 Nov 2018 21:07:07 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3F3B102BB; Fri, 2 Nov 2018 21:07:06 +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 wA2L769q061695; Fri, 2 Nov 2018 21:07:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2L76I2061694; Fri, 2 Nov 2018 21:07:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811022107.wA2L76I2061694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 2 Nov 2018 21:07:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340082 - head/sys/tools X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/tools X-SVN-Commit-Revision: 340082 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 21:07:07 -0000 Author: emaste Date: Fri Nov 2 21:07:06 2018 New Revision: 340082 URL: https://svnweb.freebsd.org/changeset/base/340082 Log: embed_mfs.sh: replace some compound statements with conventional ifs Use the more readable form - there's no need to try being clever. Modified: head/sys/tools/embed_mfs.sh Modified: head/sys/tools/embed_mfs.sh ============================================================================== --- head/sys/tools/embed_mfs.sh Fri Nov 2 20:56:19 2018 (r340081) +++ head/sys/tools/embed_mfs.sh Fri Nov 2 21:07:06 2018 (r340082) @@ -45,7 +45,10 @@ fi mfs_size=`stat -f '%z' $2 2> /dev/null` # If we can't determine MFS image size - bail. -[ -z ${mfs_size} ] && echo "Can't determine MFS image size" && exit 1 +if [ -z ${mfs_size} ]; then + echo "Can't determine MFS image size" + exit 1 +fi err_no_mfs="Can't locate mfs section within " @@ -53,7 +56,10 @@ if file -b $1 | grep -q '^ELF ..-bit .SB executable'; sec_info=`elfdump -c $1 2> /dev/null | grep -A 5 -E "sh_name: oldmfs$"` # If we can't find the mfs section within the given kernel - bail. - [ -z "${sec_info}" ] && echo "${err_no_mfs} $1" && exit 1 + if [ -z "${sec_info}" ]; then + echo "${err_no_mfs} $1" + exit 1 + fi sec_size=`echo "${sec_info}" | awk '/sh_size/ {print $2}' 2>/dev/null` sec_start=`echo "${sec_info}" | \ @@ -78,7 +84,10 @@ else fi # If the mfs section size is smaller than the mfs image - bail. -[ ${sec_size} -lt ${mfs_size} ] && echo "MFS image too large" && exit 1 +if [ ${sec_size} -lt ${mfs_size} ]; then + echo "MFS image too large" + exit 1 +fi # Dump the mfs image into the mfs section dd if=$2 ibs=8192 of=$1 obs=${sec_start} oseek=1 conv=notrunc 2> /dev/null && \ From owner-svn-src-head@freebsd.org Fri Nov 2 21:20:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30FE210DBA90; Fri, 2 Nov 2018 21:20:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB2687F196; Fri, 2 Nov 2018 21:20:46 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC42110479; Fri, 2 Nov 2018 21:20:46 +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 wA2LKkUT066739; Fri, 2 Nov 2018 21:20:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2LKkdQ066738; Fri, 2 Nov 2018 21:20:46 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811022120.wA2LKkdQ066738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 2 Nov 2018 21:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340083 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 340083 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 21:20:47 -0000 Author: emaste Date: Fri Nov 2 21:20:46 2018 New Revision: 340083 URL: https://svnweb.freebsd.org/changeset/base/340083 Log: newvers.sh: fix git false positive -dirty tag Assuming that any output from `git diff-index --name-only` implies changes in the working tree results in false positives: files with metadata, but not content, changes are also listed. Check that content differences exist before adding the -dirty tag to the git hash. PR: 229230 Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15968 Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Fri Nov 2 21:07:06 2018 (r340082) +++ head/sys/conf/newvers.sh Fri Nov 2 21:20:46 2018 (r340083) @@ -76,6 +76,35 @@ findvcs() return 1 } +git_tree_modified() +{ + # git diff-index lists both files that are known to have changes as + # well as those with metadata that does not match what is recorded in + # git's internal state. The latter case is indicated by an all-zero + # destination file hash. + + local fifo vcstop_abs + + fifo=$(mktemp -u) + mkfifo -m 600 $fifo + vcstop_abs=$(realpath $VCSTOP) + $git_cmd --work-tree=${VCSTOP} diff-index HEAD > $fifo & + while read smode dmode ssha dsha status file; do + if ! expr $dsha : '^00*$' >/dev/null; then + rm $fifo + return 0 + fi + if ! $git_cmd diff --quiet -- "${vcstop_abs}/${file}"; then + rm $fifo + return 0 + fi + done < $fifo + # No files with content differences. + rm $fifo + return 1 +} + + if [ -z "${SYSDIR}" ]; then SYSDIR=$(dirname $0)/.. fi @@ -240,8 +269,7 @@ if [ -n "$git_cmd" ] ; then if [ -n "$git_b" ] ; then git="${git}(${git_b})" fi - if $git_cmd --work-tree=${VCSTOP} diff-index \ - --name-only HEAD | read dummy; then + if git_tree_modified; then git="${git}-dirty" modified=true fi From owner-svn-src-head@freebsd.org Fri Nov 2 22:15:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00EA210DD031; Fri, 2 Nov 2018 22:15:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7E4780E24; Fri, 2 Nov 2018 22:15:30 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 894E310E07; Fri, 2 Nov 2018 22:15:30 +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 wA2MFUqm097383; Fri, 2 Nov 2018 22:15:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2MFUl2097382; Fri, 2 Nov 2018 22:15:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811022215.wA2MFUl2097382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 2 Nov 2018 22:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340086 - head/sbin/devd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/devd X-SVN-Commit-Revision: 340086 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 22:15:31 -0000 Author: imp Date: Fri Nov 2 22:15:30 2018 New Revision: 340086 URL: https://svnweb.freebsd.org/changeset/base/340086 Log: Document r226775: tell why we omit usbus[0-9]+ tcpdump can capture packet traces from the usb bus. usbus[0-9] are registered as ifnet devices so this can work. When these devices come up, devd was trying to run pccard_ether on those interfaces, which didn't exist and generated an error. Modified: head/sbin/devd/devd.conf Modified: head/sbin/devd/devd.conf ============================================================================== --- head/sbin/devd/devd.conf Fri Nov 2 22:12:30 2018 (r340085) +++ head/sbin/devd/devd.conf Fri Nov 2 22:15:30 2018 (r340086) @@ -33,7 +33,9 @@ options { # # Configure the interface on attach. Due to a historical accident, this -# script is called pccard_ether. +# script is called pccard_ether. We omit the usbus devices because those +# devices are assocaited with the USB Bus and provide a tcpdump point +# to capture USB packets. # # NB: DETACH events are ignored; the kernel should handle all cleanup # (routes, arp cache). Beware of races against immediate create From owner-svn-src-head@freebsd.org Fri Nov 2 22:15:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8887B10DD054; Fri, 2 Nov 2018 22:15:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F5DA80F4F; Fri, 2 Nov 2018 22:15: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CA8A10E08; Fri, 2 Nov 2018 22:15:48 +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 wA2MFlYg097443; Fri, 2 Nov 2018 22:15:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2MFlZh097442; Fri, 2 Nov 2018 22:15:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811022215.wA2MFlZh097442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 2 Nov 2018 22:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340087 - head/sbin/devd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/devd X-SVN-Commit-Revision: 340087 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 22:15:48 -0000 Author: imp Date: Fri Nov 2 22:15:47 2018 New Revision: 340087 URL: https://svnweb.freebsd.org/changeset/base/340087 Log: Catch up with the SCSI device removal. We should likely review why we even have this. Modified: head/sbin/devd/devd.conf Modified: head/sbin/devd/devd.conf ============================================================================== --- head/sbin/devd/devd.conf Fri Nov 2 22:15:30 2018 (r340086) +++ head/sbin/devd/devd.conf Fri Nov 2 22:15:47 2018 (r340087) @@ -19,9 +19,8 @@ options { # Setup some shorthand for regex that we use later in the file. #XXX Yes, these are gross -- imp set scsi-controller-regex - "(aac|adv|adw|aha|ahc|ahd|aic|amr|bt|ciss|dpt|\ - esp|ida|iir|ips|isp|mlx|mly|mpr|mps|mpt|ncr|ncv|nsp|stg|sym|\ - trm)\ + "(aac|aacraid|ahc|ahd|amr|ciss|\ + esp|ida|iir|ips|isp|mlx|mly|mpr|mps|mpt|sym|trm)\ [0-9]+"; set wifi-driver-regex "(ath|bwi|bwn|ipw|iwi|iwm|iwn|malo|mwl|ral|rsu|rtwn|rum|run|\ From owner-svn-src-head@freebsd.org Fri Nov 2 22:18:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C82A10DD18C; Fri, 2 Nov 2018 22:18:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 236A78115D; Fri, 2 Nov 2018 22:18:03 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0597B10E0A; Fri, 2 Nov 2018 22:18:03 +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 wA2MI2B2097600; Fri, 2 Nov 2018 22:18:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2MI2Ae097599; Fri, 2 Nov 2018 22:18:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811022218.wA2MI2Ae097599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 2 Nov 2018 22:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340088 - head/sbin/devd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/devd X-SVN-Commit-Revision: 340088 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 22:18:03 -0000 Author: imp Date: Fri Nov 2 22:18:02 2018 New Revision: 340088 URL: https://svnweb.freebsd.org/changeset/base/340088 Log: Further research shows usbdump(8) is what we should point people at rather than tcpdump for usb traffic capture. Modified: head/sbin/devd/devd.conf Modified: head/sbin/devd/devd.conf ============================================================================== --- head/sbin/devd/devd.conf Fri Nov 2 22:15:47 2018 (r340087) +++ head/sbin/devd/devd.conf Fri Nov 2 22:18:02 2018 (r340088) @@ -33,8 +33,8 @@ options { # # Configure the interface on attach. Due to a historical accident, this # script is called pccard_ether. We omit the usbus devices because those -# devices are assocaited with the USB Bus and provide a tcpdump point -# to capture USB packets. +# devices are assocaited with the USB Bus and provide an ifnet device to +# allow usb traffic to be captured with usbdump(8). # # NB: DETACH events are ignored; the kernel should handle all cleanup # (routes, arp cache). Beware of races against immediate create From owner-svn-src-head@freebsd.org Fri Nov 2 22:23:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D691D10DD4A0; Fri, 2 Nov 2018 22:23:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A6F7815FB; Fri, 2 Nov 2018 22:23:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6CCAC10F96; Fri, 2 Nov 2018 22:23:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA2MNQwO002433; Fri, 2 Nov 2018 22:23:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2MNQML002432; Fri, 2 Nov 2018 22:23:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811022223.wA2MNQML002432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 2 Nov 2018 22:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340089 - head/usr.sbin/uhsoctl X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/usr.sbin/uhsoctl X-SVN-Commit-Revision: 340089 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 22:23:27 -0000 Author: hselasky Date: Fri Nov 2 22:23:25 2018 New Revision: 340089 URL: https://svnweb.freebsd.org/changeset/base/340089 Log: Use correct type for IOCTL request argument. This fixes signed IOCTL value warnings in uhsoctl(). MFC after: 1 week Submitted by: Marcin Cieslak Sponsored by: Mellanox Technologies Modified: head/usr.sbin/uhsoctl/uhsoctl.c Modified: head/usr.sbin/uhsoctl/uhsoctl.c ============================================================================== --- head/usr.sbin/uhsoctl/uhsoctl.c Fri Nov 2 22:18:02 2018 (r340088) +++ head/usr.sbin/uhsoctl/uhsoctl.c Fri Nov 2 22:23:25 2018 (r340089) @@ -360,7 +360,7 @@ logger(int pri, const char *fmt, ...) /* Add/remove IP address from an interface */ static int -ifaddr_ad(int d, const char *ifnam, struct sockaddr *sa, struct sockaddr *mask) +ifaddr_ad(unsigned long d, const char *ifnam, struct sockaddr *sa, struct sockaddr *mask) { struct ifaliasreq req; int fd, error; From owner-svn-src-head@freebsd.org Fri Nov 2 22:28:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E7C610DD81D; Fri, 2 Nov 2018 22:28:37 +0000 (UTC) (envelope-from fullermd@over-yonder.net) Received: from mail.infocus-llc.com (mail.infocus-llc.com [199.15.120.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F076181A5E; Fri, 2 Nov 2018 22:28:36 +0000 (UTC) (envelope-from fullermd@over-yonder.net) Received: from draco.over-yonder.net (c-75-65-60-66.hsd1.ms.comcast.net [75.65.60.66]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.tarragon.infocus-llc.com (Postfix) with ESMTPSA id 42mxYT6VDszZk0; Fri, 2 Nov 2018 17:28:29 -0500 (CDT) Received: by draco.over-yonder.net (Postfix, from userid 100) id 42mxYT1TmjzDlf; Fri, 2 Nov 2018 17:28:29 -0500 (CDT) Date: Fri, 2 Nov 2018 17:28:29 -0500 From: "Matthew D. Fuller" To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340088 - head/sbin/devd Message-ID: <20181102222829.GC30820@over-yonder.net> References: <201811022218.wA2MI2Ae097599@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201811022218.wA2MI2Ae097599@repo.freebsd.org> X-Editor: vi X-OS: FreeBSD User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 22:28:37 -0000 > +# devices are assocaited with the USB Bus and provide an ifnet device to ^^^^ Tpyo. -- Matthew Fuller (MF4839) | fullermd@over-yonder.net Systems/Network Administrator | http://www.over-yonder.net/~fullermd/ On the Internet, nobody can hear you scream. From owner-svn-src-head@freebsd.org Fri Nov 2 22:33:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A12A110DDA7E; Fri, 2 Nov 2018 22:33:38 +0000 (UTC) (envelope-from db@db.net) Received: from artemis.db.net (artemis.db.net [45.32.229.41]) by mx1.freebsd.org (Postfix) with ESMTP id 3FCC58263E; Fri, 2 Nov 2018 22:33:38 +0000 (UTC) (envelope-from db@db.net) Received: from night.db.net (artemis.db.net [45.32.229.41]) by artemis.db.net (Postfix) with ESMTP id B8C27111A2; Fri, 2 Nov 2018 22:33:37 +0000 (UTC) Received: by night.db.net (Postfix, from userid 1000) id 26D5139874; Fri, 2 Nov 2018 18:33:37 -0400 (EDT) Date: Fri, 2 Nov 2018 18:33:37 -0400 From: Diane Bruce To: "Matthew D. Fuller" Cc: Warner Losh , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r340088 - head/sbin/devd Message-ID: <20181102223337.GB117@night.db.net> References: <201811022218.wA2MI2Ae097599@repo.freebsd.org> <20181102222829.GC30820@over-yonder.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181102222829.GC30820@over-yonder.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 22:33:38 -0000 On Fri, Nov 02, 2018 at 05:28:29PM -0500, Matthew D. Fuller wrote: > > +# devices are assocaited with the USB Bus and provide an ifnet device to > ^^^^ > Tpyo. heh I just emailed him privately about that one too ;) > > > -- > Matthew Fuller (MF4839) | fullermd@over-yonder.net > Systems/Network Administrator | http://www.over-yonder.net/~fullermd/ > On the Internet, nobody can hear you scream. > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- - db@FreeBSD.org db@db.net http://artemis.db.net/~db From owner-svn-src-head@freebsd.org Fri Nov 2 22:50:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55DD210DDD34; Fri, 2 Nov 2018 22:50:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A0CA82B22; Fri, 2 Nov 2018 22:50:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA9E4112ED; Fri, 2 Nov 2018 22:50:18 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA2MoI20012924; Fri, 2 Nov 2018 22:50:18 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2MoDrI012893; Fri, 2 Nov 2018 22:50:13 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811022250.wA2MoDrI012893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 2 Nov 2018 22:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340090 - in head/sys/contrib/dev/acpica: . common compiler components/debugger components/dispatcher components/namespace components/parser components/tables include X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head/sys/contrib/dev/acpica: . common compiler components/debugger components/dispatcher components/namespace components/parser components/tables include X-SVN-Commit-Revision: 340090 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 22:50:19 -0000 Author: jkim Date: Fri Nov 2 22:50:13 2018 New Revision: 340090 URL: https://svnweb.freebsd.org/changeset/base/340090 Log: MFV: r339981 Merge ACPICA 20181031. Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/dmtbdump3.c head/sys/contrib/dev/acpica/common/dmtbinfo3.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslmessages.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/aslpredef.c head/sys/contrib/dev/acpica/compiler/aslxref.c head/sys/contrib/dev/acpica/compiler/dtio.c head/sys/contrib/dev/acpica/compiler/dttable2.c head/sys/contrib/dev/acpica/compiler/prscan.c head/sys/contrib/dev/acpica/components/debugger/dbxface.c head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c head/sys/contrib/dev/acpica/components/namespace/nsaccess.c head/sys/contrib/dev/acpica/components/parser/psloop.c head/sys/contrib/dev/acpica/components/parser/psobject.c head/sys/contrib/dev/acpica/components/tables/tbxfload.c head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acnamesp.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actbinfo.h head/sys/contrib/dev/acpica/include/actbl3.h Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/changes.txt Fri Nov 2 22:50:13 2018 (r340090) @@ -1,4 +1,54 @@ ---------------------------------------- +31 October 2018. Summary of changes for version 20181031: + +This release is available at https://acpica.org/downloads + + +An Operation Region regression was fixed by properly adding address +ranges to a global list during initialization. This allows OS to +accurately check for overlapping regions between native devices (such as +PCI) and Operation regions as well as checking for region conflicts +between two Operation Regions. + +Added support for the 2-byte extended opcodes in the code/feature that +attempts to continue parsing during the table load phase. Skip parsing +Device declarations (and other extended opcodes) when an error occurs +during parsing. Previously, only single-byte opcodes were supported. + +Cleanup: Simplified the module-level code support by eliminating a +useless global variable (AcpiGbl_GroupModuleLeveCode). + + +2) iASL Compiler/Disassembler and Tools: + +iASL/Preprocessor: Fixed a regression where an incorrect use of ACPI_FREE +could cause a fault in the preprocessor. This was an inadvertent side- +effect from moving more allocations/frees to the local cache/memory +mechanism. + +iASL: Enhanced error detection by validating that all NameSeg elements +within a NamePatch actually exist. The previous behavior was spotty at +best, and such errors could be improperly ignored at compiler time (never +at runtime, however. There are two new error messages, as shown in the +examples below: + +dsdt.asl 33: CreateByteField (TTTT.BXXX, 1, CBF1) +Error 6161 - ^ One or more objects within +the Pathname do not exist (TTTT.BXXX) + +dsdt.asl 34: CreateByteField (BUF1, UUUU.INT1, BBBB.CBF1) +Error 6160 - One or more prefix Scopes do not exist ^ +(BBBB.CBF1) + +iASL: Disassembler/table-compiler: Added support for the static data +table TPM2 revision 3 (an older version of TPM2). The support has been +added for the compiler and the disassembler. + +Fixed compilation of DOS format data table file on Unix/Linux systems. +iASL now properly detects line continuations (\) for DOS format data +table definition language files on when executing on Unix/Linux. + +---------------------------------------- 03 October 2018. Summary of changes for version 20181003: Modified: head/sys/contrib/dev/acpica/common/dmtbdump3.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump3.c Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/common/dmtbdump3.c Fri Nov 2 22:50:13 2018 (r340090) @@ -497,7 +497,52 @@ AcpiDmDumpTcpa ( * DESCRIPTION: Format the contents of a TPM2. * ******************************************************************************/ +static void +AcpiDmDumpTpm2Rev3 ( + ACPI_TABLE_HEADER *Table) +{ + UINT32 Offset = sizeof (ACPI_TABLE_TPM23); + ACPI_TABLE_TPM23 *CommonHeader = ACPI_CAST_PTR (ACPI_TABLE_TPM23, Table); + ACPI_TPM23_TRAILER *Subtable = ACPI_ADD_PTR (ACPI_TPM23_TRAILER, Table, Offset); + ACPI_STATUS Status; + + /* Main table */ + + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoTpm23); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Optional subtable if start method is ACPI start method */ + + switch (CommonHeader->StartMethod) + { + case ACPI_TPM23_ACPI_START_METHOD: + + Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, + Table->Length - Offset, AcpiDmTableInfoTpm23a); + break; + + default: + break; + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmDumpTpm2 + * + * PARAMETERS: Table - A TPM2 table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a TPM2. + * + ******************************************************************************/ + void AcpiDmDumpTpm2 ( ACPI_TABLE_HEADER *Table) @@ -509,9 +554,16 @@ AcpiDmDumpTpm2 ( ACPI_STATUS Status; + if (Table->Revision == 3) + { + AcpiDmDumpTpm2Rev3(Table); + return; + } + /* Main table */ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoTpm2); + if (ACPI_FAILURE (Status)) { return; Modified: head/sys/contrib/dev/acpica/common/dmtbinfo3.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo3.c Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/common/dmtbinfo3.c Fri Nov 2 22:50:13 2018 (r340090) @@ -446,6 +446,26 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaServer[ * ******************************************************************************/ +/* TPM2 revision 3 */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoTpm23[] = +{ + {ACPI_DMT_UINT32, ACPI_TPM23_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT64, ACPI_TPM23_OFFSET (ControlAddress), "Control Address", 0}, + {ACPI_DMT_UINT32, ACPI_TPM23_OFFSET (StartMethod), "Start Method", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Trailer in the case that StartMethod == 2 */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoTpm23a[] = +{ + {ACPI_DMT_UINT32, ACPI_TPM23A_OFFSET (Reserved), "Reserved", DT_OPTIONAL}, + ACPI_DMT_TERMINATOR +}; + +/* TPM2 revision 4 */ + ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[] = { {ACPI_DMT_UINT16, ACPI_TPM2_OFFSET (PlatformClass), "Platform Class", 0}, Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Fri Nov 2 22:50:13 2018 (r340090) @@ -858,7 +858,7 @@ CmCleanupAndExit ( if (AslGbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT) { - printf ("\nMaximum error count (%u) exceeded\n", + printf ("\nMaximum error count (%d) exceeded\n", ASL_MAX_ERROR_COUNT); } Modified: head/sys/contrib/dev/acpica/compiler/aslerror.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslerror.c Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/compiler/aslerror.c Fri Nov 2 22:50:13 2018 (r340090) @@ -1097,7 +1097,7 @@ AslExpectException ( if (AslGbl_ExpectedMessagesIndex >= ASL_MAX_EXPECTED_MESSAGES) { - printf ("Too many messages have been registered as expected (max %u)\n", + printf ("Too many messages have been registered as expected (max %d)\n", ASL_MAX_DISABLED_MESSAGES); return (AE_LIMIT); } @@ -1144,7 +1144,7 @@ AslDisableException ( if (AslGbl_DisabledMessagesIndex >= ASL_MAX_DISABLED_MESSAGES) { - printf ("Too many messages have been disabled (max %u)\n", + printf ("Too many messages have been disabled (max %d)\n", ASL_MAX_DISABLED_MESSAGES); return (AE_LIMIT); } Modified: head/sys/contrib/dev/acpica/compiler/aslload.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslload.c Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/compiler/aslload.c Fri Nov 2 22:50:13 2018 (r340090) @@ -417,10 +417,8 @@ LdLoadResourceElements ( { Status = AcpiNsLookup (WalkState->ScopeInfo, InitializerOp->Asl.ExternalName, - ACPI_TYPE_LOCAL_RESOURCE_FIELD, - ACPI_IMODE_LOAD_PASS1, - ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE, - NULL, &Node); + ACPI_TYPE_LOCAL_RESOURCE_FIELD, ACPI_IMODE_LOAD_PASS1, + ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node); if (ACPI_FAILURE (Status)) { return (Status); @@ -687,8 +685,7 @@ LdNamespace1Begin ( * handle this case. Perhaps someday this case can go away. */ Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY, - ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, - WalkState, &(Node)); + ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, WalkState, &Node); if (ACPI_FAILURE (Status)) { if (Status == AE_NOT_FOUND) @@ -696,23 +693,26 @@ LdNamespace1Begin ( /* The name was not found, go ahead and create it */ Status = AcpiNsLookup (WalkState->ScopeInfo, Path, - ACPI_TYPE_LOCAL_SCOPE, - ACPI_IMODE_LOAD_PASS1, Flags, - WalkState, &(Node)); + ACPI_TYPE_LOCAL_SCOPE, ACPI_IMODE_LOAD_PASS1, + Flags, WalkState, &Node); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } - /* - * However, this is an error -- primarily because the MS - * interpreter can't handle a forward reference from the - * Scope() operator. - */ - AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, - Op->Asl.ExternalName); - AslError (ASL_ERROR, ASL_MSG_SCOPE_FWD_REF, Op, - Op->Asl.ExternalName); + /* However, this is an error -- operand to Scope must exist */ + + if (strlen (Op->Asl.ExternalName) == ACPI_NAME_SIZE) + { + AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, + Op->Asl.ExternalName); + } + else + { + AslError (ASL_ERROR, ASL_MSG_NAMEPATH_NOT_EXIST, Op, + Op->Asl.ExternalName); + } + goto FinishNode; } @@ -824,7 +824,6 @@ LdNamespace1Begin ( break; } - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Loading name: %s, (%s)\n", Op->Asl.ExternalName, AcpiUtGetTypeName (ObjectType))); @@ -833,6 +832,18 @@ LdNamespace1Begin ( Flags |= ACPI_NS_ERROR_IF_FOUND; /* + * For opcodes that enter new names into the namespace, + * all prefix NameSegs must exist. + */ + WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode); + if (((WalkState->OpInfo->Flags & AML_NAMED) || + (WalkState->OpInfo->Flags & AML_CREATE)) && + (Op->Asl.AmlOpcode != AML_EXTERNAL_OP)) + { + Flags |= ACPI_NS_PREFIX_MUST_EXIST; + } + + /* * Enter the named type into the internal namespace. We enter the name * as we go downward in the parse tree. Any necessary subobjects that * involve arguments to the opcode must be created as we go back up the @@ -915,8 +926,20 @@ LdNamespace1Begin ( return_ACPI_STATUS (AE_OK); } } + else if (AE_NOT_FOUND) + { + /* + * One or more prefix NameSegs of the NamePath do not exist + * (all of them must exist). Attempt to continue compilation + * by setting the current scope to the root. + */ + Node = AcpiGbl_RootNode; + Status = AE_OK; + } else { + /* Flag all other errors as coming from the ACPICA core */ + AslCoreSubsystemError (Op, Status, "Failure from namespace lookup", FALSE); return_ACPI_STATUS (Status); @@ -1043,10 +1066,10 @@ LdNamespace2Begin ( if (Op->Asl.ParseOpcode == PARSEOP_ALIAS) { - /* Complete the alias node by getting and saving the target node */ - - /* First child is the alias target */ - + /* + * Complete the alias node by getting and saving the target node. + * First child is the alias target + */ Arg = Op->Asl.Child; /* Get the target pathname */ @@ -1070,18 +1093,34 @@ LdNamespace2Begin ( { if (Status == AE_NOT_FOUND) { - AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, - Op->Asl.ExternalName); + /* Standalone NameSeg vs. NamePath */ + if (strlen (Arg->Asl.ExternalName) == ACPI_NAME_SIZE) + { + AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, + Arg->Asl.ExternalName); + } + else + { + AslError (ASL_ERROR, ASL_MSG_NAMEPATH_NOT_EXIST, Op, + Arg->Asl.ExternalName); + } + +#if 0 +/* + * NOTE: Removed 10/2018 to enhance compiler error reporting. No + * regressions seen. + */ /* * The name was not found, go ahead and create it. * This prevents more errors later. */ Status = AcpiNsLookup (WalkState->ScopeInfo, Path, - ACPI_TYPE_ANY, - ACPI_IMODE_LOAD_PASS1, ACPI_NS_NO_UPSEARCH, - WalkState, &(Node)); - return (AE_OK); + ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS1, + ACPI_NS_NO_UPSEARCH, WalkState, &Node); +#endif + return (Status); +/* Removed: return (AE_OK)*/ } AslCoreSubsystemError (Op, Status, Modified: head/sys/contrib/dev/acpica/compiler/aslmain.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmain.c Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/compiler/aslmain.c Fri Nov 2 22:50:13 2018 (r340090) @@ -329,7 +329,7 @@ AslSignalHandler ( default: - printf (ASL_PREFIX "Unknown interrupt signal (%u)\n", Sig); + printf (ASL_PREFIX "Unknown interrupt signal (%d)\n", Sig); break; } Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.c Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.c Fri Nov 2 22:50:13 2018 (r340090) @@ -285,7 +285,7 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_NON_ASCII */ "Invalid characters found in file", /* ASL_MSG_NON_ZERO */ "Operand evaluates to zero", /* ASL_MSG_NOT_EXIST */ "Object does not exist", -/* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from scope", +/* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from current scope", /* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke", /* ASL_MSG_NOT_PARAMETER */ "Not a parameter, used as local only", /* ASL_MSG_NOT_REACHABLE */ "Object is not accessible from this scope", @@ -359,7 +359,9 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_OEM_ID */ "Invalid OEM ID", /* ASL_MSG_UNLOAD */ "Unload is not supported by all operating systems", /* ASL_MSG_OFFSET */ "Unnecessary/redundant use of Offset operator", -/* ASL_MSG_LONG_SLEEP */ "Very long Sleep, greater than 1 second" +/* ASL_MSG_LONG_SLEEP */ "Very long Sleep, greater than 1 second", +/* ASL_MSG_PREFIX_NOT_EXIST */ "One or more prefix Scopes do not exist", +/* ASL_MSG_NAMEPATH_NOT_EXIST */ "One or more objects within the Pathname do not exist" }; /* Table compiler */ Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.h Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.h Fri Nov 2 22:50:13 2018 (r340090) @@ -362,6 +362,8 @@ typedef enum ASL_MSG_UNLOAD, ASL_MSG_OFFSET, ASL_MSG_LONG_SLEEP, + ASL_MSG_PREFIX_NOT_EXIST, + ASL_MSG_NAMEPATH_NOT_EXIST, /* These messages are used by the Data Table compiler only */ Modified: head/sys/contrib/dev/acpica/compiler/aslpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslpredef.c Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/compiler/aslpredef.c Fri Nov 2 22:50:13 2018 (r340090) @@ -222,7 +222,7 @@ ApCheckForPredefinedMethod ( if (MethodInfo->NumArguments != 0) { - sprintf (AslGbl_MsgBuffer, "%s requires %u", Op->Asl.ExternalName, 0); + sprintf (AslGbl_MsgBuffer, "%s requires %d", Op->Asl.ExternalName, 0); AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op, AslGbl_MsgBuffer); Modified: head/sys/contrib/dev/acpica/compiler/aslxref.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslxref.c Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/compiler/aslxref.c Fri Nov 2 22:50:13 2018 (r340090) @@ -718,23 +718,55 @@ XfNamespaceLocateBegin ( } else { - /* Check for a fully qualified path */ + /* The NamePath contains multiple NameSegs */ - if (Path[0] == AML_ROOT_PREFIX) + if ((OpInfo->Flags & AML_CREATE) || + (OpInfo->ObjectType == ACPI_TYPE_LOCAL_ALIAS)) { - /* Gave full path, the object does not exist */ + /* + * The new name is the last parameter. For the + * CreateXXXXField and Alias operators + */ + NextOp = Op->Asl.Child; + while (!(NextOp->Asl.CompileFlags & OP_IS_NAME_DECLARATION)) + { + NextOp = NextOp->Asl.Next; + } + AslError (ASL_ERROR, ASL_MSG_PREFIX_NOT_EXIST, NextOp, + NextOp->Asl.ExternalName); + } + else if (OpInfo->Flags & AML_NAMED) + { + /* The new name is the first parameter */ + + AslError (ASL_ERROR, ASL_MSG_PREFIX_NOT_EXIST, Op, + Op->Asl.ExternalName); + } + else if (Path[0] == AML_ROOT_PREFIX) + { + /* Full namepath from root, the object does not exist */ + AslError (ASL_ERROR, ASL_MSG_NOT_EXIST, Op, Op->Asl.ExternalName); } else { /* - * We can't tell whether it doesn't exist or just - * can't be reached. + * Generic "not found" error. Cannot determine whether it + * doesn't exist or just can't be reached. However, we + * can differentiate between a NameSeg vs. NamePath. */ - AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, - Op->Asl.ExternalName); + if (strlen (Op->Asl.ExternalName) == ACPI_NAME_SIZE) + { + AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, + Op->Asl.ExternalName); + } + else + { + AslError (ASL_ERROR, ASL_MSG_NAMEPATH_NOT_EXIST, Op, + Op->Asl.ExternalName); + } } } Modified: head/sys/contrib/dev/acpica/compiler/dtio.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dtio.c Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/compiler/dtio.c Fri Nov 2 22:50:13 2018 (r340090) @@ -236,7 +236,7 @@ DtTrim ( /* Skip lines that start with a space */ - if (!strcmp (String, " ")) + if (*String == 0 || !strcmp (String, " ")) { ReturnString = UtLocalCacheCalloc (1); return (ReturnString); @@ -258,7 +258,7 @@ DtTrim ( while (End >= Start) { - if (*End == '\r' || *End == '\n') + if (*End == '\n') { End--; continue; @@ -522,6 +522,7 @@ DtGetNextLine ( UINT32 CurrentLineOffset; UINT32 i; int c; + int c1; memset (AslGbl_CurrentLineBuffer, 0, AslGbl_LineBufferSize); @@ -568,6 +569,29 @@ DtGetNextLine ( */ c = '\n'; State = DT_NORMAL_TEXT; + } + else if (c == '\r') + { + c1 = getc (Handle); + if (c1 == '\n') + { + /* + * Skip the carriage return as if it didn't exist. This is + * onlt meant for input files in DOS format in unix. fopen in + * unix may not support "text mode" and leaves CRLF intact. + */ + c = '\n'; + } + else + { + /* This was not a CRLF. Only a CR */ + + ungetc(c1, Handle); + + DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, + "Carriage return without linefeed detected"); + return (ASL_EOF); + } } switch (State) Modified: head/sys/contrib/dev/acpica/compiler/dttable2.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dttable2.c Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/compiler/dttable2.c Fri Nov 2 22:50:13 2018 (r340090) @@ -1878,6 +1878,62 @@ DtCompileTcpa ( /****************************************************************************** * + * FUNCTION: DtCompileTpm2Rev3 + * + * PARAMETERS: PFieldList - Current field list pointer + * + * RETURN: Status + * + * DESCRIPTION: Compile TPM2 revision 3 + * + *****************************************************************************/ +static ACPI_STATUS +DtCompileTpm2Rev3 ( + void **List) +{ + DT_FIELD **PFieldList = (DT_FIELD **) List; + DT_SUBTABLE *Subtable; + ACPI_TABLE_TPM23 *Tpm23Header; + DT_SUBTABLE *ParentTable; + ACPI_STATUS Status = AE_OK; + + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoTpm23, + &Subtable); + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + Tpm23Header = ACPI_CAST_PTR (ACPI_TABLE_TPM23, ParentTable->Buffer); + + /* Subtable type depends on the StartMethod */ + + switch (Tpm23Header->StartMethod) + { + case ACPI_TPM23_ACPI_START_METHOD: + + /* Subtable specific to to ARM_SMC */ + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoTpm23a, + &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + break; + + default: + break; + } + + return (Status); +} + + +/****************************************************************************** + * * FUNCTION: DtCompileTpm2 * * PARAMETERS: PFieldList - Current field list pointer @@ -1897,7 +1953,17 @@ DtCompileTpm2 ( ACPI_TABLE_TPM2 *Tpm2Header; DT_SUBTABLE *ParentTable; ACPI_STATUS Status = AE_OK; + ACPI_TABLE_HEADER *Header; + + ParentTable = DtPeekSubtable (); + + Header = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer); + + if (Header->Revision == 3) + { + return (DtCompileTpm2Rev3 (List)); + } /* Compile the main table */ Modified: head/sys/contrib/dev/acpica/compiler/prscan.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/prscan.c Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/compiler/prscan.c Fri Nov 2 22:50:13 2018 (r340090) @@ -1259,7 +1259,6 @@ PrPopDirective ( AslGbl_DirectiveInfo[Info->Directive].Name, Info->Argument, AslGbl_IgnoringThisCodeBlock ? "TRUE" : "FALSE"); - ACPI_FREE (Info); return (AE_OK); } Modified: head/sys/contrib/dev/acpica/components/debugger/dbxface.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbxface.c Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/components/debugger/dbxface.c Fri Nov 2 22:50:13 2018 (r340090) @@ -174,6 +174,12 @@ AcpiDbMethodEnd ( ACPI_WALK_STATE *WalkState); #endif +#ifdef ACPI_DISASSEMBLER +static ACPI_PARSE_OBJECT * +AcpiDbGetDisplayOp ( + ACPI_WALK_STATE *WalkState, + ACPI_PARSE_OBJECT *Op); +#endif /******************************************************************************* * @@ -273,8 +279,76 @@ AcpiDbSignalBreakPoint ( } +#ifdef ACPI_DISASSEMBLER /******************************************************************************* * + * FUNCTION: AcpiDbGetDisplayOp + * + * PARAMETERS: WalkState - Current walk + * Op - Current executing op (from aml interpreter) + * + * RETURN: Opcode to display + * + * DESCRIPTION: Find the opcode to display during single stepping + * + ******************************************************************************/ + +static ACPI_PARSE_OBJECT * +AcpiDbGetDisplayOp ( + ACPI_WALK_STATE *WalkState, + ACPI_PARSE_OBJECT *Op) +{ + ACPI_PARSE_OBJECT *DisplayOp; + ACPI_PARSE_OBJECT *ParentOp; + + DisplayOp = Op; + ParentOp = Op->Common.Parent; + if (ParentOp) + { + if ((WalkState->ControlState) && + (WalkState->ControlState->Common.State == + ACPI_CONTROL_PREDICATE_EXECUTING)) + { + /* + * We are executing the predicate of an IF or WHILE statement + * Search upwards for the containing IF or WHILE so that the + * entire predicate can be displayed. + */ + while (ParentOp) + { + if ((ParentOp->Common.AmlOpcode == AML_IF_OP) || + (ParentOp->Common.AmlOpcode == AML_WHILE_OP)) + { + DisplayOp = ParentOp; + break; + } + ParentOp = ParentOp->Common.Parent; + } + } + else + { + while (ParentOp) + { + if ((ParentOp->Common.AmlOpcode == AML_IF_OP) || + (ParentOp->Common.AmlOpcode == AML_ELSE_OP) || + (ParentOp->Common.AmlOpcode == AML_SCOPE_OP) || + (ParentOp->Common.AmlOpcode == AML_METHOD_OP) || + (ParentOp->Common.AmlOpcode == AML_WHILE_OP)) + { + break; + } + DisplayOp = ParentOp; + ParentOp = ParentOp->Common.Parent; + } + } + } + return DisplayOp; +} +#endif + + +/******************************************************************************* + * * FUNCTION: AcpiDbSingleStep * * PARAMETERS: WalkState - Current walk @@ -296,8 +370,6 @@ AcpiDbSingleStep ( ACPI_PARSE_OBJECT *Next; ACPI_STATUS Status = AE_OK; UINT32 OriginalDebugLevel; - ACPI_PARSE_OBJECT *DisplayOp; - ACPI_PARSE_OBJECT *ParentOp; UINT32 AmlOffset; @@ -393,53 +465,11 @@ AcpiDbSingleStep ( Next = Op->Common.Next; Op->Common.Next = NULL; - - DisplayOp = Op; - ParentOp = Op->Common.Parent; - if (ParentOp) - { - if ((WalkState->ControlState) && - (WalkState->ControlState->Common.State == - ACPI_CONTROL_PREDICATE_EXECUTING)) - { - /* - * We are executing the predicate of an IF or WHILE statement - * Search upwards for the containing IF or WHILE so that the - * entire predicate can be displayed. - */ - while (ParentOp) - { - if ((ParentOp->Common.AmlOpcode == AML_IF_OP) || - (ParentOp->Common.AmlOpcode == AML_WHILE_OP)) - { - DisplayOp = ParentOp; - break; - } - ParentOp = ParentOp->Common.Parent; - } - } - else - { - while (ParentOp) - { - if ((ParentOp->Common.AmlOpcode == AML_IF_OP) || - (ParentOp->Common.AmlOpcode == AML_ELSE_OP) || - (ParentOp->Common.AmlOpcode == AML_SCOPE_OP) || - (ParentOp->Common.AmlOpcode == AML_METHOD_OP) || - (ParentOp->Common.AmlOpcode == AML_WHILE_OP)) - { - break; - } - DisplayOp = ParentOp; - ParentOp = ParentOp->Common.Parent; - } - } - } - /* Now we can disassemble and display it */ #ifdef ACPI_DISASSEMBLER - AcpiDmDisassemble (WalkState, DisplayOp, ACPI_UINT32_MAX); + AcpiDmDisassemble (WalkState, AcpiDbGetDisplayOp (WalkState, Op), + ACPI_UINT32_MAX); #else /* * The AML Disassembler is not configured - at least we can Modified: head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c ============================================================================== --- head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c Fri Nov 2 22:50:13 2018 (r340090) @@ -586,6 +586,9 @@ AcpiDsEvalRegionOperands ( ObjDesc, ACPI_FORMAT_UINT64 (ObjDesc->Region.Address), ObjDesc->Region.Length)); + Status = AcpiUtAddAddressRange (ObjDesc->Region.SpaceId, + ObjDesc->Region.Address, ObjDesc->Region.Length, Node); + /* Now the address and length are valid for this opregion */ ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID; Modified: head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c ============================================================================== --- head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c Fri Nov 2 22:50:13 2018 (r340090) @@ -448,6 +448,15 @@ AcpiDsLoad2BeginOp ( } #endif + /* + * For name creation opcodes, the full namepath prefix must + * exist, except for the final (new) nameseg. + */ + if (WalkState->OpInfo->Flags & AML_NAMED) + { + Flags |= ACPI_NS_PREFIX_MUST_EXIST; + } + /* Add new entry or lookup existing entry */ Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType, Modified: head/sys/contrib/dev/acpica/components/namespace/nsaccess.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsaccess.c Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/components/namespace/nsaccess.c Fri Nov 2 22:50:13 2018 (r340090) @@ -421,6 +421,7 @@ AcpiNsLookup ( ACPI_OBJECT_TYPE ThisSearchType; UINT32 SearchParentFlag = ACPI_NS_SEARCH_PARENT; UINT32 LocalFlags; + ACPI_INTERPRETER_MODE LocalInterpreterMode; ACPI_FUNCTION_TRACE (NsLookup); @@ -670,6 +671,7 @@ AcpiNsLookup ( */ ThisSearchType = ACPI_TYPE_ANY; CurrentNode = ThisNode; + while (NumSegments && CurrentNode) { NumSegments--; @@ -704,6 +706,16 @@ AcpiNsLookup ( } } + /* Handle opcodes that create a new NameSeg via a full NamePath */ + + LocalInterpreterMode = InterpreterMode; + if ((Flags & ACPI_NS_PREFIX_MUST_EXIST) && (NumSegments > 0)) + { + /* Every element of the path must exist (except for the final NameSeg) */ + + LocalInterpreterMode = ACPI_IMODE_EXECUTE; + } + /* Extract one ACPI name from the front of the pathname */ ACPI_MOVE_32_TO_32 (&SimpleName, Path); @@ -711,11 +723,18 @@ AcpiNsLookup ( /* Try to find the single (4 character) ACPI name */ Status = AcpiNsSearchAndEnter (SimpleName, WalkState, CurrentNode, - InterpreterMode, ThisSearchType, LocalFlags, &ThisNode); + LocalInterpreterMode, ThisSearchType, LocalFlags, &ThisNode); if (ACPI_FAILURE (Status)) { if (Status == AE_NOT_FOUND) { +#if !defined ACPI_ASL_COMPILER /* Note: iASL reports this error by itself, not needed here */ + if (Flags & ACPI_NS_PREFIX_MUST_EXIST) + { + AcpiOsPrintf (ACPI_MSG_BIOS_ERROR + "Object does not exist: %4.4s\n", &SimpleName); + } +#endif /* Name not found in ACPI namespace */ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, Modified: head/sys/contrib/dev/acpica/components/parser/psloop.c ============================================================================== --- head/sys/contrib/dev/acpica/components/parser/psloop.c Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/components/parser/psloop.c Fri Nov 2 22:50:13 2018 (r340090) @@ -298,7 +298,7 @@ AcpiPsGetArguments ( * future. Use of this option can cause problems with AML code that * depends upon in-order immediate execution of module-level code. */ - if (AcpiGbl_GroupModuleLevelCode && + if (!AcpiGbl_ExecuteTablesAsMethods && (WalkState->PassNumber <= ACPI_IMODE_LOAD_PASS2) && ((WalkState->ParseFlags & ACPI_PARSE_DISASSEMBLE) == 0)) { @@ -566,6 +566,7 @@ AcpiPsParseLoop ( ACPI_PARSE_OBJECT *Op = NULL; /* current op */ ACPI_PARSE_STATE *ParserState; UINT8 *AmlOpStart = NULL; + UINT8 OpcodeLength; ACPI_FUNCTION_TRACE_PTR (PsParseLoop, WalkState); @@ -654,7 +655,7 @@ AcpiPsParseLoop ( * status to AE_OK to proceed with the table load. */ if ((WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL) && - Status == AE_ALREADY_EXISTS) + ((Status == AE_ALREADY_EXISTS) || (Status == AE_NOT_FOUND))) { Status = AE_OK; } @@ -686,9 +687,20 @@ AcpiPsParseLoop ( * the scope op because the parse failure indicates that * the device may not exist. */ - ACPI_ERROR ((AE_INFO, "Skip parsing opcode %s", - AcpiPsGetOpcodeName (WalkState->Opcode))); - WalkState->ParserState.Aml = WalkState->Aml + 1; + ACPI_INFO (("Skipping parse of AML opcode: %s (0x%4.4X)", + AcpiPsGetOpcodeName (WalkState->Opcode), WalkState->Opcode)); + + /* + * Determine the opcode length before skipping the opcode. + * An opcode can be 1 byte or 2 bytes in length. + */ + OpcodeLength = 1; + if ((WalkState->Opcode & 0xFF00) == AML_EXTENDED_OPCODE) + { + OpcodeLength = 2; + } + WalkState->ParserState.Aml = WalkState->Aml + OpcodeLength; + WalkState->ParserState.Aml = AcpiPsGetNextPackageEnd(&WalkState->ParserState); WalkState->Aml = WalkState->ParserState.Aml; Modified: head/sys/contrib/dev/acpica/components/parser/psobject.c ============================================================================== --- head/sys/contrib/dev/acpica/components/parser/psobject.c Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/components/parser/psobject.c Fri Nov 2 22:50:13 2018 (r340090) @@ -773,7 +773,7 @@ AcpiPsCompleteOp ( * because there could be correct AML beyond the parts that caused * the runtime error. */ - ACPI_ERROR ((AE_INFO, "Ignore error and continue table load")); + ACPI_INFO (("Ignoring error and continuing table load")); return_ACPI_STATUS (AE_OK); } return_ACPI_STATUS (Status); Modified: head/sys/contrib/dev/acpica/components/tables/tbxfload.c ============================================================================== --- head/sys/contrib/dev/acpica/components/tables/tbxfload.c Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/components/tables/tbxfload.c Fri Nov 2 22:50:13 2018 (r340090) @@ -219,7 +219,7 @@ AcpiLoadTables ( "While loading namespace from ACPI tables")); } - if (AcpiGbl_ExecuteTablesAsMethods || !AcpiGbl_GroupModuleLevelCode) + if (AcpiGbl_ExecuteTablesAsMethods) { /* * If the module-level code support is enabled, initialize the objects Modified: head/sys/contrib/dev/acpica/include/acdisasm.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acdisasm.h Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/include/acdisasm.h Fri Nov 2 22:50:13 2018 (r340090) @@ -561,6 +561,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaSer extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm211[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm23[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm23a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc0[]; Modified: head/sys/contrib/dev/acpica/include/acnamesp.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acnamesp.h Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/include/acnamesp.h Fri Nov 2 22:50:13 2018 (r340090) @@ -177,6 +177,7 @@ #define ACPI_NS_TEMPORARY 0x0040 #define ACPI_NS_OVERRIDE_IF_FOUND 0x0080 #define ACPI_NS_EARLY_INIT 0x0100 +#define ACPI_NS_PREFIX_MUST_EXIST 0x0200 /* Flags for AcpiNsWalkNamespace */ Modified: head/sys/contrib/dev/acpica/include/acpixf.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acpixf.h Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/include/acpixf.h Fri Nov 2 22:50:13 2018 (r340090) @@ -154,7 +154,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20181003 +#define ACPI_CA_VERSION 0x20181031 #include #include @@ -299,13 +299,6 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CopyDsdtLo * some machines. Default behavior is to use the XSDT if present. */ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DoNotUseXsdt, FALSE); - -/* - * Optionally support group module level code. - * NOTE, this is essentially obsolete and will be removed soon - * (01/2018). - */ -ACPI_INIT_GLOBAL (UINT8, AcpiGbl_GroupModuleLevelCode, FALSE); /* * Optionally support module level code by parsing an entire table as Modified: head/sys/contrib/dev/acpica/include/actbinfo.h ============================================================================== --- head/sys/contrib/dev/acpica/include/actbinfo.h Fri Nov 2 22:23:25 2018 (r340089) +++ head/sys/contrib/dev/acpica/include/actbinfo.h Fri Nov 2 22:50:13 2018 (r340090) @@ -194,6 +194,7 @@ #define ACPI_STAO_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_STAO,f) #define ACPI_TCPA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_HDR,f) #define ACPI_TPM2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TPM2,f) +#define ACPI_TPM23_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TPM23,f) #define ACPI_UEFI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_UEFI,f) #define ACPI_WAET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WAET,f) #define ACPI_WDAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDAT,f) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Nov 2 22:57:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D56BD10DE28D; Fri, 2 Nov 2018 22:57:01 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CB4883054; Fri, 2 Nov 2018 22:57:00 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wA2MuqsF077798; Fri, 2 Nov 2018 15:56:52 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wA2Muqdg077797; Fri, 2 Nov 2018 15:56:52 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811022256.wA2Muqdg077797@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340082 - head/sys/tools In-Reply-To: <201811022107.wA2L76I2061694@repo.freebsd.org> To: Ed Maste Date: Fri, 2 Nov 2018 15:56:52 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 22:57:02 -0000 > Author: emaste > Date: Fri Nov 2 21:07:06 2018 > New Revision: 340082 > URL: https://svnweb.freebsd.org/changeset/base/340082 > > Log: > embed_mfs.sh: replace some compound statements with conventional ifs > > Use the more readable form - there's no need to try being clever. This also fixes the fact that an unhandled error did not result in the exit 1 being done, though the chance of that happening (echo would have to fail) is near nil). > > Modified: > head/sys/tools/embed_mfs.sh > > Modified: head/sys/tools/embed_mfs.sh > ============================================================================== > --- head/sys/tools/embed_mfs.sh Fri Nov 2 20:56:19 2018 (r340081) > +++ head/sys/tools/embed_mfs.sh Fri Nov 2 21:07:06 2018 (r340082) > @@ -45,7 +45,10 @@ fi > > mfs_size=`stat -f '%z' $2 2> /dev/null` > # If we can't determine MFS image size - bail. > -[ -z ${mfs_size} ] && echo "Can't determine MFS image size" && exit 1 > +if [ -z ${mfs_size} ]; then > + echo "Can't determine MFS image size" > + exit 1 > +fi > > err_no_mfs="Can't locate mfs section within " > > @@ -53,7 +56,10 @@ if file -b $1 | grep -q '^ELF ..-bit .SB executable'; > > sec_info=`elfdump -c $1 2> /dev/null | grep -A 5 -E "sh_name: oldmfs$"` > # If we can't find the mfs section within the given kernel - bail. > - [ -z "${sec_info}" ] && echo "${err_no_mfs} $1" && exit 1 ^^ would not execute exit if echo failed... this is poor sh coding. > + if [ -z "${sec_info}" ]; then > + echo "${err_no_mfs} $1" > + exit 1 > + fi This fixes that possible, though highly unlikely, issue. It is also much easier to read and understand! > > sec_size=`echo "${sec_info}" | awk '/sh_size/ {print $2}' 2>/dev/null` > sec_start=`echo "${sec_info}" | \ > @@ -78,7 +84,10 @@ else > fi > > # If the mfs section size is smaller than the mfs image - bail. > -[ ${sec_size} -lt ${mfs_size} ] && echo "MFS image too large" && exit 1 > +if [ ${sec_size} -lt ${mfs_size} ]; then > + echo "MFS image too large" > + exit 1 > +fi > > # Dump the mfs image into the mfs section > dd if=$2 ibs=8192 of=$1 obs=${sec_start} oseek=1 conv=notrunc 2> /dev/null && \ > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Nov 2 23:03:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1D2710DE537; Fri, 2 Nov 2018 23:03:41 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5241B83634; Fri, 2 Nov 2018 23:03:41 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33F7711613; Fri, 2 Nov 2018 23:03:41 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA2N3fgq022910; Fri, 2 Nov 2018 23:03:41 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2N3fg0022909; Fri, 2 Nov 2018 23:03:41 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201811022303.wA2N3fg0022909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 2 Nov 2018 23:03:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340091 - head/contrib/one-true-awk X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/contrib/one-true-awk X-SVN-Commit-Revision: 340091 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 23:03:41 -0000 Author: dteske Date: Fri Nov 2 23:03:40 2018 New Revision: 340091 URL: https://svnweb.freebsd.org/changeset/base/340091 Log: Update awk(1) manual to state an exception to egrep(1)-like RE syntax Reviewed by: imp, jmg MFC after: 3 days Sponsored by: Smule, Inc. Differential Revision: https://reviews.freebsd.org/D17739 Modified: head/contrib/one-true-awk/awk.1 Modified: head/contrib/one-true-awk/awk.1 ============================================================================== --- head/contrib/one-true-awk/awk.1 Fri Nov 2 22:50:13 2018 (r340090) +++ head/contrib/one-true-awk/awk.1 Fri Nov 2 23:03:40 2018 (r340091) @@ -352,9 +352,13 @@ Patterns are arbitrary Boolean combinations of regular expressions and relational expressions. Regular expressions are as in -.IR egrep ; -see -.IR grep (1). +.IR egrep (1) +except numeric quantifiers are not supported beyond the basic +.B + +and +.B ? +for quantities \&\f(CW"0 or 1"\fP and \&\f(CW"1 or more"\fP +respectively. Isolated regular expressions in a pattern apply to the entire line. Regular expressions may also occur in From owner-svn-src-head@freebsd.org Sat Nov 3 00:37:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E5C510E0D67; Sat, 3 Nov 2018 00:37:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3546586C2A; Sat, 3 Nov 2018 00:37:52 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12F78124C0; Sat, 3 Nov 2018 00:37:52 +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 wA30bp2k070787; Sat, 3 Nov 2018 00:37:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA30bpaJ070785; Sat, 3 Nov 2018 00:37:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811030037.wA30bpaJ070785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 3 Nov 2018 00:37:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340092 - head/sys/dev/ahci X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/ahci X-SVN-Commit-Revision: 340092 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 00:37:52 -0000 Author: imp Date: Sat Nov 3 00:37:51 2018 New Revision: 340092 URL: https://svnweb.freebsd.org/changeset/base/340092 Log: Implement ability to turn on/off PHYs for AHCI devices. As part of Chuck's work on fixing kernel crashes caused by disk I/O errors, it is useful to be able to trigger various kinds of errors. This patch allows causing an AHCI-attached disk to disappear, by having the driver keep the PHY disabled when the driver would otherwise enable the PHY. It also allows making the disk reappear by having the driver go back to setting the PHY enable/disable state as it normal would and simulating the hardware event that causes a bus rescan. Submitted by: Chuck Silvers Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D16043 Modified: head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci.h Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Fri Nov 2 23:03:40 2018 (r340091) +++ head/sys/dev/ahci/ahci.c Sat Nov 3 00:37:51 2018 (r340092) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -80,6 +81,8 @@ static void ahci_stop(struct ahci_channel *ch); static void ahci_clo(struct ahci_channel *ch); static void ahci_start_fr(struct ahci_channel *ch); static void ahci_stop_fr(struct ahci_channel *ch); +static int ahci_phy_check_events(struct ahci_channel *ch, u_int32_t serr); +static uint32_t ahci_ch_detval(struct ahci_channel *ch, uint32_t val); static int ahci_sata_connect(struct ahci_channel *ch); static int ahci_sata_phy_reset(struct ahci_channel *ch); @@ -100,6 +103,13 @@ static MALLOC_DEFINE(M_AHCI, "AHCI driver", "AHCI driv #define RECOVERY_REQUEST_SENSE 2 #define recovery_slot spriv_field1 +static uint32_t +ahci_ch_detval(struct ahci_channel *ch, uint32_t val) +{ + + return ch->disablephy ? ATA_SC_DET_DISABLE : val; +} + int ahci_ctlr_setup(device_t dev) { @@ -665,11 +675,38 @@ ahci_ch_probe(device_t dev) } static int +ahci_ch_disablephy_proc(SYSCTL_HANDLER_ARGS) +{ + struct ahci_channel *ch; + int error, value; + + ch = arg1; + value = ch->disablephy; + error = sysctl_handle_int(oidp, &value, 0, req); + if (error != 0 || req->newptr == NULL || (value != 0 && value != 1)) + return (error); + + mtx_lock(&ch->mtx); + ch->disablephy = value; + if (value) { + ahci_ch_deinit(ch->dev); + } else { + ahci_ch_init(ch->dev); + ahci_phy_check_events(ch, ATA_SE_PHY_CHANGED | ATA_SE_EXCHANGED); + } + mtx_unlock(&ch->mtx); + + return (0); +} + +static int ahci_ch_attach(device_t dev) { struct ahci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ahci_channel *ch = device_get_softc(dev); struct cam_devq *devq; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; int rid, error, i, sata_rev = 0; u_int32_t version; @@ -787,6 +824,11 @@ ahci_ch_attach(device_t dev) ahci_ch_pm, ch); } mtx_unlock(&ch->mtx); + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "disable_phy", + CTLFLAG_RW | CTLTYPE_UINT, ch, 0, ahci_ch_disablephy_proc, "IU", + "Disable PHY"); return (0); err3: @@ -2497,7 +2539,7 @@ static int ahci_sata_phy_reset(struct ahci_channel *ch) { int sata_rev; - uint32_t val; + uint32_t val, detval; if (ch->listening) { val = ATA_INL(ch->r_mem, AHCI_P_CMD); @@ -2514,12 +2556,14 @@ ahci_sata_phy_reset(struct ahci_channel *ch) val = ATA_SC_SPD_SPEED_GEN3; else val = 0; + detval = ahci_ch_detval(ch, ATA_SC_DET_RESET); ATA_OUTL(ch->r_mem, AHCI_P_SCTL, - ATA_SC_DET_RESET | val | + detval | val | ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER); DELAY(1000); + detval = ahci_ch_detval(ch, ATA_SC_DET_IDLE); ATA_OUTL(ch->r_mem, AHCI_P_SCTL, - ATA_SC_DET_IDLE | val | ((ch->pm_level > 0) ? 0 : + detval | val | ((ch->pm_level > 0) ? 0 : (ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER))); if (!ahci_sata_connect(ch)) { if (ch->caps & AHCI_CAP_SSS) { Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Fri Nov 2 23:03:40 2018 (r340091) +++ head/sys/dev/ahci/ahci.h Sat Nov 3 00:37:51 2018 (r340092) @@ -461,6 +461,8 @@ struct ahci_channel { struct mtx_padalign mtx; /* state lock */ STAILQ_HEAD(, ccb_hdr) doneq; /* queue of completed CCBs */ int batch; /* doneq is in use */ + + int disablephy; /* keep PHY disabled */ }; struct ahci_enclosure { From owner-svn-src-head@freebsd.org Sat Nov 3 00:47:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89E5210E120B; Sat, 3 Nov 2018 00:47:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F0658718E; Sat, 3 Nov 2018 00:47:03 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2028012653; Sat, 3 Nov 2018 00:47:03 +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 wA30l3la075735; Sat, 3 Nov 2018 00:47:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA30l3aj075734; Sat, 3 Nov 2018 00:47:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811030047.wA30l3aj075734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 3 Nov 2018 00:47:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340093 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 340093 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 00:47:03 -0000 Author: imp Date: Sat Nov 3 00:47:02 2018 New Revision: 340093 URL: https://svnweb.freebsd.org/changeset/base/340093 Log: Document disbale_phy in ahcich sysctls. Modified: head/share/man/man4/ahci.4 Modified: head/share/man/man4/ahci.4 ============================================================================== --- head/share/man/man4/ahci.4 Sat Nov 3 00:37:51 2018 (r340092) +++ head/share/man/man4/ahci.4 Sat Nov 3 00:47:02 2018 (r340093) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 22, 2013 +.Dd November 2, 2018 .Dt AHCI 4 .Os .Sh NAME @@ -162,6 +162,13 @@ fault LED device nodes .It Pa /dev/led/ahci*.*.locate locate LED device nodes .El +.Sh SYSCTL +.Bl -tag +.It Pa dev.ahcich.X.disable_phy +Set to 1 to disable the phy for the drive on channel X. +Set to 0 to enable the phy. +Useful for turning off troublemakers. +Also useful for debugging when you need the ada drive to come and go. .Sh SEE ALSO .Xr ada 4 , .Xr ata 4 , From owner-svn-src-head@freebsd.org Sat Nov 3 00:51:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30DC610E14BD for ; Sat, 3 Nov 2018 00:51:38 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic302-4.consmr.mail.bf2.yahoo.com (sonic302-4.consmr.mail.bf2.yahoo.com [74.6.135.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B788A8743F for ; Sat, 3 Nov 2018 00:51:37 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: S16Cc_4VM1l9t45Na5OJehDPNEtSSo4oRi2jct77ur7heZCMXCTX4ryfX68NIgR ziVZJZvejmrQnfCO7vCmTg4AWJVVw2fRuFl9s7f0.v6AmTEEtOIE36BabeJjUlaJTjIVG5jpGn36 wzkkwCLJtapaN8Gu5ZjPyq5I44698Ahbqfa_LDdMoFxRjcdSNQ1Kyy.9FnxZiyrk_Mt9c25g3zpy zkPrDQlyg1DxYSby0kGOhdKY9nRV_vemD8liUCy_a4nbgYPBgekRROh0fLTJecLW6G0NO6b8A9s3 MhA1DjMzalIR3tl3i9awUn1WKwbkqVgyX90_Yk.gN754lnH4UztVvF7GbcEarH_H31.Fy1h6n0AX WmvyRCTn_wBgFiLbVvwVARiH5cJIOfZJq1ooO8ibHpOLea4MarhrsAxofCXScbn0TRUK_WKu5sE5 _rMxGmlq07NxPiXuXbrrmRvsSSn_mNkyxsgSjmL1x1MvX7AYOfb.V26rLaNEIcPM2E4Scm68LEZ5 90WlnLcDH4DYD.9PVClDuySrFyJ3Y4KOTDtjs7VCNY9vtqUWF0xafRBNzCikAi9TTJ7fDTT9Gf3k UiJRwMmH.NLB_Mpdih_rMen4a8ntZjkqBc5jKpGUMSROhJo01PWcmZUXOPdlxwqsEEYwK41ZrIRM e2AScKh3ug35h2lZ0cSx6lFTjCgLBQOS3IPJtRZ06TGRH.MzmVKjNyEkSOSLA7Dgy6_MbhrTb0_P 7lDO214ZYOOeKjiIH0gV.RWfeJTaA_rOwmDMPdHYRxQ6eADJg1HyOYO82yNYwqUQb3bIG.S1a3Qz 7xv_VQU8RgkWViBLAWRIsD8kg5cCC7G17uj6LvfLjHRFhUQFIkOr0ODIpanKdORJlRSa7c8yC55J WX6AO1El8sKZVT.DuXIJAAuc2gOWeazcgwAShqBJs.FK2CF46ymKxxeYLOZQbySQKUE3.IF8jZcz YIG.NszBu1ozljvEdTto9bZyeWLzF.SbSQFTrjfLteBguM2iLWl6slFgQIJ3F60wgtNlSwa1ULCX PCavOOBy_A7nxctfYi07Y432ypZYZNsV.E3xwpYxX.EH6As93NsoT Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.bf2.yahoo.com with HTTP; Sat, 3 Nov 2018 00:51:31 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp423.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 4c548923b972ede9b83991f98bd938f4; Sat, 03 Nov 2018 00:51:28 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r339876 - head/libexec/rtld-elf From: Mark Millard In-Reply-To: <20181102185014.GP5335@kib.kiev.ua> Date: Fri, 2 Nov 2018 17:51:25 -0700 Cc: svn-src-head@freebsd.org, Alexander Richardson Content-Transfer-Encoding: quoted-printable Message-Id: <34554290-D26E-4FED-A598-4FB3E313EA92@yahoo.com> References: <8E5A5F3A-F1A7-4702-A2F7-65D74CC5B2E5@yahoo.com> <20181102004101.GI5335@kib.kiev.ua> <003A49D7-6E8B-4775-A70B-E0EB44505D4B@yahoo.com> <20181102113827.GM5335@kib.kiev.ua> <7B29A4C8-228D-41CB-B594-98DFA456E9C8@yahoo.com> <20181102155234.GN5335@kib.kiev.ua> <20181102185014.GP5335@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 00:51:38 -0000 On 2018-Nov-2, at 11:50 AM, Konstantin Belousov = wrote: > On Fri, Nov 02, 2018 at 10:38:08AM -0700, Mark Millard wrote: >> . . . >=20 > There seems to be an issue with the direct execution mode on ppc. > Even otherwise working ld-elf.so.1 segfaults if I try to use it as > standalone binary. >=20 > But if I specify patched ld-elf.so.1 as the interpreter for some = program, > using 'cc -Wl,-I,/ld-elf.so.1' it works. So I see there two = bugs, > one is regression due to textsize calculation, which should be fixed = by > my patch. Another is the direct exec problem. My head -r339076 based powerpc64 and armv7 contexts also fail for: # /libexec/ld-elf.so.1 /bin/ls The armv7 (a Cortext-A7 context) is interestingly different in how it fails: # /libexec/ld-elf.so.1 /bin/ls ld-elf.so.1: /bin/ls: mmap of entire address space failed: Cannot = allocate memory My aarch64 context (a Cortext-A53 context) had no problem. (All 3 examples are without any of the the recent updates or patches to ld-elf.so.1 source code.) =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Sat Nov 3 01:44:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D54910E80E2; Sat, 3 Nov 2018 01:44:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 005606BA45; Sat, 3 Nov 2018 01:44:38 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6E3A13322; Sat, 3 Nov 2018 01:44:37 +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 wA31ibdL006012; Sat, 3 Nov 2018 01:44:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA31ibpx006011; Sat, 3 Nov 2018 01:44:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811030144.wA31ibpx006011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 3 Nov 2018 01:44:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340094 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 340094 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 01:44:38 -0000 Author: imp Date: Sat Nov 3 01:44:37 2018 New Revision: 340094 URL: https://svnweb.freebsd.org/changeset/base/340094 Log: Add missing .El Modified: head/share/man/man4/ahci.4 Modified: head/share/man/man4/ahci.4 ============================================================================== --- head/share/man/man4/ahci.4 Sat Nov 3 00:47:02 2018 (r340093) +++ head/share/man/man4/ahci.4 Sat Nov 3 01:44:37 2018 (r340094) @@ -169,6 +169,7 @@ Set to 1 to disable the phy for the drive on channel X Set to 0 to enable the phy. Useful for turning off troublemakers. Also useful for debugging when you need the ada drive to come and go. +.El .Sh SEE ALSO .Xr ada 4 , .Xr ata 4 , From owner-svn-src-head@freebsd.org Sat Nov 3 01:53:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A83E10E8602; Sat, 3 Nov 2018 01:53:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00FF06BEC1; Sat, 3 Nov 2018 01:53:27 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D61D113518; Sat, 3 Nov 2018 01:53:26 +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 wA31rQm8011160; Sat, 3 Nov 2018 01:53:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA31rQk0011159; Sat, 3 Nov 2018 01:53:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811030153.wA31rQk0011159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 3 Nov 2018 01:53:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340095 - head/tools/test/sort/bigtest X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/test/sort/bigtest X-SVN-Commit-Revision: 340095 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 01:53:27 -0000 Author: emaste Date: Sat Nov 3 01:53:26 2018 New Revision: 340095 URL: https://svnweb.freebsd.org/changeset/base/340095 Log: Remove apparently unused 0-byte files that cause grief on Windows r235274 added a sort regression test (it operates by comparing output against GNU sort). The commit included a number of 0-byte files, one of which ends in a trailing . which reportedly breaks svn/git checkouts on Windows. It appears these were added accidentally, so just remove them. PR: 232479 MFC after: 1 month Deleted: head/tools/test/sort/bigtest/q-1.022.tgz head/tools/test/sort/bigtest/q-1.024.003. head/tools/test/sort/bigtest/q-1.024.003.tgz head/tools/test/sort/bigtest/q-1.024.009.tgz head/tools/test/sort/bigtest/q-1.024.07.tgz head/tools/test/sort/bigtest/q-1.024.tgz head/tools/test/sort/bigtest/q-1.23.1.tgz head/tools/test/sort/bigtest/q-1.23.tgz From owner-svn-src-head@freebsd.org Sat Nov 3 03:10:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00AC910EB486; Sat, 3 Nov 2018 03:10:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7FA46EB16; Sat, 3 Nov 2018 03:10:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 899941421C; Sat, 3 Nov 2018 03:10:06 +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 wA33A65j047961; Sat, 3 Nov 2018 03:10:06 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA33A6Jl047960; Sat, 3 Nov 2018 03:10:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201811030310.wA33A6Jl047960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 3 Nov 2018 03:10:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340096 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 340096 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 03:10:07 -0000 Author: mav Date: Sat Nov 3 03:10:06 2018 New Revision: 340096 URL: https://svnweb.freebsd.org/changeset/base/340096 Log: 9952 Block size change during zfs receive drops spill block Replication code in receive_object() falsely assumes that if received object block size is different from local, then it must be a new object and calls dmu_object_reclaim() to wipe it out. In most cases it is not a problem, since all dnode, bonus buffer and data block(s) are immediately rewritten any way, but the problem is that spill block (if used) is not. This means loss of ACLs, extended attributes, etc. This issue can be triggered in very simple way: 1. create 4KB file with 10+ ACL entries; 2. take snapshot and send it to different dataset; 3. append another 4KB to the file; 4. take another snapshot and send incrementally; 5. witness ACL loss on receive side. PR: 198457 Discussed with: mahrens MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Nov 3 01:53:26 2018 (r340095) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Nov 3 03:10:06 2018 (r340096) @@ -2143,6 +2143,7 @@ receive_object(struct receive_writer_arg *rwa, struct { dmu_object_info_t doi; dmu_tx_t *tx; + dmu_buf_t *db; uint64_t object; int err; @@ -2190,12 +2191,14 @@ receive_object(struct receive_writer_arg *rwa, struct tx = dmu_tx_create(rwa->os); dmu_tx_hold_bonus(tx, object); + dmu_tx_hold_write(tx, object, 0, 0); err = dmu_tx_assign(tx, TXG_WAIT); if (err != 0) { dmu_tx_abort(tx); return (err); } + db = NULL; if (object == DMU_NEW_OBJECT) { /* currently free, want to be allocated */ err = dmu_object_claim_dnsize(rwa->os, drro->drr_object, @@ -2203,15 +2206,33 @@ receive_object(struct receive_writer_arg *rwa, struct drro->drr_bonustype, drro->drr_bonuslen, drro->drr_dn_slots << DNODE_SHIFT, tx); } else if (drro->drr_type != doi.doi_type || - drro->drr_blksz != doi.doi_data_block_size || - drro->drr_bonustype != doi.doi_bonus_type || - drro->drr_bonuslen != doi.doi_bonus_size) { + (drro->drr_blksz != doi.doi_data_block_size && + doi.doi_max_offset > doi.doi_data_block_size)) { /* currently allocated, but with different properties */ err = dmu_object_reclaim(rwa->os, drro->drr_object, drro->drr_type, drro->drr_blksz, drro->drr_bonustype, drro->drr_bonuslen, tx); + } else { + /* + * Currently allocated, but with slightly different properties, + * that may change live, like block size or bonus buffer. + * Change those specifically to not loose the spill block, etc. + */ + if (drro->drr_bonustype != doi.doi_bonus_type || + drro->drr_bonuslen != doi.doi_bonus_size) + VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, + &db)); + if (drro->drr_bonustype != doi.doi_bonus_type) + VERIFY0(dmu_set_bonustype(db, drro->drr_bonustype, tx)); + if (drro->drr_bonuslen != doi.doi_bonus_size) + VERIFY0(dmu_set_bonus(db, drro->drr_bonuslen, tx)); + if (drro->drr_blksz != doi.doi_data_block_size) + err = dmu_object_set_blocksize(rwa->os, drro->drr_object, + drro->drr_blksz, 0, tx); } if (err != 0) { + if (db != NULL) + dmu_buf_rele(db, FTAG); dmu_tx_commit(tx); return (SET_ERROR(EINVAL)); } @@ -2222,9 +2243,9 @@ receive_object(struct receive_writer_arg *rwa, struct drro->drr_compress, tx); if (data != NULL) { - dmu_buf_t *db; - - VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, &db)); + if (db == NULL) + VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, + &db)); dmu_buf_will_dirty(db, tx); ASSERT3U(db->db_size, >=, drro->drr_bonuslen); @@ -2235,8 +2256,9 @@ receive_object(struct receive_writer_arg *rwa, struct dmu_ot_byteswap[byteswap].ob_func(db->db_data, drro->drr_bonuslen); } - dmu_buf_rele(db, FTAG); } + if (db != NULL) + dmu_buf_rele(db, FTAG); dmu_tx_commit(tx); return (0); From owner-svn-src-head@freebsd.org Sat Nov 3 03:43:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5B8310EC935; Sat, 3 Nov 2018 03:43:33 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8AFB36FE20; Sat, 3 Nov 2018 03:43:33 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50F1714904; Sat, 3 Nov 2018 03:43:33 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA33hX0W067834; Sat, 3 Nov 2018 03:43:33 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA33hXRD067832; Sat, 3 Nov 2018 03:43:33 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201811030343.wA33hXRD067832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 3 Nov 2018 03:43:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340097 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 340097 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 03:43:34 -0000 Author: mmacy Date: Sat Nov 3 03:43:32 2018 New Revision: 340097 URL: https://svnweb.freebsd.org/changeset/base/340097 Log: Convert epoch to read / write records per cpu In discussing D17503 "Run epoch calls sooner and more reliably" with sbahra@ we came to the conclusion that epoch is currently misusing the ck_epoch API. It isn't safe to do a "write side" operation (ck_epoch_call or ck_epoch_poll) in the middle of a "read side" section. Since, by definition, it's possible to be preempted during the middle of an EPOCH_PREEMPT epoch the GC task might call ck_epoch_poll or another thread might call ck_epoch_call on the same section. The right solution is ultimately to change the way that ck_epoch works for this use case. However, as a stopgap for 12 we agreed to simply have separate records for each use case. Tested by: pho@ MFC after: 3 days Modified: head/sys/kern/subr_epoch.c head/sys/sys/epoch_private.h Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Sat Nov 3 03:10:06 2018 (r340096) +++ head/sys/kern/subr_epoch.c Sat Nov 3 03:43:32 2018 (r340097) @@ -150,7 +150,8 @@ epoch_ctor(epoch_t epoch) CPU_FOREACH(cpu) { er = zpcpu_get_cpu(epoch->e_pcpu_record, cpu); bzero(er, sizeof(*er)); - ck_epoch_register(&epoch->e_epoch, &er->er_record, NULL); + ck_epoch_register(&epoch->e_epoch, &er->er_read_record, NULL); + ck_epoch_register(&epoch->e_epoch, &er->er_write_record, NULL); TAILQ_INIT((struct threadlist *)(uintptr_t)&er->er_tdlist); er->er_cpuid = cpu; } @@ -235,7 +236,7 @@ epoch_block_handler_preempt(struct ck_epoch *global __ int spincount, gen; int locksheld __unused; - record = __containerof(cr, struct epoch_record, er_record); + record = __containerof(cr, struct epoch_record, er_read_record); td = curthread; locksheld = td->td_locks; spincount = 0; @@ -461,7 +462,7 @@ epoch_call(epoch_t epoch, epoch_context_t ctx, void (* critical_enter(); *DPCPU_PTR(epoch_cb_count) += 1; er = epoch_currecord(epoch); - ck_epoch_call(&er->er_record, cb, (ck_epoch_cb_t *)callback); + ck_epoch_call(&er->er_write_record, cb, (ck_epoch_cb_t *)callback); critical_exit(); return; boottime: @@ -485,7 +486,7 @@ epoch_call_task(void *arg __unused) if (__predict_false((epoch = allepochs[i]) == NULL)) continue; er = epoch_currecord(epoch); - record = &er->er_record; + record = &er->er_write_record; if ((npending = record->n_pending) == 0) continue; ck_epoch_poll_deferred(record, &cb_stack); Modified: head/sys/sys/epoch_private.h ============================================================================== --- head/sys/sys/epoch_private.h Sat Nov 3 03:10:06 2018 (r340096) +++ head/sys/sys/epoch_private.h Sat Nov 3 03:43:32 2018 (r340097) @@ -89,7 +89,8 @@ typedef struct epoch_thread { TAILQ_HEAD (epoch_tdlist, epoch_thread); typedef struct epoch_record { - ck_epoch_record_t er_record; + ck_epoch_record_t er_read_record; + ck_epoch_record_t er_write_record; volatile struct epoch_tdlist er_tdlist; volatile uint32_t er_gen; uint32_t er_cpuid; @@ -138,7 +139,7 @@ epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et) td->td_pre_epoch_prio = td->td_priority; er = epoch_currecord(epoch); TAILQ_INSERT_TAIL(&er->er_tdlist, etd, et_link); - ck_epoch_begin(&er->er_record, (ck_epoch_section_t *)&etd->et_section); + ck_epoch_begin(&er->er_read_record, (ck_epoch_section_t *)&etd->et_section); critical_exit_sa(td); } @@ -155,7 +156,7 @@ epoch_enter(epoch_t epoch) td->td_epochnest++; critical_enter_sa(td); er = epoch_currecord(epoch); - ck_epoch_begin(&er->er_record, NULL); + ck_epoch_begin(&er->er_read_record, NULL); } static __inline void @@ -183,7 +184,7 @@ epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et) etd->et_magic_post = 0; #endif etd->et_td = (void*)0xDEADBEEF; - ck_epoch_end(&er->er_record, + ck_epoch_end(&er->er_read_record, (ck_epoch_section_t *)&etd->et_section); TAILQ_REMOVE(&er->er_tdlist, etd, et_link); er->er_gen++; @@ -203,7 +204,7 @@ epoch_exit(epoch_t epoch) MPASS(td->td_epochnest); td->td_epochnest--; er = epoch_currecord(epoch); - ck_epoch_end(&er->er_record, NULL); + ck_epoch_end(&er->er_read_record, NULL); critical_exit_sa(td); } #endif /* _KERNEL */ From owner-svn-src-head@freebsd.org Sat Nov 3 12:15:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAC8310FC4C3; Sat, 3 Nov 2018 12:15:53 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [IPv6:2a01:4f8:191:217b::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mail.bsd4all.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8707B7FF0A; Sat, 3 Nov 2018 12:15:53 +0000 (UTC) (envelope-from herbert@gojira.at) Date: Sat, 03 Nov 2018 13:15:50 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail201809; t=1541247350; bh=9rddYZWvjUiSzIjTiPNC/98NLflY+w+nhddpIzccX8w=; h=Date:Message-ID:From:To:Subject:MIME-Version:Content-Type:from:to: subject:date:content-type:mime-version:message-id; b=oNAO8NI/dLXjod3J+ts48kPqd/53Raw8v0qLDJZ1hRvLucOtRqU3h1nVS56onCvsu iCkiVtLuHaPeNejeJ7GwXFngwiV0Y5fem8lXWHugURwFscd4U2VedmXr0rYCeyI62P 9DAaWPY+Iex6scVtkMAf0uA8Ifz8caoq/jXOwdpPntGiRoZFaXPIDRGaab6tGXBGfo 8PQVGStGPYEC0OFoDuxOzfHerXYWbhM5ABZXtdewOUZv8LSeAhCvERlmhoBipQ7/W8 cxAUHNt5KYVYw409QV8aSUC9RJz5qBf1TGT3CBFzHCwT6NkS87bMWCGtx7EHwSyhk4 1/sAw/IF8l8Ag== Message-ID: <877ehu2w7d.wl-herbert@gojira.at> From: "Herbert J. Skuhra" To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339388 - head/sys/dev/usb/controller In-Reply-To: <201810161847.w9GIlD7k068441@repo.freebsd.org> References: <201810161847.w9GIlD7k068441@repo.freebsd.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/27.0 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 12:15:54 -0000 On Tue, 16 Oct 2018 20:47:13 +0200, Hans Petter Selasky wrote: > > Author: hselasky > Date: Tue Oct 16 18:47:13 2018 > New Revision: 339388 > URL: https://svnweb.freebsd.org/changeset/base/339388 > > Log: > Fix for reception of large full speed isochronous frames via the transaction > translator, when using the DWC OTG USB controller driver. Make sure to re-try > getting the complete split packets until a DATA0 packet is received. Larger > isochronous frames may be split into multiple MDATA packets terminated > by a single DATA0 packet. > > PR: 230434 > MFC after: 3 days > Approved by: re (gjb) > Sponsored by: Mellanox Technologies > > Modified: > head/sys/dev/usb/controller/dwc_otg.c Hei, I use a Sound Blaster Play 2 USB soundcard on a Raspberry Pi 2 and a Raspberry Pi 3 to listen to internet radio streams (e.g. NRK, SR, BBC, etc.). After this commit audio quality is deteriorated (strange noises). I've tried mpg123 and moc. -- Herbert From owner-svn-src-head@freebsd.org Sat Nov 3 12:52:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11FB110FD0CD; Sat, 3 Nov 2018 12:52:36 +0000 (UTC) (envelope-from ml@vishwin.info) Received: from varun.vishwin.info (varun.vishwin.info [46.101.93.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "varun.vishwin.info", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29E2D81186; Sat, 3 Nov 2018 12:52:35 +0000 (UTC) (envelope-from ml@vishwin.info) Received: from varun.vishwin.info (fd35:9eae:7575::2 [IPv6:fd35:9eae:7575::2]) by varun.vishwin.info (OpenSMTPD) with ESMTP id 2e4c757f; Sat, 3 Nov 2018 08:52:25 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=vishwin.info; h=subject :to:cc:references:from:message-id:date:mime-version:in-reply-to :content-type; s=fuccboi12; bh=mwq4fvqbYQJFwZ8nnwNk2PUU6aCuGX1k3 dCj4+fN0f4=; b=qh45drA6mwkKVdUQDEHon0AphrDgyWkXo2m6LkWPJX5PMAbkP /DT0vabXmg4tB2m8FdIvAnI+EpNU7C70lI5jpRkrSvIhMHFQuFJKrqJErGp4Zk2H DXE/qIf/jrR48GXjuBsecKHxlP1rraJHl8JpGJo8ENtm1r9VM+A+AAKdxYt+PEC8 dorPyRGWRK3/YYp3Ra7LES9b8ap3kfNGINdJOLfcE2iV4G9xpLn4AMtLXKshWmK0 ZJfWGVVJOJubm0ofAvRzewJ5pAyKiMCCnU5gPHrtENKhy6QG8dDL8LuxMqu/mSAn 7gasnnoB8HA5jUIYhqTQFVWrZYwxCpXp0WemA== Received: from [IPv6:2600:1002:b023:fe03:2815:7eff:fe80:5264] (2600:1002:b023:fe03:2815:7eff:fe80:5264 [IPv6:2600:1002:b023:fe03:2815:7eff:fe80:5264]) by varun.vishwin.info (OpenSMTPD) with ESMTPSA id e857e33e TLS version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO; Sat, 3 Nov 2018 08:52:24 -0400 (EDT) Subject: Re: svn commit: r339898 - head/lib/libc/amd64/sys To: Brooks Davis Cc: svn-src-head@freebsd.org, toolchain@freebsd.org, Konstantin Belousov , current@freebsd.org References: <201810300011.w9U0BUui038857@repo.freebsd.org> <20181101160406.GA60233__23941.7825396687$1541088368$gmane$org@spindle.one-eyed-alien.net> From: Charlie Li Openpgp: preference=signencrypt Autocrypt: addr=ml@vishwin.info; keydata= xsFNBFt7iHUBEADCorTixbMGuHd9WYSKCELlv/TFcRtvpHUw/n9LtXzKixUUwl7iuMFMYTz3 QXePX0Twq4jCQYySfcxWbPkLsSYlPOkaGQ+XytfmIHoqG5ba4i1fp+F41is0oCtLt1+oL84j NKUd13em/JWd+PJeQbSTVnHbT2yaAi7vqWw5WKVaMExjfPGU5TArV46wSRU6Zuy1ZX66q0q5 dPzeBdeKYWJE8aGtyi3pYUpKUOX4gxiNetf6leDFZ4OsexWaRdU0n8fId5d1qwjAE3lOwV5z 0Ilt8t4iXtX3JL3DAQyLZIeXHIg9O3rrpPMXQWSp2/5g39PohNk7farbhcpIKxuDN+L5N6U9 OxNHBSCv9FGDO4R/mw3YwJCovDzsF7RSyXQDIY36yjdh2uTLZ0uD5Ci/DPmJUySFLRvpqWnQ M7V5cYhdqDfcElGpRbi8JZQVYRJjvI5Jj0byG98KeaD0YFxKqmmm+Oh+xWXE7xt/DsBoZeZJ BFP84LvFbwQqprvI+sg+1z2+JIgNbYwl8VaYzfyGnqTEXTOsQYEKTdKA9MODSAsN31MlQICe CIHZV+OwOqH1KQ/mZp59AnpXAmj4T94bnahE9yJtVW/qglX/nTeFNUdu5MyEgkeB0x7mx+t0 3hE20yp/NbyvG1T/o53NHwHiURC/8Fxd1NWPZ6n4X8npQn6iyQARAQABzSFDaGFybGllIExp IDx2aXNod2luQHZpc2h3aW4uaW5mbz7CwZEEEwEIADsCGyMFCwkIBwIGFQoJCAsCBBYCAwEC HgECF4AWIQT/f8Kqvlr7jU9sRv6OcHje8gOrbAUCW3uI+wIZAQAKCRCOcHje8gOrbNX8EACT HGo3AsShFj+AaUgD9V6wTMaR2w7ubIqbkn2ZqZZ1xWj3gM6VYRKHflj9LiYqFRO4wBteAq30 Snz6F93IG+u5B1uwlC58HDwCQaROaU5cHQ8UvGPSEv0XXCcYTaC3d5NMoIh/LdutVZz56LTx hWs5NHUCaG6FfGV9QplECRteQr2rMxHZxZ3ppSY9oev/wY3U3VRUGnhM2ZwGrpmjksC1HTBH Fw2XbYdVNCOYjQrTIulaYb3y0ssgsOhvSk9bPHSTsWSCQGJk0uFNXTvIq68GhkhOwAet6//w R2y1whg47r554pBManttODaQnmWmIWBM0bZMJrlNT8T/oXlG9nA0jrjA8LvTThrCAvMSMB0F 2FhStd/I2/Fs7T6Uk1BUpgCvFiDtE8Jt1W2yq2GLtPysGrJXyDaat8IuVUthnNVhoyZb9tZu sI/FFhfh9MkPmZDwCoTUJN2yU8QhxS1iJXfMZ1f06r1TYY9rwb8E/WCBJFbMzJs3VLj/TnHL N09J2zNZgTs7gewLn/2lEV1kOL/FxIDgN7ailcf3kcNdVUxr/pLbx3NZcDkXniPO0dzQpuRw q841wBT3uqdPFJwIl4pf1EYhLj89r2vOGnM2RChl1/t+wSqHhBji3R3uylzE0qbr8O/cgx/5 wlvZJiUhyu0hJ/JoJkF8WEFkesJrTZORGc7BTQRbe4h1ARAA12Xtgcbwk7IdsRi/7sTFKs73 qoFFq+DUWwMbSuIOaWw5J9nZ+ovr9gkXlax+xf335hJ0iItB8LhA7D9wD4wjrmmBjhwK7jYv tghb8BH6MHWEWD5D9xt47CO4o8Vi1m/F4OlKxoDqIhH6n63gNeSNaXzqDpZoUsL62KX+sKKU Udj/X/oz3XwXWCb/rEIgAMMW7QFcuQBJzkHgu69oUSIki4j1mhAMiBbGexfS1dcTfpLAr9eu jDNHOw5r7aI4cA8q7us8YfDLby87hPlSrtTKcxkbawrdFNs6KNrEvggkXhYxGqm4Z0FInixa avloimBf1q7kvVM0AAgsmkdeeS/6Tzbn71WBuEW0VgEcSSBS1dv7DfgmeQeiSmv0Dvx2lZv5 P6M4Q/plSAz7hVXL6EIKltwJUjY8Re7zDbPf7jJlbEgWbLxRhlGh5MwrNXbMt6KygDRcDyOP njxg0+ICXbQyPKiq7jZY2/Q/x8P08xNx8sUKPY+XE6G5QVohQfe3LT9s15KM+1Ur4v3Hhbft HtTW1iT60HkyU9qRCJJC11OgH7wrfiucG3/eQKgBgvsfKDD36rJmsQpkO0/kkp6R+CzLby3X PrrFYJTCr08e5QWKKPdyNvAhuyQj27Lb7EhNxe3hmpV+llx0aaN9t1M+QZ88famMOgIlp7Nh 1uFr/c5WGZUAEQEAAcLBdgQYAQgAIBYhBP9/wqq+WvuNT2xG/o5weN7yA6tsBQJbe4h1AhsM AAoJEI5weN7yA6tsTGcP/2rBIvgeKismZQQn7kJOHwgmqXg/N5ArwPH3eCJmzmNZWUIlOZyl A2KtYhkzZ5G3rsL/BMmMuYRUbPJJUukaJSqFep1E6AWYPC8Seakhu1ZbK8ayBI4KZmP+3PQY S0tKyMlxX+Qt9+S/tcQqS31mMgmcVhVhKi8MrWjY+g7pF+LkBYccHuNiGNIcm8mMPHTIKU72 ARiG3DtHrRg4sf5wqgOi72277jBHdDBGw0Y7rCvMsaGm3G4GsMwj4e47H6PAFOWK7O69muvL o50oMN2rkPi+9AKPi8WcrinstleEGyEIyguRagDQjZP5gX9Xk5vkS6+xMgKt7+k7+D3jWKlW R6G9U0CyKmVJoeNqwHUdLoFD3lywjwT9vo+cqb4gQKnZsA1ss/WOvEp4EaNSR7JHFOY5X8AN QgiPxLhrbI7FPGXKw3Y7nCpcIlzFph6UL9jhNRwvoQ3GfZ0sF0JgpASdrS4N3Fmnt9L6lc3q rIrxDPpDjYwcDEUBl0sp/prjh3gdC3qs9xZ0RNWWdUqcmvRv2SDkrVDw3iQ9WhMZWuQYBmGa MViypa6WrjjlVTjqZftZyqytnHwuo1PA/qLcF/vUUn0QHFPIDx8/yTSqiw/xTwPuOFxznHjJ VbxEEG0H5rmreh1Z0WeMwsSbjC3EEf+ZI39QpFwVIG8pDwXFOClfhjFz Message-ID: Date: Sat, 3 Nov 2018 08:52:16 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="C0HnXM2VAaMMDpnpVwa7nUB9IvrMd94Ka" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 12:52:36 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --C0HnXM2VAaMMDpnpVwa7nUB9IvrMd94Ka Content-Type: multipart/mixed; boundary="U4mnKhyu4E5ivA7g9U4oz1g4zewYaeRyC"; protected-headers="v1" From: Charlie Li To: Brooks Davis Cc: svn-src-head@freebsd.org, toolchain@freebsd.org, Konstantin Belousov , current@freebsd.org Message-ID: Subject: Re: svn commit: r339898 - head/lib/libc/amd64/sys References: <201810300011.w9U0BUui038857@repo.freebsd.org> <20181101160406.GA60233__23941.7825396687$1541088368$gmane$org@spindle.one-eyed-alien.net> In-Reply-To: --U4mnKhyu4E5ivA7g9U4oz1g4zewYaeRyC Content-Type: text/plain; charset=utf-8 Content-Language: en-GB-large Content-Transfer-Encoding: quoted-printable On 01/11/2018 15:43, Charlie Li wrote: > On 01/11/2018 12:04, Brooks Davis wrote: >> Is this failure with devel/llvm70? It's currently missing the patch >> required to make this work. https://reviews.freebsd.org/D17709 contai= ns >> this patch among others. I'll see about getting it applied. >> > Yes, devel/llvm70. Will build with your port commit at my next opportun= ity. >=20 After building world and kernel r340097, kernel runs fine, but every userspace program in world crashes with Illegal instruction. They all crash in exactly the same way. Example backtrace from bmake, running from objdir (first discovered after updating a poudriere jail and attempting to even start it): Reading symbols from /usr/obj/usr/src/amd64.amd64/usr.bin/bmake/make...Reading symbols from /usr/obj/usr/src/amd64.amd64/usr.bin/bmake/make.debug...done. done. [New LWP 100097] Core was generated by `/usr/obj/usr/src/amd64.amd64/usr.bin/bmake/make --help'. Program terminated with signal SIGILL, Illegal instruction. #0 0x00000000002f5664 in _init () (gdb) bt #0 0x00000000002f5664 in _init () #1 0x00000000002290fe in _start (ap=3D, cleanup=3D) at /usr/src/lib/csu/amd64/crt1.c:66 Given the line number referenced in crt1.c, I'm guessing this condition may have existed since at least r339351. --=20 Charlie Li Can't think of a witty .sigline today=E2=80=A6 (This email address is for mailing list use only; replace local-part with vishwin for off-list communication) --U4mnKhyu4E5ivA7g9U4oz1g4zewYaeRyC-- --C0HnXM2VAaMMDpnpVwa7nUB9IvrMd94Ka Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE/3/Cqr5a+41PbEb+jnB43vIDq2wFAlvdmgcACgkQjnB43vID q2wIlxAAmPnnEBn8xQQFszrUQLehIroYFjhTrNNBc0XNrbo2vgayedxEdhZ+az6m EsFtzcKXVwCXhyrDlkk8uliZ9OzFkvZWZwSb0IoUDllSPAIn8ghqGLVkFiQPGK/3 n4E2t7oCWLSFRf/OXvEzXZcIZtDc6xzN6h3tAkORkG9rGt/+vp+MWWOLk30zixc2 7Y2iahHEdZEfJrfoZyOo6V7q6Is+pQZlhHcnhCbzixRoeubFTcu5+vwesNip7KRa QVG52zxfr3ROoct7BnwVihh/lYN2GlY/ps17VyuYw6hTACXHQKWrspLdyzeKUzjB gjrJ067Tz8+gBqpEkapYAViKdtswVS18YkB1tCvzwRl6CEqVNx42U1synjWBbmuL j+zcDp08alX89NYFDW9j9SYEqN9RxwrjWrWwYpPwK9EB+2BVrrsyl2ahc/1QPH6g eRoR0jRvC2q6PwUmaWiYQWBcYXzqXojVhwTrTtWdKkozAE3AJBLyMhwr7MNbs1p7 REIEu7rrLszskdwRoCzedRbtgj5sfBbSqZmxZV7RHOieC783NvCigSkrfZT1ovdr APafYeKMOS58WHDnvCCiQZHCGlMwnoa/Y13lFG7A6fHDdBfXGOv9/VzKqvhAKq53 t57HcActG81EAYrKVJFNUrdIecFS+C7MuXM51ujnS4WRXSTTdus= =58qI -----END PGP SIGNATURE----- --C0HnXM2VAaMMDpnpVwa7nUB9IvrMd94Ka-- From owner-svn-src-head@freebsd.org Sat Nov 3 15:29:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8E6610D4CBB; Sat, 3 Nov 2018 15:29:47 +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 44CE886474; Sat, 3 Nov 2018 15:29:47 +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 wA3FTawa052863 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 3 Nov 2018 17:29:39 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wA3FTawa052863 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wA3FTamU052862; Sat, 3 Nov 2018 17:29:36 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 3 Nov 2018 17:29:36 +0200 From: Konstantin Belousov To: Charlie Li Cc: Brooks Davis , svn-src-head@freebsd.org, toolchain@freebsd.org, Konstantin Belousov , current@freebsd.org Subject: Re: svn commit: r339898 - head/lib/libc/amd64/sys Message-ID: <20181103152936.GQ5335@kib.kiev.ua> References: <201810300011.w9U0BUui038857@repo.freebsd.org> <20181101160406.GA60233__23941.7825396687$1541088368$gmane$org@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 15:29:48 -0000 On Sat, Nov 03, 2018 at 08:52:16AM -0400, Charlie Li wrote: > On 01/11/2018 15:43, Charlie Li wrote: > > On 01/11/2018 12:04, Brooks Davis wrote: > >> Is this failure with devel/llvm70? It's currently missing the patch > >> required to make this work. https://reviews.freebsd.org/D17709 contains > >> this patch among others. I'll see about getting it applied. > >> > > Yes, devel/llvm70. Will build with your port commit at my next opportunity. > > > After building world and kernel r340097, kernel runs fine, but every > userspace program in world crashes with Illegal instruction. They all > crash in exactly the same way. Example backtrace from bmake, running > from objdir (first discovered after updating a poudriere jail and > attempting to even start it): > > Reading symbols from > /usr/obj/usr/src/amd64.amd64/usr.bin/bmake/make...Reading symbols from > /usr/obj/usr/src/amd64.amd64/usr.bin/bmake/make.debug...done. > done. > [New LWP 100097] > Core was generated by `/usr/obj/usr/src/amd64.amd64/usr.bin/bmake/make > --help'. > Program terminated with signal SIGILL, Illegal instruction. > #0 0x00000000002f5664 in _init () > (gdb) bt > #0 0x00000000002f5664 in _init () > #1 0x00000000002290fe in _start (ap=, cleanup= out>) at /usr/src/lib/csu/amd64/crt1.c:66 > > Given the line number referenced in crt1.c, I'm guessing this condition > may have existed since at least r339351. Some minimal amount of facts instead of guesses would be much more useful. What is the instruction which faulted ? Disassemble the text at 0x2f5664. Regardless of what is the instruction, show either the output from 'x86info -f' on the machine, or cpu identification lines from the _verbose_ boot dmesg. make is statically linked, do dynamically linked program fault ? From owner-svn-src-head@freebsd.org Sat Nov 3 15:50:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43A1610DB8FD for ; Sat, 3 Nov 2018 15:50:07 +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 8CE6C8706C; Sat, 3 Nov 2018 15:50:06 +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 wA3Fnuep057443 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 3 Nov 2018 17:49:59 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wA3Fnuep057443 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wA3Fntjd057442; Sat, 3 Nov 2018 17:49:55 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 3 Nov 2018 17:49:55 +0200 From: Konstantin Belousov To: Mark Millard Cc: svn-src-head@freebsd.org, Alexander Richardson Subject: Re: svn commit: r339876 - head/libexec/rtld-elf Message-ID: <20181103154955.GR5335@kib.kiev.ua> References: <8E5A5F3A-F1A7-4702-A2F7-65D74CC5B2E5@yahoo.com> <20181102004101.GI5335@kib.kiev.ua> <003A49D7-6E8B-4775-A70B-E0EB44505D4B@yahoo.com> <20181102113827.GM5335@kib.kiev.ua> <7B29A4C8-228D-41CB-B594-98DFA456E9C8@yahoo.com> <20181102155234.GN5335@kib.kiev.ua> <20181102185014.GP5335@kib.kiev.ua> <34554290-D26E-4FED-A598-4FB3E313EA92@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <34554290-D26E-4FED-A598-4FB3E313EA92@yahoo.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 15:50:07 -0000 On Fri, Nov 02, 2018 at 05:51:25PM -0700, Mark Millard wrote: > On 2018-Nov-2, at 11:50 AM, Konstantin Belousov wrote: > > > On Fri, Nov 02, 2018 at 10:38:08AM -0700, Mark Millard wrote: > >> . . . > > > > There seems to be an issue with the direct execution mode on ppc. > > Even otherwise working ld-elf.so.1 segfaults if I try to use it as > > standalone binary. > > > > But if I specify patched ld-elf.so.1 as the interpreter for some program, > > using 'cc -Wl,-I,/ld-elf.so.1' it works. So I see there two bugs, > > one is regression due to textsize calculation, which should be fixed by > > my patch. Another is the direct exec problem. > > My head -r339076 based powerpc64 and armv7 contexts also > fail for: > > # /libexec/ld-elf.so.1 /bin/ls > > The armv7 (a Cortext-A7 context) is interestingly different > in how it fails: > > # /libexec/ld-elf.so.1 /bin/ls > ld-elf.so.1: /bin/ls: mmap of entire address space failed: Cannot allocate memory Can you show the ktrace/kdump for this ? > > My aarch64 context (a Cortext-A53 context) had no problem. > > (All 3 examples are without any of the the recent updates > or patches to ld-elf.so.1 source code.) And still, does the patch for isync range works ? You can test the new ld-elf.so.1 standalone by hard-coding its path into the binary. Build e.g. only ls(1) by using make in its directory, then re-issue the linking command with the additional flag '-Wl,-I, and try to run ls.full. From owner-svn-src-head@freebsd.org Sat Nov 3 17:11:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B118210DE4DF; Sat, 3 Nov 2018 17:11:23 +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 5190F8A56B; Sat, 3 Nov 2018 17:11:23 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [178.17.145.230]) (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 D058D260344; Sat, 3 Nov 2018 18:11:20 +0100 (CET) Subject: Re: svn commit: r339388 - head/sys/dev/usb/controller To: "Herbert J. Skuhra" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810161847.w9GIlD7k068441@repo.freebsd.org> <877ehu2w7d.wl-herbert@gojira.at> From: Hans Petter Selasky Message-ID: <7682021b-d57c-71aa-c6ac-891ce2c7046a@selasky.org> Date: Sat, 3 Nov 2018 18:10:49 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.0.1 MIME-Version: 1.0 In-Reply-To: <877ehu2w7d.wl-herbert@gojira.at> 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 17:11:23 -0000 On 11/3/18 1:15 PM, Herbert J. Skuhra wrote: > On Tue, 16 Oct 2018 20:47:13 +0200, Hans Petter Selasky wrote: >> >> Author: hselasky >> Date: Tue Oct 16 18:47:13 2018 >> New Revision: 339388 >> URL: https://svnweb.freebsd.org/changeset/base/339388 >> >> Log: >> Fix for reception of large full speed isochronous frames via the transaction >> translator, when using the DWC OTG USB controller driver. Make sure to re-try >> getting the complete split packets until a DATA0 packet is received. Larger >> isochronous frames may be split into multiple MDATA packets terminated >> by a single DATA0 packet. >> >> PR: 230434 >> MFC after: 3 days >> Approved by: re (gjb) >> Sponsored by: Mellanox Technologies >> >> Modified: >> head/sys/dev/usb/controller/dwc_otg.c > > Hei, > > I use a Sound Blaster Play 2 USB soundcard on a Raspberry Pi 2 and a > Raspberry Pi 3 to listen to internet radio streams (e.g. NRK, SR, BBC, > etc.). After this commit audio quality is deteriorated (strange noises). I've > tried mpg123 and moc. > > -- > Herbert > Hi, How many channels does your audio device have? What sample rates are you using? What happens if you lower the vchanrate? dmesg ? What are the following sysctl values? dev.pcm.x.rec.vchanrate: 48000 dev.pcm.x.play.vchanrate: 48000 x is 0 or 1. --HPS From owner-svn-src-head@freebsd.org Sat Nov 3 18:03:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 956AC10E0342; Sat, 3 Nov 2018 18:03:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40E748C5FB; Sat, 3 Nov 2018 18:03:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20A8E1D304; Sat, 3 Nov 2018 18:03:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA3I3PUX010169; Sat, 3 Nov 2018 18:03:25 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA3I3OYa010166; Sat, 3 Nov 2018 18:03:24 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201811031803.wA3I3OYa010166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 3 Nov 2018 18:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340098 - in head/usr.sbin: ndp rtadvd X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head/usr.sbin: ndp rtadvd X-SVN-Commit-Revision: 340098 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 18:03:25 -0000 Author: bz Date: Sat Nov 3 18:03:24 2018 New Revision: 340098 URL: https://svnweb.freebsd.org/changeset/base/340098 Log: Update the "flag" for draft-ietf-6man-ipv6only-flag. Having the flag named "6" can possibly be a problem for configurations where parsing strings and numbers can produce ambivalent results. Rename the "6" flag to the "S"ix (or Silence-IPv4) flag. Modified: head/usr.sbin/ndp/ndp.c head/usr.sbin/rtadvd/config.c head/usr.sbin/rtadvd/rtadvd.c Modified: head/usr.sbin/ndp/ndp.c ============================================================================== --- head/usr.sbin/ndp/ndp.c Sat Nov 3 03:43:32 2018 (r340097) +++ head/usr.sbin/ndp/ndp.c Sat Nov 3 18:03:24 2018 (r340098) @@ -1097,7 +1097,7 @@ rtrlist() p->flags & ND_RA_FLAG_MANAGED ? "M" : "", p->flags & ND_RA_FLAG_OTHER ? "O" : ""); #ifdef DRAFT_IETF_6MAN_IPV6ONLY_FLAG - printf("%s", p->flags & ND_RA_FLAG_IPV6_ONLY ? "6" : ""); + printf("%s", p->flags & ND_RA_FLAG_IPV6_ONLY ? "S" : ""); #endif rtpref = ((p->flags & ND_RA_FLAG_RTPREF_MASK) >> 3) & 0xff; printf(", pref=%s", rtpref_str[rtpref]); Modified: head/usr.sbin/rtadvd/config.c ============================================================================== --- head/usr.sbin/rtadvd/config.c Sat Nov 3 03:43:32 2018 (r340097) +++ head/usr.sbin/rtadvd/config.c Sat Nov 3 18:03:24 2018 (r340098) @@ -438,7 +438,7 @@ getconfig(struct ifinfo *ifi) val |= ND_RA_FLAG_RTPREF_LOW; } #ifdef DRAFT_IETF_6MAN_IPV6ONLY_FLAG - if (strchr(flagstr, '6')) + if (strchr(flagstr, 'S')) val |= ND_RA_FLAG_IPV6_ONLY; #endif } else Modified: head/usr.sbin/rtadvd/rtadvd.c ============================================================================== --- head/usr.sbin/rtadvd/rtadvd.c Sat Nov 3 03:43:32 2018 (r340097) +++ head/usr.sbin/rtadvd/rtadvd.c Sat Nov 3 18:03:24 2018 (r340098) @@ -1161,11 +1161,11 @@ ra_input(int len, struct nd_router_advert *nra, inconsistent++; } #ifdef DRAFT_IETF_6MAN_IPV6ONLY_FLAG - /* 6 flag */ + /* S "IPv6-Only" (Six, Silence-IPv4) flag */ if ((nra->nd_ra_flags_reserved & ND_RA_FLAG_IPV6_ONLY) != rai->rai_ipv6onlyflg) { syslog(LOG_NOTICE, - "6 flag inconsistent on %s:" + "S flag inconsistent on %s:" " %s from %s, %s from us", ifi->ifi_ifname, on_off[!rai->rai_ipv6onlyflg], inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf, From owner-svn-src-head@freebsd.org Sat Nov 3 19:05:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28F0710E1A2D for ; Sat, 3 Nov 2018 19:05:07 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic301-32.consmr.mail.ne1.yahoo.com (sonic301-32.consmr.mail.ne1.yahoo.com [66.163.184.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B98FC8DD09 for ; Sat, 3 Nov 2018 19:05:06 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: cdYFyQcVM1lzrecoS4JvaobmvVUFcfY10n7LNvpreJdgehTliqaNRnPnDrL1ZIi wCW_8wnzK7n0TxfTNsR2fBbXHJQOodQ6i8x506BdhlGj1RnOgVI.HQ0wNqpyKTMGGRE46SuplgG6 bhFIr.gN1MW64LsTF5U3yGRC4cMx55tS1gwAWw2K8acFWrVaC_7A5f1oMQF4eLiEO2SSsdRLVIRM nW1ZfgJjRcCiHFXjONnF1iacxnZySdDPr29qvr90S.D9d2Hwco.j1s7Xo9VX5XtCAqj6EIHT1TRt tEtKc_mvRi.exxHc66na08y1YPRUHxl9Z.Sh8zRHR33InUICrDkdCKPxvwCOCmysptESn6469mI0 y_bYrBnoMzvm6YhIAFkEilBFE.PQdngWxbctDaxbUDnYL9gRD5MeIl_VoN9t6LyyKV9yAkU_ib52 N4acMEbSx.pUL98GaKgx.8VgJlJp29238lmREerASc3utjiWAStYanUpDIjhlQngH6yU8DGJry_n VdYPlkgilB4I5GNHkp6vStR.36WZeu66gCtpcKkEDxaMtkwtTvDY.H5wCkRCTGRG72OPBD9W4rz. ha242iISE8sWdb9SSIWE_p8ZbfYe1tlM2tzKwYWj6_IUiTo2XO1whuk9_1wdsAfNPPmhfDsL0gtr M72qeJMvMO6BiUq.uO5Twi0QQAsmxuvmo4fEBC90HycuhZeQJHHlW9qpGarJDbsb9cMW14m249ub wVOMNOYJp33M6C7_tN79rHOx541bKKl3KR13wMXWqg7.oJQBLJZw_WONTO8P08.5lIgom9UzgmTv nf_74HwMBjEeCKWVNtU7eGvGZI_0ppHUxP2HNGFL92wsEICRtbqAov4ddFgTlCV4WcEKIUY4kAn8 N8WE62zTdZqdzlEb0ULs0aGjPAgEJerI12S.WC5tw_HvBzZ7WlOv3rtWnM945fNqKUjC4SlDyvQU 3BbeWAr6O46Pys0PwqsVvFES555IJpPHeQEiQo50tlxJuWqYnwntmrBdEcFeAYNggUYd7DXDcLo0 hlO_AedTVbbHHge5RLVeuP.UuZMgOh2qcIYlA0EhK2MEKYg-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.ne1.yahoo.com with HTTP; Sat, 3 Nov 2018 19:05:00 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp422.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 56e53060648147265693a05bbffc1ea3; Sat, 03 Nov 2018 19:04:54 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r339876 - head/libexec/rtld-elf From: Mark Millard In-Reply-To: <20181103154955.GR5335@kib.kiev.ua> Date: Sat, 3 Nov 2018 12:04:53 -0700 Cc: svn-src-head@freebsd.org, Alexander Richardson Content-Transfer-Encoding: quoted-printable Message-Id: <1AD60949-F621-4F24-8985-B02102824EB1@yahoo.com> References: <8E5A5F3A-F1A7-4702-A2F7-65D74CC5B2E5@yahoo.com> <20181102004101.GI5335@kib.kiev.ua> <003A49D7-6E8B-4775-A70B-E0EB44505D4B@yahoo.com> <20181102113827.GM5335@kib.kiev.ua> <7B29A4C8-228D-41CB-B594-98DFA456E9C8@yahoo.com> <20181102155234.GN5335@kib.kiev.ua> <20181102185014.GP5335@kib.kiev.ua> <34554290-D26E-4FED-A598-4FB3E313EA92@yahoo.com> <20181103154955.GR5335@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 19:05:07 -0000 On 2018-Nov-3, at 8:49 AM, Konstantin Belousov = wrote: > On Fri, Nov 02, 2018 at 05:51:25PM -0700, Mark Millard wrote: >> On 2018-Nov-2, at 11:50 AM, Konstantin Belousov wrote: >>=20 >>> On Fri, Nov 02, 2018 at 10:38:08AM -0700, Mark Millard wrote: >>>> . . . >>>=20 >>> There seems to be an issue with the direct execution mode on ppc. >>> Even otherwise working ld-elf.so.1 segfaults if I try to use it as >>> standalone binary. >>>=20 >>> But if I specify patched ld-elf.so.1 as the interpreter for some = program, >>> using 'cc -Wl,-I,/ld-elf.so.1' it works. So I see there two = bugs, >>> one is regression due to textsize calculation, which should be fixed = by >>> my patch. Another is the direct exec problem. >>=20 >> My head -r339076 based powerpc64 and armv7 contexts also >> fail for: >>=20 >> # /libexec/ld-elf.so.1 /bin/ls >>=20 >> The armv7 (a Cortext-A7 context) is interestingly different >> in how it fails: >>=20 >> # /libexec/ld-elf.so.1 /bin/ls >> ld-elf.so.1: /bin/ls: mmap of entire address space failed: Cannot = allocate memory > Can you show the ktrace/kdump for this ? Sure, in the Cortex-A7 context . . . # ktrace -t+ /libexec/ld-elf.so.1 /bin/ls ld-elf.so.1: /bin/ls: mmap of entire address space failed: Cannot = allocate memory # kdump | less 80903 ktrace RET ktrace 0 80903 ktrace CALL execve(0xbfbfee23,0xbfbfecf0,0xbfbfecfc) 80903 ktrace NAMI "/libexec/ld-elf.so.1" 80903 ld-elf.so.1 RET execve JUSTRETURN 80903 ld-elf.so.1 CALL = mmap(0,0x20000,0x3,0x1002,0xff= ffffff,0,0,0) 80903 ld-elf.so.1 RET mmap 537071616/0x20031000 80903 ld-elf.so.1 CALL issetugid 80903 ld-elf.so.1 RET issetugid 0 80903 ld-elf.so.1 CALL = openat(AT_FDCWD,0xbfbfee2d,0x300000) 80903 ld-elf.so.1 NAMI "/bin/ls" 80903 ld-elf.so.1 RET openat 3 80903 ld-elf.so.1 CALL fstat(0x3,0xbfbfe638) 80903 ld-elf.so.1 STRU struct stat {dev=3D95, ino=3D2568217, = mode=3D0100555, nlink=3D1, uid=3D0, gid=3D0, rdev=3D5140776, = atime=3D1538464078.957949000, mtime=3D1538464078.958055000, = ctime=3D1538464078.958810000, birthtime=3D1538464078.957947000, = size=3D39440, blksize=3D32768, blocks=3D80, flags=3D0x0 } 80903 ld-elf.so.1 RET fstat 0 80903 ld-elf.so.1 CALL geteuid 80903 ld-elf.so.1 RET geteuid 0 80903 ld-elf.so.1 CALL = mmap(0,0x1000,0x1,0x40002,0x3,0,= 0,0) 80903 ld-elf.so.1 RET mmap 537202688/0x20051000 80903 ld-elf.so.1 CALL = mmap(0x10000,0xb000,0,0x6010,0xff= ffffff,0x10000,0,0) 80903 ld-elf.so.1 RET mmap -1 errno 12 Cannot allocate memory 80903 ld-elf.so.1 CALL munmap(0x20051000,0x1000) 80903 ld-elf.so.1 RET munmap 0 80903 ld-elf.so.1 CALL close(0x3) 80903 ld-elf.so.1 RET close 0 80903 ld-elf.so.1 CALL write(0x2,0x12e38,0xd) 80903 ld-elf.so.1 GIO fd 2 wrote 13 bytes "ld-elf.so.1: " 80903 ld-elf.so.1 RET write 13/0xd 80903 ld-elf.so.1 CALL write(0x2,0x33238,0x44) 80903 ld-elf.so.1 GIO fd 2 wrote 68 bytes "/bin/ls: mmap of entire address space failed: Cannot allocate = memory" 80903 ld-elf.so.1 RET write 68/0x44 80903 ld-elf.so.1 CALL write(0x2,0xbfbfe1e7,0x1) 80903 ld-elf.so.1 GIO fd 2 wrote 1 byte " " 80903 ld-elf.so.1 RET write 1 80903 ld-elf.so.1 CALL exit(0x1) >> My aarch64 context (a Cortext-A53 context) had no problem. >>=20 >> (All 3 examples are without any of the the recent updates >> or patches to ld-elf.so.1 source code.) >=20 > And still, does the patch for isync range works ? You can test the = new > ld-elf.so.1 standalone by hard-coding its path into the binary. Build = e.g. > only ls(1) by using make in its directory, then re-issue the linking > command with the additional flag '-Wl,-I, > and try to run ls.full. Looks like the old PowerMac is available again for such activity. So I'll see about testing. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Sat Nov 3 19:31:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69EC110E2120; Sat, 3 Nov 2018 19:31:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FEE78E4FC; Sat, 3 Nov 2018 19:31:12 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01D811E022; Sat, 3 Nov 2018 19:31:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA3JVBXA054001; Sat, 3 Nov 2018 19:31:11 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA3JVBxg054000; Sat, 3 Nov 2018 19:31:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811031931.wA3JVBxg054000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 3 Nov 2018 19:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340099 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 340099 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 19:31:12 -0000 Author: emaste Date: Sat Nov 3 19:31:11 2018 New Revision: 340099 URL: https://svnweb.freebsd.org/changeset/base/340099 Log: libcompat: disable retpoline when building build tools These are built with the host toolchain which may not support retpoline. While here, move the MK_ overrides to a separate line and sort them alphabetically to support future changes. MFC with: r339511 Sponsored by: The FreeBSD Foundation Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Sat Nov 3 18:03:24 2018 (r340098) +++ head/Makefile.libcompat Sat Nov 3 19:31:11 2018 (r340099) @@ -200,7 +200,8 @@ build${libcompat}: .PHONY OBJTOP=${LIBCOMPAT_OBJTOP} \ OBJROOT='$${OBJTOP}/' \ MAKEOBJDIRPREFIX= \ - DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ + DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS \ + MK_CTF=no MK_RETPOLINE=no MK_WARNS=no \ ${_t} .endfor .endfor From owner-svn-src-head@freebsd.org Sat Nov 3 19:52:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 849DC10E275A for ; Sat, 3 Nov 2018 19:52:09 +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 014768EEDE; Sat, 3 Nov 2018 19:52:08 +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 wA3Jpwhp014132 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 3 Nov 2018 21:52:01 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wA3Jpwhp014132 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wA3Jpvk1014131; Sat, 3 Nov 2018 21:51:57 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 3 Nov 2018 21:51:57 +0200 From: Konstantin Belousov To: Mark Millard Cc: svn-src-head@freebsd.org, Alexander Richardson Subject: Re: svn commit: r339876 - head/libexec/rtld-elf Message-ID: <20181103195157.GT5335@kib.kiev.ua> References: <003A49D7-6E8B-4775-A70B-E0EB44505D4B@yahoo.com> <20181102113827.GM5335@kib.kiev.ua> <7B29A4C8-228D-41CB-B594-98DFA456E9C8@yahoo.com> <20181102155234.GN5335@kib.kiev.ua> <20181102185014.GP5335@kib.kiev.ua> <34554290-D26E-4FED-A598-4FB3E313EA92@yahoo.com> <20181103154955.GR5335@kib.kiev.ua> <1AD60949-F621-4F24-8985-B02102824EB1@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1AD60949-F621-4F24-8985-B02102824EB1@yahoo.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 19:52:09 -0000 On Sat, Nov 03, 2018 at 12:04:53PM -0700, Mark Millard wrote: > 80903 ld-elf.so.1 CALL mmap(0x10000,0xb000,0,0x6010,0xffffffff,0x10000,0,0) > 80903 ld-elf.so.1 RET mmap -1 errno 12 Cannot allocate memory This is the allocation of VA for the whole binary. I guess that the normal non-PIE binary virtual base on arm is 0x10000. I put the arm PIE base at 0x12000, which obviously causes the conflict between pre-loaded ld-elf.so.1 and later attempt to mmap the binary at the linked address. In fact I am happy that we added MAP_EXCL and it catched the situation. You can try to change ET_DYN_LOAD_ADDR on arm: diff --git a/sys/arm/include/elf.h b/sys/arm/include/elf.h index 7424b45e78f..28fc14e3dae 100644 --- a/sys/arm/include/elf.h +++ b/sys/arm/include/elf.h @@ -84,7 +84,7 @@ __ElfType(Auxinfo); */ #define MAGIC_TRAMP_NUMBER 0x5c000003 -#define ET_DYN_LOAD_ADDR 0x12000 +#define ET_DYN_LOAD_ADDR 0x500000 /* Flags passed in AT_HWCAP. */ #define HWCAP_SWP 0x00000001 /* Unsupported, never set. */ From owner-svn-src-head@freebsd.org Sat Nov 3 20:03:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D7AE10E2A05 for ; Sat, 3 Nov 2018 20:03:08 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic304-23.consmr.mail.gq1.yahoo.com (sonic304-23.consmr.mail.gq1.yahoo.com [98.137.68.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 892088F37B for ; Sat, 3 Nov 2018 20:03:07 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: Xi1y.w0VM1lKFac6vnfpoYxc8KmvZtN077Ru9AY0wLV1ck1nxA8UJoWZo9N1C.z bVW1uQuJn7NIwuRLFDcm4GCESVM18FAlCBlbrD50udPOG0zKvw795j3dbovXgHtY0EjR8fW4efyR V645LsusobGr_iz30.MjVkd37kUEdvz0cUIWvfm5VGp_wo8DT9jDMLY2UUzh5ztXIc0OnnwfMhks dVWB6s2q1AjVVqZty5677rgi2VtGJZ0ekr7o8.T9eLt2JuFwUpwRpKMUKi2ve.2rCM7hu1abu0bP i9qD_RdoVpezfEDDVfKF1n9pOkjb9j9jjdlwkl8mtgt7MyOtuJPQz3MWr5k1iA_XPlehKZsOEA0H Ug2_nC0ag0rxkvOC5BWtRgKPvLAKFSfKK8gm2O38FrQpF.TSd44p0aBgXpV8pv8T_dGRt2ZbmIAA Pl6ivdepaJbRWiI3CKuDWwsLcL3r9zmodxpmURmAmSf2HXlUj8_Yyatr4Bi8vXHLk.P3PtEkOIOX Rpd8dvMljjvEtShD8p99nvRLspnYL.g6_c6xkXbIhDH_XWiz6yjks2Ts1TnYwy4vEtacT0gkIHnz eZKAMTmrdq.J0g2eDQul5aIJXUuvLh_KJWRo5WuAAvMwQtj68EDSJ7Hx2Rmjq7v4RGi5AV7lwICZ LPykaC7f1MzffXIfhAR7WaMHt61TkTj.jSOiLB4CGB9aooiSMjlZNcrexMcPTeir3raGe3s0vlVO 70SWbD_h2e1nevfpp3u.FVhBsuc1GyQnAi5wAQMQ9Le4iE53b6Md8T7LE.0SeZpP5B3s2Ss25CKu SQe03QcQLcHEeBgW5B.Qvg2sT_GV20yQuk3ZyLwUQCwrckP.UJYWW2qagGMAXLGlHbG0mVdTGd1X hNUGWSKHCZMzQQ2L22pykE0Iw3Ex95ktx_JIOhohPxXU7U8I5R1vUwsCRCCHNyQm0ObfCBWhvPl_ NXvh4X9TLsS00supVsz2pmLNijwVstvlf8xL39Q97o1HDwBTJfg5fncBVdZSOt1Syl8KSmV6SZ1B NMMyFz.l4rcFABwO.lfLW7QwlcKCu9QrEf7k6a._EuJlC9q0- Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.gq1.yahoo.com with HTTP; Sat, 3 Nov 2018 20:03:00 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp421.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 39fb3f9dac19b08eb4b1e8318043b326; Sat, 03 Nov 2018 20:02:56 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r339876 - head/libexec/rtld-elf From: Mark Millard In-Reply-To: <1AD60949-F621-4F24-8985-B02102824EB1@yahoo.com> Date: Sat, 3 Nov 2018 13:02:55 -0700 Cc: svn-src-head@freebsd.org, Alexander Richardson Content-Transfer-Encoding: quoted-printable Message-Id: <342280B4-75B9-48AA-926D-EF85FD6C3FE3@yahoo.com> References: <8E5A5F3A-F1A7-4702-A2F7-65D74CC5B2E5@yahoo.com> <20181102004101.GI5335@kib.kiev.ua> <003A49D7-6E8B-4775-A70B-E0EB44505D4B@yahoo.com> <20181102113827.GM5335@kib.kiev.ua> <7B29A4C8-228D-41CB-B594-98DFA456E9C8@yahoo.com> <20181102155234.GN5335@kib.kiev.ua> <20181102185014.GP5335@kib.kiev.ua> <34554290-D26E-4FED-A598-4FB3E313EA92@yahoo.com> <20181103154955.GR5335@kib.kiev.ua> <1AD60949-F621-4F24-8985-B02102824EB1@yahoo.com> To: Konstantin Belousov X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 20:03:08 -0000 On 2018-Nov-3, at 12:04 PM, Mark Millard = wrote: > On 2018-Nov-3, at 8:49 AM, Konstantin Belousov wrote: >=20 >> On Fri, Nov 02, 2018 at 05:51:25PM -0700, Mark Millard wrote: >>> On 2018-Nov-2, at 11:50 AM, Konstantin Belousov wrote: >>>=20 >>>> On Fri, Nov 02, 2018 at 10:38:08AM -0700, Mark Millard wrote: >>>>> . . . >>>>=20 >>>> There seems to be an issue with the direct execution mode on ppc. >>>> Even otherwise working ld-elf.so.1 segfaults if I try to use it as >>>> standalone binary. >>>>=20 >>>> But if I specify patched ld-elf.so.1 as the interpreter for some = program, >>>> using 'cc -Wl,-I,/ld-elf.so.1' it works. So I see there two = bugs, >>>> one is regression due to textsize calculation, which should be = fixed by >>>> my patch. Another is the direct exec problem. >>>=20 >>> My head -r339076 based powerpc64 and armv7 contexts also >>> fail for: >>>=20 >>> # /libexec/ld-elf.so.1 /bin/ls >>>=20 >>> The armv7 (a Cortext-A7 context) is interestingly different >>> in how it fails: >>>=20 >>> # /libexec/ld-elf.so.1 /bin/ls >>> ld-elf.so.1: /bin/ls: mmap of entire address space failed: Cannot = allocate memory >> Can you show the ktrace/kdump for this ? >=20 > Sure, in the Cortex-A7 context . . . >=20 > . . . >=20 >=20 >>> My aarch64 context (a Cortext-A53 context) had no problem. >>>=20 >>> (All 3 examples are without any of the the recent updates >>> or patches to ld-elf.so.1 source code.) >>=20 >> And still, does the patch for isync range works ? You can test the = new >> ld-elf.so.1 standalone by hard-coding its path into the binary. = Build e.g. >> only ls(1) by using make in its directory, then re-issue the linking >> command with the additional flag '-Wl,-I, >> and try to run ls.full. >=20 > Looks like the old PowerMac is available again for > such activity. So I'll see about testing. I tried installing a buildworld that has the patches via using the make arguments: installworld distrib-dirs distribution DB_FROM_SRC=3D1 = DESTDIR=3D/usr/obj/DESTDIRs/gcc421-powerpc-installworld-poud (I normally have poudriere-devel use this = gcc421-powerpc-installworld-poud in this environment.) Then: # chroot /usr/obj/DESTDIRs/gcc421-powerpc-installworld-poud # pwd / # ls .cshrc COPYRIGHT boot etc libexec = mnt proc root tmp var .profile bin dev lib media = net rescue sbin usr # df -m Filesystem 1M-blocks Used Avail Capacity Mounted on /dev/ufs/FBSDG4Srootfs 95203 38217 49369 44% / devfs 0 0 0 100% /dev # ls -lTd /bin/ls -r-xr-xr-x 1 root wheel 36816 Nov 3 19:19:26 2018 /bin/ls # ls -lTd /libexec/ld-elf.so.1* -r-xr-xr-x 1 root wheel 136100 Nov 3 19:17:53 2018 = /libexec/ld-elf.so.1 -r-xr-xr-x 1 root wheel 135932 Nov 2 02:10:34 2018 = /libexec/ld-elf.so.1.old # /usr/libexec/gdb /libexec/ld-elf.so.1 . . . (gdb) disass reloc_non_plt Dump of assembler code for function reloc_non_plt: . . . 0x00002b48 : bl 0xef78 0x00002b4c : lwz r31,64(r29) 0x00002b50 : lwz r9,68(r29) 0x00002b54 : mr r11,r31 0x00002b58 : add r0,r31,r9 0x00002b5c : cmplw cr7,r31,r0 0x00002b60 : blt+ cr7,0x2b78 0x00002b64 : b 0x2bbc 0x00002b68 : addi r31,r31,32 0x00002b6c : add r0,r11,r9 0x00002b70 : cmplw cr7,r0,r31 0x00002b74 : ble- cr7,0x2bbc 0x00002b78 : lwz r0,0(r31) 0x00002b7c : cmpwi cr7,r0,1 0x00002b80 : bne+ cr7,0x2b68 0x00002b84 : lwz r0,24(r31) 0x00002b88 : andi. r10,r0,1 ---Type to continue, or q to quit--- 0x00002b8c : beq+ 0x2b68 0x00002b90 : lwz r0,52(r29) 0x00002b94 : lwz r3,8(r31) 0x00002b98 : lwz r4,20(r31) 0x00002b9c : addi r31,r31,32 0x00002ba0 : add r3,r0,r3 0x00002ba4 : bl 0x12858 <__syncicache> 0x00002ba8 : lwz r11,64(r29) 0x00002bac : lwz r9,68(r29) 0x00002bb0 : add r0,r11,r9 0x00002bb4 : cmplw cr7,r0,r31 0x00002bb8 : bgt+ cr7,0x2b78 . . . So, unless the chroot somehow bypasses use of that local /libexec/ld-elf.so.1 , the __synicache in a loop seems to be working under the chroot use. Let me know if this test is insufficient for some reason. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Sat Nov 3 20:05:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06ACA10E2A55; Sat, 3 Nov 2018 20:05:51 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8F8E8F3B5; Sat, 3 Nov 2018 20:05:50 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C66E1E63A; Sat, 3 Nov 2018 20:05:50 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA3K5oDb071068; Sat, 3 Nov 2018 20:05:50 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA3K5oJI071067; Sat, 3 Nov 2018 20:05:50 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811032005.wA3K5oJI071067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 3 Nov 2018 20:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340100 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 340100 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 20:05:51 -0000 Author: ae Date: Sat Nov 3 20:05:50 2018 New Revision: 340100 URL: https://svnweb.freebsd.org/changeset/base/340100 Log: Do not use bzero() for the O_ICMP6TYPE opcode. The buffer is already zeroed in compile_rule() function, and also it may contain configured F_NOT flag in o.len field. This fixes the filling for "not icmp6types" opcode. PR: 232939 MFC after: 3 days Modified: head/sbin/ipfw/ipv6.c Modified: head/sbin/ipfw/ipv6.c ============================================================================== --- head/sbin/ipfw/ipv6.c Sat Nov 3 19:31:11 2018 (r340099) +++ head/sbin/ipfw/ipv6.c Sat Nov 3 20:05:50 2018 (r340100) @@ -143,8 +143,6 @@ fill_icmp6types(ipfw_insn_icmp6 *cmd, char *av, int cb uint8_t type; CHECK_LENGTH(cblen, F_INSN_SIZE(ipfw_insn_icmp6)); - - bzero(cmd, sizeof(*cmd)); while (*av) { if (*av == ',') av++; From owner-svn-src-head@freebsd.org Sat Nov 3 20:39:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDB0710E386E; Sat, 3 Nov 2018 20:39:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FDE369E1B; Sat, 3 Nov 2018 20:39:17 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 407461EB09; Sat, 3 Nov 2018 20:39:17 +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 wA3KdHZ1086725; Sat, 3 Nov 2018 20:39:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA3KdGjD086723; Sat, 3 Nov 2018 20:39:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811032039.wA3KdGjD086723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 3 Nov 2018 20:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340102 - in head/libexec/rtld-elf: powerpc powerpc64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/libexec/rtld-elf: powerpc powerpc64 X-SVN-Commit-Revision: 340102 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 20:39:18 -0000 Author: kib Date: Sat Nov 3 20:39:16 2018 New Revision: 340102 URL: https://svnweb.freebsd.org/changeset/base/340102 Log: Flush data cache for executable loadable segments explicitly. Do not use textsize and do not flush everything between map base and base + textsize, because unmapped areas cannot be flushed. This makes Obj_Entry textsize only use go away, and I will remove it later. Reported by: tuexen Tested by: Mark Millard Sponsored by: The FreeBSD Foundation Modified: head/libexec/rtld-elf/powerpc/reloc.c head/libexec/rtld-elf/powerpc64/reloc.c Modified: head/libexec/rtld-elf/powerpc/reloc.c ============================================================================== --- head/libexec/rtld-elf/powerpc/reloc.c Sat Nov 3 20:35:39 2018 (r340101) +++ head/libexec/rtld-elf/powerpc/reloc.c Sat Nov 3 20:39:16 2018 (r340102) @@ -294,6 +294,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int { const Elf_Rela *relalim; const Elf_Rela *rela; + const Elf_Phdr *phdr; SymCache *cache; int r = -1; @@ -327,8 +328,18 @@ done: if (cache != NULL) free(cache); - /* Synchronize icache for text seg in case we made any changes */ - __syncicache(obj->mapbase, obj->textsize); + /* + * Synchronize icache for executable segments in case we made + * any changes. + */ + for (phdr = obj->phdr; + (const char *)phdr < (const char *)obj->phdr + obj->phsize; + phdr++) { + if (phdr->p_type == PT_LOAD && (phdr->p_flags & PF_X) != 0) { + __syncicache(obj->relocbase + phdr->p_vaddr, + phdr->p_memsz); + } + } return (r); } Modified: head/libexec/rtld-elf/powerpc64/reloc.c ============================================================================== --- head/libexec/rtld-elf/powerpc64/reloc.c Sat Nov 3 20:35:39 2018 (r340101) +++ head/libexec/rtld-elf/powerpc64/reloc.c Sat Nov 3 20:39:16 2018 (r340102) @@ -291,6 +291,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int { const Elf_Rela *relalim; const Elf_Rela *rela; + const Elf_Phdr *phdr; SymCache *cache; int bytes = obj->dynsymcount * sizeof(SymCache); int r = -1; @@ -327,8 +328,18 @@ done: if (cache) munmap(cache, bytes); - /* Synchronize icache for text seg in case we made any changes */ - __syncicache(obj->mapbase, obj->textsize); + /* + * Synchronize icache for executable segments in case we made + * any changes. + */ + for (phdr = obj->phdr; + (const char *)phdr < (const char *)obj->phdr + obj->phsize; + phdr++) { + if (phdr->p_type == PT_LOAD && (phdr->p_flags & PF_X) != 0) { + __syncicache(obj->relocbase + phdr->p_vaddr, + phdr->p_memsz); + } + } return (r); } From owner-svn-src-head@freebsd.org Sat Nov 3 22:02:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2CB210E98A5; Sat, 3 Nov 2018 22:02:11 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 85A5E6C3B3; Sat, 3 Nov 2018 22:02:11 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D3F11F91E; Sat, 3 Nov 2018 22:02:11 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA3M2BK2032386; Sat, 3 Nov 2018 22:02:11 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA3M2BqE032385; Sat, 3 Nov 2018 22:02:11 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201811032202.wA3M2BqE032385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Sat, 3 Nov 2018 22:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340104 - in head: share/colldef share/ctypedef share/monetdef share/numericdef tools/tools/locale tools/tools/locale/etc tools/tools/locale/etc/final-maps X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: in head: share/colldef share/ctypedef share/monetdef share/numericdef tools/tools/locale tools/tools/locale/etc tools/tools/locale/etc/final-maps X-SVN-Commit-Revision: 340104 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.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 22:02:12 -0000 Author: yuripv Date: Sat Nov 3 22:02:10 2018 New Revision: 340104 URL: https://svnweb.freebsd.org/changeset/base/340104 Log: Update to CLDR 34 and UNICODE 11. Discussed with: bapt Approved by: kib (mentor) MFC after: 1 month Added: head/share/monetdef/fr_FR.UTF-8.src (contents, props changed) head/share/monetdef/it_IT.ISO8859-15.src - copied, changed from r340103, head/share/monetdef/de_AT.ISO8859-15.src head/share/monetdef/it_IT.UTF-8.src - copied, changed from r340103, head/share/monetdef/de_AT.UTF-8.src head/share/monetdef/nl_BE.ISO8859-1.src - copied unchanged from r340103, head/share/monetdef/de_AT.ISO8859-1.src head/share/numericdef/fr_FR.UTF-8.src (contents, props changed) Deleted: head/share/monetdef/de_AT.ISO8859-1.src head/share/monetdef/de_AT.ISO8859-15.src head/share/monetdef/de_AT.UTF-8.src Modified: head/share/colldef/af_ZA.UTF-8.src head/share/colldef/am_ET.UTF-8.src head/share/colldef/ar_SA.UTF-8.src head/share/colldef/be_BY.UTF-8.src head/share/colldef/ca_AD.UTF-8.src head/share/colldef/cs_CZ.ISO8859-2.src head/share/colldef/cs_CZ.UTF-8.src head/share/colldef/da_DK.ISO8859-1.src head/share/colldef/da_DK.ISO8859-15.src head/share/colldef/da_DK.UTF-8.src head/share/colldef/el_GR.UTF-8.src head/share/colldef/en_US.UTF-8.src head/share/colldef/es_MX.UTF-8.src head/share/colldef/et_EE.UTF-8.src head/share/colldef/fi_FI.UTF-8.src head/share/colldef/fr_CA.UTF-8.src head/share/colldef/he_IL.UTF-8.src head/share/colldef/hi_IN.UTF-8.src head/share/colldef/hr_HR.ISO8859-2.src head/share/colldef/hu_HU.ISO8859-2.src head/share/colldef/hu_HU.UTF-8.src head/share/colldef/hy_AM.UTF-8.src head/share/colldef/is_IS.UTF-8.src head/share/colldef/ja_JP.UTF-8.src head/share/colldef/ja_JP.eucJP.src head/share/colldef/kk_KZ.UTF-8.src head/share/colldef/ko_KR.UTF-8.src head/share/colldef/lt_LT.UTF-8.src head/share/colldef/lv_LV.UTF-8.src head/share/colldef/nb_NO.ISO8859-1.src head/share/colldef/nb_NO.ISO8859-15.src head/share/colldef/nn_NO.ISO8859-1.src head/share/colldef/nn_NO.ISO8859-15.src head/share/colldef/nn_NO.UTF-8.src head/share/colldef/pl_PL.UTF-8.src head/share/colldef/ro_RO.UTF-8.src head/share/colldef/ru_RU.UTF-8.src head/share/colldef/se_NO.UTF-8.src head/share/colldef/sk_SK.ISO8859-2.src head/share/colldef/sk_SK.UTF-8.src head/share/colldef/sl_SI.UTF-8.src head/share/colldef/sr_RS.ISO8859-2.src head/share/colldef/sr_RS.ISO8859-5.src head/share/colldef/sr_RS.UTF-8.src head/share/colldef/sr_RS.UTF-8@latin.src head/share/colldef/sv_SE.UTF-8.src head/share/colldef/tr_TR.UTF-8.src head/share/colldef/uk_UA.UTF-8.src head/share/colldef/zh_CN.GB18030.src head/share/colldef/zh_CN.GB2312.src head/share/colldef/zh_CN.GBK.src head/share/colldef/zh_CN.UTF-8.src head/share/colldef/zh_CN.eucCN.src head/share/colldef/zh_TW.Big5.src head/share/colldef/zh_TW.UTF-8.src head/share/ctypedef/Makefile head/share/ctypedef/ca_IT.ISO8859-1.src head/share/ctypedef/en_US.ISO8859-1.src head/share/ctypedef/hi_IN.ISCII-DEV.src head/share/ctypedef/hy_AM.ARMSCII-8.src head/share/ctypedef/ja_JP.eucJP.src head/share/ctypedef/zh_CN.eucCN.src head/share/monetdef/Makefile head/share/monetdef/fr_CH.UTF-8.src head/share/monetdef/hy_AM.ARMSCII-8.src head/share/monetdef/hy_AM.UTF-8.src head/share/monetdef/mn_MN.UTF-8.src head/share/monetdef/nl_BE.ISO8859-15.src head/share/monetdef/nl_BE.UTF-8.src head/share/numericdef/Makefile head/tools/tools/locale/Makefile head/tools/tools/locale/etc/charmaps.xml head/tools/tools/locale/etc/final-maps/map.UTF-8 Modified: head/share/colldef/af_ZA.UTF-8.src ============================================================================== --- head/share/colldef/af_ZA.UTF-8.src Sat Nov 3 21:59:52 2018 (r340103) +++ head/share/colldef/af_ZA.UTF-8.src Sat Nov 3 22:02:10 2018 (r340104) @@ -60,6 +60,7 @@ collating-symbol collating-symbol collating-symbol collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -70,431 +71,433 @@ collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol +collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol order_start forward;forward;forward;forward @@ -550,6 +553,7 @@ order_start forward;forward;forward;forward + @@ -560,431 +564,433 @@ order_start forward;forward;forward;forward - - - - + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Nov 3 22:59:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0AB710EB87A; Sat, 3 Nov 2018 22:59:26 +0000 (UTC) (envelope-from ml@vishwin.info) Received: from varun.vishwin.info (varun.vishwin.info [46.101.93.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "varun.vishwin.info", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 543F16FE1E; Sat, 3 Nov 2018 22:59:25 +0000 (UTC) (envelope-from ml@vishwin.info) Received: from varun.vishwin.info (fd35:9eae:7575::2 [IPv6:fd35:9eae:7575::2]) by varun.vishwin.info (OpenSMTPD) with ESMTP id 39ca564f; Sat, 3 Nov 2018 18:59:21 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=vishwin.info; h=subject :to:cc:references:from:message-id:date:mime-version:in-reply-to :content-type; s=fuccboi12; bh=M8q6+yQnc2GVecjvmnxpREtFXyxIaHRb8 Wi08kPHVts=; b=Mqc6fvFTHb3NaKWLYhYxyAa6a+gHC2aBOibY3zFoeo5CcV2RD fjVXC9xC/50nJD0Um/4X7zxSfbe+YmqncOyO0LGUGssWC8at4AOI4r2xm1Iv38Lv ekfxNmGc317jp64wprnB9zU14pIvoSFdkzEJqiqdsHtmr/KxlBGKMcnW4h8h9/Wg MWHPq2j+pqDWVqMoYb1gxBifoVsMdltRK8COKBEqFe9xA9X6gHlkh/Em1PuEvanc zpbfcjLTtB2OTrVqX6lapFjIrNKQsp+f1AqINzUYxdYFeDygpsAj/TojEffORA9I +AhmX8MsJP1JWGAzRNx+JMaAThwVt5CRTLRcg== Received: from [IPv6:2600:1002:b023:dc42:3602:86ff:fe03:d90] (2600:1002:b023:dc42:3602:86ff:fe03:d90 [IPv6:2600:1002:b023:dc42:3602:86ff:fe03:d90]) by varun.vishwin.info (OpenSMTPD) with ESMTPSA id 99563cba TLS version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO; Sat, 3 Nov 2018 18:59:21 -0400 (EDT) Subject: Re: svn commit: r339898 - head/lib/libc/amd64/sys To: Konstantin Belousov Cc: Brooks Davis , svn-src-head@freebsd.org, toolchain@freebsd.org, current@freebsd.org References: <201810300011.w9U0BUui038857@repo.freebsd.org> <20181101160406.GA60233__23941.7825396687$1541088368$gmane$org@spindle.one-eyed-alien.net> <20181103152936.GQ5335@kib.kiev.ua> From: Charlie Li Openpgp: preference=signencrypt Autocrypt: addr=ml@vishwin.info; prefer-encrypt=mutual; keydata= xsFNBFt7iHUBEADCorTixbMGuHd9WYSKCELlv/TFcRtvpHUw/n9LtXzKixUUwl7iuMFMYTz3 QXePX0Twq4jCQYySfcxWbPkLsSYlPOkaGQ+XytfmIHoqG5ba4i1fp+F41is0oCtLt1+oL84j NKUd13em/JWd+PJeQbSTVnHbT2yaAi7vqWw5WKVaMExjfPGU5TArV46wSRU6Zuy1ZX66q0q5 dPzeBdeKYWJE8aGtyi3pYUpKUOX4gxiNetf6leDFZ4OsexWaRdU0n8fId5d1qwjAE3lOwV5z 0Ilt8t4iXtX3JL3DAQyLZIeXHIg9O3rrpPMXQWSp2/5g39PohNk7farbhcpIKxuDN+L5N6U9 OxNHBSCv9FGDO4R/mw3YwJCovDzsF7RSyXQDIY36yjdh2uTLZ0uD5Ci/DPmJUySFLRvpqWnQ M7V5cYhdqDfcElGpRbi8JZQVYRJjvI5Jj0byG98KeaD0YFxKqmmm+Oh+xWXE7xt/DsBoZeZJ BFP84LvFbwQqprvI+sg+1z2+JIgNbYwl8VaYzfyGnqTEXTOsQYEKTdKA9MODSAsN31MlQICe CIHZV+OwOqH1KQ/mZp59AnpXAmj4T94bnahE9yJtVW/qglX/nTeFNUdu5MyEgkeB0x7mx+t0 3hE20yp/NbyvG1T/o53NHwHiURC/8Fxd1NWPZ6n4X8npQn6iyQARAQABzSFDaGFybGllIExp IDx2aXNod2luQHZpc2h3aW4uaW5mbz7CwZEEEwEIADsCGyMFCwkIBwIGFQoJCAsCBBYCAwEC HgECF4AWIQT/f8Kqvlr7jU9sRv6OcHje8gOrbAUCW3uI+wIZAQAKCRCOcHje8gOrbNX8EACT HGo3AsShFj+AaUgD9V6wTMaR2w7ubIqbkn2ZqZZ1xWj3gM6VYRKHflj9LiYqFRO4wBteAq30 Snz6F93IG+u5B1uwlC58HDwCQaROaU5cHQ8UvGPSEv0XXCcYTaC3d5NMoIh/LdutVZz56LTx hWs5NHUCaG6FfGV9QplECRteQr2rMxHZxZ3ppSY9oev/wY3U3VRUGnhM2ZwGrpmjksC1HTBH Fw2XbYdVNCOYjQrTIulaYb3y0ssgsOhvSk9bPHSTsWSCQGJk0uFNXTvIq68GhkhOwAet6//w R2y1whg47r554pBManttODaQnmWmIWBM0bZMJrlNT8T/oXlG9nA0jrjA8LvTThrCAvMSMB0F 2FhStd/I2/Fs7T6Uk1BUpgCvFiDtE8Jt1W2yq2GLtPysGrJXyDaat8IuVUthnNVhoyZb9tZu sI/FFhfh9MkPmZDwCoTUJN2yU8QhxS1iJXfMZ1f06r1TYY9rwb8E/WCBJFbMzJs3VLj/TnHL N09J2zNZgTs7gewLn/2lEV1kOL/FxIDgN7ailcf3kcNdVUxr/pLbx3NZcDkXniPO0dzQpuRw q841wBT3uqdPFJwIl4pf1EYhLj89r2vOGnM2RChl1/t+wSqHhBji3R3uylzE0qbr8O/cgx/5 wlvZJiUhyu0hJ/JoJkF8WEFkesJrTZORGc7BTQRbe4h1ARAA12Xtgcbwk7IdsRi/7sTFKs73 qoFFq+DUWwMbSuIOaWw5J9nZ+ovr9gkXlax+xf335hJ0iItB8LhA7D9wD4wjrmmBjhwK7jYv tghb8BH6MHWEWD5D9xt47CO4o8Vi1m/F4OlKxoDqIhH6n63gNeSNaXzqDpZoUsL62KX+sKKU Udj/X/oz3XwXWCb/rEIgAMMW7QFcuQBJzkHgu69oUSIki4j1mhAMiBbGexfS1dcTfpLAr9eu jDNHOw5r7aI4cA8q7us8YfDLby87hPlSrtTKcxkbawrdFNs6KNrEvggkXhYxGqm4Z0FInixa avloimBf1q7kvVM0AAgsmkdeeS/6Tzbn71WBuEW0VgEcSSBS1dv7DfgmeQeiSmv0Dvx2lZv5 P6M4Q/plSAz7hVXL6EIKltwJUjY8Re7zDbPf7jJlbEgWbLxRhlGh5MwrNXbMt6KygDRcDyOP njxg0+ICXbQyPKiq7jZY2/Q/x8P08xNx8sUKPY+XE6G5QVohQfe3LT9s15KM+1Ur4v3Hhbft HtTW1iT60HkyU9qRCJJC11OgH7wrfiucG3/eQKgBgvsfKDD36rJmsQpkO0/kkp6R+CzLby3X PrrFYJTCr08e5QWKKPdyNvAhuyQj27Lb7EhNxe3hmpV+llx0aaN9t1M+QZ88famMOgIlp7Nh 1uFr/c5WGZUAEQEAAcLBdgQYAQgAIBYhBP9/wqq+WvuNT2xG/o5weN7yA6tsBQJbe4h1AhsM AAoJEI5weN7yA6tsTGcP/2rBIvgeKismZQQn7kJOHwgmqXg/N5ArwPH3eCJmzmNZWUIlOZyl A2KtYhkzZ5G3rsL/BMmMuYRUbPJJUukaJSqFep1E6AWYPC8Seakhu1ZbK8ayBI4KZmP+3PQY S0tKyMlxX+Qt9+S/tcQqS31mMgmcVhVhKi8MrWjY+g7pF+LkBYccHuNiGNIcm8mMPHTIKU72 ARiG3DtHrRg4sf5wqgOi72277jBHdDBGw0Y7rCvMsaGm3G4GsMwj4e47H6PAFOWK7O69muvL o50oMN2rkPi+9AKPi8WcrinstleEGyEIyguRagDQjZP5gX9Xk5vkS6+xMgKt7+k7+D3jWKlW R6G9U0CyKmVJoeNqwHUdLoFD3lywjwT9vo+cqb4gQKnZsA1ss/WOvEp4EaNSR7JHFOY5X8AN QgiPxLhrbI7FPGXKw3Y7nCpcIlzFph6UL9jhNRwvoQ3GfZ0sF0JgpASdrS4N3Fmnt9L6lc3q rIrxDPpDjYwcDEUBl0sp/prjh3gdC3qs9xZ0RNWWdUqcmvRv2SDkrVDw3iQ9WhMZWuQYBmGa MViypa6WrjjlVTjqZftZyqytnHwuo1PA/qLcF/vUUn0QHFPIDx8/yTSqiw/xTwPuOFxznHjJ VbxEEG0H5rmreh1Z0WeMwsSbjC3EEf+ZI39QpFwVIG8pDwXFOClfhjFz Message-ID: Date: Sat, 3 Nov 2018 18:59:02 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <20181103152936.GQ5335@kib.kiev.ua> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fH65cH0eBd2F1iuHfkAMiUC3fhblqIpkD" X-Rspamd-Queue-Id: 543F16FE1E X-Spamd-Result: default: False [-2.63 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[vishwin.info]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; HAS_ATTACHMENT(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; DMARC_NA(0.00)[vishwin.info]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[vishwin.info:+]; MX_GOOD(-0.01)[varun.vishwin.info]; SIGNED_PGP(-2.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.02)[country: US(-0.08)]; ASN(0.00)[asn:14061, ipnet:46.101.80.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 22:59:27 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --fH65cH0eBd2F1iuHfkAMiUC3fhblqIpkD Content-Type: multipart/mixed; boundary="q9Jfd9G1NjpUiLTkRuGIPkOE0DmXqX611"; protected-headers="v1" From: Charlie Li To: Konstantin Belousov Cc: Brooks Davis , svn-src-head@freebsd.org, toolchain@freebsd.org, current@freebsd.org Message-ID: Subject: Re: svn commit: r339898 - head/lib/libc/amd64/sys References: <201810300011.w9U0BUui038857@repo.freebsd.org> <20181101160406.GA60233__23941.7825396687$1541088368$gmane$org@spindle.one-eyed-alien.net> <20181103152936.GQ5335@kib.kiev.ua> In-Reply-To: <20181103152936.GQ5335@kib.kiev.ua> --q9Jfd9G1NjpUiLTkRuGIPkOE0DmXqX611 Content-Type: text/plain; charset=utf-8 Content-Language: en-GB-large Content-Transfer-Encoding: quoted-printable On 03/11/2018 11:29, Konstantin Belousov wrote: > Some minimal amount of facts instead of guesses would be much more usef= ul. >=20 Yeah, being sleep deprived and hurried (on my end) certainly doesn't help= =2E > What is the instruction which faulted ? Disassemble the text at 0x2f56= 64. > Regardless of what is the instruction, show either the output from > 'x86info -f' on the machine, or cpu identification lines from the > _verbose_ boot dmesg. >=20 It appears that 0x2f5664 does not exist: Disassembly of section .init: 00000000002f565c <_init>: 2f565c: 48 83 ec 08 sub $0x8,%rsp 2f5660: e8 fb 3c f3 ff callq 229360 2f5665: e8 b6 ff ff ff callq 2f5620 <__do_global_ctors_aux> 2f566a: 48 83 c4 08 add $0x8,%rsp 2f566e: c3 retq CPU ident: CPU: Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz (2394.52-MHz K8-class CPU) Origin=3D"GenuineIntel" Id=3D0x306d4 Family=3D0x6 Model=3D0x3d Step= ping=3D4 Features=3D0xbfebfbff Features2=3D0x7ffafbbf AMD Features=3D0x2c100800 AMD Features2=3D0x121 Structured Extended Features=3D0x21c27ab Structured Extended Features3=3D0x9c000000 XSAVE Features=3D0x1 VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID TSC: P-state invariant, performance statistics > make is statically linked, do dynamically linked program fault ? >=20 After some more checks, only the statically linked programs crash. --=20 Charlie Li Can't think of a witty .sigline today=E2=80=A6 (This email address is for mailing list use only; replace local-part with vishwin for off-list communication) --q9Jfd9G1NjpUiLTkRuGIPkOE0DmXqX611-- --fH65cH0eBd2F1iuHfkAMiUC3fhblqIpkD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE/3/Cqr5a+41PbEb+jnB43vIDq2wFAlveKDYACgkQjnB43vID q2y/SA/9H7IB8/yfLonhV0cMf7JeBsRg9WbrfQ4MoVPjDVwDOfH1CSPDTjySfAl1 kcNtuMYPgf1Y3RKhDsXsnK+qNft8MSme5shP8PHf6p/yO9eIeiaFCX1NjLnFq4GS 41tW9MmiuImORGGj4m8vtkBQ5yvD3lJ+AoBAH4IKpGRU8vtcRQ2e/cDe2k/5S67V QWvrIdSjmNECeKEmNbtf/P28OCGby8FWK+OjIDDxoJiDu1+qT40xnyOhm5NuvBCc 7/gkrclqELvZHnLxUf14dL3zD50mNqC7j+0EX1NIQ5WzKxjcypOo2WleTCQKizct MOljVRI7DU+xwvTlTm99nsthRpMirUn8hh/QIkzgjPj08JJt6ZwPgsRTvP0+AO2R l5P+0qvkJlTzkx/9+35GYxL9s+9g4Wah0GBt69cynrAxVecgAAAosf45eQfvosq8 7klEkC+yj2lFo1YYXTKFQ844nNEehec6qwIGwVaj3IBJpbGn9RJAz4Rmr0v2yCMi 6XPcQdL6FQoE2zzG9h2l5Re8Ty58fb9kCLB+AhYqWmQiNvz+HS85E90XaK7APCdw 6FyreBE+hpgyp/oBq4uE84qrGgmW4lcNLwnjY8H6dZWclAEOXPUDlVNFtC2NtVxk 7MlO3paEEy+UYZcjjBgBHKjlaH1jjKZm7y7+oZMjNB/SXDVIslQ= =rTb7 -----END PGP SIGNATURE----- --fH65cH0eBd2F1iuHfkAMiUC3fhblqIpkD-- From owner-svn-src-head@freebsd.org Sat Nov 3 23:37:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 481AF10EC6A0; Sat, 3 Nov 2018 23:37:15 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9643F70EB6; Sat, 3 Nov 2018 23:37:14 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68F25207FB; Sat, 3 Nov 2018 23:37:14 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA3NbE7L084082; Sat, 3 Nov 2018 23:37:14 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA3NbDso084080; Sat, 3 Nov 2018 23:37:13 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201811032337.wA3NbDso084080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Sat, 3 Nov 2018 23:37:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340106 - in head: contrib/netbsd-tests/lib/libc/time lib/libc/stdtime X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: in head: contrib/netbsd-tests/lib/libc/time lib/libc/stdtime X-SVN-Commit-Revision: 340106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9643F70EB6 X-Spamd-Result: default: False [-0.83 / 200.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.72)[-0.719,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 23:37:15 -0000 Author: yuripv Date: Sat Nov 3 23:37:13 2018 New Revision: 340106 URL: https://svnweb.freebsd.org/changeset/base/340106 Log: strptime: make %k and %l specifiers match their description in strftime(3), and allow them to process space-padded input. PR: 230720 Submitted by: rlittle@inetco.com (original version) Approved by: kib (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D17761 Modified: head/contrib/netbsd-tests/lib/libc/time/t_strptime.c head/lib/libc/stdtime/strptime.c Modified: head/contrib/netbsd-tests/lib/libc/time/t_strptime.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/time/t_strptime.c Sat Nov 3 22:12:21 2018 (r340105) +++ head/contrib/netbsd-tests/lib/libc/time/t_strptime.c Sat Nov 3 23:37:13 2018 (r340106) @@ -331,8 +331,19 @@ ATF_TC_BODY(hour, tc) h_fail("00", "%I"); h_fail("13", "%I"); + #ifdef __FreeBSD__ - h_fail("00", "%l"); + h_pass("0", "%k", 1, -1, -1, 0, -1, -1, -1, -1, -1); + h_pass("04", "%k", 2, -1, -1, 4, -1, -1, -1, -1, -1); + h_pass(" 8", "%k", 2, -1, -1, 8, -1, -1, -1, -1, -1); + h_pass("23", "%k", 2, -1, -1, 23, -1, -1, -1, -1, -1); + h_fail("24", "%k"); + + h_fail("0", "%l"); + h_pass("1", "%l", 1, -1, -1, 1, -1, -1, -1, -1, -1); + h_pass("05", "%l", 2, -1, -1, 5, -1, -1, -1, -1, -1); + h_pass(" 9", "%l", 2, -1, -1, 9, -1, -1, -1, -1, -1); + h_pass("12", "%l", 2, -1, -1, 12, -1, -1, -1, -1, -1); h_fail("13", "%l"); #endif Modified: head/lib/libc/stdtime/strptime.c ============================================================================== --- head/lib/libc/stdtime/strptime.c Sat Nov 3 22:12:21 2018 (r340105) +++ head/lib/libc/stdtime/strptime.c Sat Nov 3 23:37:13 2018 (r340106) @@ -272,17 +272,24 @@ label: case 'k': case 'l': /* - * Of these, %l is the only specifier explicitly - * documented as not being zero-padded. However, - * there is no harm in allowing zero-padding. + * %k and %l specifiers are documented as being + * blank-padded. However, there is no harm in + * allowing zero-padding. * - * XXX The %l specifier may gobble one too many + * XXX %k and %l specifiers may gobble one too many * digits if used incorrectly. */ + + len = 2; + if ((c == 'k' || c == 'l') && + isblank_l((unsigned char)*buf, locale)) { + buf++; + len = 1; + } + if (!isdigit_l((unsigned char)*buf, locale)) return (NULL); - len = 2; for (i = 0; len && *buf != 0 && isdigit_l((unsigned char)*buf, locale); buf++) { i *= 10; From owner-svn-src-head@freebsd.org Sat Nov 3 23:46:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACA3910ECA74; Sat, 3 Nov 2018 23:46:03 +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 E98A3713B0; Sat, 3 Nov 2018 23:46:02 +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 wA3Njpki067743 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 4 Nov 2018 01:45:54 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wA3Njpki067743 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wA3NjpQa067742; Sun, 4 Nov 2018 01:45:51 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 4 Nov 2018 01:45:51 +0200 From: Konstantin Belousov To: Charlie Li Cc: Brooks Davis , svn-src-head@freebsd.org, toolchain@freebsd.org, current@freebsd.org Subject: Re: svn commit: r339898 - head/lib/libc/amd64/sys Message-ID: <20181103234551.GX5335@kib.kiev.ua> References: <201810300011.w9U0BUui038857@repo.freebsd.org> <20181101160406.GA60233__23941.7825396687$1541088368$gmane$org@spindle.one-eyed-alien.net> <20181103152936.GQ5335@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: E98A3713B0 X-Spamd-Result: default: False [-0.83 / 200.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.80)[-0.804,0]; IP_SCORE(-0.02)[country: US(-0.08)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_TLS_LAST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 23:46:03 -0000 On Sat, Nov 03, 2018 at 06:59:02PM -0400, Charlie Li wrote: > On 03/11/2018 11:29, Konstantin Belousov wrote: > > Some minimal amount of facts instead of guesses would be much more useful. > > > Yeah, being sleep deprived and hurried (on my end) certainly doesn't help. > > What is the instruction which faulted ? Disassemble the text at 0x2f5664. > > Regardless of what is the instruction, show either the output from > > 'x86info -f' on the machine, or cpu identification lines from the > > _verbose_ boot dmesg. > > > It appears that 0x2f5664 does not exist: Or rather, it is a middle of the valid instruction. Next frame looks like it is process_irelocs(), if trusting the line numbers. So most likely it is something related to calling wrong relocator function, if anything. Perhaps you could try to trace the things manually, doing single-stepping of the startup code in debugger. There should be very modest amount of the irelocs, perhaps only one, and see where things go off the way. Might be try to vary the clang version, we know that this work with 6.0.1, and according to your report, breaks with 7.0. Try clang trunk ? > > Disassembly of section .init: > > 00000000002f565c <_init>: > 2f565c: 48 83 ec 08 sub $0x8,%rsp > 2f5660: e8 fb 3c f3 ff callq 229360 > 2f5665: e8 b6 ff ff ff callq 2f5620 > <__do_global_ctors_aux> > 2f566a: 48 83 c4 08 add $0x8,%rsp > 2f566e: c3 retq > > CPU ident: > > CPU: Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz (2394.52-MHz K8-class CPU) > Origin="GenuineIntel" Id=0x306d4 Family=0x6 Model=0x3d Stepping=4 > > Features=0xbfebfbff > > Features2=0x7ffafbbf > AMD Features=0x2c100800 > AMD Features2=0x121 > Structured Extended > Features=0x21c27ab > Structured Extended Features3=0x9c000000 > XSAVE Features=0x1 > VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID > TSC: P-state invariant, performance statistics > > make is statically linked, do dynamically linked program fault ? > > > After some more checks, only the statically linked programs crash. > > -- > Charlie Li > Can't think of a witty .sigline today… > > (This email address is for mailing list use only; replace local-part > with vishwin for off-list communication) >