From owner-svn-src-all@freebsd.org Sun Oct 28 00:57:40 2018 Return-Path: Delivered-To: svn-src-all@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 D80FC10DA7B3; Sun, 28 Oct 2018 00:57:40 +0000 (UTC) (envelope-from cy@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 811F484C5A; Sun, 28 Oct 2018 00:57:40 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 553DF17F14; Sun, 28 Oct 2018 00:57:40 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9S0vejf065823; Sun, 28 Oct 2018 00:57:40 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9S0veaC065822; Sun, 28 Oct 2018 00:57:40 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201810280057.w9S0veaC065822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 28 Oct 2018 00:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339828 - stable/12/lib/libc/stdio X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/12/lib/libc/stdio X-SVN-Commit-Revision: 339828 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 00:57:41 -0000 Author: cy Date: Sun Oct 28 00:57:39 2018 New Revision: 339828 URL: https://svnweb.freebsd.org/changeset/base/339828 Log: Follow up on r331936. gets_s(3) will also fail in the same way that gets(3) does. This was missed in r331936. Reported by: emaste@ Approved by: re (kib@) Modified: stable/12/lib/libc/stdio/fgets.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/stdio/fgets.3 ============================================================================== --- stable/12/lib/libc/stdio/fgets.3 Sat Oct 27 23:31:42 2018 (r339827) +++ stable/12/lib/libc/stdio/fgets.3 Sun Oct 28 00:57:39 2018 (r339828) @@ -140,6 +140,8 @@ or .Pp The function .Fn gets +and +.Fn gets_s may also fail and set .Va errno for any of the errors specified for the routine From owner-svn-src-all@freebsd.org Sun Oct 28 00:57:51 2018 Return-Path: Delivered-To: svn-src-all@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 658B310DA7E7; Sun, 28 Oct 2018 00:57:51 +0000 (UTC) (envelope-from cy@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 B5F2384C92; Sun, 28 Oct 2018 00:57:45 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC81D17F15; Sun, 28 Oct 2018 00:57:44 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9S0vi97065870; Sun, 28 Oct 2018 00:57:44 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9S0viag065869; Sun, 28 Oct 2018 00:57:44 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201810280057.w9S0viag065869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 28 Oct 2018 00:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339829 - stable/11/lib/libc/stdio X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/lib/libc/stdio X-SVN-Commit-Revision: 339829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 00:57:51 -0000 Author: cy Date: Sun Oct 28 00:57:44 2018 New Revision: 339829 URL: https://svnweb.freebsd.org/changeset/base/339829 Log: Follow up on r331936. gets_s(3) will also fail in the same way that gets(3) does. This was missed in r331936. Reported by: emaste@ Modified: stable/11/lib/libc/stdio/fgets.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/stdio/fgets.3 ============================================================================== --- stable/11/lib/libc/stdio/fgets.3 Sun Oct 28 00:57:39 2018 (r339828) +++ stable/11/lib/libc/stdio/fgets.3 Sun Oct 28 00:57:44 2018 (r339829) @@ -140,6 +140,8 @@ or .Pp The function .Fn gets +and +.Fn gets_s may also fail and set .Va errno for any of the errors specified for the routine From owner-svn-src-all@freebsd.org Sun Oct 28 00:58:41 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Oct 28 03:02:11 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Oct 28 02:57:51 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Oct 28 02:58:16 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Oct 28 02:58:27 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Oct 28 05:32:52 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Oct 28 05:37:16 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Oct 28 07:50:16 2018 Return-Path: Delivered-To: svn-src-all@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 B3E6810EB0B2; Sun, 28 Oct 2018 07:50:16 +0000 (UTC) (envelope-from vmaffione@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 5D03074437; Sun, 28 Oct 2018 07:50:16 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3B0111C7B3; Sun, 28 Oct 2018 07:50:16 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9S7oGvB078162; Sun, 28 Oct 2018 07:50:16 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9S7oGh0078161; Sun, 28 Oct 2018 07:50:16 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201810280750.w9S7oGh0078161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 28 Oct 2018 07:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339839 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 339839 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 07:50:16 -0000 Author: vmaffione Date: Sun Oct 28 07:50:15 2018 New Revision: 339839 URL: https://svnweb.freebsd.org/changeset/base/339839 Log: MFC r339548: man: fix vale(4) port naming The current documentation describing the syntax of a VALE port is wrong. This patch fixes it to make it consistent. Approved by: re (gjb) Modified: stable/12/share/man/man4/vale.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/vale.4 ============================================================================== --- stable/12/share/man/man4/vale.4 Sun Oct 28 05:50:04 2018 (r339838) +++ stable/12/share/man/man4/vale.4 Sun Oct 28 07:50:15 2018 (r339839) @@ -59,18 +59,18 @@ API. .Pp .Nm ports are named -.Pa vale[bdg:][port] +.Pa valeSSS:PPP where .Pa vale is the prefix indicating a VALE switch rather than a standard interface, -.Pa bdg +.Pa SSS indicates a specific switch (the colon is a separator), and -.Pa port +.Pa PPP indicates a port within the switch. -Bridge and port names are arbitrary strings, the only -constraint being that the full name must fit within 16 -characters. +Both SSS and PPP have the form [0-9a-zA-Z_]+ , the string cannot +exceed IFNAMSIZ characters, and PPP cannot be the name of any +existing OS network interface. .Pp See .Xr netmap 4 @@ -97,22 +97,20 @@ Set to non-zero values to enable in-kernel diagnostics Create one switch, with a traffic generator connected to one port, and a netmap-enabled tcpdump instance on another port: .Bd -literal -offset indent -tcpdump -ni vale-a:1 & -pkt-gen -i vale-a:0 -f tx & +tcpdump -ni valea:1 & +pkt-gen -i valea:0 -f tx & .Ed .Pp Create two switches, each connected to two qemu machines on different ports. .Bd -literal -offset indent -qemu -net nic -net netmap,ifname=vale-1:a ... & -qemu -net nic -net netmap,ifname=vale-1:b ... & -qemu -net nic -net netmap,ifname=vale-2:c ... & -qemu -net nic -net netmap,ifname=vale-2:d ... & +qemu -net nic -net netmap,ifname=vale1:a ... & +qemu -net nic -net netmap,ifname=vale1:b ... & +qemu -net nic -net netmap,ifname=vale2:c ... & +qemu -net nic -net netmap,ifname=vale2:d ... & .Ed .Sh SEE ALSO .Xr netmap 4 -.Pp -.Xr http://info.iet.unipi.it/~luigi/vale/ .Pp Luigi Rizzo, Giuseppe Lettieri: VALE, a switched ethernet for virtual machines, June 2012, http://info.iet.unipi.it/~luigi/vale/ From owner-svn-src-all@freebsd.org Sun Oct 28 05:41:14 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Oct 28 05:50:05 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Oct 28 10:59:50 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Oct 28 18:21:15 2018 Return-Path: Delivered-To: svn-src-all@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 F07BB10DC444; Sun, 28 Oct 2018 18:21:14 +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 A69A18FE2B; Sun, 28 Oct 2018 18:21:14 +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 87C1F22F98; Sun, 28 Oct 2018 18:21:14 +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 w9SILEY8013688; Sun, 28 Oct 2018 18:21:14 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9SILEWH013687; Sun, 28 Oct 2018 18:21:14 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810281821.w9SILEWH013687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 28 Oct 2018 18:21:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339841 - stable/12/sbin/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sbin/ipfw X-SVN-Commit-Revision: 339841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 18:21:15 -0000 Author: ae Date: Sun Oct 28 18:21:14 2018 New Revision: 339841 URL: https://svnweb.freebsd.org/changeset/base/339841 Log: MFC r339740: Use correct format specificator to print setdscp action. PR: 232642 Approved by: re (rgrimes) Modified: stable/12/sbin/ipfw/ipfw2.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ipfw/ipfw2.c ============================================================================== --- stable/12/sbin/ipfw/ipfw2.c Sun Oct 28 10:59:49 2018 (r339840) +++ stable/12/sbin/ipfw/ipfw2.c Sun Oct 28 18:21:14 2018 (r339841) @@ -1946,7 +1946,7 @@ print_action_instruction(struct buf_pr *bp, const stru if (s != NULL) bprintf(bp, "setdscp %s", s); else - bprintf(bp, "setdscp %s", cmd->arg1 & 0x3F); + bprintf(bp, "setdscp %u", cmd->arg1 & 0x3F); break; case O_REASS: bprintf(bp, "reass"); From owner-svn-src-all@freebsd.org Sun Oct 28 18:23:14 2018 Return-Path: Delivered-To: svn-src-all@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 6CAFD10DC520; Sun, 28 Oct 2018 18:23:14 +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 2222C69AFD; Sun, 28 Oct 2018 18:23:14 +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 03A0523006; Sun, 28 Oct 2018 18:23:14 +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 w9SINDUV016040; Sun, 28 Oct 2018 18:23:13 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9SINDvq016039; Sun, 28 Oct 2018 18:23:13 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810281823.w9SINDvq016039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 28 Oct 2018 18:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339842 - stable/11/sbin/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sbin/ipfw X-SVN-Commit-Revision: 339842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 18:23:14 -0000 Author: ae Date: Sun Oct 28 18:23:13 2018 New Revision: 339842 URL: https://svnweb.freebsd.org/changeset/base/339842 Log: MFC r339740: Use correct format specificator to print setdscp action. PR: 232642 Modified: stable/11/sbin/ipfw/ipfw2.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/ipfw2.c ============================================================================== --- stable/11/sbin/ipfw/ipfw2.c Sun Oct 28 18:21:14 2018 (r339841) +++ stable/11/sbin/ipfw/ipfw2.c Sun Oct 28 18:23:13 2018 (r339842) @@ -1946,7 +1946,7 @@ print_action_instruction(struct buf_pr *bp, const stru if (s != NULL) bprintf(bp, "setdscp %s", s); else - bprintf(bp, "setdscp %s", cmd->arg1 & 0x3F); + bprintf(bp, "setdscp %u", cmd->arg1 & 0x3F); break; case O_REASS: bprintf(bp, "reass"); From owner-svn-src-all@freebsd.org Sun Oct 28 18:32:49 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Oct 28 19:29:08 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Oct 28 22:09:19 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Oct 28 23:50:27 2018 Return-Path: Delivered-To: svn-src-all@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 73ACD10E9C07; Sun, 28 Oct 2018 23:50:27 +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 29E0E756D0; Sun, 28 Oct 2018 23:50:27 +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 F3F8026558; Sun, 28 Oct 2018 23:50:26 +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 w9SNoQWu085908; Sun, 28 Oct 2018 23:50:26 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9SNoPsr085900; Sun, 28 Oct 2018 23:50:25 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201810282350.w9SNoPsr085900@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:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r339846 - vendor/tzdata/dist X-SVN-Group: vendor X-SVN-Commit-Author: philip X-SVN-Commit-Paths: vendor/tzdata/dist X-SVN-Commit-Revision: 339846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 23:50:27 -0000 Author: philip Date: Sun Oct 28 23:50:24 2018 New Revision: 339846 URL: https://svnweb.freebsd.org/changeset/base/339846 Log: Import tzdata 2018g Modified: vendor/tzdata/dist/NEWS vendor/tzdata/dist/africa vendor/tzdata/dist/europe vendor/tzdata/dist/northamerica vendor/tzdata/dist/theory.html vendor/tzdata/dist/version vendor/tzdata/dist/ziguard.awk vendor/tzdata/dist/zishrink.awk Modified: vendor/tzdata/dist/NEWS ============================================================================== --- vendor/tzdata/dist/NEWS Sun Oct 28 22:09:18 2018 (r339845) +++ vendor/tzdata/dist/NEWS Sun Oct 28 23:50:24 2018 (r339846) @@ -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: vendor/tzdata/dist/africa ============================================================================== --- vendor/tzdata/dist/africa Sun Oct 28 22:09:18 2018 (r339845) +++ vendor/tzdata/dist/africa Sun Oct 28 23:50:24 2018 (r339846) @@ -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: vendor/tzdata/dist/europe ============================================================================== --- vendor/tzdata/dist/europe Sun Oct 28 22:09:18 2018 (r339845) +++ vendor/tzdata/dist/europe Sun Oct 28 23:50:24 2018 (r339846) @@ -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: vendor/tzdata/dist/northamerica ============================================================================== --- vendor/tzdata/dist/northamerica Sun Oct 28 22:09:18 2018 (r339845) +++ vendor/tzdata/dist/northamerica Sun Oct 28 23:50:24 2018 (r339846) @@ -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: vendor/tzdata/dist/theory.html ============================================================================== --- vendor/tzdata/dist/theory.html Sun Oct 28 22:09:18 2018 (r339845) +++ vendor/tzdata/dist/theory.html Sun Oct 28 23:50:24 2018 (r339846) @@ -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: vendor/tzdata/dist/version ============================================================================== --- vendor/tzdata/dist/version Sun Oct 28 22:09:18 2018 (r339845) +++ vendor/tzdata/dist/version Sun Oct 28 23:50:24 2018 (r339846) @@ -1 +1 @@ -2018f +2018g Modified: vendor/tzdata/dist/ziguard.awk ============================================================================== --- vendor/tzdata/dist/ziguard.awk Sun Oct 28 22:09:18 2018 (r339845) +++ vendor/tzdata/dist/ziguard.awk Sun Oct 28 23:50:24 2018 (r339846) @@ -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: vendor/tzdata/dist/zishrink.awk ============================================================================== --- vendor/tzdata/dist/zishrink.awk Sun Oct 28 22:09:18 2018 (r339845) +++ vendor/tzdata/dist/zishrink.awk Sun Oct 28 23:50:24 2018 (r339846) @@ -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-all@freebsd.org Sun Oct 28 23:51:01 2018 Return-Path: Delivered-To: svn-src-all@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 ED26B10E9D49; Sun, 28 Oct 2018 23:51:00 +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 A08A67593D; Sun, 28 Oct 2018 23:51:00 +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 69F4926579; Sun, 28 Oct 2018 23:51:00 +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 w9SNp0q5085973; Sun, 28 Oct 2018 23:51:00 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9SNp0ui085972; Sun, 28 Oct 2018 23:51:00 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201810282351.w9SNp0ui085972@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:51:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r339847 - vendor/tzdata/tzdata2018g X-SVN-Group: vendor X-SVN-Commit-Author: philip X-SVN-Commit-Paths: vendor/tzdata/tzdata2018g X-SVN-Commit-Revision: 339847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 23:51:01 -0000 Author: philip Date: Sun Oct 28 23:51:00 2018 New Revision: 339847 URL: https://svnweb.freebsd.org/changeset/base/339847 Log: Tag import of tzdata2018g Added: vendor/tzdata/tzdata2018g/ - copied from r339846, vendor/tzdata/dist/ From owner-svn-src-all@freebsd.org Sun Oct 28 23:54:08 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Mon Oct 29 02:58:31 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 12:08:16 2018 Return-Path: Delivered-To: svn-src-all@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 55FD410D612B; Mon, 29 Oct 2018 12:08:16 +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 E2D6C6E1C4; Mon, 29 Oct 2018 12:08:15 +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 BEF796348; Mon, 29 Oct 2018 12:08:15 +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 w9TC8FNU064329; Mon, 29 Oct 2018 12:08:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TC8FB3064328; Mon, 29 Oct 2018 12:08:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810291208.w9TC8FB3064328@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 12:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339851 - stable/12/sys/dev/usb/serial X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/usb/serial X-SVN-Commit-Revision: 339851 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 12:08:16 -0000 Author: hselasky Date: Mon Oct 29 12:08:15 2018 New Revision: 339851 URL: https://svnweb.freebsd.org/changeset/base/339851 Log: MFC r339587: Added support for formula-based arbitrary baud rates, in contrast to the current fixed values, which enables use of rates above 1 Mbps. Improved the detection of HXD chips, and the status flag handling as well. Submitted by: Gabor Simon PR: 225932 Approved by: re (kib) Differential revision: https://reviews.freebsd.org/D16639 Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/usb/serial/uplcom.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/serial/uplcom.c ============================================================================== --- stable/12/sys/dev/usb/serial/uplcom.c Mon Oct 29 09:06:20 2018 (r339850) +++ stable/12/sys/dev/usb/serial/uplcom.c Mon Oct 29 12:08:15 2018 (r339851) @@ -134,12 +134,20 @@ SYSCTL_INT(_hw_usb_uplcom, OID_AUTO, debug, CTLFLAG_RW #define UPLCOM_SET_CRTSCTS 0x41 #define UPLCOM_SET_CRTSCTS_PL2303X 0x61 #define RSAQ_STATUS_CTS 0x80 +#define RSAQ_STATUS_OVERRUN_ERROR 0x40 +#define RSAQ_STATUS_PARITY_ERROR 0x20 +#define RSAQ_STATUS_FRAME_ERROR 0x10 +#define RSAQ_STATUS_RING 0x08 +#define RSAQ_STATUS_BREAK_ERROR 0x04 #define RSAQ_STATUS_DSR 0x02 #define RSAQ_STATUS_DCD 0x01 #define TYPE_PL2303 0 #define TYPE_PL2303HX 1 +#define TYPE_PL2303HXD 2 +#define UPLCOM_STATE_INDEX 8 + enum { UPLCOM_BULK_DT_WR, UPLCOM_BULK_DT_RD, @@ -369,18 +377,49 @@ uplcom_attach(device_t dev) sc->sc_udev = uaa->device; - /* Determine the chip type. This algorithm is taken from Linux. */ dd = usbd_get_device_descriptor(sc->sc_udev); - if (dd->bDeviceClass == 0x02) - sc->sc_chiptype = TYPE_PL2303; - else if (dd->bMaxPacketSize == 0x40) + + switch (UGETW(dd->bcdDevice)) { + case 0x0300: sc->sc_chiptype = TYPE_PL2303HX; - else - sc->sc_chiptype = TYPE_PL2303; + /* or TA, that is HX with external crystal */ + break; + case 0x0400: + sc->sc_chiptype = TYPE_PL2303HXD; + /* or EA, that is HXD with ESD protection */ + /* or RA, that has internal voltage level converter that works only up to 1Mbaud (!) */ + break; + case 0x0500: + sc->sc_chiptype = TYPE_PL2303HXD; + /* in fact it's TB, that is HXD with external crystal */ + break; + default: + /* NOTE: I have no info about the bcdDevice for the base PL2303 (up to 1.2Mbaud, + only fixed rates) and for PL2303SA (8-pin chip, up to 115200 baud */ + /* Determine the chip type. This algorithm is taken from Linux. */ + if (dd->bDeviceClass == 0x02) + sc->sc_chiptype = TYPE_PL2303; + else if (dd->bMaxPacketSize == 0x40) + sc->sc_chiptype = TYPE_PL2303HX; + else + sc->sc_chiptype = TYPE_PL2303; + break; + } - DPRINTF("chiptype: %s\n", - (sc->sc_chiptype == TYPE_PL2303HX) ? - "2303X" : "2303"); + switch (sc->sc_chiptype) { + case TYPE_PL2303: + DPRINTF("chiptype: 2303\n"); + break; + case TYPE_PL2303HX: + DPRINTF("chiptype: 2303HX/TA\n"); + break; + case TYPE_PL2303HXD: + DPRINTF("chiptype: 2303HXD/TB/RA/EA\n"); + break; + default: + DPRINTF("chiptype: unknown %d\n", sc->sc_chiptype); + break; + } /* * USB-RSAQ1 has two interface @@ -429,13 +468,14 @@ uplcom_attach(device_t dev) goto detach; } - if (sc->sc_chiptype != TYPE_PL2303HX) { + if (sc->sc_chiptype == TYPE_PL2303) { /* HX variants seem to lock up after a clear stall request. */ mtx_lock(&sc->sc_mtx); usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_WR]); usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_RD]); mtx_unlock(&sc->sc_mtx); } else { + /* reset upstream data pipes */ if (uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 8, 0, 0) || uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, @@ -554,7 +594,7 @@ uplcom_pl2303_init(struct usb_device *udev, uint8_t ch || uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 1, 0, 0)) return (EIO); - if (chiptype == TYPE_PL2303HX) + if (chiptype != TYPE_PL2303) err = uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 2, 0x44, 0); else err = uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 2, 0x24, 0); @@ -634,23 +674,52 @@ uplcom_cfg_set_break(struct ucom_softc *ucom, uint8_t &req, NULL, 0, 1000); } +/* + * NOTE: These baud rates are officially supported, they can be written + * directly into dwDTERate register. + * + * Free baudrate setting is not supported by the base PL2303, and on + * other models it requires writing a divisor value to dwDTERate instead + * of the raw baudrate. The formula for divisor calculation is not published + * by the vendor, so it is speculative, though the official product homepage + * refers to the Linux module source as a reference implementation. + */ static const uint32_t uplcom_rates[] = { - 75, 150, 300, 600, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 14400, - 19200, 28800, 38400, 57600, 115200, /* - * Higher speeds are probably possible. PL2303X supports up to - * 6Mb and can set any rate + * Basic 'standard' speed rates, supported by all models + * NOTE: 900 and 56000 actually works as well */ - 230400, 460800, 614400, 921600, 1228800 + 75, 150, 300, 600, 900, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 14400, + 19200, 28800, 38400, 56000, 57600, 115200, + /* + * Advanced speed rates up to 6Mbs, supported by HX/TA and HXD/TB/EA/RA + * NOTE: regardless of the spec, 256000 does not work + */ + 128000, 134400, 161280, 201600, 230400, 268800, 403200, 460800, 614400, + 806400, 921600, 1228800, 2457600, 3000000, 6000000, + /* + * Advanced speed rates up to 12, supported by HXD/TB/EA/RA + */ + 12000000 }; #define N_UPLCOM_RATES nitems(uplcom_rates) static int +uplcom_baud_supported(unsigned int speed) +{ + int i; + for (i = 0; i < N_UPLCOM_RATES; i++) { + if (uplcom_rates[i] == speed) + return 1; + } + return 0; +} + +static int uplcom_pre_param(struct ucom_softc *ucom, struct termios *t) { struct uplcom_softc *sc = ucom->sc_parent; - uint8_t i; DPRINTF("\n"); @@ -658,26 +727,75 @@ uplcom_pre_param(struct ucom_softc *ucom, struct termi * Check requested baud rate. * * The PL2303 can only set specific baud rates, up to 1228800 baud. - * The PL2303X can set any baud rate up to 6Mb. + * The PL2303HX can set any baud rate up to 6Mb. * The PL2303HX rev. D can set any baud rate up to 12Mb. * - * XXX: We currently cannot identify the PL2303HX rev. D, so treat - * it the same as the PL2303X. */ - if (sc->sc_chiptype != TYPE_PL2303HX) { - for (i = 0; i < N_UPLCOM_RATES; i++) { - if (uplcom_rates[i] == t->c_ospeed) + + /* accept raw divisor data, if someone wants to do the math in user domain */ + if (t->c_ospeed & 0x80000000) + return 0; + switch (sc->sc_chiptype) { + case TYPE_PL2303HXD: + if (t->c_ospeed <= 12000000) return (0); - } - } else { - if (t->c_ospeed <= 6000000) - return (0); + break; + case TYPE_PL2303HX: + if (t->c_ospeed <= 6000000) + return (0); + break; + default: + if (uplcom_baud_supported(t->c_ospeed)) + return (0); + break; } DPRINTF("uplcom_param: bad baud rate (%d)\n", t->c_ospeed); return (EIO); } +static unsigned int +uplcom_encode_baud_rate_divisor(uint8_t *buf, unsigned int baud) +{ + unsigned int baseline, mantissa, exponent; + + /* Determine the baud rate divisor. This algorithm is taken from Linux. */ + /* + * Apparently the formula is: + * baudrate = baseline / (mantissa * 4^exponent) + * where + * mantissa = buf[8:0] + * exponent = buf[11:9] + */ + if (baud == 0) + baud = 1; + baseline = 383385600; + mantissa = baseline / baud; + if (mantissa == 0) + mantissa = 1; + exponent = 0; + while (mantissa >= 512) { + if (exponent < 7) { + mantissa >>= 2; /* divide by 4 */ + exponent++; + } else { + /* Exponent is maxed. Trim mantissa and leave. This gives approx. 45.8 baud */ + mantissa = 511; + break; + } + } + + buf[3] = 0x80; + buf[2] = 0; + buf[1] = exponent << 1 | mantissa >> 8; + buf[0] = mantissa & 0xff; + + /* Calculate and return the exact baud rate. */ + baud = (baseline / mantissa) >> (exponent << 1); + DPRINTF("real baud rate will be %u\n", baud); + + return baud; +} static void uplcom_cfg_param(struct ucom_softc *ucom, struct termios *t) { @@ -689,10 +807,24 @@ uplcom_cfg_param(struct ucom_softc *ucom, struct termi memset(&ls, 0, sizeof(ls)); - USETDW(ls.dwDTERate, t->c_ospeed); + /* + * NOTE: If unsupported baud rates are set directly, the PL2303* uses 9600 baud. + */ + if ((t->c_ospeed & 0x80000000) || uplcom_baud_supported(t->c_ospeed)) + USETDW(ls.dwDTERate, t->c_ospeed); + else + t->c_ospeed = uplcom_encode_baud_rate_divisor((uint8_t*)&ls.dwDTERate, t->c_ospeed); if (t->c_cflag & CSTOPB) { - ls.bCharFormat = UCDC_STOP_BIT_2; + if ((t->c_cflag & CSIZE) == CS5) { + /* + * NOTE: Comply with "real" UARTs / RS232: + * use 1.5 instead of 2 stop bits with 5 data bits + */ + ls.bCharFormat = UCDC_STOP_BIT_1_5; + } else { + ls.bCharFormat = UCDC_STOP_BIT_2; + } } else { ls.bCharFormat = UCDC_STOP_BIT_1; } @@ -722,7 +854,7 @@ uplcom_cfg_param(struct ucom_softc *ucom, struct termi break; } - DPRINTF("rate=%d fmt=%d parity=%d bits=%d\n", + DPRINTF("rate=0x%08x fmt=%d parity=%d bits=%d\n", UGETDW(ls.dwDTERate), ls.bCharFormat, ls.bParityType, ls.bDataBits); @@ -743,7 +875,7 @@ uplcom_cfg_param(struct ucom_softc *ucom, struct termi req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = UPLCOM_SET_REQUEST; USETW(req.wValue, 0); - if (sc->sc_chiptype == TYPE_PL2303HX) + if (sc->sc_chiptype != TYPE_PL2303) USETW(req.wIndex, UPLCOM_SET_CRTSCTS_PL2303X); else USETW(req.wIndex, UPLCOM_SET_CRTSCTS); @@ -809,7 +941,6 @@ uplcom_cfg_get_status(struct ucom_softc *ucom, uint8_t DPRINTF("\n"); - /* XXX Note: sc_lsr is always zero */ *lsr = sc->sc_lsr; *msr = sc->sc_msr; } @@ -834,18 +965,33 @@ uplcom_intr_callback(struct usb_xfer *xfer, usb_error_ pc = usbd_xfer_get_frame(xfer, 0); usbd_copy_out(pc, 0, buf, sizeof(buf)); - DPRINTF("status = 0x%02x\n", buf[8]); + DPRINTF("status = 0x%02x\n", buf[UPLCOM_STATE_INDEX]); sc->sc_lsr = 0; sc->sc_msr = 0; - if (buf[8] & RSAQ_STATUS_CTS) { + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_CTS) { sc->sc_msr |= SER_CTS; } - if (buf[8] & RSAQ_STATUS_DSR) { + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_OVERRUN_ERROR) { + sc->sc_lsr |= ULSR_OE; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_PARITY_ERROR) { + sc->sc_lsr |= ULSR_PE; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_FRAME_ERROR) { + sc->sc_lsr |= ULSR_FE; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_RING) { + sc->sc_msr |= SER_RI; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_BREAK_ERROR) { + sc->sc_lsr |= ULSR_BI; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_DSR) { sc->sc_msr |= SER_DSR; } - if (buf[8] & RSAQ_STATUS_DCD) { + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_DCD) { sc->sc_msr |= SER_DCD; } ucom_status_change(&sc->sc_ucom); From owner-svn-src-all@freebsd.org Mon Oct 29 12:10:07 2018 Return-Path: Delivered-To: svn-src-all@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 AD28310D6218; Mon, 29 Oct 2018 12:10:07 +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 5FD146E361; Mon, 29 Oct 2018 12:10:07 +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 3FEC2634F; Mon, 29 Oct 2018 12:10:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TCA7Z4064499; Mon, 29 Oct 2018 12:10:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TCA7qw064498; Mon, 29 Oct 2018 12:10:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810291210.w9TCA7qw064498@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 12:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339852 - stable/11/sys/dev/usb/serial X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/usb/serial X-SVN-Commit-Revision: 339852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 12:10:07 -0000 Author: hselasky Date: Mon Oct 29 12:10:06 2018 New Revision: 339852 URL: https://svnweb.freebsd.org/changeset/base/339852 Log: MFC r339587: Added support for formula-based arbitrary baud rates, in contrast to the current fixed values, which enables use of rates above 1 Mbps. Improved the detection of HXD chips, and the status flag handling as well. Submitted by: Gabor Simon PR: 225932 Differential revision: https://reviews.freebsd.org/D16639 Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/serial/uplcom.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/serial/uplcom.c ============================================================================== --- stable/11/sys/dev/usb/serial/uplcom.c Mon Oct 29 12:08:15 2018 (r339851) +++ stable/11/sys/dev/usb/serial/uplcom.c Mon Oct 29 12:10:06 2018 (r339852) @@ -132,12 +132,20 @@ SYSCTL_INT(_hw_usb_uplcom, OID_AUTO, debug, CTLFLAG_RW #define UPLCOM_SET_CRTSCTS 0x41 #define UPLCOM_SET_CRTSCTS_PL2303X 0x61 #define RSAQ_STATUS_CTS 0x80 +#define RSAQ_STATUS_OVERRUN_ERROR 0x40 +#define RSAQ_STATUS_PARITY_ERROR 0x20 +#define RSAQ_STATUS_FRAME_ERROR 0x10 +#define RSAQ_STATUS_RING 0x08 +#define RSAQ_STATUS_BREAK_ERROR 0x04 #define RSAQ_STATUS_DSR 0x02 #define RSAQ_STATUS_DCD 0x01 #define TYPE_PL2303 0 #define TYPE_PL2303HX 1 +#define TYPE_PL2303HXD 2 +#define UPLCOM_STATE_INDEX 8 + enum { UPLCOM_BULK_DT_WR, UPLCOM_BULK_DT_RD, @@ -367,18 +375,49 @@ uplcom_attach(device_t dev) sc->sc_udev = uaa->device; - /* Determine the chip type. This algorithm is taken from Linux. */ dd = usbd_get_device_descriptor(sc->sc_udev); - if (dd->bDeviceClass == 0x02) - sc->sc_chiptype = TYPE_PL2303; - else if (dd->bMaxPacketSize == 0x40) + + switch (UGETW(dd->bcdDevice)) { + case 0x0300: sc->sc_chiptype = TYPE_PL2303HX; - else - sc->sc_chiptype = TYPE_PL2303; + /* or TA, that is HX with external crystal */ + break; + case 0x0400: + sc->sc_chiptype = TYPE_PL2303HXD; + /* or EA, that is HXD with ESD protection */ + /* or RA, that has internal voltage level converter that works only up to 1Mbaud (!) */ + break; + case 0x0500: + sc->sc_chiptype = TYPE_PL2303HXD; + /* in fact it's TB, that is HXD with external crystal */ + break; + default: + /* NOTE: I have no info about the bcdDevice for the base PL2303 (up to 1.2Mbaud, + only fixed rates) and for PL2303SA (8-pin chip, up to 115200 baud */ + /* Determine the chip type. This algorithm is taken from Linux. */ + if (dd->bDeviceClass == 0x02) + sc->sc_chiptype = TYPE_PL2303; + else if (dd->bMaxPacketSize == 0x40) + sc->sc_chiptype = TYPE_PL2303HX; + else + sc->sc_chiptype = TYPE_PL2303; + break; + } - DPRINTF("chiptype: %s\n", - (sc->sc_chiptype == TYPE_PL2303HX) ? - "2303X" : "2303"); + switch (sc->sc_chiptype) { + case TYPE_PL2303: + DPRINTF("chiptype: 2303\n"); + break; + case TYPE_PL2303HX: + DPRINTF("chiptype: 2303HX/TA\n"); + break; + case TYPE_PL2303HXD: + DPRINTF("chiptype: 2303HXD/TB/RA/EA\n"); + break; + default: + DPRINTF("chiptype: unknown %d\n", sc->sc_chiptype); + break; + } /* * USB-RSAQ1 has two interface @@ -427,13 +466,14 @@ uplcom_attach(device_t dev) goto detach; } - if (sc->sc_chiptype != TYPE_PL2303HX) { + if (sc->sc_chiptype == TYPE_PL2303) { /* HX variants seem to lock up after a clear stall request. */ mtx_lock(&sc->sc_mtx); usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_WR]); usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_RD]); mtx_unlock(&sc->sc_mtx); } else { + /* reset upstream data pipes */ if (uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 8, 0, 0) || uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, @@ -552,7 +592,7 @@ uplcom_pl2303_init(struct usb_device *udev, uint8_t ch || uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 1, 0, 0)) return (EIO); - if (chiptype == TYPE_PL2303HX) + if (chiptype != TYPE_PL2303) err = uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 2, 0x44, 0); else err = uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 2, 0x24, 0); @@ -632,23 +672,52 @@ uplcom_cfg_set_break(struct ucom_softc *ucom, uint8_t &req, NULL, 0, 1000); } +/* + * NOTE: These baud rates are officially supported, they can be written + * directly into dwDTERate register. + * + * Free baudrate setting is not supported by the base PL2303, and on + * other models it requires writing a divisor value to dwDTERate instead + * of the raw baudrate. The formula for divisor calculation is not published + * by the vendor, so it is speculative, though the official product homepage + * refers to the Linux module source as a reference implementation. + */ static const uint32_t uplcom_rates[] = { - 75, 150, 300, 600, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 14400, - 19200, 28800, 38400, 57600, 115200, /* - * Higher speeds are probably possible. PL2303X supports up to - * 6Mb and can set any rate + * Basic 'standard' speed rates, supported by all models + * NOTE: 900 and 56000 actually works as well */ - 230400, 460800, 614400, 921600, 1228800 + 75, 150, 300, 600, 900, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 14400, + 19200, 28800, 38400, 56000, 57600, 115200, + /* + * Advanced speed rates up to 6Mbs, supported by HX/TA and HXD/TB/EA/RA + * NOTE: regardless of the spec, 256000 does not work + */ + 128000, 134400, 161280, 201600, 230400, 268800, 403200, 460800, 614400, + 806400, 921600, 1228800, 2457600, 3000000, 6000000, + /* + * Advanced speed rates up to 12, supported by HXD/TB/EA/RA + */ + 12000000 }; #define N_UPLCOM_RATES nitems(uplcom_rates) static int +uplcom_baud_supported(unsigned int speed) +{ + int i; + for (i = 0; i < N_UPLCOM_RATES; i++) { + if (uplcom_rates[i] == speed) + return 1; + } + return 0; +} + +static int uplcom_pre_param(struct ucom_softc *ucom, struct termios *t) { struct uplcom_softc *sc = ucom->sc_parent; - uint8_t i; DPRINTF("\n"); @@ -656,26 +725,75 @@ uplcom_pre_param(struct ucom_softc *ucom, struct termi * Check requested baud rate. * * The PL2303 can only set specific baud rates, up to 1228800 baud. - * The PL2303X can set any baud rate up to 6Mb. + * The PL2303HX can set any baud rate up to 6Mb. * The PL2303HX rev. D can set any baud rate up to 12Mb. * - * XXX: We currently cannot identify the PL2303HX rev. D, so treat - * it the same as the PL2303X. */ - if (sc->sc_chiptype != TYPE_PL2303HX) { - for (i = 0; i < N_UPLCOM_RATES; i++) { - if (uplcom_rates[i] == t->c_ospeed) + + /* accept raw divisor data, if someone wants to do the math in user domain */ + if (t->c_ospeed & 0x80000000) + return 0; + switch (sc->sc_chiptype) { + case TYPE_PL2303HXD: + if (t->c_ospeed <= 12000000) return (0); - } - } else { - if (t->c_ospeed <= 6000000) - return (0); + break; + case TYPE_PL2303HX: + if (t->c_ospeed <= 6000000) + return (0); + break; + default: + if (uplcom_baud_supported(t->c_ospeed)) + return (0); + break; } DPRINTF("uplcom_param: bad baud rate (%d)\n", t->c_ospeed); return (EIO); } +static unsigned int +uplcom_encode_baud_rate_divisor(uint8_t *buf, unsigned int baud) +{ + unsigned int baseline, mantissa, exponent; + + /* Determine the baud rate divisor. This algorithm is taken from Linux. */ + /* + * Apparently the formula is: + * baudrate = baseline / (mantissa * 4^exponent) + * where + * mantissa = buf[8:0] + * exponent = buf[11:9] + */ + if (baud == 0) + baud = 1; + baseline = 383385600; + mantissa = baseline / baud; + if (mantissa == 0) + mantissa = 1; + exponent = 0; + while (mantissa >= 512) { + if (exponent < 7) { + mantissa >>= 2; /* divide by 4 */ + exponent++; + } else { + /* Exponent is maxed. Trim mantissa and leave. This gives approx. 45.8 baud */ + mantissa = 511; + break; + } + } + + buf[3] = 0x80; + buf[2] = 0; + buf[1] = exponent << 1 | mantissa >> 8; + buf[0] = mantissa & 0xff; + + /* Calculate and return the exact baud rate. */ + baud = (baseline / mantissa) >> (exponent << 1); + DPRINTF("real baud rate will be %u\n", baud); + + return baud; +} static void uplcom_cfg_param(struct ucom_softc *ucom, struct termios *t) { @@ -687,10 +805,24 @@ uplcom_cfg_param(struct ucom_softc *ucom, struct termi memset(&ls, 0, sizeof(ls)); - USETDW(ls.dwDTERate, t->c_ospeed); + /* + * NOTE: If unsupported baud rates are set directly, the PL2303* uses 9600 baud. + */ + if ((t->c_ospeed & 0x80000000) || uplcom_baud_supported(t->c_ospeed)) + USETDW(ls.dwDTERate, t->c_ospeed); + else + t->c_ospeed = uplcom_encode_baud_rate_divisor((uint8_t*)&ls.dwDTERate, t->c_ospeed); if (t->c_cflag & CSTOPB) { - ls.bCharFormat = UCDC_STOP_BIT_2; + if ((t->c_cflag & CSIZE) == CS5) { + /* + * NOTE: Comply with "real" UARTs / RS232: + * use 1.5 instead of 2 stop bits with 5 data bits + */ + ls.bCharFormat = UCDC_STOP_BIT_1_5; + } else { + ls.bCharFormat = UCDC_STOP_BIT_2; + } } else { ls.bCharFormat = UCDC_STOP_BIT_1; } @@ -720,7 +852,7 @@ uplcom_cfg_param(struct ucom_softc *ucom, struct termi break; } - DPRINTF("rate=%d fmt=%d parity=%d bits=%d\n", + DPRINTF("rate=0x%08x fmt=%d parity=%d bits=%d\n", UGETDW(ls.dwDTERate), ls.bCharFormat, ls.bParityType, ls.bDataBits); @@ -741,7 +873,7 @@ uplcom_cfg_param(struct ucom_softc *ucom, struct termi req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = UPLCOM_SET_REQUEST; USETW(req.wValue, 0); - if (sc->sc_chiptype == TYPE_PL2303HX) + if (sc->sc_chiptype != TYPE_PL2303) USETW(req.wIndex, UPLCOM_SET_CRTSCTS_PL2303X); else USETW(req.wIndex, UPLCOM_SET_CRTSCTS); @@ -807,7 +939,6 @@ uplcom_cfg_get_status(struct ucom_softc *ucom, uint8_t DPRINTF("\n"); - /* XXX Note: sc_lsr is always zero */ *lsr = sc->sc_lsr; *msr = sc->sc_msr; } @@ -832,18 +963,33 @@ uplcom_intr_callback(struct usb_xfer *xfer, usb_error_ pc = usbd_xfer_get_frame(xfer, 0); usbd_copy_out(pc, 0, buf, sizeof(buf)); - DPRINTF("status = 0x%02x\n", buf[8]); + DPRINTF("status = 0x%02x\n", buf[UPLCOM_STATE_INDEX]); sc->sc_lsr = 0; sc->sc_msr = 0; - if (buf[8] & RSAQ_STATUS_CTS) { + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_CTS) { sc->sc_msr |= SER_CTS; } - if (buf[8] & RSAQ_STATUS_DSR) { + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_OVERRUN_ERROR) { + sc->sc_lsr |= ULSR_OE; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_PARITY_ERROR) { + sc->sc_lsr |= ULSR_PE; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_FRAME_ERROR) { + sc->sc_lsr |= ULSR_FE; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_RING) { + sc->sc_msr |= SER_RI; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_BREAK_ERROR) { + sc->sc_lsr |= ULSR_BI; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_DSR) { sc->sc_msr |= SER_DSR; } - if (buf[8] & RSAQ_STATUS_DCD) { + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_DCD) { sc->sc_msr |= SER_DCD; } ucom_status_change(&sc->sc_ucom); From owner-svn-src-all@freebsd.org Mon Oct 29 12:11:28 2018 Return-Path: Delivered-To: svn-src-all@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 9FA0910D62D3; Mon, 29 Oct 2018 12:11:28 +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 553D56E56E; Mon, 29 Oct 2018 12:11:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3687E6485; Mon, 29 Oct 2018 12:11:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TCBRPA065339; Mon, 29 Oct 2018 12:11:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TCBRQ2065338; Mon, 29 Oct 2018 12:11:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810291211.w9TCBRQ2065338@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 12:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r339853 - stable/10/sys/dev/usb/serial X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/usb/serial X-SVN-Commit-Revision: 339853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 12:11:28 -0000 Author: hselasky Date: Mon Oct 29 12:11:27 2018 New Revision: 339853 URL: https://svnweb.freebsd.org/changeset/base/339853 Log: MFC r339587: Added support for formula-based arbitrary baud rates, in contrast to the current fixed values, which enables use of rates above 1 Mbps. Improved the detection of HXD chips, and the status flag handling as well. Submitted by: Gabor Simon PR: 225932 Differential revision: https://reviews.freebsd.org/D16639 Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/usb/serial/uplcom.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/uplcom.c ============================================================================== --- stable/10/sys/dev/usb/serial/uplcom.c Mon Oct 29 12:10:06 2018 (r339852) +++ stable/10/sys/dev/usb/serial/uplcom.c Mon Oct 29 12:11:27 2018 (r339853) @@ -132,12 +132,20 @@ SYSCTL_INT(_hw_usb_uplcom, OID_AUTO, debug, CTLFLAG_RW #define UPLCOM_SET_CRTSCTS 0x41 #define UPLCOM_SET_CRTSCTS_PL2303X 0x61 #define RSAQ_STATUS_CTS 0x80 +#define RSAQ_STATUS_OVERRUN_ERROR 0x40 +#define RSAQ_STATUS_PARITY_ERROR 0x20 +#define RSAQ_STATUS_FRAME_ERROR 0x10 +#define RSAQ_STATUS_RING 0x08 +#define RSAQ_STATUS_BREAK_ERROR 0x04 #define RSAQ_STATUS_DSR 0x02 #define RSAQ_STATUS_DCD 0x01 #define TYPE_PL2303 0 #define TYPE_PL2303HX 1 +#define TYPE_PL2303HXD 2 +#define UPLCOM_STATE_INDEX 8 + enum { UPLCOM_BULK_DT_WR, UPLCOM_BULK_DT_RD, @@ -366,18 +374,49 @@ uplcom_attach(device_t dev) sc->sc_udev = uaa->device; - /* Determine the chip type. This algorithm is taken from Linux. */ dd = usbd_get_device_descriptor(sc->sc_udev); - if (dd->bDeviceClass == 0x02) - sc->sc_chiptype = TYPE_PL2303; - else if (dd->bMaxPacketSize == 0x40) + + switch (UGETW(dd->bcdDevice)) { + case 0x0300: sc->sc_chiptype = TYPE_PL2303HX; - else - sc->sc_chiptype = TYPE_PL2303; + /* or TA, that is HX with external crystal */ + break; + case 0x0400: + sc->sc_chiptype = TYPE_PL2303HXD; + /* or EA, that is HXD with ESD protection */ + /* or RA, that has internal voltage level converter that works only up to 1Mbaud (!) */ + break; + case 0x0500: + sc->sc_chiptype = TYPE_PL2303HXD; + /* in fact it's TB, that is HXD with external crystal */ + break; + default: + /* NOTE: I have no info about the bcdDevice for the base PL2303 (up to 1.2Mbaud, + only fixed rates) and for PL2303SA (8-pin chip, up to 115200 baud */ + /* Determine the chip type. This algorithm is taken from Linux. */ + if (dd->bDeviceClass == 0x02) + sc->sc_chiptype = TYPE_PL2303; + else if (dd->bMaxPacketSize == 0x40) + sc->sc_chiptype = TYPE_PL2303HX; + else + sc->sc_chiptype = TYPE_PL2303; + break; + } - DPRINTF("chiptype: %s\n", - (sc->sc_chiptype == TYPE_PL2303HX) ? - "2303X" : "2303"); + switch (sc->sc_chiptype) { + case TYPE_PL2303: + DPRINTF("chiptype: 2303\n"); + break; + case TYPE_PL2303HX: + DPRINTF("chiptype: 2303HX/TA\n"); + break; + case TYPE_PL2303HXD: + DPRINTF("chiptype: 2303HXD/TB/RA/EA\n"); + break; + default: + DPRINTF("chiptype: unknown %d\n", sc->sc_chiptype); + break; + } /* * USB-RSAQ1 has two interface @@ -426,13 +465,14 @@ uplcom_attach(device_t dev) goto detach; } - if (sc->sc_chiptype != TYPE_PL2303HX) { + if (sc->sc_chiptype == TYPE_PL2303) { /* HX variants seem to lock up after a clear stall request. */ mtx_lock(&sc->sc_mtx); usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_WR]); usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_RD]); mtx_unlock(&sc->sc_mtx); } else { + /* reset upstream data pipes */ if (uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 8, 0, 0) || uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, @@ -551,7 +591,7 @@ uplcom_pl2303_init(struct usb_device *udev, uint8_t ch || uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 1, 0, 0)) return (EIO); - if (chiptype == TYPE_PL2303HX) + if (chiptype != TYPE_PL2303) err = uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 2, 0x44, 0); else err = uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 2, 0x24, 0); @@ -631,23 +671,52 @@ uplcom_cfg_set_break(struct ucom_softc *ucom, uint8_t &req, NULL, 0, 1000); } +/* + * NOTE: These baud rates are officially supported, they can be written + * directly into dwDTERate register. + * + * Free baudrate setting is not supported by the base PL2303, and on + * other models it requires writing a divisor value to dwDTERate instead + * of the raw baudrate. The formula for divisor calculation is not published + * by the vendor, so it is speculative, though the official product homepage + * refers to the Linux module source as a reference implementation. + */ static const uint32_t uplcom_rates[] = { - 75, 150, 300, 600, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 14400, - 19200, 28800, 38400, 57600, 115200, /* - * Higher speeds are probably possible. PL2303X supports up to - * 6Mb and can set any rate + * Basic 'standard' speed rates, supported by all models + * NOTE: 900 and 56000 actually works as well */ - 230400, 460800, 614400, 921600, 1228800 + 75, 150, 300, 600, 900, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 14400, + 19200, 28800, 38400, 56000, 57600, 115200, + /* + * Advanced speed rates up to 6Mbs, supported by HX/TA and HXD/TB/EA/RA + * NOTE: regardless of the spec, 256000 does not work + */ + 128000, 134400, 161280, 201600, 230400, 268800, 403200, 460800, 614400, + 806400, 921600, 1228800, 2457600, 3000000, 6000000, + /* + * Advanced speed rates up to 12, supported by HXD/TB/EA/RA + */ + 12000000 }; #define N_UPLCOM_RATES (sizeof(uplcom_rates)/sizeof(uplcom_rates[0])) static int +uplcom_baud_supported(unsigned int speed) +{ + int i; + for (i = 0; i < N_UPLCOM_RATES; i++) { + if (uplcom_rates[i] == speed) + return 1; + } + return 0; +} + +static int uplcom_pre_param(struct ucom_softc *ucom, struct termios *t) { struct uplcom_softc *sc = ucom->sc_parent; - uint8_t i; DPRINTF("\n"); @@ -655,26 +724,75 @@ uplcom_pre_param(struct ucom_softc *ucom, struct termi * Check requested baud rate. * * The PL2303 can only set specific baud rates, up to 1228800 baud. - * The PL2303X can set any baud rate up to 6Mb. + * The PL2303HX can set any baud rate up to 6Mb. * The PL2303HX rev. D can set any baud rate up to 12Mb. * - * XXX: We currently cannot identify the PL2303HX rev. D, so treat - * it the same as the PL2303X. */ - if (sc->sc_chiptype != TYPE_PL2303HX) { - for (i = 0; i < N_UPLCOM_RATES; i++) { - if (uplcom_rates[i] == t->c_ospeed) + + /* accept raw divisor data, if someone wants to do the math in user domain */ + if (t->c_ospeed & 0x80000000) + return 0; + switch (sc->sc_chiptype) { + case TYPE_PL2303HXD: + if (t->c_ospeed <= 12000000) return (0); - } - } else { - if (t->c_ospeed <= 6000000) - return (0); + break; + case TYPE_PL2303HX: + if (t->c_ospeed <= 6000000) + return (0); + break; + default: + if (uplcom_baud_supported(t->c_ospeed)) + return (0); + break; } DPRINTF("uplcom_param: bad baud rate (%d)\n", t->c_ospeed); return (EIO); } +static unsigned int +uplcom_encode_baud_rate_divisor(uint8_t *buf, unsigned int baud) +{ + unsigned int baseline, mantissa, exponent; + + /* Determine the baud rate divisor. This algorithm is taken from Linux. */ + /* + * Apparently the formula is: + * baudrate = baseline / (mantissa * 4^exponent) + * where + * mantissa = buf[8:0] + * exponent = buf[11:9] + */ + if (baud == 0) + baud = 1; + baseline = 383385600; + mantissa = baseline / baud; + if (mantissa == 0) + mantissa = 1; + exponent = 0; + while (mantissa >= 512) { + if (exponent < 7) { + mantissa >>= 2; /* divide by 4 */ + exponent++; + } else { + /* Exponent is maxed. Trim mantissa and leave. This gives approx. 45.8 baud */ + mantissa = 511; + break; + } + } + + buf[3] = 0x80; + buf[2] = 0; + buf[1] = exponent << 1 | mantissa >> 8; + buf[0] = mantissa & 0xff; + + /* Calculate and return the exact baud rate. */ + baud = (baseline / mantissa) >> (exponent << 1); + DPRINTF("real baud rate will be %u\n", baud); + + return baud; +} static void uplcom_cfg_param(struct ucom_softc *ucom, struct termios *t) { @@ -686,10 +804,24 @@ uplcom_cfg_param(struct ucom_softc *ucom, struct termi memset(&ls, 0, sizeof(ls)); - USETDW(ls.dwDTERate, t->c_ospeed); + /* + * NOTE: If unsupported baud rates are set directly, the PL2303* uses 9600 baud. + */ + if ((t->c_ospeed & 0x80000000) || uplcom_baud_supported(t->c_ospeed)) + USETDW(ls.dwDTERate, t->c_ospeed); + else + t->c_ospeed = uplcom_encode_baud_rate_divisor((uint8_t*)&ls.dwDTERate, t->c_ospeed); if (t->c_cflag & CSTOPB) { - ls.bCharFormat = UCDC_STOP_BIT_2; + if ((t->c_cflag & CSIZE) == CS5) { + /* + * NOTE: Comply with "real" UARTs / RS232: + * use 1.5 instead of 2 stop bits with 5 data bits + */ + ls.bCharFormat = UCDC_STOP_BIT_1_5; + } else { + ls.bCharFormat = UCDC_STOP_BIT_2; + } } else { ls.bCharFormat = UCDC_STOP_BIT_1; } @@ -719,7 +851,7 @@ uplcom_cfg_param(struct ucom_softc *ucom, struct termi break; } - DPRINTF("rate=%d fmt=%d parity=%d bits=%d\n", + DPRINTF("rate=0x%08x fmt=%d parity=%d bits=%d\n", UGETDW(ls.dwDTERate), ls.bCharFormat, ls.bParityType, ls.bDataBits); @@ -740,7 +872,7 @@ uplcom_cfg_param(struct ucom_softc *ucom, struct termi req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = UPLCOM_SET_REQUEST; USETW(req.wValue, 0); - if (sc->sc_chiptype == TYPE_PL2303HX) + if (sc->sc_chiptype != TYPE_PL2303) USETW(req.wIndex, UPLCOM_SET_CRTSCTS_PL2303X); else USETW(req.wIndex, UPLCOM_SET_CRTSCTS); @@ -830,18 +962,33 @@ uplcom_intr_callback(struct usb_xfer *xfer, usb_error_ pc = usbd_xfer_get_frame(xfer, 0); usbd_copy_out(pc, 0, buf, sizeof(buf)); - DPRINTF("status = 0x%02x\n", buf[8]); + DPRINTF("status = 0x%02x\n", buf[UPLCOM_STATE_INDEX]); sc->sc_lsr = 0; sc->sc_msr = 0; - if (buf[8] & RSAQ_STATUS_CTS) { + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_CTS) { sc->sc_msr |= SER_CTS; } - if (buf[8] & RSAQ_STATUS_DSR) { + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_OVERRUN_ERROR) { + sc->sc_lsr |= ULSR_OE; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_PARITY_ERROR) { + sc->sc_lsr |= ULSR_PE; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_FRAME_ERROR) { + sc->sc_lsr |= ULSR_FE; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_RING) { + sc->sc_msr |= SER_RI; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_BREAK_ERROR) { + sc->sc_lsr |= ULSR_BI; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_DSR) { sc->sc_msr |= SER_DSR; } - if (buf[8] & RSAQ_STATUS_DCD) { + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_DCD) { sc->sc_msr |= SER_DCD; } ucom_status_change(&sc->sc_ucom); From owner-svn-src-all@freebsd.org Mon Oct 29 12:13:06 2018 Return-Path: Delivered-To: svn-src-all@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 2F5CE10D651B; Mon, 29 Oct 2018 12:13:06 +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 D7DBB6E8DB; Mon, 29 Oct 2018 12:13:05 +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 B41AD64DE; Mon, 29 Oct 2018 12:13:05 +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 w9TCD5BH069721; Mon, 29 Oct 2018 12:13:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TCD5Pt069720; Mon, 29 Oct 2018 12:13:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810291213.w9TCD5Pt069720@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 12:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r339854 - stable/9/sys/dev/usb/serial X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/9/sys/dev/usb/serial X-SVN-Commit-Revision: 339854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 12:13:06 -0000 Author: hselasky Date: Mon Oct 29 12:13:05 2018 New Revision: 339854 URL: https://svnweb.freebsd.org/changeset/base/339854 Log: MFC r339587: Added support for formula-based arbitrary baud rates, in contrast to the current fixed values, which enables use of rates above 1 Mbps. Improved the detection of HXD chips, and the status flag handling as well. Submitted by: Gabor Simon PR: 225932 Differential revision: https://reviews.freebsd.org/D16639 Sponsored by: Mellanox Technologies Modified: stable/9/sys/dev/usb/serial/uplcom.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/usb/serial/uplcom.c ============================================================================== --- stable/9/sys/dev/usb/serial/uplcom.c Mon Oct 29 12:11:27 2018 (r339853) +++ stable/9/sys/dev/usb/serial/uplcom.c Mon Oct 29 12:13:05 2018 (r339854) @@ -132,12 +132,20 @@ SYSCTL_INT(_hw_usb_uplcom, OID_AUTO, debug, CTLFLAG_RW #define UPLCOM_SET_CRTSCTS 0x41 #define UPLCOM_SET_CRTSCTS_PL2303X 0x61 #define RSAQ_STATUS_CTS 0x80 +#define RSAQ_STATUS_OVERRUN_ERROR 0x40 +#define RSAQ_STATUS_PARITY_ERROR 0x20 +#define RSAQ_STATUS_FRAME_ERROR 0x10 +#define RSAQ_STATUS_RING 0x08 +#define RSAQ_STATUS_BREAK_ERROR 0x04 #define RSAQ_STATUS_DSR 0x02 #define RSAQ_STATUS_DCD 0x01 #define TYPE_PL2303 0 #define TYPE_PL2303HX 1 +#define TYPE_PL2303HXD 2 +#define UPLCOM_STATE_INDEX 8 + enum { UPLCOM_BULK_DT_WR, UPLCOM_BULK_DT_RD, @@ -366,18 +374,49 @@ uplcom_attach(device_t dev) sc->sc_udev = uaa->device; - /* Determine the chip type. This algorithm is taken from Linux. */ dd = usbd_get_device_descriptor(sc->sc_udev); - if (dd->bDeviceClass == 0x02) - sc->sc_chiptype = TYPE_PL2303; - else if (dd->bMaxPacketSize == 0x40) + + switch (UGETW(dd->bcdDevice)) { + case 0x0300: sc->sc_chiptype = TYPE_PL2303HX; - else - sc->sc_chiptype = TYPE_PL2303; + /* or TA, that is HX with external crystal */ + break; + case 0x0400: + sc->sc_chiptype = TYPE_PL2303HXD; + /* or EA, that is HXD with ESD protection */ + /* or RA, that has internal voltage level converter that works only up to 1Mbaud (!) */ + break; + case 0x0500: + sc->sc_chiptype = TYPE_PL2303HXD; + /* in fact it's TB, that is HXD with external crystal */ + break; + default: + /* NOTE: I have no info about the bcdDevice for the base PL2303 (up to 1.2Mbaud, + only fixed rates) and for PL2303SA (8-pin chip, up to 115200 baud */ + /* Determine the chip type. This algorithm is taken from Linux. */ + if (dd->bDeviceClass == 0x02) + sc->sc_chiptype = TYPE_PL2303; + else if (dd->bMaxPacketSize == 0x40) + sc->sc_chiptype = TYPE_PL2303HX; + else + sc->sc_chiptype = TYPE_PL2303; + break; + } - DPRINTF("chiptype: %s\n", - (sc->sc_chiptype == TYPE_PL2303HX) ? - "2303X" : "2303"); + switch (sc->sc_chiptype) { + case TYPE_PL2303: + DPRINTF("chiptype: 2303\n"); + break; + case TYPE_PL2303HX: + DPRINTF("chiptype: 2303HX/TA\n"); + break; + case TYPE_PL2303HXD: + DPRINTF("chiptype: 2303HXD/TB/RA/EA\n"); + break; + default: + DPRINTF("chiptype: unknown %d\n", sc->sc_chiptype); + break; + } /* * USB-RSAQ1 has two interface @@ -426,13 +465,14 @@ uplcom_attach(device_t dev) goto detach; } - if (sc->sc_chiptype != TYPE_PL2303HX) { + if (sc->sc_chiptype == TYPE_PL2303) { /* HX variants seem to lock up after a clear stall request. */ mtx_lock(&sc->sc_mtx); usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_WR]); usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_RD]); mtx_unlock(&sc->sc_mtx); } else { + /* reset upstream data pipes */ if (uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 8, 0, 0) || uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, @@ -551,7 +591,7 @@ uplcom_pl2303_init(struct usb_device *udev, uint8_t ch || uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 1, 0, 0)) return (EIO); - if (chiptype == TYPE_PL2303HX) + if (chiptype != TYPE_PL2303) err = uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 2, 0x44, 0); else err = uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 2, 0x24, 0); @@ -631,23 +671,52 @@ uplcom_cfg_set_break(struct ucom_softc *ucom, uint8_t &req, NULL, 0, 1000); } +/* + * NOTE: These baud rates are officially supported, they can be written + * directly into dwDTERate register. + * + * Free baudrate setting is not supported by the base PL2303, and on + * other models it requires writing a divisor value to dwDTERate instead + * of the raw baudrate. The formula for divisor calculation is not published + * by the vendor, so it is speculative, though the official product homepage + * refers to the Linux module source as a reference implementation. + */ static const uint32_t uplcom_rates[] = { - 75, 150, 300, 600, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 14400, - 19200, 28800, 38400, 57600, 115200, /* - * Higher speeds are probably possible. PL2303X supports up to - * 6Mb and can set any rate + * Basic 'standard' speed rates, supported by all models + * NOTE: 900 and 56000 actually works as well */ - 230400, 460800, 614400, 921600, 1228800 + 75, 150, 300, 600, 900, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 14400, + 19200, 28800, 38400, 56000, 57600, 115200, + /* + * Advanced speed rates up to 6Mbs, supported by HX/TA and HXD/TB/EA/RA + * NOTE: regardless of the spec, 256000 does not work + */ + 128000, 134400, 161280, 201600, 230400, 268800, 403200, 460800, 614400, + 806400, 921600, 1228800, 2457600, 3000000, 6000000, + /* + * Advanced speed rates up to 12, supported by HXD/TB/EA/RA + */ + 12000000 }; #define N_UPLCOM_RATES (sizeof(uplcom_rates)/sizeof(uplcom_rates[0])) static int +uplcom_baud_supported(unsigned int speed) +{ + int i; + for (i = 0; i < N_UPLCOM_RATES; i++) { + if (uplcom_rates[i] == speed) + return 1; + } + return 0; +} + +static int uplcom_pre_param(struct ucom_softc *ucom, struct termios *t) { struct uplcom_softc *sc = ucom->sc_parent; - uint8_t i; DPRINTF("\n"); @@ -655,26 +724,75 @@ uplcom_pre_param(struct ucom_softc *ucom, struct termi * Check requested baud rate. * * The PL2303 can only set specific baud rates, up to 1228800 baud. - * The PL2303X can set any baud rate up to 6Mb. + * The PL2303HX can set any baud rate up to 6Mb. * The PL2303HX rev. D can set any baud rate up to 12Mb. * - * XXX: We currently cannot identify the PL2303HX rev. D, so treat - * it the same as the PL2303X. */ - if (sc->sc_chiptype != TYPE_PL2303HX) { - for (i = 0; i < N_UPLCOM_RATES; i++) { - if (uplcom_rates[i] == t->c_ospeed) + + /* accept raw divisor data, if someone wants to do the math in user domain */ + if (t->c_ospeed & 0x80000000) + return 0; + switch (sc->sc_chiptype) { + case TYPE_PL2303HXD: + if (t->c_ospeed <= 12000000) return (0); - } - } else { - if (t->c_ospeed <= 6000000) - return (0); + break; + case TYPE_PL2303HX: + if (t->c_ospeed <= 6000000) + return (0); + break; + default: + if (uplcom_baud_supported(t->c_ospeed)) + return (0); + break; } DPRINTF("uplcom_param: bad baud rate (%d)\n", t->c_ospeed); return (EIO); } +static unsigned int +uplcom_encode_baud_rate_divisor(uint8_t *buf, unsigned int baud) +{ + unsigned int baseline, mantissa, exponent; + + /* Determine the baud rate divisor. This algorithm is taken from Linux. */ + /* + * Apparently the formula is: + * baudrate = baseline / (mantissa * 4^exponent) + * where + * mantissa = buf[8:0] + * exponent = buf[11:9] + */ + if (baud == 0) + baud = 1; + baseline = 383385600; + mantissa = baseline / baud; + if (mantissa == 0) + mantissa = 1; + exponent = 0; + while (mantissa >= 512) { + if (exponent < 7) { + mantissa >>= 2; /* divide by 4 */ + exponent++; + } else { + /* Exponent is maxed. Trim mantissa and leave. This gives approx. 45.8 baud */ + mantissa = 511; + break; + } + } + + buf[3] = 0x80; + buf[2] = 0; + buf[1] = exponent << 1 | mantissa >> 8; + buf[0] = mantissa & 0xff; + + /* Calculate and return the exact baud rate. */ + baud = (baseline / mantissa) >> (exponent << 1); + DPRINTF("real baud rate will be %u\n", baud); + + return baud; +} static void uplcom_cfg_param(struct ucom_softc *ucom, struct termios *t) { @@ -686,10 +804,24 @@ uplcom_cfg_param(struct ucom_softc *ucom, struct termi memset(&ls, 0, sizeof(ls)); - USETDW(ls.dwDTERate, t->c_ospeed); + /* + * NOTE: If unsupported baud rates are set directly, the PL2303* uses 9600 baud. + */ + if ((t->c_ospeed & 0x80000000) || uplcom_baud_supported(t->c_ospeed)) + USETDW(ls.dwDTERate, t->c_ospeed); + else + t->c_ospeed = uplcom_encode_baud_rate_divisor((uint8_t*)&ls.dwDTERate, t->c_ospeed); if (t->c_cflag & CSTOPB) { - ls.bCharFormat = UCDC_STOP_BIT_2; + if ((t->c_cflag & CSIZE) == CS5) { + /* + * NOTE: Comply with "real" UARTs / RS232: + * use 1.5 instead of 2 stop bits with 5 data bits + */ + ls.bCharFormat = UCDC_STOP_BIT_1_5; + } else { + ls.bCharFormat = UCDC_STOP_BIT_2; + } } else { ls.bCharFormat = UCDC_STOP_BIT_1; } @@ -719,7 +851,7 @@ uplcom_cfg_param(struct ucom_softc *ucom, struct termi break; } - DPRINTF("rate=%d fmt=%d parity=%d bits=%d\n", + DPRINTF("rate=0x%08x fmt=%d parity=%d bits=%d\n", UGETDW(ls.dwDTERate), ls.bCharFormat, ls.bParityType, ls.bDataBits); @@ -740,7 +872,7 @@ uplcom_cfg_param(struct ucom_softc *ucom, struct termi req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = UPLCOM_SET_REQUEST; USETW(req.wValue, 0); - if (sc->sc_chiptype == TYPE_PL2303HX) + if (sc->sc_chiptype != TYPE_PL2303) USETW(req.wIndex, UPLCOM_SET_CRTSCTS_PL2303X); else USETW(req.wIndex, UPLCOM_SET_CRTSCTS); @@ -830,18 +962,33 @@ uplcom_intr_callback(struct usb_xfer *xfer, usb_error_ pc = usbd_xfer_get_frame(xfer, 0); usbd_copy_out(pc, 0, buf, sizeof(buf)); - DPRINTF("status = 0x%02x\n", buf[8]); + DPRINTF("status = 0x%02x\n", buf[UPLCOM_STATE_INDEX]); sc->sc_lsr = 0; sc->sc_msr = 0; - if (buf[8] & RSAQ_STATUS_CTS) { + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_CTS) { sc->sc_msr |= SER_CTS; } - if (buf[8] & RSAQ_STATUS_DSR) { + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_OVERRUN_ERROR) { + sc->sc_lsr |= ULSR_OE; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_PARITY_ERROR) { + sc->sc_lsr |= ULSR_PE; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_FRAME_ERROR) { + sc->sc_lsr |= ULSR_FE; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_RING) { + sc->sc_msr |= SER_RI; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_BREAK_ERROR) { + sc->sc_lsr |= ULSR_BI; + } + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_DSR) { sc->sc_msr |= SER_DSR; } - if (buf[8] & RSAQ_STATUS_DCD) { + if (buf[UPLCOM_STATE_INDEX] & RSAQ_STATUS_DCD) { sc->sc_msr |= SER_DCD; } ucom_status_change(&sc->sc_ucom); From owner-svn-src-all@freebsd.org Mon Oct 29 12:41:50 2018 Return-Path: Delivered-To: svn-src-all@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 AE5A310D6FD5; Mon, 29 Oct 2018 12:41:50 +0000 (UTC) (envelope-from avg@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 62F376F78A; Mon, 29 Oct 2018 12:41:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 459376978; Mon, 29 Oct 2018 12:41:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TCfo9r080839; Mon, 29 Oct 2018 12:41:50 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TCfo8f080838; Mon, 29 Oct 2018 12:41:50 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201810291241.w9TCfo8f080838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 29 Oct 2018 12:41:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339855 - stable/11/sys/ddb X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/ddb X-SVN-Commit-Revision: 339855 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 12:41:50 -0000 Author: avg Date: Mon Oct 29 12:41:49 2018 New Revision: 339855 URL: https://svnweb.freebsd.org/changeset/base/339855 Log: MFC r303648: Fix ddb "show proc" to show full arguments PR: 200052 Modified: stable/11/sys/ddb/db_ps.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ddb/db_ps.c ============================================================================== --- stable/11/sys/ddb/db_ps.c Mon Oct 29 12:13:05 2018 (r339854) +++ stable/11/sys/ddb/db_ps.c Mon Oct 29 12:41:49 2018 (r339855) @@ -440,9 +440,16 @@ DB_SHOW_COMMAND(proc, db_show_proc) p->p_leader); if (p->p_sysent != NULL) db_printf(" ABI: %s\n", p->p_sysent->sv_name); - if (p->p_args != NULL) - db_printf(" arguments: %.*s\n", (int)p->p_args->ar_length, - p->p_args->ar_args); + if (p->p_args != NULL) { + db_printf(" arguments: "); + for (i = 0; i < (int)p->p_args->ar_length; i++) { + if (p->p_args->ar_args[i] == '\0') + db_printf(" "); + else + db_printf("%c", p->p_args->ar_args[i]); + } + db_printf("\n"); + } db_printf(" threads: %d\n", p->p_numthreads); FOREACH_THREAD_IN_PROC(p, td) { dumpthread(p, td, 1); From owner-svn-src-all@freebsd.org Mon Oct 29 12:45:09 2018 Return-Path: Delivered-To: svn-src-all@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 BCE8610D72A8; Mon, 29 Oct 2018 12:45:09 +0000 (UTC) (envelope-from avg@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 6C5DB6FA04; Mon, 29 Oct 2018 12:45:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44D8E69B1; Mon, 29 Oct 2018 12:45:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TCj8SK085150; Mon, 29 Oct 2018 12:45:08 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TCj8Vt085149; Mon, 29 Oct 2018 12:45:08 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201810291245.w9TCj8Vt085149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 29 Oct 2018 12:45:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r339856 - stable/10/sys/ddb X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/ddb X-SVN-Commit-Revision: 339856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 12:45:09 -0000 Author: avg Date: Mon Oct 29 12:45:08 2018 New Revision: 339856 URL: https://svnweb.freebsd.org/changeset/base/339856 Log: MFC r303648: Fix ddb "show proc" to show full arguments PR: 200052 Modified: stable/10/sys/ddb/db_ps.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ddb/db_ps.c ============================================================================== --- stable/10/sys/ddb/db_ps.c Mon Oct 29 12:41:49 2018 (r339855) +++ stable/10/sys/ddb/db_ps.c Mon Oct 29 12:45:08 2018 (r339856) @@ -426,9 +426,16 @@ DB_SHOW_COMMAND(proc, db_show_proc) p->p_leader); if (p->p_sysent != NULL) db_printf(" ABI: %s\n", p->p_sysent->sv_name); - if (p->p_args != NULL) - db_printf(" arguments: %.*s\n", (int)p->p_args->ar_length, - p->p_args->ar_args); + if (p->p_args != NULL) { + db_printf(" arguments: "); + for (i = 0; i < (int)p->p_args->ar_length; i++) { + if (p->p_args->ar_args[i] == '\0') + db_printf(" "); + else + db_printf("%c", p->p_args->ar_args[i]); + } + db_printf("\n"); + } db_printf(" threads: %d\n", p->p_numthreads); FOREACH_THREAD_IN_PROC(p, td) { dumpthread(p, td, 1); From owner-svn-src-all@freebsd.org Mon Oct 29 12:47:17 2018 Return-Path: Delivered-To: svn-src-all@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 1C75810D73F4; Mon, 29 Oct 2018 12:47:17 +0000 (UTC) (envelope-from avg@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 C57C06FC60; Mon, 29 Oct 2018 12:47:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7A0B69B4; Mon, 29 Oct 2018 12:47:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TClGqg085314; Mon, 29 Oct 2018 12:47:16 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TClGEZ085313; Mon, 29 Oct 2018 12:47:16 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201810291247.w9TClGEZ085313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 29 Oct 2018 12:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339857 - in stable/11: share/man/man4 sys/ddb X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/ddb X-SVN-Commit-Revision: 339857 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 12:47:17 -0000 Author: avg Date: Mon Oct 29 12:47:15 2018 New Revision: 339857 URL: https://svnweb.freebsd.org/changeset/base/339857 Log: MFC r337528: add an option for ddb ps command to print process arguments Sponsored by: Panzura Modified: stable/11/share/man/man4/ddb.4 stable/11/sys/ddb/db_ps.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/ddb.4 ============================================================================== --- stable/11/share/man/man4/ddb.4 Mon Oct 29 12:45:08 2018 (r339856) +++ stable/11/share/man/man4/ddb.4 Mon Oct 29 12:47:15 2018 (r339857) @@ -537,16 +537,15 @@ If the thread is not found, search the thread stack ca cached stack address. Otherwise, prints nothing. .Pp -.It Ic show Cm all procs Ns Op Li / Ns Cm m -.It Ic ps Ns Op Li / Ns Cm m +.It Ic show Cm all procs Ns Op Li / Ns Cm a +.It Ic ps Ns Op Li / Ns Cm a Display all process information. The process information may not be shown if it is not supported in the machine, or the bottom of the stack of the target process is not in the main memory at that time. The -.Cm m -modifier will alter the display to show VM map -addresses for the process and not show other information. +.Cm a +modifier will print command line arguments for each process. .\" .Pp .It Ic show Cm all trace Modified: stable/11/sys/ddb/db_ps.c ============================================================================== --- stable/11/sys/ddb/db_ps.c Mon Oct 29 12:45:08 2018 (r339856) +++ stable/11/sys/ddb/db_ps.c Mon Oct 29 12:47:15 2018 (r339857) @@ -47,8 +47,13 @@ __FBSDID("$FreeBSD$"); #include +#define PRINT_NONE 0 +#define PRINT_ARGS 1 + static void dumpthread(volatile struct proc *p, volatile struct thread *td, int all); +static int ps_mode; + /* * At least one non-optional show-command must be implemented using * DB_SHOW_ALL_COMMAND() so that db_show_all_cmd_set gets created. @@ -59,6 +64,24 @@ DB_SHOW_ALL_COMMAND(procs, db_procs_cmd) db_ps(addr, have_addr, count, modif); } +static void +dump_args(volatile struct proc *p) +{ + char *args; + int i, len; + + if (p->p_args == NULL) + return; + args = p->p_args->ar_args; + len = (int)p->p_args->ar_length; + for (i = 0; i < len; i++) { + if (args[i] == '\0') + db_printf(" "); + else + db_printf("%c", args[i]); + } +} + /* * Layout: * - column counts @@ -87,6 +110,7 @@ db_ps(db_expr_t addr, bool hasaddr, db_expr_t count, c char state[9]; int np, rflag, sflag, dflag, lflag, wflag; + ps_mode = modif[0] == 'a' ? PRINT_ARGS : PRINT_NONE; np = nprocs; if (!LIST_EMPTY(&allproc)) @@ -204,6 +228,10 @@ db_ps(db_expr_t addr, bool hasaddr, db_expr_t count, c db_printf("%s", p->p_comm); if (p->p_flag & P_SYSTEM) db_printf("]"); + if (ps_mode == PRINT_ARGS) { + db_printf(" "); + dump_args(p); + } db_printf("\n"); } FOREACH_THREAD_IN_PROC(p, td) { @@ -296,6 +324,10 @@ dumpthread(volatile struct proc *p, volatile struct th db_printf("%s", td->td_proc->p_comm); if (p->p_flag & P_SYSTEM) db_printf("]"); + if (ps_mode == PRINT_ARGS && all == 0) { + db_printf(" "); + dump_args(p); + } db_printf("\n"); } @@ -442,12 +474,7 @@ DB_SHOW_COMMAND(proc, db_show_proc) db_printf(" ABI: %s\n", p->p_sysent->sv_name); if (p->p_args != NULL) { db_printf(" arguments: "); - for (i = 0; i < (int)p->p_args->ar_length; i++) { - if (p->p_args->ar_args[i] == '\0') - db_printf(" "); - else - db_printf("%c", p->p_args->ar_args[i]); - } + dump_args(p); db_printf("\n"); } db_printf(" threads: %d\n", p->p_numthreads); From owner-svn-src-all@freebsd.org Mon Oct 29 12:48:32 2018 Return-Path: Delivered-To: svn-src-all@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 F0EED10D74DB; Mon, 29 Oct 2018 12:48:31 +0000 (UTC) (envelope-from avg@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 A5B4A6FDFF; Mon, 29 Oct 2018 12:48:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86B4069B6; Mon, 29 Oct 2018 12:48:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TCmVO7085431; Mon, 29 Oct 2018 12:48:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TCmVPx085430; Mon, 29 Oct 2018 12:48:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201810291248.w9TCmVPx085430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 29 Oct 2018 12:48:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r339858 - in stable/10: share/man/man4 sys/ddb X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/10: share/man/man4 sys/ddb X-SVN-Commit-Revision: 339858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 12:48:32 -0000 Author: avg Date: Mon Oct 29 12:48:30 2018 New Revision: 339858 URL: https://svnweb.freebsd.org/changeset/base/339858 Log: MFC r337528: add an option for ddb ps command to print process arguments Sponsored by: Panzura Modified: stable/10/share/man/man4/ddb.4 stable/10/sys/ddb/db_ps.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/ddb.4 ============================================================================== --- stable/10/share/man/man4/ddb.4 Mon Oct 29 12:47:15 2018 (r339857) +++ stable/10/share/man/man4/ddb.4 Mon Oct 29 12:48:30 2018 (r339858) @@ -535,16 +535,15 @@ If the thread is not found, search the thread stack ca cached stack address. Otherwise, prints nothing. .Pp -.It Ic show Cm all procs Ns Op Li / Ns Cm m -.It Ic ps Ns Op Li / Ns Cm m +.It Ic show Cm all procs Ns Op Li / Ns Cm a +.It Ic ps Ns Op Li / Ns Cm a Display all process information. The process information may not be shown if it is not supported in the machine, or the bottom of the stack of the target process is not in the main memory at that time. The -.Cm m -modifier will alter the display to show VM map -addresses for the process and not show other information. +.Cm a +modifier will print command line arguments for each process. .\" .Pp .It Ic show Cm all trace Modified: stable/10/sys/ddb/db_ps.c ============================================================================== --- stable/10/sys/ddb/db_ps.c Mon Oct 29 12:47:15 2018 (r339857) +++ stable/10/sys/ddb/db_ps.c Mon Oct 29 12:48:30 2018 (r339858) @@ -44,8 +44,13 @@ __FBSDID("$FreeBSD$"); #include +#define PRINT_NONE 0 +#define PRINT_ARGS 1 + static void dumpthread(volatile struct proc *p, volatile struct thread *td, int all); +static int ps_mode; + /* * At least one non-optional show-command must be implemented using * DB_SHOW_ALL_COMMAND() so that db_show_all_cmd_set gets created. @@ -56,6 +61,24 @@ DB_SHOW_ALL_COMMAND(procs, db_procs_cmd) db_ps(addr, have_addr, count, modif); } +static void +dump_args(volatile struct proc *p) +{ + char *args; + int i, len; + + if (p->p_args == NULL) + return; + args = p->p_args->ar_args; + len = (int)p->p_args->ar_length; + for (i = 0; i < len; i++) { + if (args[i] == '\0') + db_printf(" "); + else + db_printf("%c", args[i]); + } +} + /* * Layout: * - column counts @@ -84,6 +107,7 @@ db_ps(db_expr_t addr, boolean_t hasaddr, db_expr_t cou char state[9]; int np, rflag, sflag, dflag, lflag, wflag; + ps_mode = modif[0] == 'a' ? PRINT_ARGS : PRINT_NONE; np = nprocs; if (!LIST_EMPTY(&allproc)) @@ -201,6 +225,10 @@ db_ps(db_expr_t addr, boolean_t hasaddr, db_expr_t cou db_printf("%s", p->p_comm); if (p->p_flag & P_SYSTEM) db_printf("]"); + if (ps_mode == PRINT_ARGS) { + db_printf(" "); + dump_args(p); + } db_printf("\n"); } FOREACH_THREAD_IN_PROC(p, td) { @@ -293,6 +321,10 @@ dumpthread(volatile struct proc *p, volatile struct th db_printf("%s", td->td_proc->p_comm); if (p->p_flag & P_SYSTEM) db_printf("]"); + if (ps_mode == PRINT_ARGS && all == 0) { + db_printf(" "); + dump_args(p); + } db_printf("\n"); } @@ -428,12 +460,7 @@ DB_SHOW_COMMAND(proc, db_show_proc) db_printf(" ABI: %s\n", p->p_sysent->sv_name); if (p->p_args != NULL) { db_printf(" arguments: "); - for (i = 0; i < (int)p->p_args->ar_length; i++) { - if (p->p_args->ar_args[i] == '\0') - db_printf(" "); - else - db_printf("%c", p->p_args->ar_args[i]); - } + dump_args(p); db_printf("\n"); } db_printf(" threads: %d\n", p->p_numthreads); From owner-svn-src-all@freebsd.org Mon Oct 29 13:17:42 2018 Return-Path: Delivered-To: svn-src-all@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 54C9210D7D19; Mon, 29 Oct 2018 13:17:42 +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 0711670AA7; Mon, 29 Oct 2018 13:17:42 +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 CE1206E80; Mon, 29 Oct 2018 13:17:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TDHf24000638; Mon, 29 Oct 2018 13:17:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TDHf7F000637; Mon, 29 Oct 2018 13:17:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810291317.w9TDHf7F000637@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 13:17:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339859 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 339859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 13:17:42 -0000 Author: hselasky Date: Mon Oct 29 13:17:41 2018 New Revision: 339859 URL: https://svnweb.freebsd.org/changeset/base/339859 Log: MFC r339588: Resolve deadlock between epoch(9) and various network interface SX-locks, during if_purgeaddrs(), by not allowing to hold the epoch read lock over typical network IOCTL code paths. This is a regression issue after r334305. Reviewed by: ae (network) Approved by: re (kib) Differential revision: https://reviews.freebsd.org/D17647 Sponsored by: Mellanox Technologies Modified: stable/12/sys/net/if.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if.c ============================================================================== --- stable/12/sys/net/if.c Mon Oct 29 12:48:30 2018 (r339858) +++ stable/12/sys/net/if.c Mon Oct 29 13:17:41 2018 (r339859) @@ -964,12 +964,18 @@ if_attachdomain1(struct ifnet *ifp) void if_purgeaddrs(struct ifnet *ifp) { - struct ifaddr *ifa, *next; + struct ifaddr *ifa; - NET_EPOCH_ENTER(); - CK_STAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, next) { - if (ifa->ifa_addr->sa_family == AF_LINK) - continue; + while (1) { + NET_EPOCH_ENTER(); + CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family != AF_LINK) + break; + } + NET_EPOCH_EXIT(); + + if (ifa == NULL) + break; #ifdef INET /* XXX: Ugly!! ad hoc just for INET */ if (ifa->ifa_addr->sa_family == AF_INET) { @@ -996,7 +1002,6 @@ if_purgeaddrs(struct ifnet *ifp) IF_ADDR_WUNLOCK(ifp); ifa_free(ifa); } - NET_EPOCH_EXIT(); } /* From owner-svn-src-all@freebsd.org Mon Oct 29 14:06:21 2018 Return-Path: Delivered-To: svn-src-all@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 F3B5210DAC8A; Mon, 29 Oct 2018 14:06:20 +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 A88D3727F4; Mon, 29 Oct 2018 14:06:20 +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 896BC76B2; Mon, 29 Oct 2018 14:06:20 +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 w9TE6K4o026281; Mon, 29 Oct 2018 14:06:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TE6K6N026280; Mon, 29 Oct 2018 14:06:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810291406.w9TE6K6N026280@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 14:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339860 - stable/12/sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/sys X-SVN-Commit-Revision: 339860 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 14:06:21 -0000 Author: hselasky Date: Mon Oct 29 14:06:20 2018 New Revision: 339860 URL: https://svnweb.freebsd.org/changeset/base/339860 Log: MFC r339600: Make sure returned value is checked and assert a valid refcount. While at it fix a print: Unsigned types cannot be negative. Reviewed by: kib, mjg Approved by: re (gjb) Differential revision: https://reviews.freebsd.org/D17616 Sponsored by: Mellanox Technologies Modified: stable/12/sys/sys/refcount.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/sys/refcount.h ============================================================================== --- stable/12/sys/sys/refcount.h Mon Oct 29 13:17:41 2018 (r339859) +++ stable/12/sys/sys/refcount.h Mon Oct 29 14:06:20 2018 (r339860) @@ -62,7 +62,7 @@ refcount_release(volatile u_int *count) atomic_thread_fence_rel(); old = atomic_fetchadd_int(count, -1); - KASSERT(old > 0, ("negative refcount %p", count)); + KASSERT(old > 0, ("refcount %p is zero", count)); if (old > 1) return (0); @@ -77,15 +77,19 @@ refcount_release(volatile u_int *count) } /* + * This functions returns non-zero if the refcount was + * incremented. Else zero is returned. + * * A temporary hack until refcount_* APIs are sorted out. */ -static __inline int +static __inline __result_use_check int refcount_acquire_if_not_zero(volatile u_int *count) { u_int old; old = *count; for (;;) { + KASSERT(old < UINT_MAX, ("refcount %p overflowed", count)); if (old == 0) return (0); if (atomic_fcmpset_int(count, &old, old + 1)) @@ -93,13 +97,14 @@ refcount_acquire_if_not_zero(volatile u_int *count) } } -static __inline int +static __inline __result_use_check int refcount_release_if_not_last(volatile u_int *count) { u_int old; old = *count; for (;;) { + KASSERT(old > 0, ("refcount %p is zero", count)); if (old == 1) return (0); if (atomic_fcmpset_int(count, &old, old - 1)) From owner-svn-src-all@freebsd.org Mon Oct 29 14:36:05 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 14:37:28 2018 Return-Path: Delivered-To: svn-src-all@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 2630310DB6ED; Mon, 29 Oct 2018 14:37:28 +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 CDEB573803; Mon, 29 Oct 2018 14:37:27 +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 AE82C7B92; Mon, 29 Oct 2018 14:37:27 +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 w9TEbRoV041469; Mon, 29 Oct 2018 14:37:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TEbRH1041468; Mon, 29 Oct 2018 14:37:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810291437.w9TEbRH1041468@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 14:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339862 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 339862 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 14:37:28 -0000 Author: hselasky Date: Mon Oct 29 14:37:27 2018 New Revision: 339862 URL: https://svnweb.freebsd.org/changeset/base/339862 Log: MFC r339600: Make sure returned value is checked and assert a valid refcount. While at it fix a print: Unsigned types cannot be negative. Reviewed by: kib, mjg Differential revision: https://reviews.freebsd.org/D17616 Sponsored by: Mellanox Technologies Modified: stable/11/sys/sys/refcount.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/refcount.h ============================================================================== --- stable/11/sys/sys/refcount.h Mon Oct 29 14:36:03 2018 (r339861) +++ stable/11/sys/sys/refcount.h Mon Oct 29 14:37:27 2018 (r339862) @@ -60,7 +60,7 @@ refcount_release(volatile u_int *count) atomic_thread_fence_rel(); old = atomic_fetchadd_int(count, -1); - KASSERT(old > 0, ("negative refcount %p", count)); + KASSERT(old > 0, ("refcount %p is zero", count)); if (old > 1) return (0); @@ -75,15 +75,19 @@ refcount_release(volatile u_int *count) } /* + * This functions returns non-zero if the refcount was + * incremented. Else zero is returned. + * * A temporary hack until refcount_* APIs are sorted out. */ -static __inline int +static __inline __result_use_check int refcount_acquire_if_not_zero(volatile u_int *count) { u_int old; old = *count; for (;;) { + KASSERT(old < UINT_MAX, ("refcount %p overflowed", count)); if (old == 0) return (0); if (atomic_fcmpset_int(count, &old, old + 1)) @@ -91,13 +95,14 @@ refcount_acquire_if_not_zero(volatile u_int *count) } } -static __inline int +static __inline __result_use_check int refcount_release_if_not_last(volatile u_int *count) { u_int old; old = *count; for (;;) { + KASSERT(old > 0, ("refcount %p is zero", count)); if (old == 1) return (0); if (atomic_fcmpset_int(count, &old, old - 1)) From owner-svn-src-all@freebsd.org Mon Oct 29 15:12:16 2018 Return-Path: Delivered-To: svn-src-all@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 94F2810DCF0F; Mon, 29 Oct 2018 15:12:16 +0000 (UTC) (envelope-from whu@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 48FEB74FB0; Mon, 29 Oct 2018 15:12:16 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2AABF1020D; Mon, 29 Oct 2018 15:12:16 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TFCGSO061868; Mon, 29 Oct 2018 15:12:16 GMT (envelope-from whu@FreeBSD.org) Received: (from whu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TFCGPF061867; Mon, 29 Oct 2018 15:12:16 GMT (envelope-from whu@FreeBSD.org) Message-Id: <201810291512.w9TFCGPF061867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: whu set sender to whu@FreeBSD.org using -f From: Wei Hu Date: Mon, 29 Oct 2018 15:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339863 - stable/11/sys/dev/hyperv/netvsc X-SVN-Group: stable-11 X-SVN-Commit-Author: whu X-SVN-Commit-Paths: stable/11/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 339863 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 15:12:16 -0000 Author: whu Date: Mon Oct 29 15:12:15 2018 New Revision: 339863 URL: https://svnweb.freebsd.org/changeset/base/339863 Log: MFC: 339585 r339585: Do not drop UDP traffic when TXCSUM_IPV6 flag is on PR: 231797 Submitted by: whu Reviewed by: dexuan Obtained from: Kevin Morse Sponsored by: Microsoft Differential Revision: https://bugs.freebsd.org/bugzilla/attachment.cgi?id=198333&action=diff Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hn.c Mon Oct 29 14:37:27 2018 (r339862) +++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Mon Oct 29 15:12:15 2018 (r339863) @@ -861,7 +861,8 @@ hn_set_hlen(struct mbuf *m_head) PULLUP_HDR(m_head, ehlen + sizeof(*ip6)); ip6 = mtodo(m_head, ehlen); - if (ip6->ip6_nxt != IPPROTO_TCP) { + if (ip6->ip6_nxt != IPPROTO_TCP && + ip6->ip6_nxt != IPPROTO_UDP) { m_freem(m_head); return (NULL); } From owner-svn-src-all@freebsd.org Mon Oct 29 17:03:21 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 17:13:13 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 17:55:27 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 19:01:49 2018 Return-Path: Delivered-To: svn-src-all@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 0660510E31C1; Mon, 29 Oct 2018 19:01:49 +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 AD3877D9B5; Mon, 29 Oct 2018 19:01:48 +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 7404A12763; Mon, 29 Oct 2018 19:01:48 +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 w9TJ1mGp076815; Mon, 29 Oct 2018 19:01:48 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TJ1mxT076814; Mon, 29 Oct 2018 19:01:48 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201810291901.w9TJ1mxT076814@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:01:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339867 - in stable/12: share/man/man4 sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/netinet X-SVN-Commit-Revision: 339867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 19:01:49 -0000 Author: tuexen Date: Mon Oct 29 19:01:47 2018 New Revision: 339867 URL: https://svnweb.freebsd.org/changeset/base/339867 Log: MFC r339791: Add initial descriptions for SCTP related MIB variable. This work was mostly done by Marie-Helene Kvello-Aune. Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D3583 Modified: stable/12/share/man/man4/sctp.4 stable/12/sys/netinet/sctp_sysctl.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/sctp.4 ============================================================================== --- stable/12/share/man/man4/sctp.4 Mon Oct 29 17:55:26 2018 (r339866) +++ stable/12/share/man/man4/sctp.4 Mon Oct 29 19:01:47 2018 (r339867) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 15, 2006 +.Dd October 10, 2018 .Dt SCTP 4 .Os .Sh NAME @@ -145,7 +145,7 @@ with no regard to the ordering of any other message. The FreeBSD implementation of .Tn SCTP also supports the following extensions: -.Bl -hang -width indent +.Bl -tag -width "sctp partial reliability" .It "sctp partial reliability" This extension allows one to have message be skipped and not delivered based on some user specified parameters. @@ -168,7 +168,7 @@ utilization. This extension allows a user on either side to reset the stream sequence numbers used by any or all streams. .El -.Pp +.Ss Socket Options .Tn SCTP supports a number of socket options which can be set with .Xr setsockopt 2 @@ -176,7 +176,7 @@ and tested with .Xr getsockopt 2 or .Xr sctp_opt_info 3 : -.Bl -tag -width ".Dv SCTP_SET_PEER_PRIMARY_ADDR" +.Bl -tag -indent .It Dv SCTP_NODELAY Under most circumstances, .Tn SCTP @@ -409,6 +409,191 @@ Note that the peer endpoint must also support the stream reset extension as well. .El +.Ss MIB Variables +The +.Tn SCTP +protocol implements a number of variables in the +.Va net.inet.sctp +branch of the +.Xr sysctl 3 +MIB. +.Bl -ohang +.It Sy Congestion Control +.Bl -tag -width indent +.It Va default_cc_module +Default congestion control module. +Default value is 0. +The minimum is 0, and the maximum is 3. +A value of 0 enables the default congestion control algorithm. +A value of 1 enables the High Speed congestion control algorithm. +A value of 2 enables the HTCP congestion control algorithm. +A value of 3 enables the data center congestion control (DCCC) algorithm. +.It Va initial_cwnd +Defines the initial congestion window size in MTUs. +.It Va cwnd_maxburst +Use congestion control instead of 'blind' logic to limit maximum burst when sending. +Default value is 1. May be set to 0 or 1. +.It Va ecn_enable +Enable Explicit Congestion Notification (ECN). +Default value is 1. May be set to 0 or 1. +.It Va rttvar_steady_step +Number of identical bandwidth measurements DCCC takes to try step down the congestion window. +Default value is 20. +The minimum is 0, and the maximum is 65535. +.It Va rttvar_eqret +Whether DCCC reduces the congestion window size when round-trip time and bandwidth remain unchanged. +Default value is 0. +May be set to 0 or 1. +.It Va rttvar_bw +Shift amount DCCC uses for bandwidth smoothing on round-trip-time calculation. +Default value is 4. +The minimum is 0, and the maximum is 32. +.It Va rttvar_rtt +Shift amount DCCC uses for round-trip-time smoothing on round-trip-time calculation. +Default value is 5. +The minimum is 0, and the maximum is 32. +.It Va use_dcccecn +Enable ECN when using DCCC. +Default value is 1. +May be set to 0 or 1. +.El +.It Sy Misc +.Bl -tag -width indent +.It Va getcred +Get the ucred of a SCTP connection. +.It Va assoclist +List of active SCTP associations. +.It Va stats +SCTP statistics (struct sctp_stat). +.It Va diag_info_code +Diagnostic information error cause code. +.It Va blackhole +Enable SCTP blackholing. +See +.Xr blackhole 4 +for more details. +.It Va buffer_splitting +Enable send/receive buffer splitting. +.It Va vtag_time_wait +Vtag wait time in seconds, 0 to disable. +.It Va nat_friendly_init +Enable sending of the NAT-friendly SCTP option on INITs. +.It Va enable_sack_immediately +Enable sending of the SACK-IMMEDIATELY bit. +.It Va udp_tunneling_port +Set the SCTP/UDP tunneling port. +.It Va mobility_fasthandoff +Enable SCTP fast handoff. +.It Va mobility_base +Enable SCTP base mobility +.It Va default_frag_interleave +Default fragment interleave level. +.It Va default_ss_module +Default stream scheduling module. +.It Va log_level +Ltrace/KTR trace logging level. +.It Va max_retran_chunk +Number of retransmissions of a DATA chunk before an association is aborted. +.It Va min_residual +Minimum residual data chunk in second part of split. +.It Va strict_data_order +Enforce strict data ordering, abort if control inside data. +.It Va abort_at_limit +Abort when one-to-one hits qlimit. +.It Va hb_max_burst +Confirmation heartbeat max burst. +.It Va do_sctp_drain +Flush chunks in receive queues with TSN higher than the cumulative TSN if the +system is low on mbufs. +.It Va max_chained_mbufs +Default max number of small mbufs on a chain. +.It Va abc_l_var +SCTP ABC max increase per SACK (L). +.It Va nat_friendly +SCTP NAT friendly operation. +.It Va cmt_use_dac +CMT DAC on/off flag. +.It Va cmt_on_off +CMT settings. +.It Va outgoing_streams +Default number of outgoing streams. +.It Va incoming_streams +Default number of incoming streams. +.It Va add_more_on_output +When space-wise is it worthwhile to try to add more to a socket send buffer. +.It Va path_pf_threshold +Default potentially failed threshold. +.It Va path_rtx_max +Default maximum of retransmissions per path. +.It Va assoc_rtx_max +Default maximum number of retransmissions per association. +.It Va init_rtx_max +Default maximum number of retransmissions for INIT chunks. +.It Va valid_cookie_life +Default cookie lifetime in seconds. +.It Va init_rto_max +Default maximum retransmission timeout during association setup in ms. +.It Va rto_initial +Default initial retransmission timeout in ms. +.It Va rto_min +Default minimum retransmission timeout in ms. +.It Va rto_max +Default maximum retransmission timeout in ms. +.It Va secret_lifetime +Default secret lifetime in seconds. +.It Va shutdown_guard_time +Shutdown guard timer in seconds (0 means 5 times RTO.Max). +.It Va pmtu_raise_time +Default PMTU raise timer in seconds. +.It Va heartbeat_interval +Default heartbeat interval in ms. +.It Va asoc_resource +Max number of cached resources in an association. +.It Va sys_resource +Max number of cached resources in the system. +.It Va sack_freq +Default SACK frequency. +.It Va delayed_sack_time +Default delayed SACK timer in ms. +.It Va chunkscale +Tunable for scaling of number of chunks and messages. +.It Va min_split_point +Minimum size when splitting a chunk. +.It Va pcbhashsize +Tunable for PCB hash table sizes. +.It Va tcbhashsize +Tunable for TCB hash table sizes. +.It Va maxchunks +Default max chunks on queue per association. +.It Va fr_maxburst +Default max burst for SCTP endpoints when fast retransmitting. +.It Va maxburst +Default max burst for SCTP endpoints. +.It Va peer_chkoh +Amount to debit peers rwnd per chunk sent. +.It Va strict_sacks +Enable SCTP Strict SACK checking. +.It Va pktdrop_enable +Enable SCTP PKTDROP. +.It Va nrsack_enable +Enable SCTP NR-SACK. +.It Va reconfig_enable +Enable SCTP RE-CONFIG. +.It Va asconf_enable +Enable SCTP ASCONF. +.It Va auth_enable +Enable SCTP AUTH. +.It Va pr_enable +Enable PR-SCTP. +.It Va auto_asconf +Enable SCTP Auto-ASCONF. +.It Va recvspace +Maximum incoming SCTP buffer size. +.It Va sendspace +Maximum outgoing SCTP buffer size. +.El +.El + .Sh SEE ALSO .Xr accept 2 , .Xr bind 2 , @@ -418,4 +603,5 @@ as well. .Xr sctp_connectx 3 , .Xr sctp_opt_info 3 , .Xr sctp_recvmsg 3 , -.Xr sctp_sendmsg 3 +.Xr sctp_sendmsg 3 , +.Xr blackhole 4 Modified: stable/12/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/12/sys/netinet/sctp_sysctl.h Mon Oct 29 17:55:26 2018 (r339866) +++ stable/12/sys/netinet/sctp_sysctl.h Mon Oct 29 19:01:47 2018 (r339867) @@ -212,7 +212,7 @@ struct sctp_sysctl { #define SCTPCTL_MAXBURST_DEFAULT SCTP_DEF_MAX_BURST /* fr_maxburst: Default max burst for sctp endpoints when fast retransmitting */ -#define SCTPCTL_FRMAXBURST_DESC "Default fr max burst for sctp endpoints" +#define SCTPCTL_FRMAXBURST_DESC "Default max burst for SCTP endpoints when fast retransmitting" #define SCTPCTL_FRMAXBURST_MIN 0 #define SCTPCTL_FRMAXBURST_MAX 0xFFFFFFFF #define SCTPCTL_FRMAXBURST_DEFAULT SCTP_DEF_FRMAX_BURST @@ -243,7 +243,7 @@ struct sctp_sysctl { #define SCTPCTL_MIN_SPLIT_POINT_DEFAULT SCTP_DEFAULT_SPLIT_POINT_MIN /* chunkscale: Tunable for Scaling of number of chunks and messages */ -#define SCTPCTL_CHUNKSCALE_DESC "Tunable for Scaling of number of chunks and messages" +#define SCTPCTL_CHUNKSCALE_DESC "Tunable for scaling of number of chunks and messages" #define SCTPCTL_CHUNKSCALE_MIN 1 #define SCTPCTL_CHUNKSCALE_MAX 0xFFFFFFFF #define SCTPCTL_CHUNKSCALE_DEFAULT SCTP_CHUNKQUEUE_SCALE @@ -327,7 +327,7 @@ struct sctp_sysctl { #define SCTPCTL_VALID_COOKIE_LIFE_DEFAULT SCTP_DEFAULT_COOKIE_LIFE /* init_rtx_max: Default maximum number of retransmission for INIT chunks */ -#define SCTPCTL_INIT_RTX_MAX_DESC "Default maximum number of retransmission for INIT chunks" +#define SCTPCTL_INIT_RTX_MAX_DESC "Default maximum number of retransmissions for INIT chunks" #define SCTPCTL_INIT_RTX_MAX_MIN 0 #define SCTPCTL_INIT_RTX_MAX_MAX 0xFFFFFFFF #define SCTPCTL_INIT_RTX_MAX_DEFAULT SCTP_DEF_MAX_INIT @@ -380,8 +380,8 @@ struct sctp_sysctl { #define SCTPCTL_CMT_USE_DAC_MAX 1 #define SCTPCTL_CMT_USE_DAC_DEFAULT 0 -/* cwnd_maxburst: Use a CWND adjusting maxburst */ -#define SCTPCTL_CWND_MAXBURST_DESC "Use a CWND adjusting maxburst" +/* cwnd_maxburst: Use a CWND adjusting to implement maxburst */ +#define SCTPCTL_CWND_MAXBURST_DESC "Adjust congestion control window to limit maximum burst when sending" #define SCTPCTL_CWND_MAXBURST_MIN 0 #define SCTPCTL_CWND_MAXBURST_MAX 1 #define SCTPCTL_CWND_MAXBURST_DEFAULT 1 @@ -417,7 +417,7 @@ struct sctp_sysctl { #define SCTPCTL_HB_MAX_BURST_DEFAULT SCTP_DEF_HBMAX_BURST /* abort_at_limit: When one-2-one hits qlimit abort */ -#define SCTPCTL_ABORT_AT_LIMIT_DESC "When one-2-one hits qlimit abort" +#define SCTPCTL_ABORT_AT_LIMIT_DESC "Abort when one-to-one hits qlimit" #define SCTPCTL_ABORT_AT_LIMIT_MIN 0 #define SCTPCTL_ABORT_AT_LIMIT_MAX 1 #define SCTPCTL_ABORT_AT_LIMIT_DEFAULT 0 @@ -429,7 +429,7 @@ struct sctp_sysctl { #define SCTPCTL_MIN_RESIDUAL_DEFAULT 1452 /* max_retran_chunk: max chunk retransmissions */ -#define SCTPCTL_MAX_RETRAN_CHUNK_DESC "Maximum times an unlucky chunk can be retran'd before assoc abort" +#define SCTPCTL_MAX_RETRAN_CHUNK_DESC "Maximum times an unlucky chunk can be retransmitted before assoc abort" #define SCTPCTL_MAX_RETRAN_CHUNK_MIN 0 #define SCTPCTL_MAX_RETRAN_CHUNK_MAX 65535 #define SCTPCTL_MAX_RETRAN_CHUNK_DEFAULT 30 @@ -477,63 +477,63 @@ struct sctp_sysctl { #define SCTPCTL_UDP_TUNNELING_PORT_DEFAULT 0 /* Enable sending of the SACK-IMMEDIATELY bit */ -#define SCTPCTL_SACK_IMMEDIATELY_ENABLE_DESC "Enable sending of the SACK-IMMEDIATELY-bit." +#define SCTPCTL_SACK_IMMEDIATELY_ENABLE_DESC "Enable sending of the SACK-IMMEDIATELY-bit" #define SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN 0 #define SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX 1 #define SCTPCTL_SACK_IMMEDIATELY_ENABLE_DEFAULT SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX /* Enable sending of the NAT-FRIENDLY message */ -#define SCTPCTL_NAT_FRIENDLY_INITS_DESC "Enable sending of the nat-friendly SCTP option on INITs." +#define SCTPCTL_NAT_FRIENDLY_INITS_DESC "Enable sending of the nat-friendly SCTP option on INITs" #define SCTPCTL_NAT_FRIENDLY_INITS_MIN 0 #define SCTPCTL_NAT_FRIENDLY_INITS_MAX 1 #define SCTPCTL_NAT_FRIENDLY_INITS_DEFAULT SCTPCTL_NAT_FRIENDLY_INITS_MIN /* Vtag time wait in seconds */ -#define SCTPCTL_TIME_WAIT_DESC "Vtag time wait time in seconds, 0 disables it." +#define SCTPCTL_TIME_WAIT_DESC "Vtag time wait time in seconds, 0 disables it" #define SCTPCTL_TIME_WAIT_MIN 0 #define SCTPCTL_TIME_WAIT_MAX 0xffffffff #define SCTPCTL_TIME_WAIT_DEFAULT SCTP_TIME_WAIT /* Enable Send/Receive buffer splitting */ -#define SCTPCTL_BUFFER_SPLITTING_DESC "Enable send/receive buffer splitting." +#define SCTPCTL_BUFFER_SPLITTING_DESC "Enable send/receive buffer splitting" #define SCTPCTL_BUFFER_SPLITTING_MIN 0 #define SCTPCTL_BUFFER_SPLITTING_MAX 0x3 #define SCTPCTL_BUFFER_SPLITTING_DEFAULT SCTPCTL_BUFFER_SPLITTING_MIN -/* Initial congestion window in MTU */ -#define SCTPCTL_INITIAL_CWND_DESC "Initial congestion window in MTUs" +/* Initial congestion window in MTUs */ +#define SCTPCTL_INITIAL_CWND_DESC "Defines the initial congestion window size in MTUs" #define SCTPCTL_INITIAL_CWND_MIN 0 #define SCTPCTL_INITIAL_CWND_MAX 0xffffffff #define SCTPCTL_INITIAL_CWND_DEFAULT 3 /* rttvar smooth avg for bw calc */ -#define SCTPCTL_RTTVAR_BW_DESC "Shift amount for bw smoothing on rtt calc" +#define SCTPCTL_RTTVAR_BW_DESC "Shift amount DCCC uses for bw smoothing on rtt calc" #define SCTPCTL_RTTVAR_BW_MIN 0 #define SCTPCTL_RTTVAR_BW_MAX 32 #define SCTPCTL_RTTVAR_BW_DEFAULT 4 /* rttvar smooth avg for bw calc */ -#define SCTPCTL_RTTVAR_RTT_DESC "Shift amount for rtt smoothing on rtt calc" +#define SCTPCTL_RTTVAR_RTT_DESC "Shift amount DCCC uses for rtt smoothing on rtt calc" #define SCTPCTL_RTTVAR_RTT_MIN 0 #define SCTPCTL_RTTVAR_RTT_MAX 32 #define SCTPCTL_RTTVAR_RTT_DEFAULT 5 -#define SCTPCTL_RTTVAR_EQRET_DESC "What to return when rtt and bw are unchanged" +#define SCTPCTL_RTTVAR_EQRET_DESC "Whether DCCC increases cwnd when the rtt and bw are unchanged" #define SCTPCTL_RTTVAR_EQRET_MIN 0 #define SCTPCTL_RTTVAR_EQRET_MAX 1 #define SCTPCTL_RTTVAR_EQRET_DEFAULT 0 -#define SCTPCTL_RTTVAR_STEADYS_DESC "How many the sames it takes to try step down of cwnd" +#define SCTPCTL_RTTVAR_STEADYS_DESC "Number of identical bw measurements DCCC takes to try step down of cwnd" #define SCTPCTL_RTTVAR_STEADYS_MIN 0 #define SCTPCTL_RTTVAR_STEADYS_MAX 0xFFFF #define SCTPCTL_RTTVAR_STEADYS_DEFAULT 20 /* 0 means disable feature */ -#define SCTPCTL_RTTVAR_DCCCECN_DESC "Enable for RTCC CC datacenter ECN" +#define SCTPCTL_RTTVAR_DCCCECN_DESC "Enable ECN for DCCC." #define SCTPCTL_RTTVAR_DCCCECN_MIN 0 #define SCTPCTL_RTTVAR_DCCCECN_MAX 1 #define SCTPCTL_RTTVAR_DCCCECN_DEFAULT 1 /* 0 means disable feature */ -#define SCTPCTL_BLACKHOLE_DESC "Enable SCTP blackholing. See blackhole(4) for more details." +#define SCTPCTL_BLACKHOLE_DESC "Enable SCTP blackholing, see blackhole(4) for more details" #define SCTPCTL_BLACKHOLE_MIN 0 #define SCTPCTL_BLACKHOLE_MAX 2 #define SCTPCTL_BLACKHOLE_DEFAULT SCTPCTL_BLACKHOLE_MIN @@ -553,7 +553,7 @@ struct sctp_sysctl { #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) -#define SCTPCTL_OUTPUT_UNLOCKED_DESC "Unlock socket when sending packets down to IP." +#define SCTPCTL_OUTPUT_UNLOCKED_DESC "Unlock socket when sending packets down to IP" #define SCTPCTL_OUTPUT_UNLOCKED_MIN 0 #define SCTPCTL_OUTPUT_UNLOCKED_MAX 1 #define SCTPCTL_OUTPUT_UNLOCKED_DEFAULT SCTPCTL_OUTPUT_UNLOCKED_MIN From owner-svn-src-all@freebsd.org Mon Oct 29 19:02:37 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 19:14:57 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 19:25:31 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 20:08:20 2018 Return-Path: Delivered-To: svn-src-all@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 261C210E8C0D; Mon, 29 Oct 2018 20:08:20 +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 CDB7280659; Mon, 29 Oct 2018 20:08:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A37731311D; Mon, 29 Oct 2018 20:08:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TK8JdN011273; Mon, 29 Oct 2018 20:08:19 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TK8JxU011272; Mon, 29 Oct 2018 20:08:19 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201810292008.w9TK8JxU011272@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 20:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339871 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 339871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 20:08:20 -0000 Author: tuexen Date: Mon Oct 29 20:08:19 2018 New Revision: 339871 URL: https://svnweb.freebsd.org/changeset/base/339871 Log: MFC r339869,r339870: Remove empty line. Reported by: gjb@ Approved by: re (gjb@) Modified: stable/12/share/man/man4/sctp.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/sctp.4 ============================================================================== --- stable/12/share/man/man4/sctp.4 Mon Oct 29 19:25:30 2018 (r339870) +++ stable/12/share/man/man4/sctp.4 Mon Oct 29 20:08:19 2018 (r339871) @@ -593,7 +593,6 @@ Maximum incoming SCTP buffer size. Maximum outgoing SCTP buffer size. .El .El - .Sh SEE ALSO .Xr accept 2 , .Xr bind 2 , From owner-svn-src-all@freebsd.org Mon Oct 29 20:21:12 2018 Return-Path: Delivered-To: svn-src-all@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 1A37C10E8FDB; Mon, 29 Oct 2018 20:21:12 +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 C37AF80CE0; Mon, 29 Oct 2018 20:21:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BD60133EB; Mon, 29 Oct 2018 20:21:11 +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 w9TKLBCK020441; Mon, 29 Oct 2018 20:21:11 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TKLBps020439; Mon, 29 Oct 2018 20:21:11 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201810292021.w9TKLBps020439@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 20:21:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339872 - in stable/11/sys: amd64/include i386/include x86/include X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/11/sys: amd64/include i386/include x86/include X-SVN-Commit-Revision: 339872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 20:21:12 -0000 Author: jhb Date: Mon Oct 29 20:21:10 2018 New Revision: 339872 URL: https://svnweb.freebsd.org/changeset/base/339872 Log: MFC 338101: Merge amd64 and i386 headers. Added: stable/11/sys/x86/include/intr_machdep.h - copied, changed from r338101, head/sys/x86/include/intr_machdep.h Modified: stable/11/sys/amd64/include/intr_machdep.h stable/11/sys/i386/include/intr_machdep.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/include/intr_machdep.h ============================================================================== --- stable/11/sys/amd64/include/intr_machdep.h Mon Oct 29 20:08:19 2018 (r339871) +++ stable/11/sys/amd64/include/intr_machdep.h Mon Oct 29 20:21:10 2018 (r339872) @@ -29,112 +29,9 @@ #ifndef __MACHINE_INTR_MACHDEP_H__ #define __MACHINE_INTR_MACHDEP_H__ -#ifdef _KERNEL +#include /* - * The maximum number of I/O interrupts we allow. This number is rather - * arbitrary as it is just the maximum IRQ resource value. The interrupt - * source for a given IRQ maps that I/O interrupt to device interrupt - * source whether it be a pin on an interrupt controller or an MSI interrupt. - * The 16 ISA IRQs are assigned fixed IDT vectors, but all other device - * interrupts allocate IDT vectors on demand. Currently we have 191 IDT - * vectors available for device interrupts. On many systems with I/O APICs, - * a lot of the IRQs are not used, so this number can be much larger than - * 191 and still be safe since only interrupt sources in actual use will - * allocate IDT vectors. - * - * The first 255 IRQs (0 - 254) are reserved for ISA IRQs and PCI intline IRQs. - * IRQ values from 256 to 767 are used by MSI. When running under the Xen - * Hypervisor, IRQ values from 768 to 4863 are available for binding to - * event channel events. We leave 255 unused to avoid confusion since 255 is - * used in PCI to indicate an invalid IRQ. - */ -#define NUM_MSI_INTS 512 -#define FIRST_MSI_INT 256 -#ifdef XENHVM -#include -#include -#define NUM_EVTCHN_INTS NR_EVENT_CHANNELS -#define FIRST_EVTCHN_INT \ - (FIRST_MSI_INT + NUM_MSI_INTS) -#define LAST_EVTCHN_INT \ - (FIRST_EVTCHN_INT + NUM_EVTCHN_INTS - 1) -#else -#define NUM_EVTCHN_INTS 0 -#endif -#define NUM_IO_INTS (FIRST_MSI_INT + NUM_MSI_INTS + NUM_EVTCHN_INTS) - -/* - * Default base address for MSI messages on x86 platforms. - */ -#define MSI_INTEL_ADDR_BASE 0xfee00000 - -/* - * - 1 ??? dummy counter. - * - 2 counters for each I/O interrupt. - * - 1 counter for each CPU for lapic timer. - * - 8 counters for each CPU for IPI counters for SMP. - */ -#ifdef SMP -#define INTRCNT_COUNT (1 + NUM_IO_INTS * 2 + (1 + 8) * MAXCPU) -#else -#define INTRCNT_COUNT (1 + NUM_IO_INTS * 2 + 1) -#endif - -#ifndef LOCORE - -typedef void inthand_t(void); - -#define IDTVEC(name) __CONCAT(X,name) - -struct intsrc; - -/* - * Methods that a PIC provides to mask/unmask a given interrupt source, - * "turn on" the interrupt on the CPU side by setting up an IDT entry, and - * return the vector associated with this source. - */ -struct pic { - void (*pic_enable_source)(struct intsrc *); - void (*pic_disable_source)(struct intsrc *, int); - void (*pic_eoi_source)(struct intsrc *); - void (*pic_enable_intr)(struct intsrc *); - void (*pic_disable_intr)(struct intsrc *); - int (*pic_vector)(struct intsrc *); - int (*pic_source_pending)(struct intsrc *); - void (*pic_suspend)(struct pic *); - void (*pic_resume)(struct pic *, bool suspend_cancelled); - int (*pic_config_intr)(struct intsrc *, enum intr_trigger, - enum intr_polarity); - int (*pic_assign_cpu)(struct intsrc *, u_int apic_id); - void (*pic_reprogram_pin)(struct intsrc *); - TAILQ_ENTRY(pic) pics; -}; - -/* Flags for pic_disable_source() */ -enum { - PIC_EOI, - PIC_NO_EOI, -}; - -/* - * An interrupt source. The upper-layer code uses the PIC methods to - * control a given source. The lower-layer PIC drivers can store additional - * private data in a given interrupt source such as an interrupt pin number - * or an I/O APIC pointer. - */ -struct intsrc { - struct pic *is_pic; - struct intr_event *is_event; - u_long *is_count; - u_long *is_straycount; - u_int is_index; - u_int is_handlers; -}; - -struct trapframe; - -/* * The following data structure holds per-cpu data, and is placed just * above the top of the space used for the NMI and MC# stacks. */ @@ -143,53 +40,4 @@ struct nmi_pcpu { register_t __padding; /* pad to 16 bytes */ }; -#ifdef SMP -extern cpuset_t intr_cpus; -#endif -extern struct mtx icu_lock; -extern int elcr_found; -#ifdef SMP -extern int msix_disable_migration; -#endif - -#ifndef DEV_ATPIC -void atpic_reset(void); -#endif -/* XXX: The elcr_* prototypes probably belong somewhere else. */ -int elcr_probe(void); -enum intr_trigger elcr_read_trigger(u_int irq); -void elcr_resume(void); -void elcr_write_trigger(u_int irq, enum intr_trigger trigger); -#ifdef SMP -void intr_add_cpu(u_int cpu); -#endif -int intr_add_handler(const char *name, int vector, driver_filter_t filter, - driver_intr_t handler, void *arg, enum intr_type flags, - void **cookiep); -#ifdef SMP -int intr_bind(u_int vector, u_char cpu); -#endif -int intr_config_intr(int vector, enum intr_trigger trig, - enum intr_polarity pol); -int intr_describe(u_int vector, void *ih, const char *descr); -void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame); -u_int intr_next_cpu(void); -struct intsrc *intr_lookup_source(int vector); -int intr_register_pic(struct pic *pic); -int intr_register_source(struct intsrc *isrc); -int intr_remove_handler(void *cookie); -void intr_resume(bool suspend_cancelled); -void intr_suspend(void); -void intr_reprogram(void); -void intrcnt_add(const char *name, u_long **countp); -void nexus_add_irq(u_long irq); -int msi_alloc(device_t dev, int count, int maxcount, int *irqs); -void msi_init(void); -int msi_map(int irq, uint64_t *addr, uint32_t *data); -int msi_release(int *irqs, int count); -int msix_alloc(device_t dev, int *irq); -int msix_release(int irq); - -#endif /* !LOCORE */ -#endif /* _KERNEL */ #endif /* !__MACHINE_INTR_MACHDEP_H__ */ Modified: stable/11/sys/i386/include/intr_machdep.h ============================================================================== --- stable/11/sys/i386/include/intr_machdep.h Mon Oct 29 20:08:19 2018 (r339871) +++ stable/11/sys/i386/include/intr_machdep.h Mon Oct 29 20:21:10 2018 (r339872) @@ -1,185 +1,6 @@ /*- - * Copyright (c) 2003 John Baldwin - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef __MACHINE_INTR_MACHDEP_H__ -#define __MACHINE_INTR_MACHDEP_H__ - -#ifdef _KERNEL - -/* - * The maximum number of I/O interrupts we allow. This number is rather - * arbitrary as it is just the maximum IRQ resource value. The interrupt - * source for a given IRQ maps that I/O interrupt to device interrupt - * source whether it be a pin on an interrupt controller or an MSI interrupt. - * The 16 ISA IRQs are assigned fixed IDT vectors, but all other device - * interrupts allocate IDT vectors on demand. Currently we have 191 IDT - * vectors available for device interrupts. On many systems with I/O APICs, - * a lot of the IRQs are not used, so this number can be much larger than - * 191 and still be safe since only interrupt sources in actual use will - * allocate IDT vectors. - * - * The first 255 IRQs (0 - 254) are reserved for ISA IRQs and PCI intline IRQs. - * IRQ values from 256 to 767 are used by MSI. When running under the Xen - * Hypervisor, IRQ values from 768 to 4863 are available for binding to - * event channel events. We leave 255 unused to avoid confusion since 255 is - * used in PCI to indicate an invalid IRQ. - */ -#define NUM_MSI_INTS 512 -#define FIRST_MSI_INT 256 -#ifdef XENHVM -#include -#include -#define NUM_EVTCHN_INTS NR_EVENT_CHANNELS -#define FIRST_EVTCHN_INT \ - (FIRST_MSI_INT + NUM_MSI_INTS) -#define LAST_EVTCHN_INT \ - (FIRST_EVTCHN_INT + NUM_EVTCHN_INTS - 1) -#else /* !XENHVM */ -#define NUM_EVTCHN_INTS 0 -#endif -#define NUM_IO_INTS (FIRST_MSI_INT + NUM_MSI_INTS + NUM_EVTCHN_INTS) - -/* - * Default base address for MSI messages on x86 platforms. - */ -#define MSI_INTEL_ADDR_BASE 0xfee00000 - -/* - * - 1 ??? dummy counter. - * - 2 counters for each I/O interrupt. - * - 1 counter for each CPU for lapic timer. - * - 8 counters for each CPU for IPI counters for SMP. - */ -#ifdef SMP -#define INTRCNT_COUNT (1 + NUM_IO_INTS * 2 + (1 + 8) * MAXCPU) -#else -#define INTRCNT_COUNT (1 + NUM_IO_INTS * 2 + 1) -#endif - -#ifndef LOCORE - -typedef void inthand_t(void); - -#define IDTVEC(name) __CONCAT(X,name) - -struct intsrc; - -/* - * Methods that a PIC provides to mask/unmask a given interrupt source, - * "turn on" the interrupt on the CPU side by setting up an IDT entry, and - * return the vector associated with this source. - */ -struct pic { - void (*pic_enable_source)(struct intsrc *); - void (*pic_disable_source)(struct intsrc *, int); - void (*pic_eoi_source)(struct intsrc *); - void (*pic_enable_intr)(struct intsrc *); - void (*pic_disable_intr)(struct intsrc *); - int (*pic_vector)(struct intsrc *); - int (*pic_source_pending)(struct intsrc *); - void (*pic_suspend)(struct pic *); - void (*pic_resume)(struct pic *, bool suspend_cancelled); - int (*pic_config_intr)(struct intsrc *, enum intr_trigger, - enum intr_polarity); - int (*pic_assign_cpu)(struct intsrc *, u_int apic_id); - void (*pic_reprogram_pin)(struct intsrc *); - TAILQ_ENTRY(pic) pics; -}; - -/* Flags for pic_disable_source() */ -enum { - PIC_EOI, - PIC_NO_EOI, -}; - -/* - * An interrupt source. The upper-layer code uses the PIC methods to - * control a given source. The lower-layer PIC drivers can store additional - * private data in a given interrupt source such as an interrupt pin number - * or an I/O APIC pointer. - */ -struct intsrc { - struct pic *is_pic; - struct intr_event *is_event; - u_long *is_count; - u_long *is_straycount; - u_int is_index; - u_int is_handlers; -}; - -struct trapframe; - -#ifdef SMP -extern cpuset_t intr_cpus; -#endif -extern struct mtx icu_lock; -extern int elcr_found; -#ifdef SMP -extern int msix_disable_migration; -#endif - -#ifndef DEV_ATPIC -void atpic_reset(void); -#endif -/* XXX: The elcr_* prototypes probably belong somewhere else. */ -int elcr_probe(void); -enum intr_trigger elcr_read_trigger(u_int irq); -void elcr_resume(void); -void elcr_write_trigger(u_int irq, enum intr_trigger trigger); -#ifdef SMP -void intr_add_cpu(u_int cpu); -#endif -int intr_add_handler(const char *name, int vector, driver_filter_t filter, - driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep); -#ifdef SMP -int intr_bind(u_int vector, u_char cpu); -#endif -int intr_config_intr(int vector, enum intr_trigger trig, - enum intr_polarity pol); -int intr_describe(u_int vector, void *ih, const char *descr); -void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame); -u_int intr_next_cpu(void); -struct intsrc *intr_lookup_source(int vector); -int intr_register_pic(struct pic *pic); -int intr_register_source(struct intsrc *isrc); -int intr_remove_handler(void *cookie); -void intr_resume(bool suspend_cancelled); -void intr_suspend(void); -void intr_reprogram(void); -void intrcnt_add(const char *name, u_long **countp); -void nexus_add_irq(u_long irq); -int msi_alloc(device_t dev, int count, int maxcount, int *irqs); -void msi_init(void); -int msi_map(int irq, uint64_t *addr, uint32_t *data); -int msi_release(int* irqs, int count); -int msix_alloc(device_t dev, int *irq); -int msix_release(int irq); - -#endif /* !LOCORE */ -#endif /* _KERNEL */ -#endif /* !__MACHINE_INTR_MACHDEP_H__ */ +#include Copied and modified: stable/11/sys/x86/include/intr_machdep.h (from r338101, head/sys/x86/include/intr_machdep.h) ============================================================================== --- head/sys/x86/include/intr_machdep.h Mon Aug 20 12:31:39 2018 (r338101, copy source) +++ stable/11/sys/x86/include/intr_machdep.h Mon Oct 29 20:21:10 2018 (r339872) @@ -1,6 +1,4 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * * Copyright (c) 2003 John Baldwin * All rights reserved. * @@ -132,8 +130,6 @@ struct intsrc { u_long *is_straycount; u_int is_index; u_int is_handlers; - u_int is_domain; - u_int is_cpu; }; struct trapframe; @@ -158,9 +154,9 @@ void elcr_write_trigger(u_int irq, enum intr_trigger t #ifdef SMP void intr_add_cpu(u_int cpu); #endif -int intr_add_handler(const char *name, int vector, driver_filter_t filter, - driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep, - int domain); +int intr_add_handler(const char *name, int vector, driver_filter_t filter, + driver_intr_t handler, void *arg, enum intr_type flags, + void **cookiep); #ifdef SMP int intr_bind(u_int vector, u_char cpu); #endif @@ -168,7 +164,7 @@ int intr_config_intr(int vector, enum intr_trigger tri enum intr_polarity pol); int intr_describe(u_int vector, void *ih, const char *descr); void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame); -u_int intr_next_cpu(int domain); +u_int intr_next_cpu(void); struct intsrc *intr_lookup_source(int vector); int intr_register_pic(struct pic *pic); int intr_register_source(struct intsrc *isrc); From owner-svn-src-all@freebsd.org Mon Oct 29 20:27:10 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 20:36:09 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 20:53:06 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 21:00:17 2018 Return-Path: Delivered-To: svn-src-all@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 9C84110E9DCE; Mon, 29 Oct 2018 21:00:17 +0000 (UTC) (envelope-from davidcs@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 49701829AC; Mon, 29 Oct 2018 21:00:17 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2083513931; Mon, 29 Oct 2018 21:00:17 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TL0G18036955; Mon, 29 Oct 2018 21:00:16 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TL0GVK036953; Mon, 29 Oct 2018 21:00:16 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201810292100.w9TL0GVK036953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 29 Oct 2018 21:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339874 - stable/11/sys/dev/bxe X-SVN-Group: stable-11 X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: stable/11/sys/dev/bxe X-SVN-Commit-Revision: 339874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 21:00:17 -0000 Author: davidcs Date: Mon Oct 29 21:00:16 2018 New Revision: 339874 URL: https://svnweb.freebsd.org/changeset/base/339874 Log: MFC r338734 Fixed isses: State check before enqueuing transmit task in bxe_link_attn() routine. State check before invoking bxe_nic_unload in bxe_shutdown(). Submitted by:Vaishali.Kulkarni@cavium.com Modified: stable/11/sys/dev/bxe/bxe.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/bxe/bxe.c ============================================================================== --- stable/11/sys/dev/bxe/bxe.c Mon Oct 29 20:53:05 2018 (r339873) +++ stable/11/sys/dev/bxe/bxe.c Mon Oct 29 21:00:16 2018 (r339874) @@ -7072,13 +7072,13 @@ bxe_link_attn(struct bxe_softc *sc) if (sc->state == BXE_STATE_OPEN) { bxe_stats_handle(sc, STATS_EVENT_LINK_UP); + /* Restart tx when the link comes back. */ + FOR_EACH_ETH_QUEUE(sc, i) { + fp = &sc->fp[i]; + taskqueue_enqueue(fp->tq, &fp->tx_task); + } } - /* Restart tx when the link comes back. */ - FOR_EACH_ETH_QUEUE(sc, i) { - fp = &sc->fp[i]; - taskqueue_enqueue(fp->tq, &fp->tx_task); - } } if (sc->link_vars.link_up && sc->link_vars.line_speed) { @@ -16272,9 +16272,11 @@ bxe_shutdown(device_t dev) /* stop the periodic callout */ bxe_periodic_stop(sc); - BXE_CORE_LOCK(sc); - bxe_nic_unload(sc, UNLOAD_NORMAL, FALSE); - BXE_CORE_UNLOCK(sc); + if (sc->state != BXE_STATE_CLOSED) { + BXE_CORE_LOCK(sc); + bxe_nic_unload(sc, UNLOAD_NORMAL, FALSE); + BXE_CORE_UNLOCK(sc); + } return (0); } From owner-svn-src-all@freebsd.org Mon Oct 29 21:03:44 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 21:08:04 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 21:08:16 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 21:08:25 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 21:08:31 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 21:08:39 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 21:09:41 2018 Return-Path: Delivered-To: svn-src-all@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 5B8CF10EA35D; Mon, 29 Oct 2018 21:09:41 +0000 (UTC) (envelope-from davidcs@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 122638365B; Mon, 29 Oct 2018 21:09:41 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E729413AFE; Mon, 29 Oct 2018 21:09:40 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TL9e38042256; Mon, 29 Oct 2018 21:09:40 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TL9emL042251; Mon, 29 Oct 2018 21:09:40 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201810292109.w9TL9emL042251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 29 Oct 2018 21:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339881 - stable/11/sys/dev/bxe X-SVN-Group: stable-11 X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: stable/11/sys/dev/bxe X-SVN-Commit-Revision: 339881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 21:09:41 -0000 Author: davidcs Date: Mon Oct 29 21:09:39 2018 New Revision: 339881 URL: https://svnweb.freebsd.org/changeset/base/339881 Log: MFC r339366 Add support for Error Recovery Submitted by:Vaishali.Kulkarni@cavium.com Modified: stable/11/sys/dev/bxe/bxe.c stable/11/sys/dev/bxe/bxe.h stable/11/sys/dev/bxe/bxe_stats.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/bxe/bxe.c ============================================================================== --- stable/11/sys/dev/bxe/bxe.c Mon Oct 29 21:08:34 2018 (r339880) +++ stable/11/sys/dev/bxe/bxe.c Mon Oct 29 21:09:39 2018 (r339881) @@ -200,6 +200,7 @@ static int bxe_attach(device_t); static int bxe_detach(device_t); static int bxe_shutdown(device_t); + /* * FreeBSD KLD module/device interface event handler method. */ @@ -701,6 +702,9 @@ static void bxe_interrupt_detach(struct bxe_softc * static void bxe_set_rx_mode(struct bxe_softc *sc); static int bxe_init_locked(struct bxe_softc *sc); static int bxe_stop_locked(struct bxe_softc *sc); +static void bxe_sp_err_timeout_task(void *arg, int pending); +void bxe_parity_recover(struct bxe_softc *sc); +void bxe_handle_error(struct bxe_softc *sc); static __noinline int bxe_nic_load(struct bxe_softc *sc, int load_mode); static __noinline int bxe_nic_unload(struct bxe_softc *sc, @@ -3482,16 +3486,12 @@ bxe_watchdog(struct bxe_softc *sc, } BLOGE(sc, "TX watchdog timeout on fp[%02d], resetting!\n", fp->index); - if(sc->trigger_grcdump) { - /* taking grcdump */ - bxe_grc_dump(sc); - } BXE_FP_TX_UNLOCK(fp); + BXE_SET_ERROR_BIT(sc, BXE_ERR_TXQ_STUCK); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); - atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); - taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); - return (-1); } @@ -4246,6 +4246,7 @@ bxe_nic_unload(struct bxe_softc *sc, struct bxe_fastpath *fp; fp = &sc->fp[i]; + fp->watchdog_timer = 0; BXE_FP_TX_LOCK(fp); BXE_FP_TX_UNLOCK(fp); } @@ -4261,20 +4262,22 @@ bxe_nic_unload(struct bxe_softc *sc, if (IS_PF(sc) && sc->recovery_state != BXE_RECOVERY_DONE && (sc->state == BXE_STATE_CLOSED || sc->state == BXE_STATE_ERROR)) { - /* - * We can get here if the driver has been unloaded - * during parity error recovery and is either waiting for a - * leader to complete or for other functions to unload and - * then ifconfig down has been issued. In this case we want to - * unload and let other functions to complete a recovery - * process. - */ - sc->recovery_state = BXE_RECOVERY_DONE; - sc->is_leader = 0; - bxe_release_leader_lock(sc); - mb(); - BLOGD(sc, DBG_LOAD, "Releasing a leadership...\n"); + if(CHIP_PORT_MODE(sc) == CHIP_4_PORT_MODE) { + /* + * We can get here if the driver has been unloaded + * during parity error recovery and is either waiting for a + * leader to complete or for other functions to unload and + * then ifconfig down has been issued. In this case we want to + * unload and let other functions to complete a recovery + * process. + */ + sc->recovery_state = BXE_RECOVERY_DONE; + sc->is_leader = 0; + bxe_release_leader_lock(sc); + mb(); + BLOGD(sc, DBG_LOAD, "Releasing a leadership...\n"); + } BLOGE(sc, "Can't unload in closed or error state recover_state 0x%x" " state = 0x%x\n", sc->recovery_state, sc->state); return (-1); @@ -7566,6 +7569,10 @@ bxe_parity_attn(struct bxe_softc *sc, if (print) BLOGI(sc, "\n"); + if( *global == TRUE ) { + BXE_SET_ERROR_BIT(sc, BXE_ERR_GLOBAL); + } + return (TRUE); } @@ -7580,6 +7587,9 @@ bxe_chk_parity_attn(struct bxe_softc *sc, struct attn_route attn = { {0} }; int port = SC_PORT(sc); + if(sc->state != BXE_STATE_OPEN) + return FALSE; + attn.sig[0] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_1_FUNC_0 + port*4); attn.sig[1] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_2_FUNC_0 + port*4); attn.sig[2] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_3_FUNC_0 + port*4); @@ -7606,10 +7616,12 @@ bxe_attn_int_deasserted4(struct bxe_softc *sc, uint32_t attn) { uint32_t val; + boolean_t err_flg = FALSE; if (attn & AEU_INPUTS_ATTN_BITS_PGLUE_HW_INTERRUPT) { val = REG_RD(sc, PGLUE_B_REG_PGLUE_B_INT_STS_CLR); BLOGE(sc, "PGLUE hw attention 0x%08x\n", val); + err_flg = TRUE; if (val & PGLUE_B_PGLUE_B_INT_STS_REG_ADDRESS_ERROR) BLOGE(sc, "PGLUE_B_PGLUE_B_INT_STS_REG_ADDRESS_ERROR\n"); if (val & PGLUE_B_PGLUE_B_INT_STS_REG_INCORRECT_RCV_BEHAVIOR) @@ -7633,6 +7645,7 @@ bxe_attn_int_deasserted4(struct bxe_softc *sc, if (attn & AEU_INPUTS_ATTN_BITS_ATC_HW_INTERRUPT) { val = REG_RD(sc, ATC_REG_ATC_INT_STS_CLR); BLOGE(sc, "ATC hw attention 0x%08x\n", val); + err_flg = TRUE; if (val & ATC_ATC_INT_STS_REG_ADDRESS_ERROR) BLOGE(sc, "ATC_ATC_INT_STS_REG_ADDRESS_ERROR\n"); if (val & ATC_ATC_INT_STS_REG_ATC_TCPL_TO_NOT_PEND) @@ -7652,7 +7665,14 @@ bxe_attn_int_deasserted4(struct bxe_softc *sc, BLOGE(sc, "FATAL parity attention set4 0x%08x\n", (uint32_t)(attn & (AEU_INPUTS_ATTN_BITS_PGLUE_PARITY_ERROR | AEU_INPUTS_ATTN_BITS_ATC_PARITY_ERROR))); + err_flg = TRUE; } + if (err_flg) { + BXE_SET_ERROR_BIT(sc, BXE_ERR_MISC); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + } + } static void @@ -8007,14 +8027,21 @@ bxe_attn_int_deasserted3(struct bxe_softc *sc, REG_WR(sc, MISC_REG_AEU_GENERAL_ATTN_9, 0); REG_WR(sc, MISC_REG_AEU_GENERAL_ATTN_8, 0); REG_WR(sc, MISC_REG_AEU_GENERAL_ATTN_7, 0); - bxe_panic(sc, ("MC assert!\n")); - + bxe_int_disable(sc); + BXE_SET_ERROR_BIT(sc, BXE_ERR_MC_ASSERT); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + } else if (attn & BXE_MCP_ASSERT) { BLOGE(sc, "MCP assert!\n"); REG_WR(sc, MISC_REG_AEU_GENERAL_ATTN_11, 0); - // XXX bxe_fw_dump(sc); + BXE_SET_ERROR_BIT(sc, BXE_ERR_MCP_ASSERT); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + bxe_int_disable(sc); /*avoid repetive assert alert */ + } else { BLOGE(sc, "Unknown HW assert! (attn 0x%08x)\n", attn); } @@ -8042,6 +8069,7 @@ bxe_attn_int_deasserted2(struct bxe_softc *sc, int reg_offset; uint32_t val0, mask0, val1, mask1; uint32_t val; + boolean_t err_flg = FALSE; if (attn & AEU_INPUTS_ATTN_BITS_CFC_HW_INTERRUPT) { val = REG_RD(sc, CFC_REG_CFC_INT_STS_CLR); @@ -8049,6 +8077,7 @@ bxe_attn_int_deasserted2(struct bxe_softc *sc, /* CFC error attention */ if (val & 0x2) { BLOGE(sc, "FATAL error from CFC\n"); + err_flg = TRUE; } } @@ -8058,11 +8087,13 @@ bxe_attn_int_deasserted2(struct bxe_softc *sc, /* RQ_USDMDP_FIFO_OVERFLOW */ if (val & 0x18000) { BLOGE(sc, "FATAL error from PXP\n"); + err_flg = TRUE; } if (!CHIP_IS_E1x(sc)) { val = REG_RD(sc, PXP_REG_PXP_INT_STS_CLR_1); BLOGE(sc, "PXP hw attention-1 0x%08x\n", val); + err_flg = TRUE; } } @@ -8099,6 +8130,7 @@ bxe_attn_int_deasserted2(struct bxe_softc *sc, */ if (val0 & PXP2_EOP_ERROR_BIT) { BLOGE(sc, "PXP2_WR_PGLUE_EOP_ERROR\n"); + err_flg = TRUE; /* * if only PXP2_PXP2_INT_STS_0_REG_WR_PGLUE_EOP_ERROR is @@ -8121,8 +8153,15 @@ bxe_attn_int_deasserted2(struct bxe_softc *sc, BLOGE(sc, "FATAL HW block attention set2 0x%x\n", (uint32_t)(attn & HW_INTERRUT_ASSERT_SET_2)); + err_flg = TRUE; bxe_panic(sc, ("HW block attention set2\n")); } + if(err_flg) { + BXE_SET_ERROR_BIT(sc, BXE_ERR_GLOBAL); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + } + } static void @@ -8132,6 +8171,7 @@ bxe_attn_int_deasserted1(struct bxe_softc *sc, int port = SC_PORT(sc); int reg_offset; uint32_t val; + boolean_t err_flg = FALSE; if (attn & AEU_INPUTS_ATTN_BITS_DOORBELLQ_HW_INTERRUPT) { val = REG_RD(sc, DORQ_REG_DORQ_INT_STS_CLR); @@ -8139,6 +8179,7 @@ bxe_attn_int_deasserted1(struct bxe_softc *sc, /* DORQ discard attention */ if (val & 0x2) { BLOGE(sc, "FATAL error from DORQ\n"); + err_flg = TRUE; } } @@ -8152,8 +8193,15 @@ bxe_attn_int_deasserted1(struct bxe_softc *sc, BLOGE(sc, "FATAL HW block attention set1 0x%08x\n", (uint32_t)(attn & HW_INTERRUT_ASSERT_SET_1)); + err_flg = TRUE; bxe_panic(sc, ("HW block attention set1\n")); } + if(err_flg) { + BXE_SET_ERROR_BIT(sc, BXE_ERR_MISC); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + } + } static void @@ -8190,6 +8238,11 @@ bxe_attn_int_deasserted0(struct bxe_softc *sc, val &= ~(attn & HW_INTERRUT_ASSERT_SET_0); REG_WR(sc, reg_offset, val); + + BXE_SET_ERROR_BIT(sc, BXE_ERR_MISC); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + bxe_panic(sc, ("FATAL HW block attention set0 0x%lx\n", (attn & HW_INTERRUT_ASSERT_SET_0))); } @@ -8219,10 +8272,12 @@ bxe_attn_int_deasserted(struct bxe_softc *sc, * In case of parity errors don't handle attentions so that * other function would "see" parity errors. */ - sc->recovery_state = BXE_RECOVERY_INIT; // XXX schedule a recovery task... /* disable HW interrupts */ bxe_int_disable(sc); + BXE_SET_ERROR_BIT(sc, BXE_ERR_PARITY); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); bxe_release_alr(sc); return; } @@ -12352,6 +12407,259 @@ bxe_periodic_stop(struct bxe_softc *sc) callout_drain(&sc->periodic_callout); } +void +bxe_parity_recover(struct bxe_softc *sc) +{ + uint8_t global = FALSE; + uint32_t error_recovered, error_unrecovered; + bool is_parity; + + + if ((sc->recovery_state == BXE_RECOVERY_FAILED) && + (sc->state == BXE_STATE_ERROR)) { + BLOGE(sc, "RECOVERY failed, " + "stack notified driver is NOT running! " + "Please reboot/power cycle the system.\n"); + return; + } + + while (1) { + BLOGD(sc, DBG_SP, + "%s sc=%p state=0x%x rec_state=0x%x error_status=%x\n", + __func__, sc, sc->state, sc->recovery_state, sc->error_status); + + switch(sc->recovery_state) { + + case BXE_RECOVERY_INIT: + is_parity = bxe_chk_parity_attn(sc, &global, FALSE); + + if ((CHIP_PORT_MODE(sc) == CHIP_4_PORT_MODE) || + (sc->error_status & BXE_ERR_MCP_ASSERT) || + (sc->error_status & BXE_ERR_GLOBAL)) { + + BXE_CORE_LOCK(sc); + if (if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) { + bxe_periodic_stop(sc); + } + bxe_nic_unload(sc, UNLOAD_RECOVERY, false); + sc->state = BXE_STATE_ERROR; + sc->recovery_state = BXE_RECOVERY_FAILED; + BLOGE(sc, " No Recovery tried for error 0x%x" + " stack notified driver is NOT running!" + " Please reboot/power cycle the system.\n", + sc->error_status); + BXE_CORE_UNLOCK(sc); + return; + } + + + /* Try to get a LEADER_LOCK HW lock */ + if (bxe_trylock_leader_lock(sc)) { + + bxe_set_reset_in_progress(sc); + /* + * Check if there is a global attention and if + * there was a global attention, set the global + * reset bit. + */ + if (global) { + bxe_set_reset_global(sc); + } + sc->is_leader = 1; + } + + /* If interface has been removed - break */ + + if (if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) { + bxe_periodic_stop(sc); + } + + BXE_CORE_LOCK(sc); + bxe_nic_unload(sc,UNLOAD_RECOVERY, false); + sc->recovery_state = BXE_RECOVERY_WAIT; + BXE_CORE_UNLOCK(sc); + + /* + * Ensure "is_leader", MCP command sequence and + * "recovery_state" update values are seen on other + * CPUs. + */ + mb(); + break; + case BXE_RECOVERY_WAIT: + + if (sc->is_leader) { + int other_engine = SC_PATH(sc) ? 0 : 1; + bool other_load_status = + bxe_get_load_status(sc, other_engine); + bool load_status = + bxe_get_load_status(sc, SC_PATH(sc)); + global = bxe_reset_is_global(sc); + + /* + * In case of a parity in a global block, let + * the first leader that performs a + * leader_reset() reset the global blocks in + * order to clear global attentions. Otherwise + * the gates will remain closed for that + * engine. + */ + if (load_status || + (global && other_load_status)) { + /* + * Wait until all other functions get + * down. + */ + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + return; + } else { + /* + * If all other functions got down + * try to bring the chip back to + * normal. In any case it's an exit + * point for a leader. + */ + if (bxe_leader_reset(sc)) { + BLOGE(sc, "RECOVERY failed, " + "stack notified driver is NOT running!\n"); + sc->recovery_state = BXE_RECOVERY_FAILED; + sc->state = BXE_STATE_ERROR; + mb(); + return; + } + + /* + * If we are here, means that the + * leader has succeeded and doesn't + * want to be a leader any more. Try + * to continue as a none-leader. + */ + break; + } + + } else { /* non-leader */ + if (!bxe_reset_is_done(sc, SC_PATH(sc))) { + /* + * Try to get a LEADER_LOCK HW lock as + * long as a former leader may have + * been unloaded by the user or + * released a leadership by another + * reason. + */ + if (bxe_trylock_leader_lock(sc)) { + /* + * I'm a leader now! Restart a + * switch case. + */ + sc->is_leader = 1; + break; + } + + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + return; + + } else { + /* + * If there was a global attention, wait + * for it to be cleared. + */ + if (bxe_reset_is_global(sc)) { + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + return; + } + + error_recovered = + sc->eth_stats.recoverable_error; + error_unrecovered = + sc->eth_stats.unrecoverable_error; + BXE_CORE_LOCK(sc); + sc->recovery_state = + BXE_RECOVERY_NIC_LOADING; + if (bxe_nic_load(sc, LOAD_NORMAL)) { + error_unrecovered++; + sc->recovery_state = BXE_RECOVERY_FAILED; + sc->state = BXE_STATE_ERROR; + BLOGE(sc, "Recovery is NOT successfull, " + " state=0x%x recovery_state=0x%x error=%x\n", + sc->state, sc->recovery_state, sc->error_status); + sc->error_status = 0; + } else { + sc->recovery_state = + BXE_RECOVERY_DONE; + error_recovered++; + BLOGI(sc, "Recovery is successfull from errors %x," + " state=0x%x" + " recovery_state=0x%x \n", sc->error_status, + sc->state, sc->recovery_state); + mb(); + } + sc->error_status = 0; + BXE_CORE_UNLOCK(sc); + sc->eth_stats.recoverable_error = + error_recovered; + sc->eth_stats.unrecoverable_error = + error_unrecovered; + + return; + } + } + default: + return; + } + } +} +void +bxe_handle_error(struct bxe_softc * sc) +{ + + if(sc->recovery_state == BXE_RECOVERY_WAIT) { + return; + } + if(sc->error_status) { + if (sc->state == BXE_STATE_OPEN) { + bxe_int_disable(sc); + } + if (sc->link_vars.link_up) { + if_link_state_change(sc->ifp, LINK_STATE_DOWN); + } + sc->recovery_state = BXE_RECOVERY_INIT; + BLOGI(sc, "bxe%d: Recovery started errors 0x%x recovery state 0x%x\n", + sc->unit, sc->error_status, sc->recovery_state); + bxe_parity_recover(sc); + } +} + +static void +bxe_sp_err_timeout_task(void *arg, int pending) +{ + + struct bxe_softc *sc = (struct bxe_softc *)arg; + + BLOGD(sc, DBG_SP, + "%s state = 0x%x rec state=0x%x error_status=%x\n", + __func__, sc->state, sc->recovery_state, sc->error_status); + + if((sc->recovery_state == BXE_RECOVERY_FAILED) && + (sc->state == BXE_STATE_ERROR)) { + return; + } + /* if can be taken */ + if ((sc->error_status) && (sc->trigger_grcdump)) { + bxe_grc_dump(sc); + } + if (sc->recovery_state != BXE_RECOVERY_DONE) { + bxe_handle_error(sc); + bxe_parity_recover(sc); + } else if (sc->error_status) { + bxe_handle_error(sc); + } + + return; +} + /* start the controller */ static __noinline int bxe_nic_load(struct bxe_softc *sc, @@ -12633,6 +12941,15 @@ bxe_init_locked(struct bxe_softc *sc) return (0); } + if((sc->state == BXE_STATE_ERROR) && + (sc->recovery_state == BXE_RECOVERY_FAILED)) { + BLOGE(sc, "Initialization not done, " + "as previous recovery failed." + "Reboot/Power-cycle the system\n" ); + return (ENXIO); + } + + bxe_set_power_state(sc, PCI_PM_D0); /* @@ -16030,6 +16347,10 @@ bxe_attach(device_t dev) taskqueue_start_threads(&sc->chip_tq, 1, PWAIT, /* lower priority */ "%s", sc->chip_tq_name); + TIMEOUT_TASK_INIT(taskqueue_thread, + &sc->sp_err_timeout_task, 0, bxe_sp_err_timeout_task, sc); + + /* get device info and set params */ if (bxe_get_device_info(sc) != 0) { BLOGE(sc, "getting device info\n"); @@ -16205,6 +16526,8 @@ bxe_detach(device_t dev) taskqueue_drain(sc->chip_tq, &sc->chip_tq_task); taskqueue_free(sc->chip_tq); sc->chip_tq = NULL; + taskqueue_drain_timeout(taskqueue_thread, + &sc->sp_err_timeout_task); } /* stop and reset the controller if it was open */ Modified: stable/11/sys/dev/bxe/bxe.h ============================================================================== --- stable/11/sys/dev/bxe/bxe.h Mon Oct 29 21:08:34 2018 (r339880) +++ stable/11/sys/dev/bxe/bxe.h Mon Oct 29 21:09:39 2018 (r339881) @@ -475,6 +475,10 @@ struct bxe_device_type #define BXE_FW_RX_ALIGN_END (1 << BXE_RX_ALIGN_SHIFT) #define BXE_PXP_DRAM_ALIGN (BXE_RX_ALIGN_SHIFT - 5) /* XXX ??? */ +#define BXE_SET_ERROR_BIT(sc, error) \ +{ \ + (sc)->error_status |= (error); \ +} struct bxe_bar { struct resource *resource; @@ -1388,6 +1392,8 @@ struct bxe_softc { struct taskqueue *chip_tq; char chip_tq_name[32]; + struct timeout_task sp_err_timeout_task; + /* slowpath interrupt taskqueue */ struct task sp_tq_task; struct taskqueue *sp_tq; @@ -1541,6 +1547,16 @@ struct bxe_softc { #define BXE_RECOVERY_WAIT 3 #define BXE_RECOVERY_FAILED 4 #define BXE_RECOVERY_NIC_LOADING 5 + +#define BXE_ERR_TXQ_STUCK 0x1 /* Tx queue stuck detected by driver. */ +#define BXE_ERR_MISC 0x2 /* MISC ERR */ +#define BXE_ERR_PARITY 0x4 /* Parity error detected. */ +#define BXE_ERR_STATS_TO 0x8 /* Statistics timeout detected. */ +#define BXE_ERR_MC_ASSERT 0x10 /* MC assert attention received. */ +#define BXE_ERR_PANIC 0x20 /* Driver asserted. */ +#define BXE_ERR_MCP_ASSERT 0x40 /* MCP assert attention received. No Recovery*/ +#define BXE_ERR_GLOBAL 0x80 /* PCIe/PXP/IGU/MISC/NIG device blocks error- needs PCIe/Fundamental reset */ + uint32_t error_status; uint32_t rx_mode; #define BXE_RX_MODE_NONE 0 Modified: stable/11/sys/dev/bxe/bxe_stats.c ============================================================================== --- stable/11/sys/dev/bxe/bxe_stats.c Mon Oct 29 21:08:34 2018 (r339880) +++ stable/11/sys/dev/bxe/bxe_stats.c Mon Oct 29 21:09:39 2018 (r339881) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #define BITS_PER_LONG 64 #endif -extern int bxe_grc_dump(struct bxe_softc *sc); static inline long bxe_hilo(uint32_t *hiref) @@ -236,11 +235,11 @@ bxe_stats_comp(struct bxe_softc *sc) while (*stats_comp != DMAE_COMP_VAL) { if (!cnt) { BLOGE(sc, "Timeout waiting for stats finished\n"); - if(sc->trigger_grcdump) { - /* taking grcdump */ - bxe_grc_dump(sc); - } + BXE_SET_ERROR_BIT(sc, BXE_ERR_STATS_TO); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); break; + } cnt--; @@ -923,6 +922,7 @@ bxe_hw_stats_update(struct bxe_softc *sc) nig_timer_max = SHMEM_RD(sc, port_mb[SC_PORT(sc)].stat_nig_timer); if (nig_timer_max != estats->nig_timer_max) { estats->nig_timer_max = nig_timer_max; + /*NOTE: not setting error bit */ BLOGE(sc, "invalid NIG timer max (%u)\n", estats->nig_timer_max); } @@ -1316,12 +1316,10 @@ bxe_stats_update(struct bxe_softc *sc) if (bxe_storm_stats_update(sc)) { if (sc->stats_pending++ == 3) { if (if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) { - if(sc->trigger_grcdump) { - /* taking grcdump */ - bxe_grc_dump(sc); - } - atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); - taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); + BLOGE(sc, "Storm stats not updated for 3 times, resetting\n"); + BXE_SET_ERROR_BIT(sc, BXE_ERR_STATS_TO); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); } } return; From owner-svn-src-all@freebsd.org Mon Oct 29 21:14:49 2018 Return-Path: Delivered-To: svn-src-all@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 1ECDA10EA685; Mon, 29 Oct 2018 21:14:49 +0000 (UTC) (envelope-from davidcs@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 C7C4B83BED; Mon, 29 Oct 2018 21:14:48 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A82AB13CA2; Mon, 29 Oct 2018 21:14:48 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TLEmfA046964; Mon, 29 Oct 2018 21:14:48 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TLEmR4046963; Mon, 29 Oct 2018 21:14:48 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201810292114.w9TLEmR4046963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 29 Oct 2018 21:14:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r339882 - stable/10/sys/dev/bxe X-SVN-Group: stable-10 X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: stable/10/sys/dev/bxe X-SVN-Commit-Revision: 339882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 21:14:49 -0000 Author: davidcs Date: Mon Oct 29 21:14:48 2018 New Revision: 339882 URL: https://svnweb.freebsd.org/changeset/base/339882 Log: MFC r338734 Fixed isses: State check before enqueuing transmit task in bxe_link_attn() routine. State check before invoking bxe_nic_unload in bxe_shutdown(). Submitted by:Vaishali.Kulkarni@cavium.com Modified: stable/10/sys/dev/bxe/bxe.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bxe/bxe.c ============================================================================== --- stable/10/sys/dev/bxe/bxe.c Mon Oct 29 21:09:39 2018 (r339881) +++ stable/10/sys/dev/bxe/bxe.c Mon Oct 29 21:14:48 2018 (r339882) @@ -7079,13 +7079,13 @@ bxe_link_attn(struct bxe_softc *sc) if (sc->state == BXE_STATE_OPEN) { bxe_stats_handle(sc, STATS_EVENT_LINK_UP); + /* Restart tx when the link comes back. */ + FOR_EACH_ETH_QUEUE(sc, i) { + fp = &sc->fp[i]; + taskqueue_enqueue(fp->tq, &fp->tx_task); + } } - /* Restart tx when the link comes back. */ - FOR_EACH_ETH_QUEUE(sc, i) { - fp = &sc->fp[i]; - taskqueue_enqueue(fp->tq, &fp->tx_task); - } } if (sc->link_vars.link_up && sc->link_vars.line_speed) { @@ -16281,9 +16281,11 @@ bxe_shutdown(device_t dev) /* stop the periodic callout */ bxe_periodic_stop(sc); - BXE_CORE_LOCK(sc); - bxe_nic_unload(sc, UNLOAD_NORMAL, FALSE); - BXE_CORE_UNLOCK(sc); + if (sc->state != BXE_STATE_CLOSED) { + BXE_CORE_LOCK(sc); + bxe_nic_unload(sc, UNLOAD_NORMAL, FALSE); + BXE_CORE_UNLOCK(sc); + } return (0); } From owner-svn-src-all@freebsd.org Mon Oct 29 21:16:27 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 21:31:25 2018 Return-Path: Delivered-To: svn-src-all@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 D2BB910EAB08; Mon, 29 Oct 2018 21:31:24 +0000 (UTC) (envelope-from davidcs@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 8046B845E7; Mon, 29 Oct 2018 21:31:24 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6111113FBD; Mon, 29 Oct 2018 21:31:24 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TLVOWQ053358; Mon, 29 Oct 2018 21:31:24 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TLVNtC053354; Mon, 29 Oct 2018 21:31:23 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201810292131.w9TLVNtC053354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 29 Oct 2018 21:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r339884 - stable/10/sys/dev/bxe X-SVN-Group: stable-10 X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: stable/10/sys/dev/bxe X-SVN-Commit-Revision: 339884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 21:31:25 -0000 Author: davidcs Date: Mon Oct 29 21:31:23 2018 New Revision: 339884 URL: https://svnweb.freebsd.org/changeset/base/339884 Log: MFC r339366 Add support for Error Recovery Submitted by:Vaishali.Kulkarni@cavium.com Modified: stable/10/sys/dev/bxe/bxe.c stable/10/sys/dev/bxe/bxe.h stable/10/sys/dev/bxe/bxe_stats.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bxe/bxe.c ============================================================================== --- stable/10/sys/dev/bxe/bxe.c Mon Oct 29 21:16:26 2018 (r339883) +++ stable/10/sys/dev/bxe/bxe.c Mon Oct 29 21:31:23 2018 (r339884) @@ -194,6 +194,7 @@ static int bxe_attach(device_t); static int bxe_detach(device_t); static int bxe_shutdown(device_t); + /* * FreeBSD KLD module/device interface event handler method. */ @@ -706,6 +707,9 @@ static void bxe_interrupt_detach(struct bxe_softc * static void bxe_set_rx_mode(struct bxe_softc *sc); static int bxe_init_locked(struct bxe_softc *sc); static int bxe_stop_locked(struct bxe_softc *sc); +static void bxe_sp_err_timeout_task(void *arg, int pending); +void bxe_parity_recover(struct bxe_softc *sc); +void bxe_handle_error(struct bxe_softc *sc); static __noinline int bxe_nic_load(struct bxe_softc *sc, int load_mode); static __noinline int bxe_nic_unload(struct bxe_softc *sc, @@ -3494,16 +3498,12 @@ bxe_watchdog(struct bxe_softc *sc, } BLOGE(sc, "TX watchdog timeout on fp[%02d], resetting!\n", fp->index); - if(sc->trigger_grcdump) { - /* taking grcdump */ - bxe_grc_dump(sc); - } BXE_FP_TX_UNLOCK(fp); + BXE_SET_ERROR_BIT(sc, BXE_ERR_TXQ_STUCK); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); - atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); - taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); - return (-1); } @@ -4258,6 +4258,7 @@ bxe_nic_unload(struct bxe_softc *sc, struct bxe_fastpath *fp; fp = &sc->fp[i]; + fp->watchdog_timer = 0; BXE_FP_TX_LOCK(fp); BXE_FP_TX_UNLOCK(fp); } @@ -4273,20 +4274,22 @@ bxe_nic_unload(struct bxe_softc *sc, if (IS_PF(sc) && sc->recovery_state != BXE_RECOVERY_DONE && (sc->state == BXE_STATE_CLOSED || sc->state == BXE_STATE_ERROR)) { - /* - * We can get here if the driver has been unloaded - * during parity error recovery and is either waiting for a - * leader to complete or for other functions to unload and - * then ifconfig down has been issued. In this case we want to - * unload and let other functions to complete a recovery - * process. - */ - sc->recovery_state = BXE_RECOVERY_DONE; - sc->is_leader = 0; - bxe_release_leader_lock(sc); - mb(); - BLOGD(sc, DBG_LOAD, "Releasing a leadership...\n"); + if(CHIP_PORT_MODE(sc) == CHIP_4_PORT_MODE) { + /* + * We can get here if the driver has been unloaded + * during parity error recovery and is either waiting for a + * leader to complete or for other functions to unload and + * then ifconfig down has been issued. In this case we want to + * unload and let other functions to complete a recovery + * process. + */ + sc->recovery_state = BXE_RECOVERY_DONE; + sc->is_leader = 0; + bxe_release_leader_lock(sc); + mb(); + BLOGD(sc, DBG_LOAD, "Releasing a leadership...\n"); + } BLOGE(sc, "Can't unload in closed or error state recover_state 0x%x" " state = 0x%x\n", sc->recovery_state, sc->state); return (-1); @@ -7573,6 +7576,10 @@ bxe_parity_attn(struct bxe_softc *sc, if (print) BLOGI(sc, "\n"); + if( *global == TRUE ) { + BXE_SET_ERROR_BIT(sc, BXE_ERR_GLOBAL); + } + return (TRUE); } @@ -7587,6 +7594,9 @@ bxe_chk_parity_attn(struct bxe_softc *sc, struct attn_route attn = { {0} }; int port = SC_PORT(sc); + if(sc->state != BXE_STATE_OPEN) + return FALSE; + attn.sig[0] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_1_FUNC_0 + port*4); attn.sig[1] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_2_FUNC_0 + port*4); attn.sig[2] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_3_FUNC_0 + port*4); @@ -7613,10 +7623,12 @@ bxe_attn_int_deasserted4(struct bxe_softc *sc, uint32_t attn) { uint32_t val; + boolean_t err_flg = FALSE; if (attn & AEU_INPUTS_ATTN_BITS_PGLUE_HW_INTERRUPT) { val = REG_RD(sc, PGLUE_B_REG_PGLUE_B_INT_STS_CLR); BLOGE(sc, "PGLUE hw attention 0x%08x\n", val); + err_flg = TRUE; if (val & PGLUE_B_PGLUE_B_INT_STS_REG_ADDRESS_ERROR) BLOGE(sc, "PGLUE_B_PGLUE_B_INT_STS_REG_ADDRESS_ERROR\n"); if (val & PGLUE_B_PGLUE_B_INT_STS_REG_INCORRECT_RCV_BEHAVIOR) @@ -7640,6 +7652,7 @@ bxe_attn_int_deasserted4(struct bxe_softc *sc, if (attn & AEU_INPUTS_ATTN_BITS_ATC_HW_INTERRUPT) { val = REG_RD(sc, ATC_REG_ATC_INT_STS_CLR); BLOGE(sc, "ATC hw attention 0x%08x\n", val); + err_flg = TRUE; if (val & ATC_ATC_INT_STS_REG_ADDRESS_ERROR) BLOGE(sc, "ATC_ATC_INT_STS_REG_ADDRESS_ERROR\n"); if (val & ATC_ATC_INT_STS_REG_ATC_TCPL_TO_NOT_PEND) @@ -7659,7 +7672,14 @@ bxe_attn_int_deasserted4(struct bxe_softc *sc, BLOGE(sc, "FATAL parity attention set4 0x%08x\n", (uint32_t)(attn & (AEU_INPUTS_ATTN_BITS_PGLUE_PARITY_ERROR | AEU_INPUTS_ATTN_BITS_ATC_PARITY_ERROR))); + err_flg = TRUE; } + if (err_flg) { + BXE_SET_ERROR_BIT(sc, BXE_ERR_MISC); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + } + } static void @@ -8014,14 +8034,21 @@ bxe_attn_int_deasserted3(struct bxe_softc *sc, REG_WR(sc, MISC_REG_AEU_GENERAL_ATTN_9, 0); REG_WR(sc, MISC_REG_AEU_GENERAL_ATTN_8, 0); REG_WR(sc, MISC_REG_AEU_GENERAL_ATTN_7, 0); - bxe_panic(sc, ("MC assert!\n")); - + bxe_int_disable(sc); + BXE_SET_ERROR_BIT(sc, BXE_ERR_MC_ASSERT); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + } else if (attn & BXE_MCP_ASSERT) { BLOGE(sc, "MCP assert!\n"); REG_WR(sc, MISC_REG_AEU_GENERAL_ATTN_11, 0); - // XXX bxe_fw_dump(sc); + BXE_SET_ERROR_BIT(sc, BXE_ERR_MCP_ASSERT); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + bxe_int_disable(sc); /*avoid repetive assert alert */ + } else { BLOGE(sc, "Unknown HW assert! (attn 0x%08x)\n", attn); } @@ -8049,6 +8076,7 @@ bxe_attn_int_deasserted2(struct bxe_softc *sc, int reg_offset; uint32_t val0, mask0, val1, mask1; uint32_t val; + boolean_t err_flg = FALSE; if (attn & AEU_INPUTS_ATTN_BITS_CFC_HW_INTERRUPT) { val = REG_RD(sc, CFC_REG_CFC_INT_STS_CLR); @@ -8056,6 +8084,7 @@ bxe_attn_int_deasserted2(struct bxe_softc *sc, /* CFC error attention */ if (val & 0x2) { BLOGE(sc, "FATAL error from CFC\n"); + err_flg = TRUE; } } @@ -8065,11 +8094,13 @@ bxe_attn_int_deasserted2(struct bxe_softc *sc, /* RQ_USDMDP_FIFO_OVERFLOW */ if (val & 0x18000) { BLOGE(sc, "FATAL error from PXP\n"); + err_flg = TRUE; } if (!CHIP_IS_E1x(sc)) { val = REG_RD(sc, PXP_REG_PXP_INT_STS_CLR_1); BLOGE(sc, "PXP hw attention-1 0x%08x\n", val); + err_flg = TRUE; } } @@ -8106,6 +8137,7 @@ bxe_attn_int_deasserted2(struct bxe_softc *sc, */ if (val0 & PXP2_EOP_ERROR_BIT) { BLOGE(sc, "PXP2_WR_PGLUE_EOP_ERROR\n"); + err_flg = TRUE; /* * if only PXP2_PXP2_INT_STS_0_REG_WR_PGLUE_EOP_ERROR is @@ -8128,8 +8160,15 @@ bxe_attn_int_deasserted2(struct bxe_softc *sc, BLOGE(sc, "FATAL HW block attention set2 0x%x\n", (uint32_t)(attn & HW_INTERRUT_ASSERT_SET_2)); + err_flg = TRUE; bxe_panic(sc, ("HW block attention set2\n")); } + if(err_flg) { + BXE_SET_ERROR_BIT(sc, BXE_ERR_GLOBAL); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + } + } static void @@ -8139,6 +8178,7 @@ bxe_attn_int_deasserted1(struct bxe_softc *sc, int port = SC_PORT(sc); int reg_offset; uint32_t val; + boolean_t err_flg = FALSE; if (attn & AEU_INPUTS_ATTN_BITS_DOORBELLQ_HW_INTERRUPT) { val = REG_RD(sc, DORQ_REG_DORQ_INT_STS_CLR); @@ -8146,6 +8186,7 @@ bxe_attn_int_deasserted1(struct bxe_softc *sc, /* DORQ discard attention */ if (val & 0x2) { BLOGE(sc, "FATAL error from DORQ\n"); + err_flg = TRUE; } } @@ -8159,8 +8200,15 @@ bxe_attn_int_deasserted1(struct bxe_softc *sc, BLOGE(sc, "FATAL HW block attention set1 0x%08x\n", (uint32_t)(attn & HW_INTERRUT_ASSERT_SET_1)); + err_flg = TRUE; bxe_panic(sc, ("HW block attention set1\n")); } + if(err_flg) { + BXE_SET_ERROR_BIT(sc, BXE_ERR_MISC); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + } + } static void @@ -8197,6 +8245,11 @@ bxe_attn_int_deasserted0(struct bxe_softc *sc, val &= ~(attn & HW_INTERRUT_ASSERT_SET_0); REG_WR(sc, reg_offset, val); + + BXE_SET_ERROR_BIT(sc, BXE_ERR_MISC); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + bxe_panic(sc, ("FATAL HW block attention set0 0x%lx\n", (attn & HW_INTERRUT_ASSERT_SET_0))); } @@ -8226,10 +8279,12 @@ bxe_attn_int_deasserted(struct bxe_softc *sc, * In case of parity errors don't handle attentions so that * other function would "see" parity errors. */ - sc->recovery_state = BXE_RECOVERY_INIT; // XXX schedule a recovery task... /* disable HW interrupts */ bxe_int_disable(sc); + BXE_SET_ERROR_BIT(sc, BXE_ERR_PARITY); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); bxe_release_alr(sc); return; } @@ -12360,6 +12415,259 @@ bxe_periodic_stop(struct bxe_softc *sc) callout_drain(&sc->periodic_callout); } +void +bxe_parity_recover(struct bxe_softc *sc) +{ + uint8_t global = FALSE; + uint32_t error_recovered, error_unrecovered; + bool is_parity; + + + if ((sc->recovery_state == BXE_RECOVERY_FAILED) && + (sc->state == BXE_STATE_ERROR)) { + BLOGE(sc, "RECOVERY failed, " + "stack notified driver is NOT running! " + "Please reboot/power cycle the system.\n"); + return; + } + + while (1) { + BLOGD(sc, DBG_SP, + "%s sc=%p state=0x%x rec_state=0x%x error_status=%x\n", + __func__, sc, sc->state, sc->recovery_state, sc->error_status); + + switch(sc->recovery_state) { + + case BXE_RECOVERY_INIT: + is_parity = bxe_chk_parity_attn(sc, &global, FALSE); + + if ((CHIP_PORT_MODE(sc) == CHIP_4_PORT_MODE) || + (sc->error_status & BXE_ERR_MCP_ASSERT) || + (sc->error_status & BXE_ERR_GLOBAL)) { + + BXE_CORE_LOCK(sc); + if (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) { + bxe_periodic_stop(sc); + } + bxe_nic_unload(sc, UNLOAD_RECOVERY, false); + sc->state = BXE_STATE_ERROR; + sc->recovery_state = BXE_RECOVERY_FAILED; + BLOGE(sc, " No Recovery tried for error 0x%x" + " stack notified driver is NOT running!" + " Please reboot/power cycle the system.\n", + sc->error_status); + BXE_CORE_UNLOCK(sc); + return; + } + + + /* Try to get a LEADER_LOCK HW lock */ + if (bxe_trylock_leader_lock(sc)) { + + bxe_set_reset_in_progress(sc); + /* + * Check if there is a global attention and if + * there was a global attention, set the global + * reset bit. + */ + if (global) { + bxe_set_reset_global(sc); + } + sc->is_leader = 1; + } + + /* If interface has been removed - break */ + + if (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) { + bxe_periodic_stop(sc); + } + + BXE_CORE_LOCK(sc); + bxe_nic_unload(sc,UNLOAD_RECOVERY, false); + sc->recovery_state = BXE_RECOVERY_WAIT; + BXE_CORE_UNLOCK(sc); + + /* + * Ensure "is_leader", MCP command sequence and + * "recovery_state" update values are seen on other + * CPUs. + */ + mb(); + break; + case BXE_RECOVERY_WAIT: + + if (sc->is_leader) { + int other_engine = SC_PATH(sc) ? 0 : 1; + bool other_load_status = + bxe_get_load_status(sc, other_engine); + bool load_status = + bxe_get_load_status(sc, SC_PATH(sc)); + global = bxe_reset_is_global(sc); + + /* + * In case of a parity in a global block, let + * the first leader that performs a + * leader_reset() reset the global blocks in + * order to clear global attentions. Otherwise + * the gates will remain closed for that + * engine. + */ + if (load_status || + (global && other_load_status)) { + /* + * Wait until all other functions get + * down. + */ + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + return; + } else { + /* + * If all other functions got down + * try to bring the chip back to + * normal. In any case it's an exit + * point for a leader. + */ + if (bxe_leader_reset(sc)) { + BLOGE(sc, "RECOVERY failed, " + "stack notified driver is NOT running!\n"); + sc->recovery_state = BXE_RECOVERY_FAILED; + sc->state = BXE_STATE_ERROR; + mb(); + return; + } + + /* + * If we are here, means that the + * leader has succeeded and doesn't + * want to be a leader any more. Try + * to continue as a none-leader. + */ + break; + } + + } else { /* non-leader */ + if (!bxe_reset_is_done(sc, SC_PATH(sc))) { + /* + * Try to get a LEADER_LOCK HW lock as + * long as a former leader may have + * been unloaded by the user or + * released a leadership by another + * reason. + */ + if (bxe_trylock_leader_lock(sc)) { + /* + * I'm a leader now! Restart a + * switch case. + */ + sc->is_leader = 1; + break; + } + + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + return; + + } else { + /* + * If there was a global attention, wait + * for it to be cleared. + */ + if (bxe_reset_is_global(sc)) { + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + return; + } + + error_recovered = + sc->eth_stats.recoverable_error; + error_unrecovered = + sc->eth_stats.unrecoverable_error; + BXE_CORE_LOCK(sc); + sc->recovery_state = + BXE_RECOVERY_NIC_LOADING; + if (bxe_nic_load(sc, LOAD_NORMAL)) { + error_unrecovered++; + sc->recovery_state = BXE_RECOVERY_FAILED; + sc->state = BXE_STATE_ERROR; + BLOGE(sc, "Recovery is NOT successfull, " + " state=0x%x recovery_state=0x%x error=%x\n", + sc->state, sc->recovery_state, sc->error_status); + sc->error_status = 0; + } else { + sc->recovery_state = + BXE_RECOVERY_DONE; + error_recovered++; + BLOGI(sc, "Recovery is successfull from errors %x," + " state=0x%x" + " recovery_state=0x%x \n", sc->error_status, + sc->state, sc->recovery_state); + mb(); + } + sc->error_status = 0; + BXE_CORE_UNLOCK(sc); + sc->eth_stats.recoverable_error = + error_recovered; + sc->eth_stats.unrecoverable_error = + error_unrecovered; + + return; + } + } + default: + return; + } + } +} +void +bxe_handle_error(struct bxe_softc * sc) +{ + + if(sc->recovery_state == BXE_RECOVERY_WAIT) { + return; + } + if(sc->error_status) { + if (sc->state == BXE_STATE_OPEN) { + bxe_int_disable(sc); + } + if (sc->link_vars.link_up) { + if_link_state_change(sc->ifnet, LINK_STATE_DOWN); + } + sc->recovery_state = BXE_RECOVERY_INIT; + BLOGI(sc, "bxe%d: Recovery started errors 0x%x recovery state 0x%x\n", + sc->unit, sc->error_status, sc->recovery_state); + bxe_parity_recover(sc); + } +} + +static void +bxe_sp_err_timeout_task(void *arg, int pending) +{ + + struct bxe_softc *sc = (struct bxe_softc *)arg; + + BLOGD(sc, DBG_SP, + "%s state = 0x%x rec state=0x%x error_status=%x\n", + __func__, sc->state, sc->recovery_state, sc->error_status); + + if((sc->recovery_state == BXE_RECOVERY_FAILED) && + (sc->state == BXE_STATE_ERROR)) { + return; + } + /* if can be taken */ + if ((sc->error_status) && (sc->trigger_grcdump)) { + bxe_grc_dump(sc); + } + if (sc->recovery_state != BXE_RECOVERY_DONE) { + bxe_handle_error(sc); + bxe_parity_recover(sc); + } else if (sc->error_status) { + bxe_handle_error(sc); + } + + return; +} + /* start the controller */ static __noinline int bxe_nic_load(struct bxe_softc *sc, @@ -12641,6 +12949,15 @@ bxe_init_locked(struct bxe_softc *sc) return (0); } + if((sc->state == BXE_STATE_ERROR) && + (sc->recovery_state == BXE_RECOVERY_FAILED)) { + BLOGE(sc, "Initialization not done, " + "as previous recovery failed." + "Reboot/Power-cycle the system\n" ); + return (ENXIO); + } + + bxe_set_power_state(sc, PCI_PM_D0); /* @@ -16039,6 +16356,10 @@ bxe_attach(device_t dev) taskqueue_start_threads(&sc->chip_tq, 1, PWAIT, /* lower priority */ "%s", sc->chip_tq_name); + TIMEOUT_TASK_INIT(taskqueue_thread, + &sc->sp_err_timeout_task, 0, bxe_sp_err_timeout_task, sc); + + /* get device info and set params */ if (bxe_get_device_info(sc) != 0) { BLOGE(sc, "getting device info\n"); @@ -16214,6 +16535,8 @@ bxe_detach(device_t dev) taskqueue_drain(sc->chip_tq, &sc->chip_tq_task); taskqueue_free(sc->chip_tq); sc->chip_tq = NULL; + taskqueue_drain_timeout(taskqueue_thread, + &sc->sp_err_timeout_task); } /* stop and reset the controller if it was open */ Modified: stable/10/sys/dev/bxe/bxe.h ============================================================================== --- stable/10/sys/dev/bxe/bxe.h Mon Oct 29 21:16:26 2018 (r339883) +++ stable/10/sys/dev/bxe/bxe.h Mon Oct 29 21:31:23 2018 (r339884) @@ -475,6 +475,10 @@ struct bxe_device_type #define BXE_FW_RX_ALIGN_END (1 << BXE_RX_ALIGN_SHIFT) #define BXE_PXP_DRAM_ALIGN (BXE_RX_ALIGN_SHIFT - 5) /* XXX ??? */ +#define BXE_SET_ERROR_BIT(sc, error) \ +{ \ + (sc)->error_status |= (error); \ +} struct bxe_bar { struct resource *resource; @@ -1388,6 +1392,8 @@ struct bxe_softc { struct taskqueue *chip_tq; char chip_tq_name[32]; + struct timeout_task sp_err_timeout_task; + /* slowpath interrupt taskqueue */ struct task sp_tq_task; struct taskqueue *sp_tq; @@ -1541,6 +1547,16 @@ struct bxe_softc { #define BXE_RECOVERY_WAIT 3 #define BXE_RECOVERY_FAILED 4 #define BXE_RECOVERY_NIC_LOADING 5 + +#define BXE_ERR_TXQ_STUCK 0x1 /* Tx queue stuck detected by driver. */ +#define BXE_ERR_MISC 0x2 /* MISC ERR */ +#define BXE_ERR_PARITY 0x4 /* Parity error detected. */ +#define BXE_ERR_STATS_TO 0x8 /* Statistics timeout detected. */ +#define BXE_ERR_MC_ASSERT 0x10 /* MC assert attention received. */ +#define BXE_ERR_PANIC 0x20 /* Driver asserted. */ +#define BXE_ERR_MCP_ASSERT 0x40 /* MCP assert attention received. No Recovery*/ +#define BXE_ERR_GLOBAL 0x80 /* PCIe/PXP/IGU/MISC/NIG device blocks error- needs PCIe/Fundamental reset */ + uint32_t error_status; uint32_t rx_mode; #define BXE_RX_MODE_NONE 0 Modified: stable/10/sys/dev/bxe/bxe_stats.c ============================================================================== --- stable/10/sys/dev/bxe/bxe_stats.c Mon Oct 29 21:16:26 2018 (r339883) +++ stable/10/sys/dev/bxe/bxe_stats.c Mon Oct 29 21:31:23 2018 (r339884) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #define BITS_PER_LONG 64 #endif -extern int bxe_grc_dump(struct bxe_softc *sc); static inline long bxe_hilo(uint32_t *hiref) @@ -236,11 +235,11 @@ bxe_stats_comp(struct bxe_softc *sc) while (*stats_comp != DMAE_COMP_VAL) { if (!cnt) { BLOGE(sc, "Timeout waiting for stats finished\n"); - if(sc->trigger_grcdump) { - /* taking grcdump */ - bxe_grc_dump(sc); - } + BXE_SET_ERROR_BIT(sc, BXE_ERR_STATS_TO); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); break; + } cnt--; @@ -923,6 +922,7 @@ bxe_hw_stats_update(struct bxe_softc *sc) nig_timer_max = SHMEM_RD(sc, port_mb[SC_PORT(sc)].stat_nig_timer); if (nig_timer_max != estats->nig_timer_max) { estats->nig_timer_max = nig_timer_max; + /*NOTE: not setting error bit */ BLOGE(sc, "invalid NIG timer max (%u)\n", estats->nig_timer_max); } @@ -1316,12 +1316,10 @@ bxe_stats_update(struct bxe_softc *sc) if (bxe_storm_stats_update(sc)) { if (sc->stats_pending++ == 3) { if (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) { - if(sc->trigger_grcdump) { - /* taking grcdump */ - bxe_grc_dump(sc); - } - atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); - taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); + BLOGE(sc, "Storm stats not updated for 3 times, resetting\n"); + BXE_SET_ERROR_BIT(sc, BXE_ERR_STATS_TO); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); } } return; From owner-svn-src-all@freebsd.org Mon Oct 29 21:36:11 2018 Return-Path: Delivered-To: svn-src-all@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 BAE8710EACE7; Mon, 29 Oct 2018 21:36:11 +0000 (UTC) (envelope-from davidcs@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 6820A84828; Mon, 29 Oct 2018 21:36:11 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CB251400D; Mon, 29 Oct 2018 21:36:11 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TLaBOZ057564; Mon, 29 Oct 2018 21:36:11 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TLaAtc057563; Mon, 29 Oct 2018 21:36:10 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201810292136.w9TLaAtc057563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 29 Oct 2018 21:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r339885 - stable/9/sys/dev/bxe X-SVN-Group: stable-9 X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: stable/9/sys/dev/bxe X-SVN-Commit-Revision: 339885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 21:36:11 -0000 Author: davidcs Date: Mon Oct 29 21:36:10 2018 New Revision: 339885 URL: https://svnweb.freebsd.org/changeset/base/339885 Log: MFC r338734 Fixed isses: State check before enqueuing transmit task in bxe_link_attn() routine. State check before invoking bxe_nic_unload in bxe_shutdown(). Submitted by:Vaishali.Kulkarni@cavium.com Modified: stable/9/sys/dev/bxe/bxe.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c ============================================================================== --- stable/9/sys/dev/bxe/bxe.c Mon Oct 29 21:31:23 2018 (r339884) +++ stable/9/sys/dev/bxe/bxe.c Mon Oct 29 21:36:10 2018 (r339885) @@ -7081,13 +7081,13 @@ bxe_link_attn(struct bxe_softc *sc) if (sc->state == BXE_STATE_OPEN) { bxe_stats_handle(sc, STATS_EVENT_LINK_UP); + /* Restart tx when the link comes back. */ + FOR_EACH_ETH_QUEUE(sc, i) { + fp = &sc->fp[i]; + taskqueue_enqueue(fp->tq, &fp->tx_task); + } } - /* Restart tx when the link comes back. */ - FOR_EACH_ETH_QUEUE(sc, i) { - fp = &sc->fp[i]; - taskqueue_enqueue(fp->tq, &fp->tx_task); - } } if (sc->link_vars.link_up && sc->link_vars.line_speed) { @@ -16284,9 +16284,11 @@ bxe_shutdown(device_t dev) /* stop the periodic callout */ bxe_periodic_stop(sc); - BXE_CORE_LOCK(sc); - bxe_nic_unload(sc, UNLOAD_NORMAL, FALSE); - BXE_CORE_UNLOCK(sc); + if (sc->state != BXE_STATE_CLOSED) { + BXE_CORE_LOCK(sc); + bxe_nic_unload(sc, UNLOAD_NORMAL, FALSE); + BXE_CORE_UNLOCK(sc); + } return (0); } From owner-svn-src-all@freebsd.org Mon Oct 29 21:46:06 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 21:46:16 2018 Return-Path: Delivered-To: svn-src-all@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 E685110EB1D2; Mon, 29 Oct 2018 21:46:15 +0000 (UTC) (envelope-from davidcs@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 9675084ECF; Mon, 29 Oct 2018 21:46:15 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFAF6141AE; Mon, 29 Oct 2018 21:46:13 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9TLkD2l062658; Mon, 29 Oct 2018 21:46:13 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TLkDX4062655; Mon, 29 Oct 2018 21:46:13 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201810292146.w9TLkDX4062655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 29 Oct 2018 21:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r339887 - stable/9/sys/dev/bxe X-SVN-Group: stable-9 X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: stable/9/sys/dev/bxe X-SVN-Commit-Revision: 339887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 21:46:16 -0000 Author: davidcs Date: Mon Oct 29 21:46:12 2018 New Revision: 339887 URL: https://svnweb.freebsd.org/changeset/base/339887 Log: MFC r339366 Add support for Error Recovery Submitted by:Vaishali.Kulkarni@cavium.com Modified: stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/bxe/bxe.h stable/9/sys/dev/bxe/bxe_stats.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c ============================================================================== --- stable/9/sys/dev/bxe/bxe.c Mon Oct 29 21:46:05 2018 (r339886) +++ stable/9/sys/dev/bxe/bxe.c Mon Oct 29 21:46:12 2018 (r339887) @@ -188,6 +188,7 @@ static int bxe_attach(device_t); static int bxe_detach(device_t); static int bxe_shutdown(device_t); + /* * FreeBSD KLD module/device interface event handler method. */ @@ -700,6 +701,9 @@ static void bxe_interrupt_detach(struct bxe_softc * static void bxe_set_rx_mode(struct bxe_softc *sc); static int bxe_init_locked(struct bxe_softc *sc); static int bxe_stop_locked(struct bxe_softc *sc); +static void bxe_sp_err_timeout_task(void *arg, int pending); +void bxe_parity_recover(struct bxe_softc *sc); +void bxe_handle_error(struct bxe_softc *sc); static __noinline int bxe_nic_load(struct bxe_softc *sc, int load_mode); static __noinline int bxe_nic_unload(struct bxe_softc *sc, @@ -3488,16 +3492,12 @@ bxe_watchdog(struct bxe_softc *sc, } BLOGE(sc, "TX watchdog timeout on fp[%02d], resetting!\n", fp->index); - if(sc->trigger_grcdump) { - /* taking grcdump */ - bxe_grc_dump(sc); - } BXE_FP_TX_UNLOCK(fp); + BXE_SET_ERROR_BIT(sc, BXE_ERR_TXQ_STUCK); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); - atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); - taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); - return (-1); } @@ -4252,6 +4252,7 @@ bxe_nic_unload(struct bxe_softc *sc, struct bxe_fastpath *fp; fp = &sc->fp[i]; + fp->watchdog_timer = 0; BXE_FP_TX_LOCK(fp); BXE_FP_TX_UNLOCK(fp); } @@ -4267,20 +4268,22 @@ bxe_nic_unload(struct bxe_softc *sc, if (IS_PF(sc) && sc->recovery_state != BXE_RECOVERY_DONE && (sc->state == BXE_STATE_CLOSED || sc->state == BXE_STATE_ERROR)) { - /* - * We can get here if the driver has been unloaded - * during parity error recovery and is either waiting for a - * leader to complete or for other functions to unload and - * then ifconfig down has been issued. In this case we want to - * unload and let other functions to complete a recovery - * process. - */ - sc->recovery_state = BXE_RECOVERY_DONE; - sc->is_leader = 0; - bxe_release_leader_lock(sc); - mb(); - BLOGD(sc, DBG_LOAD, "Releasing a leadership...\n"); + if(CHIP_PORT_MODE(sc) == CHIP_4_PORT_MODE) { + /* + * We can get here if the driver has been unloaded + * during parity error recovery and is either waiting for a + * leader to complete or for other functions to unload and + * then ifconfig down has been issued. In this case we want to + * unload and let other functions to complete a recovery + * process. + */ + sc->recovery_state = BXE_RECOVERY_DONE; + sc->is_leader = 0; + bxe_release_leader_lock(sc); + mb(); + BLOGD(sc, DBG_LOAD, "Releasing a leadership...\n"); + } BLOGE(sc, "Can't unload in closed or error state recover_state 0x%x" " state = 0x%x\n", sc->recovery_state, sc->state); return (-1); @@ -7575,6 +7578,10 @@ bxe_parity_attn(struct bxe_softc *sc, if (print) BLOGI(sc, "\n"); + if( *global == TRUE ) { + BXE_SET_ERROR_BIT(sc, BXE_ERR_GLOBAL); + } + return (TRUE); } @@ -7589,6 +7596,9 @@ bxe_chk_parity_attn(struct bxe_softc *sc, struct attn_route attn = { {0} }; int port = SC_PORT(sc); + if(sc->state != BXE_STATE_OPEN) + return FALSE; + attn.sig[0] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_1_FUNC_0 + port*4); attn.sig[1] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_2_FUNC_0 + port*4); attn.sig[2] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_3_FUNC_0 + port*4); @@ -7615,10 +7625,12 @@ bxe_attn_int_deasserted4(struct bxe_softc *sc, uint32_t attn) { uint32_t val; + boolean_t err_flg = FALSE; if (attn & AEU_INPUTS_ATTN_BITS_PGLUE_HW_INTERRUPT) { val = REG_RD(sc, PGLUE_B_REG_PGLUE_B_INT_STS_CLR); BLOGE(sc, "PGLUE hw attention 0x%08x\n", val); + err_flg = TRUE; if (val & PGLUE_B_PGLUE_B_INT_STS_REG_ADDRESS_ERROR) BLOGE(sc, "PGLUE_B_PGLUE_B_INT_STS_REG_ADDRESS_ERROR\n"); if (val & PGLUE_B_PGLUE_B_INT_STS_REG_INCORRECT_RCV_BEHAVIOR) @@ -7642,6 +7654,7 @@ bxe_attn_int_deasserted4(struct bxe_softc *sc, if (attn & AEU_INPUTS_ATTN_BITS_ATC_HW_INTERRUPT) { val = REG_RD(sc, ATC_REG_ATC_INT_STS_CLR); BLOGE(sc, "ATC hw attention 0x%08x\n", val); + err_flg = TRUE; if (val & ATC_ATC_INT_STS_REG_ADDRESS_ERROR) BLOGE(sc, "ATC_ATC_INT_STS_REG_ADDRESS_ERROR\n"); if (val & ATC_ATC_INT_STS_REG_ATC_TCPL_TO_NOT_PEND) @@ -7661,7 +7674,14 @@ bxe_attn_int_deasserted4(struct bxe_softc *sc, BLOGE(sc, "FATAL parity attention set4 0x%08x\n", (uint32_t)(attn & (AEU_INPUTS_ATTN_BITS_PGLUE_PARITY_ERROR | AEU_INPUTS_ATTN_BITS_ATC_PARITY_ERROR))); + err_flg = TRUE; } + if (err_flg) { + BXE_SET_ERROR_BIT(sc, BXE_ERR_MISC); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + } + } static void @@ -8016,14 +8036,21 @@ bxe_attn_int_deasserted3(struct bxe_softc *sc, REG_WR(sc, MISC_REG_AEU_GENERAL_ATTN_9, 0); REG_WR(sc, MISC_REG_AEU_GENERAL_ATTN_8, 0); REG_WR(sc, MISC_REG_AEU_GENERAL_ATTN_7, 0); - bxe_panic(sc, ("MC assert!\n")); - + bxe_int_disable(sc); + BXE_SET_ERROR_BIT(sc, BXE_ERR_MC_ASSERT); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + } else if (attn & BXE_MCP_ASSERT) { BLOGE(sc, "MCP assert!\n"); REG_WR(sc, MISC_REG_AEU_GENERAL_ATTN_11, 0); - // XXX bxe_fw_dump(sc); + BXE_SET_ERROR_BIT(sc, BXE_ERR_MCP_ASSERT); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + bxe_int_disable(sc); /*avoid repetive assert alert */ + } else { BLOGE(sc, "Unknown HW assert! (attn 0x%08x)\n", attn); } @@ -8051,6 +8078,7 @@ bxe_attn_int_deasserted2(struct bxe_softc *sc, int reg_offset; uint32_t val0, mask0, val1, mask1; uint32_t val; + boolean_t err_flg = FALSE; if (attn & AEU_INPUTS_ATTN_BITS_CFC_HW_INTERRUPT) { val = REG_RD(sc, CFC_REG_CFC_INT_STS_CLR); @@ -8058,6 +8086,7 @@ bxe_attn_int_deasserted2(struct bxe_softc *sc, /* CFC error attention */ if (val & 0x2) { BLOGE(sc, "FATAL error from CFC\n"); + err_flg = TRUE; } } @@ -8067,11 +8096,13 @@ bxe_attn_int_deasserted2(struct bxe_softc *sc, /* RQ_USDMDP_FIFO_OVERFLOW */ if (val & 0x18000) { BLOGE(sc, "FATAL error from PXP\n"); + err_flg = TRUE; } if (!CHIP_IS_E1x(sc)) { val = REG_RD(sc, PXP_REG_PXP_INT_STS_CLR_1); BLOGE(sc, "PXP hw attention-1 0x%08x\n", val); + err_flg = TRUE; } } @@ -8108,6 +8139,7 @@ bxe_attn_int_deasserted2(struct bxe_softc *sc, */ if (val0 & PXP2_EOP_ERROR_BIT) { BLOGE(sc, "PXP2_WR_PGLUE_EOP_ERROR\n"); + err_flg = TRUE; /* * if only PXP2_PXP2_INT_STS_0_REG_WR_PGLUE_EOP_ERROR is @@ -8130,8 +8162,15 @@ bxe_attn_int_deasserted2(struct bxe_softc *sc, BLOGE(sc, "FATAL HW block attention set2 0x%x\n", (uint32_t)(attn & HW_INTERRUT_ASSERT_SET_2)); + err_flg = TRUE; bxe_panic(sc, ("HW block attention set2\n")); } + if(err_flg) { + BXE_SET_ERROR_BIT(sc, BXE_ERR_GLOBAL); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + } + } static void @@ -8141,6 +8180,7 @@ bxe_attn_int_deasserted1(struct bxe_softc *sc, int port = SC_PORT(sc); int reg_offset; uint32_t val; + boolean_t err_flg = FALSE; if (attn & AEU_INPUTS_ATTN_BITS_DOORBELLQ_HW_INTERRUPT) { val = REG_RD(sc, DORQ_REG_DORQ_INT_STS_CLR); @@ -8148,6 +8188,7 @@ bxe_attn_int_deasserted1(struct bxe_softc *sc, /* DORQ discard attention */ if (val & 0x2) { BLOGE(sc, "FATAL error from DORQ\n"); + err_flg = TRUE; } } @@ -8161,8 +8202,15 @@ bxe_attn_int_deasserted1(struct bxe_softc *sc, BLOGE(sc, "FATAL HW block attention set1 0x%08x\n", (uint32_t)(attn & HW_INTERRUT_ASSERT_SET_1)); + err_flg = TRUE; bxe_panic(sc, ("HW block attention set1\n")); } + if(err_flg) { + BXE_SET_ERROR_BIT(sc, BXE_ERR_MISC); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + } + } static void @@ -8199,6 +8247,11 @@ bxe_attn_int_deasserted0(struct bxe_softc *sc, val &= ~(attn & HW_INTERRUT_ASSERT_SET_0); REG_WR(sc, reg_offset, val); + + BXE_SET_ERROR_BIT(sc, BXE_ERR_MISC); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + bxe_panic(sc, ("FATAL HW block attention set0 0x%lx\n", (attn & HW_INTERRUT_ASSERT_SET_0))); } @@ -8228,10 +8281,12 @@ bxe_attn_int_deasserted(struct bxe_softc *sc, * In case of parity errors don't handle attentions so that * other function would "see" parity errors. */ - sc->recovery_state = BXE_RECOVERY_INIT; // XXX schedule a recovery task... /* disable HW interrupts */ bxe_int_disable(sc); + BXE_SET_ERROR_BIT(sc, BXE_ERR_PARITY); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); bxe_release_alr(sc); return; } @@ -12363,6 +12418,259 @@ bxe_periodic_stop(struct bxe_softc *sc) callout_drain(&sc->periodic_callout); } +void +bxe_parity_recover(struct bxe_softc *sc) +{ + uint8_t global = FALSE; + uint32_t error_recovered, error_unrecovered; + bool is_parity; + + + if ((sc->recovery_state == BXE_RECOVERY_FAILED) && + (sc->state == BXE_STATE_ERROR)) { + BLOGE(sc, "RECOVERY failed, " + "stack notified driver is NOT running! " + "Please reboot/power cycle the system.\n"); + return; + } + + while (1) { + BLOGD(sc, DBG_SP, + "%s sc=%p state=0x%x rec_state=0x%x error_status=%x\n", + __func__, sc, sc->state, sc->recovery_state, sc->error_status); + + switch(sc->recovery_state) { + + case BXE_RECOVERY_INIT: + is_parity = bxe_chk_parity_attn(sc, &global, FALSE); + + if ((CHIP_PORT_MODE(sc) == CHIP_4_PORT_MODE) || + (sc->error_status & BXE_ERR_MCP_ASSERT) || + (sc->error_status & BXE_ERR_GLOBAL)) { + + BXE_CORE_LOCK(sc); + if (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) { + bxe_periodic_stop(sc); + } + bxe_nic_unload(sc, UNLOAD_RECOVERY, false); + sc->state = BXE_STATE_ERROR; + sc->recovery_state = BXE_RECOVERY_FAILED; + BLOGE(sc, " No Recovery tried for error 0x%x" + " stack notified driver is NOT running!" + " Please reboot/power cycle the system.\n", + sc->error_status); + BXE_CORE_UNLOCK(sc); + return; + } + + + /* Try to get a LEADER_LOCK HW lock */ + if (bxe_trylock_leader_lock(sc)) { + + bxe_set_reset_in_progress(sc); + /* + * Check if there is a global attention and if + * there was a global attention, set the global + * reset bit. + */ + if (global) { + bxe_set_reset_global(sc); + } + sc->is_leader = 1; + } + + /* If interface has been removed - break */ + + if (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) { + bxe_periodic_stop(sc); + } + + BXE_CORE_LOCK(sc); + bxe_nic_unload(sc,UNLOAD_RECOVERY, false); + sc->recovery_state = BXE_RECOVERY_WAIT; + BXE_CORE_UNLOCK(sc); + + /* + * Ensure "is_leader", MCP command sequence and + * "recovery_state" update values are seen on other + * CPUs. + */ + mb(); + break; + case BXE_RECOVERY_WAIT: + + if (sc->is_leader) { + int other_engine = SC_PATH(sc) ? 0 : 1; + bool other_load_status = + bxe_get_load_status(sc, other_engine); + bool load_status = + bxe_get_load_status(sc, SC_PATH(sc)); + global = bxe_reset_is_global(sc); + + /* + * In case of a parity in a global block, let + * the first leader that performs a + * leader_reset() reset the global blocks in + * order to clear global attentions. Otherwise + * the gates will remain closed for that + * engine. + */ + if (load_status || + (global && other_load_status)) { + /* + * Wait until all other functions get + * down. + */ + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + return; + } else { + /* + * If all other functions got down + * try to bring the chip back to + * normal. In any case it's an exit + * point for a leader. + */ + if (bxe_leader_reset(sc)) { + BLOGE(sc, "RECOVERY failed, " + "stack notified driver is NOT running!\n"); + sc->recovery_state = BXE_RECOVERY_FAILED; + sc->state = BXE_STATE_ERROR; + mb(); + return; + } + + /* + * If we are here, means that the + * leader has succeeded and doesn't + * want to be a leader any more. Try + * to continue as a none-leader. + */ + break; + } + + } else { /* non-leader */ + if (!bxe_reset_is_done(sc, SC_PATH(sc))) { + /* + * Try to get a LEADER_LOCK HW lock as + * long as a former leader may have + * been unloaded by the user or + * released a leadership by another + * reason. + */ + if (bxe_trylock_leader_lock(sc)) { + /* + * I'm a leader now! Restart a + * switch case. + */ + sc->is_leader = 1; + break; + } + + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + return; + + } else { + /* + * If there was a global attention, wait + * for it to be cleared. + */ + if (bxe_reset_is_global(sc)) { + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + return; + } + + error_recovered = + sc->eth_stats.recoverable_error; + error_unrecovered = + sc->eth_stats.unrecoverable_error; + BXE_CORE_LOCK(sc); + sc->recovery_state = + BXE_RECOVERY_NIC_LOADING; + if (bxe_nic_load(sc, LOAD_NORMAL)) { + error_unrecovered++; + sc->recovery_state = BXE_RECOVERY_FAILED; + sc->state = BXE_STATE_ERROR; + BLOGE(sc, "Recovery is NOT successfull, " + " state=0x%x recovery_state=0x%x error=%x\n", + sc->state, sc->recovery_state, sc->error_status); + sc->error_status = 0; + } else { + sc->recovery_state = + BXE_RECOVERY_DONE; + error_recovered++; + BLOGI(sc, "Recovery is successfull from errors %x," + " state=0x%x" + " recovery_state=0x%x \n", sc->error_status, + sc->state, sc->recovery_state); + mb(); + } + sc->error_status = 0; + BXE_CORE_UNLOCK(sc); + sc->eth_stats.recoverable_error = + error_recovered; + sc->eth_stats.unrecoverable_error = + error_unrecovered; + + return; + } + } + default: + return; + } + } +} +void +bxe_handle_error(struct bxe_softc * sc) +{ + + if(sc->recovery_state == BXE_RECOVERY_WAIT) { + return; + } + if(sc->error_status) { + if (sc->state == BXE_STATE_OPEN) { + bxe_int_disable(sc); + } + if (sc->link_vars.link_up) { + if_link_state_change(sc->ifnet, LINK_STATE_DOWN); + } + sc->recovery_state = BXE_RECOVERY_INIT; + BLOGI(sc, "bxe%d: Recovery started errors 0x%x recovery state 0x%x\n", + sc->unit, sc->error_status, sc->recovery_state); + bxe_parity_recover(sc); + } +} + +static void +bxe_sp_err_timeout_task(void *arg, int pending) +{ + + struct bxe_softc *sc = (struct bxe_softc *)arg; + + BLOGD(sc, DBG_SP, + "%s state = 0x%x rec state=0x%x error_status=%x\n", + __func__, sc->state, sc->recovery_state, sc->error_status); + + if((sc->recovery_state == BXE_RECOVERY_FAILED) && + (sc->state == BXE_STATE_ERROR)) { + return; + } + /* if can be taken */ + if ((sc->error_status) && (sc->trigger_grcdump)) { + bxe_grc_dump(sc); + } + if (sc->recovery_state != BXE_RECOVERY_DONE) { + bxe_handle_error(sc); + bxe_parity_recover(sc); + } else if (sc->error_status) { + bxe_handle_error(sc); + } + + return; +} + /* start the controller */ static __noinline int bxe_nic_load(struct bxe_softc *sc, @@ -12644,6 +12952,15 @@ bxe_init_locked(struct bxe_softc *sc) return (0); } + if((sc->state == BXE_STATE_ERROR) && + (sc->recovery_state == BXE_RECOVERY_FAILED)) { + BLOGE(sc, "Initialization not done, " + "as previous recovery failed." + "Reboot/Power-cycle the system\n" ); + return (ENXIO); + } + + bxe_set_power_state(sc, PCI_PM_D0); /* @@ -16042,6 +16359,10 @@ bxe_attach(device_t dev) taskqueue_start_threads(&sc->chip_tq, 1, PWAIT, /* lower priority */ "%s", sc->chip_tq_name); + TIMEOUT_TASK_INIT(taskqueue_thread, + &sc->sp_err_timeout_task, 0, bxe_sp_err_timeout_task, sc); + + /* get device info and set params */ if (bxe_get_device_info(sc) != 0) { BLOGE(sc, "getting device info\n"); @@ -16217,6 +16538,8 @@ bxe_detach(device_t dev) taskqueue_drain(sc->chip_tq, &sc->chip_tq_task); taskqueue_free(sc->chip_tq); sc->chip_tq = NULL; + taskqueue_drain_timeout(taskqueue_thread, + &sc->sp_err_timeout_task); } /* stop and reset the controller if it was open */ Modified: stable/9/sys/dev/bxe/bxe.h ============================================================================== --- stable/9/sys/dev/bxe/bxe.h Mon Oct 29 21:46:05 2018 (r339886) +++ stable/9/sys/dev/bxe/bxe.h Mon Oct 29 21:46:12 2018 (r339887) @@ -474,6 +474,10 @@ struct bxe_device_type #define BXE_FW_RX_ALIGN_END (1 << BXE_RX_ALIGN_SHIFT) #define BXE_PXP_DRAM_ALIGN (BXE_RX_ALIGN_SHIFT - 5) /* XXX ??? */ +#define BXE_SET_ERROR_BIT(sc, error) \ +{ \ + (sc)->error_status |= (error); \ +} struct bxe_bar { struct resource *resource; @@ -1387,6 +1391,8 @@ struct bxe_softc { struct taskqueue *chip_tq; char chip_tq_name[32]; + struct timeout_task sp_err_timeout_task; + /* slowpath interrupt taskqueue */ struct task sp_tq_task; struct taskqueue *sp_tq; @@ -1540,6 +1546,16 @@ struct bxe_softc { #define BXE_RECOVERY_WAIT 3 #define BXE_RECOVERY_FAILED 4 #define BXE_RECOVERY_NIC_LOADING 5 + +#define BXE_ERR_TXQ_STUCK 0x1 /* Tx queue stuck detected by driver. */ +#define BXE_ERR_MISC 0x2 /* MISC ERR */ +#define BXE_ERR_PARITY 0x4 /* Parity error detected. */ +#define BXE_ERR_STATS_TO 0x8 /* Statistics timeout detected. */ +#define BXE_ERR_MC_ASSERT 0x10 /* MC assert attention received. */ +#define BXE_ERR_PANIC 0x20 /* Driver asserted. */ +#define BXE_ERR_MCP_ASSERT 0x40 /* MCP assert attention received. No Recovery*/ +#define BXE_ERR_GLOBAL 0x80 /* PCIe/PXP/IGU/MISC/NIG device blocks error- needs PCIe/Fundamental reset */ + uint32_t error_status; uint32_t rx_mode; #define BXE_RX_MODE_NONE 0 Modified: stable/9/sys/dev/bxe/bxe_stats.c ============================================================================== --- stable/9/sys/dev/bxe/bxe_stats.c Mon Oct 29 21:46:05 2018 (r339886) +++ stable/9/sys/dev/bxe/bxe_stats.c Mon Oct 29 21:46:12 2018 (r339887) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #define BITS_PER_LONG 64 #endif -extern int bxe_grc_dump(struct bxe_softc *sc); static inline long bxe_hilo(uint32_t *hiref) @@ -236,11 +235,11 @@ bxe_stats_comp(struct bxe_softc *sc) while (*stats_comp != DMAE_COMP_VAL) { if (!cnt) { BLOGE(sc, "Timeout waiting for stats finished\n"); - if(sc->trigger_grcdump) { - /* taking grcdump */ - bxe_grc_dump(sc); - } + BXE_SET_ERROR_BIT(sc, BXE_ERR_STATS_TO); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); break; + } cnt--; @@ -923,6 +922,7 @@ bxe_hw_stats_update(struct bxe_softc *sc) nig_timer_max = SHMEM_RD(sc, port_mb[SC_PORT(sc)].stat_nig_timer); if (nig_timer_max != estats->nig_timer_max) { estats->nig_timer_max = nig_timer_max; + /*NOTE: not setting error bit */ BLOGE(sc, "invalid NIG timer max (%u)\n", estats->nig_timer_max); } @@ -1316,12 +1316,10 @@ bxe_stats_update(struct bxe_softc *sc) if (bxe_storm_stats_update(sc)) { if (sc->stats_pending++ == 3) { if (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) { - if(sc->trigger_grcdump) { - /* taking grcdump */ - bxe_grc_dump(sc); - } - atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); - taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); + BLOGE(sc, "Storm stats not updated for 3 times, resetting\n"); + BXE_SET_ERROR_BIT(sc, BXE_ERR_STATS_TO); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); } } return; From owner-svn-src-all@freebsd.org Mon Oct 29 22:08:47 2018 Return-Path: Delivered-To: svn-src-all@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 F298A10EB712; Mon, 29 Oct 2018 22:08:46 +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 A92B585A59; Mon, 29 Oct 2018 22:08:46 +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 8686414501; Mon, 29 Oct 2018 22:08:46 +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 w9TM8kim072960; Mon, 29 Oct 2018 22:08:46 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9TM8kS8072959; Mon, 29 Oct 2018 22:08:46 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201810292208.w9TM8kS8072959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 29 Oct 2018 22:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r339888 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 339888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 22:08:47 -0000 Author: jhibbits Date: Mon Oct 29 22:08:45 2018 New Revision: 339888 URL: https://svnweb.freebsd.org/changeset/base/339888 Log: Let luporl fly free. Keep up the good work! Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Mon Oct 29 21:46:12 2018 (r339887) +++ svnadmin/conf/mentors Mon Oct 29 22:08:45 2018 (r339888) @@ -25,7 +25,6 @@ jkh rwatson jwd rmacklem kadesai ken Co-mentor: scottl, ambrisko leitao jhibbits Co-mentor: nwhitehorn -luporl jhibbits Co-mentor: nwhitehorn lwhsu markj Co-mentor: emaste mahrens mckusick miwi araujo From owner-svn-src-all@freebsd.org Mon Oct 29 22:10:53 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 22:24:32 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 22:35:47 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 23:43:18 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 23:45:18 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 23:48:21 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 23:52:32 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 23:56:40 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Oct 29 23:59:27 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Tue Oct 30 00:11:32 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 00:19:45 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 00:22:16 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 00:23:38 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 00:47:41 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 02:37:24 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 05:04:20 2018 Return-Path: Delivered-To: svn-src-all@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 DCC1010D450E; Tue, 30 Oct 2018 05:04:19 +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 843A1727B7; Tue, 30 Oct 2018 05:04:19 +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 6154A18EEB; Tue, 30 Oct 2018 05:04:19 +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 w9U54Jb8092814; Tue, 30 Oct 2018 05:04:19 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9U54J1I092813; Tue, 30 Oct 2018 05:04:19 GMT (envelope-from np@FreeBSD.org) Message-Id: <201810300504.w9U54J1I092813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Oct 2018 05:04:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339905 - stable/12/sys/dev/cxgbe X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe X-SVN-Commit-Revision: 339905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 05:04:20 -0000 Author: np Date: Tue Oct 30 05:04:18 2018 New Revision: 339905 URL: https://svnweb.freebsd.org/changeset/base/339905 Log: MFC r339626: cxgbe(4): Use automatic cidx updates with ofld and ctrl queues. The bits that explicitly request cidx updates do not work reliably with all possible WRs that can be sent over the queue. The F_FW_WR_EQUIQ requests that still remain may also have to be replaced with explicit credit flush WRs in the future. Approved by: re@ (rgrimes@) Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_sge.c Tue Oct 30 02:37:23 2018 (r339904) +++ stable/12/sys/dev/cxgbe/t4_sge.c Tue Oct 30 05:04:18 2018 (r339905) @@ -2089,12 +2089,13 @@ drain_wrq_wr_list(struct adapter *sc, struct sge_wrq * if (available < eq->sidx / 4 && atomic_cmpset_int(&eq->equiq, 0, 1)) { + /* + * XXX: This is not 100% reliable with some + * types of WRs. But this is a very unusual + * situation for an ofld/ctrl queue anyway. + */ dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUIQ | F_FW_WR_EQUEQ); - eq->equeqidx = eq->pidx; - } else if (IDXDIFF(eq->pidx, eq->equeqidx, eq->sidx) >= 32) { - dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUEQ); - eq->equeqidx = eq->pidx; } dbdiff += n; @@ -2644,12 +2645,13 @@ commit_wrq_wr(struct sge_wrq *wrq, void *w, struct wrq available = IDXDIFF(eq->cidx, eq->pidx, eq->sidx) - 1; if (available < eq->sidx / 4 && atomic_cmpset_int(&eq->equiq, 0, 1)) { + /* + * XXX: This is not 100% reliable with some + * types of WRs. But this is a very unusual + * situation for an ofld/ctrl queue anyway. + */ dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUIQ | F_FW_WR_EQUEQ); - eq->equeqidx = pidx; - } else if (IDXDIFF(eq->pidx, eq->equeqidx, eq->sidx) >= 32) { - dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUEQ); - eq->equeqidx = pidx; } ring_eq_db(wrq->adapter, eq, ndesc); @@ -3584,6 +3586,23 @@ free_nm_txq(struct vi_info *vi, struct sge_nm_txq *nm_ } #endif +/* + * Returns a reasonable automatic cidx flush threshold for a given queue size. + */ +static u_int +qsize_to_fthresh(int qsize) +{ + u_int fthresh; + + while (!powerof2(qsize)) + qsize++; + fthresh = ilog2(qsize); + if (fthresh > X_CIDXFLUSHTHRESH_128) + fthresh = X_CIDXFLUSHTHRESH_128; + + return (fthresh); +} + static int ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq) { @@ -3607,7 +3626,7 @@ ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq) c.dcaen_to_eqsize = htobe32(V_FW_EQ_CTRL_CMD_FBMIN(X_FETCHBURSTMIN_64B) | V_FW_EQ_CTRL_CMD_FBMAX(X_FETCHBURSTMAX_512B) | - V_FW_EQ_CTRL_CMD_CIDXFTHRESH(X_CIDXFLUSHTHRESH_32) | + V_FW_EQ_CTRL_CMD_CIDXFTHRESH(qsize_to_fthresh(qsize)) | V_FW_EQ_CTRL_CMD_EQSIZE(qsize)); c.eqaddr = htobe64(eq->ba); @@ -3689,12 +3708,13 @@ ofld_eq_alloc(struct adapter *sc, struct vi_info *vi, c.alloc_to_len16 = htonl(F_FW_EQ_OFLD_CMD_ALLOC | F_FW_EQ_OFLD_CMD_EQSTART | FW_LEN16(c)); c.fetchszm_to_iqid = - htonl(V_FW_EQ_OFLD_CMD_HOSTFCMODE(X_HOSTFCMODE_NONE) | + htonl(V_FW_EQ_OFLD_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) | V_FW_EQ_OFLD_CMD_PCIECHN(eq->tx_chan) | F_FW_EQ_OFLD_CMD_FETCHRO | V_FW_EQ_OFLD_CMD_IQID(eq->iqid)); c.dcaen_to_eqsize = htobe32(V_FW_EQ_OFLD_CMD_FBMIN(X_FETCHBURSTMIN_64B) | V_FW_EQ_OFLD_CMD_FBMAX(X_FETCHBURSTMAX_512B) | + V_FW_EQ_OFLD_CMD_CIDXFTHRESH(qsize_to_fthresh(qsize)) | V_FW_EQ_OFLD_CMD_EQSIZE(qsize)); c.eqaddr = htobe64(eq->ba); @@ -3732,8 +3752,9 @@ alloc_eq(struct adapter *sc, struct vi_info *vi, struc if (rc) return (rc); - eq->pidx = eq->cidx = 0; - eq->equeqidx = eq->dbidx = 0; + eq->pidx = eq->cidx = eq->dbidx = 0; + /* Note that equeqidx is not used with sge_wrq (OFLD/CTRL) queues. */ + eq->equeqidx = 0; eq->doorbells = sc->doorbells; switch (eq->flags & EQ_TYPEMASK) { From owner-svn-src-all@freebsd.org Tue Oct 30 08:36:38 2018 Return-Path: Delivered-To: svn-src-all@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 EBE9110DB0DB; Tue, 30 Oct 2018 08:36:37 +0000 (UTC) (envelope-from vmaffione@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 A0F1277C40; Tue, 30 Oct 2018 08:36:37 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8316C1B09F; Tue, 30 Oct 2018 08:36:37 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9U8abvV000253; Tue, 30 Oct 2018 08:36:37 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9U8abSf000249; Tue, 30 Oct 2018 08:36:37 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201810300836.w9U8abSf000249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Tue, 30 Oct 2018 08:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339906 - in stable/12/sys: conf dev/netmap net X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in stable/12/sys: conf dev/netmap net X-SVN-Commit-Revision: 339906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 08:36:38 -0000 Author: vmaffione Date: Tue Oct 30 08:36:36 2018 New Revision: 339906 URL: https://svnweb.freebsd.org/changeset/base/339906 Log: MFC r339639: netmap: align codebase to the current upstream (sha 8374e1a7e6941) Changelist: - Move large parts of VALE code to a new file and header netmap_bdg.[ch]. This is useful to reuse the code within upcoming projects. - Improvements and bug fixes to pipes and monitors. - Introduce nm_os_onattach(), nm_os_onenter() and nm_os_onexit() to handle differences between FreeBSD and Linux. - Introduce some new helper functions to handle more host rings and fake rings (netmap_all_rings(), netmap_real_rings(), ...) - Added new sysctl to enable/disable hw checksum in emulated netmap mode. - nm_inject: add support for NS_MOREFRAG Approved by: re (gjb) Added: stable/12/sys/dev/netmap/netmap_bdg.c - copied unchanged from r339639, head/sys/dev/netmap/netmap_bdg.c stable/12/sys/dev/netmap/netmap_bdg.h - copied unchanged from r339639, head/sys/dev/netmap/netmap_bdg.h Modified: stable/12/sys/conf/files stable/12/sys/dev/netmap/netmap.c stable/12/sys/dev/netmap/netmap_freebsd.c stable/12/sys/dev/netmap/netmap_generic.c stable/12/sys/dev/netmap/netmap_kern.h stable/12/sys/dev/netmap/netmap_mem2.c stable/12/sys/dev/netmap/netmap_monitor.c stable/12/sys/dev/netmap/netmap_pipe.c stable/12/sys/dev/netmap/netmap_vale.c stable/12/sys/net/netmap.h stable/12/sys/net/netmap_user.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/files ============================================================================== --- stable/12/sys/conf/files Tue Oct 30 05:04:18 2018 (r339905) +++ stable/12/sys/conf/files Tue Oct 30 08:36:36 2018 (r339906) @@ -2544,6 +2544,7 @@ dev/netmap/netmap_pipe.c optional netmap dev/netmap/netmap_pt.c optional netmap dev/netmap/netmap_vale.c optional netmap dev/netmap/netmap_legacy.c optional netmap +dev/netmap/netmap_bdg.c optional netmap # compile-with "${NORMAL_C} -Wconversion -Wextra" dev/nfsmb/nfsmb.c optional nfsmb pci dev/nge/if_nge.c optional nge Modified: stable/12/sys/dev/netmap/netmap.c ============================================================================== --- stable/12/sys/dev/netmap/netmap.c Tue Oct 30 05:04:18 2018 (r339905) +++ stable/12/sys/dev/netmap/netmap.c Tue Oct 30 08:36:36 2018 (r339906) @@ -521,6 +521,9 @@ int netmap_generic_txqdisc = 1; int netmap_generic_ringsize = 1024; int netmap_generic_rings = 1; +/* Non-zero to enable checksum offloading in NIC drivers */ +int netmap_generic_hwcsum = 0; + /* Non-zero if ptnet devices are allowed to use virtio-net headers. */ int ptnet_vnet_hdr = 1; @@ -549,6 +552,9 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, fwd, CTLFLAG_RW, &ne SYSCTL_INT(_dev_netmap, OID_AUTO, admode, CTLFLAG_RW, &netmap_admode, 0, "Adapter mode. 0 selects the best option available," "1 forces native adapter, 2 forces emulated adapter"); +SYSCTL_INT(_dev_netmap, OID_AUTO, generic_hwcsum, CTLFLAG_RW, &netmap_generic_hwcsum, + 0, "Hardware checksums. 0 to disable checksum generation by the NIC (default)," + "1 to enable checksum generation by the NIC"); SYSCTL_INT(_dev_netmap, OID_AUTO, generic_mit, CTLFLAG_RW, &netmap_generic_mit, 0, "RX notification interval in nanoseconds"); SYSCTL_INT(_dev_netmap, OID_AUTO, generic_ringsize, CTLFLAG_RW, @@ -827,8 +833,8 @@ netmap_krings_create(struct netmap_adapter *na, u_int } /* account for the (possibly fake) host rings */ - n[NR_TX] = na->num_tx_rings + 1; - n[NR_RX] = na->num_rx_rings + 1; + n[NR_TX] = netmap_all_rings(na, NR_TX); + n[NR_RX] = netmap_all_rings(na, NR_RX); len = (n[NR_TX] + n[NR_RX]) * (sizeof(struct netmap_kring) + sizeof(struct netmap_kring *)) @@ -930,11 +936,14 @@ netmap_krings_delete(struct netmap_adapter *na) void netmap_hw_krings_delete(struct netmap_adapter *na) { - struct mbq *q = &na->rx_rings[na->num_rx_rings]->rx_queue; + u_int lim = netmap_real_rings(na, NR_RX), i; - ND("destroy sw mbq with len %d", mbq_len(q)); - mbq_purge(q); - mbq_safe_fini(q); + for (i = nma_get_nrings(na, NR_RX); i < lim; i++) { + struct mbq *q = &NMR(na, NR_RX)[i]->rx_queue; + ND("destroy sw mbq with len %d", mbq_len(q)); + mbq_purge(q); + mbq_safe_fini(q); + } netmap_krings_delete(na); } @@ -1535,7 +1544,7 @@ netmap_get_na(struct nmreq_header *hdr, goto out; /* try to see if this is a bridge port */ - error = netmap_get_bdg_na(hdr, na, nmd, create); + error = netmap_get_vale_na(hdr, na, nmd, create); if (error) goto out; @@ -1827,7 +1836,7 @@ netmap_interp_ringid(struct netmap_priv_d *priv, uint3 } priv->np_qfirst[t] = (nr_mode == NR_REG_SW ? nma_get_nrings(na, t) : 0); - priv->np_qlast[t] = nma_get_nrings(na, t) + 1; + priv->np_qlast[t] = netmap_all_rings(na, t); ND("%s: %s %d %d", nr_mode == NR_REG_SW ? "SW" : "NIC+SW", nm_txrx2str(t), priv->np_qfirst[t], priv->np_qlast[t]); @@ -2543,7 +2552,7 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c NMG_LOCK(); hdr->nr_reqtype = NETMAP_REQ_REGISTER; hdr->nr_body = (uintptr_t)®req; - error = netmap_get_bdg_na(hdr, &na, NULL, 0); + error = netmap_get_vale_na(hdr, &na, NULL, 0); hdr->nr_reqtype = NETMAP_REQ_PORT_HDR_SET; hdr->nr_body = (uintptr_t)req; if (na && !error) { @@ -3336,6 +3345,12 @@ netmap_attach_common(struct netmap_adapter *na) } na->pdev = na; /* make sure netmap_mem_map() is called */ #endif /* __FreeBSD__ */ + if (na->na_flags & NAF_HOST_RINGS) { + if (na->num_host_rx_rings == 0) + na->num_host_rx_rings = 1; + if (na->num_host_tx_rings == 0) + na->num_host_tx_rings = 1; + } if (na->nm_krings_create == NULL) { /* we assume that we have been called by a driver, * since other port types all provide their own @@ -3357,7 +3372,7 @@ netmap_attach_common(struct netmap_adapter *na) /* no special nm_bdg_attach callback. On VALE * attach, we need to interpose a bwrap */ - na->nm_bdg_attach = netmap_bwrap_attach; + na->nm_bdg_attach = netmap_default_bdg_attach; #endif return 0; @@ -3399,10 +3414,10 @@ out: static void netmap_hw_dtor(struct netmap_adapter *na) { - if (nm_iszombie(na) || na->ifp == NULL) + if (na->ifp == NULL) return; - WNA(na->ifp) = NULL; + NM_DETACH_NA(na->ifp); } @@ -3426,10 +3441,10 @@ netmap_attach_ext(struct netmap_adapter *arg, size_t s } if (arg == NULL || arg->ifp == NULL) - goto fail; + return EINVAL; ifp = arg->ifp; - if (NA(ifp) && !NM_NA_VALID(ifp)) { + if (NM_NA_CLASH(ifp)) { /* If NA(ifp) is not null but there is no valid netmap * adapter it means that someone else is using the same * pointer (e.g. ax25_ptr on linux). This happens for @@ -3456,28 +3471,8 @@ netmap_attach_ext(struct netmap_adapter *arg, size_t s NM_ATTACH_NA(ifp, &hwna->up); -#ifdef linux - if (ifp->netdev_ops) { - /* prepare a clone of the netdev ops */ -#ifndef NETMAP_LINUX_HAVE_NETDEV_OPS - hwna->nm_ndo.ndo_start_xmit = ifp->netdev_ops; -#else - hwna->nm_ndo = *ifp->netdev_ops; -#endif /* NETMAP_LINUX_HAVE_NETDEV_OPS */ - } - hwna->nm_ndo.ndo_start_xmit = linux_netmap_start_xmit; - hwna->nm_ndo.ndo_change_mtu = linux_netmap_change_mtu; - if (ifp->ethtool_ops) { - hwna->nm_eto = *ifp->ethtool_ops; - } - hwna->nm_eto.set_ringparam = linux_netmap_set_ringparam; -#ifdef NETMAP_LINUX_HAVE_SET_CHANNELS - hwna->nm_eto.set_channels = linux_netmap_set_channels; -#endif /* NETMAP_LINUX_HAVE_SET_CHANNELS */ - if (arg->nm_config == NULL) { - hwna->up.nm_config = netmap_linux_config; - } -#endif /* linux */ + nm_os_onattach(ifp); + if (arg->nm_dtor == NULL) { hwna->up.nm_dtor = netmap_hw_dtor; } @@ -3545,7 +3540,10 @@ netmap_hw_krings_create(struct netmap_adapter *na) int ret = netmap_krings_create(na, 0); if (ret == 0) { /* initialize the mbq for the sw rx ring */ - mbq_safe_init(&na->rx_rings[na->num_rx_rings]->rx_queue); + u_int lim = netmap_real_rings(na, NR_RX), i; + for (i = na->num_rx_rings; i < lim; i++) { + mbq_safe_init(&NMR(na, NR_RX)[i]->rx_queue); + } ND("initialized sw rx queue %d", na->num_rx_rings); } return ret; @@ -3608,8 +3606,14 @@ netmap_transmit(struct ifnet *ifp, struct mbuf *m) unsigned int txr; struct mbq *q; int busy; + u_int i; - kring = na->rx_rings[na->num_rx_rings]; + i = MBUF_TXQ(m); + if (i >= na->num_host_rx_rings) { + i = i % na->num_host_rx_rings; + } + kring = NMR(na, NR_RX)[nma_get_nrings(na, NR_RX) + i]; + // XXX [Linux] we do not need this lock // if we follow the down/configure/up protocol -gl // mtx_lock(&na->core_lock); @@ -3639,8 +3643,15 @@ netmap_transmit(struct ifnet *ifp, struct mbuf *m) goto done; } - if (nm_os_mbuf_has_offld(m)) { - RD(1, "%s drop mbuf that needs offloadings", na->name); + if (!netmap_generic_hwcsum) { + if (nm_os_mbuf_has_csum_offld(m)) { + RD(1, "%s drop mbuf that needs checksum offload", na->name); + goto done; + } + } + + if (nm_os_mbuf_has_seg_offld(m)) { + RD(1, "%s drop mbuf that needs generic segmentation offload", na->name); goto done; } @@ -3843,6 +3854,40 @@ netmap_rx_irq(struct ifnet *ifp, u_int q, u_int *work_ } return netmap_common_irq(na, q, work_done); +} + +/* set/clear native flags and if_transmit/netdev_ops */ +void +nm_set_native_flags(struct netmap_adapter *na) +{ + struct ifnet *ifp = na->ifp; + + /* We do the setup for intercepting packets only if we are the + * first user of this adapapter. */ + if (na->active_fds > 0) { + return; + } + + na->na_flags |= NAF_NETMAP_ON; + nm_os_onenter(ifp); + nm_update_hostrings_mode(na); +} + +void +nm_clear_native_flags(struct netmap_adapter *na) +{ + struct ifnet *ifp = na->ifp; + + /* We undo the setup for intercepting packets only if we are the + * last user of this adapapter. */ + if (na->active_fds > 0) { + return; + } + + nm_update_hostrings_mode(na); + nm_os_onexit(ifp); + + na->na_flags &= ~NAF_NETMAP_ON; } Copied: stable/12/sys/dev/netmap/netmap_bdg.c (from r339639, head/sys/dev/netmap/netmap_bdg.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dev/netmap/netmap_bdg.c Tue Oct 30 08:36:36 2018 (r339906, copy of r339639, head/sys/dev/netmap/netmap_bdg.c) @@ -0,0 +1,1827 @@ +/* + * Copyright (C) 2013-2016 Universita` di Pisa + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +/* + * This module implements the VALE switch for netmap + +--- VALE SWITCH --- + +NMG_LOCK() serializes all modifications to switches and ports. +A switch cannot be deleted until all ports are gone. + +For each switch, an SX lock (RWlock on linux) protects +deletion of ports. When configuring or deleting a new port, the +lock is acquired in exclusive mode (after holding NMG_LOCK). +When forwarding, the lock is acquired in shared mode (without NMG_LOCK). +The lock is held throughout the entire forwarding cycle, +during which the thread may incur in a page fault. +Hence it is important that sleepable shared locks are used. + +On the rx ring, the per-port lock is grabbed initially to reserve +a number of slot in the ring, then the lock is released, +packets are copied from source to destination, and then +the lock is acquired again and the receive ring is updated. +(A similar thing is done on the tx ring for NIC and host stack +ports attached to the switch) + + */ + +/* + * OS-specific code that is used only within this file. + * Other OS-specific code that must be accessed by drivers + * is present in netmap_kern.h + */ + +#if defined(__FreeBSD__) +#include /* prerequisite */ +__FBSDID("$FreeBSD$"); + +#include +#include +#include /* defines used in kernel.h */ +#include /* types used in module initialization */ +#include /* cdevsw struct, UID, GID */ +#include +#include /* struct socket */ +#include +#include +#include +#include /* sockaddrs */ +#include +#include +#include +#include +#include /* BIOCIMMEDIATE */ +#include /* bus_dmamap_* */ +#include +#include +#include + + +#elif defined(linux) + +#include "bsd_glue.h" + +#elif defined(__APPLE__) + +#warning OSX support is only partial +#include "osx_glue.h" + +#elif defined(_WIN32) +#include "win_glue.h" + +#else + +#error Unsupported platform + +#endif /* unsupported */ + +/* + * common headers + */ + +#include +#include +#include + +#include + +const char* +netmap_bdg_name(struct netmap_vp_adapter *vp) +{ + struct nm_bridge *b = vp->na_bdg; + if (b == NULL) + return NULL; + return b->bdg_basename; +} + + +#ifndef CONFIG_NET_NS +/* + * XXX in principle nm_bridges could be created dynamically + * Right now we have a static array and deletions are protected + * by an exclusive lock. + */ +static struct nm_bridge *nm_bridges; +#endif /* !CONFIG_NET_NS */ + + +static int +nm_is_id_char(const char c) +{ + return (c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || + (c >= '0' && c <= '9') || + (c == '_'); +} + +/* Validate the name of a VALE bridge port and return the + * position of the ":" character. */ +static int +nm_vale_name_validate(const char *name) +{ + int colon_pos = -1; + int i; + + if (!name || strlen(name) < strlen(NM_BDG_NAME)) { + return -1; + } + + for (i = 0; i < NM_BDG_IFNAMSIZ && name[i]; i++) { + if (name[i] == ':') { + colon_pos = i; + break; + } else if (!nm_is_id_char(name[i])) { + return -1; + } + } + + if (strlen(name) - colon_pos > IFNAMSIZ) { + /* interface name too long */ + return -1; + } + + return colon_pos; +} + +/* + * locate a bridge among the existing ones. + * MUST BE CALLED WITH NMG_LOCK() + * + * a ':' in the name terminates the bridge name. Otherwise, just NM_NAME. + * We assume that this is called with a name of at least NM_NAME chars. + */ +struct nm_bridge * +nm_find_bridge(const char *name, int create, struct netmap_bdg_ops *ops) +{ + int i, namelen; + struct nm_bridge *b = NULL, *bridges; + u_int num_bridges; + + NMG_LOCK_ASSERT(); + + netmap_bns_getbridges(&bridges, &num_bridges); + + namelen = nm_vale_name_validate(name); + if (namelen < 0) { + D("invalid bridge name %s", name ? name : NULL); + return NULL; + } + + /* lookup the name, remember empty slot if there is one */ + for (i = 0; i < num_bridges; i++) { + struct nm_bridge *x = bridges + i; + + if ((x->bdg_flags & NM_BDG_ACTIVE) + x->bdg_active_ports == 0) { + if (create && b == NULL) + b = x; /* record empty slot */ + } else if (x->bdg_namelen != namelen) { + continue; + } else if (strncmp(name, x->bdg_basename, namelen) == 0) { + ND("found '%.*s' at %d", namelen, name, i); + b = x; + break; + } + } + if (i == num_bridges && b) { /* name not found, can create entry */ + /* initialize the bridge */ + ND("create new bridge %s with ports %d", b->bdg_basename, + b->bdg_active_ports); + b->ht = nm_os_malloc(sizeof(struct nm_hash_ent) * NM_BDG_HASH); + if (b->ht == NULL) { + D("failed to allocate hash table"); + return NULL; + } + strncpy(b->bdg_basename, name, namelen); + b->bdg_namelen = namelen; + b->bdg_active_ports = 0; + for (i = 0; i < NM_BDG_MAXPORTS; i++) + b->bdg_port_index[i] = i; + /* set the default function */ + b->bdg_ops = ops; + b->private_data = b->ht; + b->bdg_flags = 0; + NM_BNS_GET(b); + } + return b; +} + + +int +netmap_bdg_free(struct nm_bridge *b) +{ + if ((b->bdg_flags & NM_BDG_ACTIVE) + b->bdg_active_ports != 0) { + return EBUSY; + } + + ND("marking bridge %s as free", b->bdg_basename); + nm_os_free(b->ht); + b->bdg_ops = NULL; + b->bdg_flags = 0; + NM_BNS_PUT(b); + return 0; +} + + +/* remove from bridge b the ports in slots hw and sw + * (sw can be -1 if not needed) + */ +void +netmap_bdg_detach_common(struct nm_bridge *b, int hw, int sw) +{ + int s_hw = hw, s_sw = sw; + int i, lim =b->bdg_active_ports; + uint32_t *tmp = b->tmp_bdg_port_index; + + /* + New algorithm: + make a copy of bdg_port_index; + lookup NA(ifp)->bdg_port and SWNA(ifp)->bdg_port + in the array of bdg_port_index, replacing them with + entries from the bottom of the array; + decrement bdg_active_ports; + acquire BDG_WLOCK() and copy back the array. + */ + + if (netmap_verbose) + D("detach %d and %d (lim %d)", hw, sw, lim); + /* make a copy of the list of active ports, update it, + * and then copy back within BDG_WLOCK(). + */ + memcpy(b->tmp_bdg_port_index, b->bdg_port_index, sizeof(b->tmp_bdg_port_index)); + for (i = 0; (hw >= 0 || sw >= 0) && i < lim; ) { + if (hw >= 0 && tmp[i] == hw) { + ND("detach hw %d at %d", hw, i); + lim--; /* point to last active port */ + tmp[i] = tmp[lim]; /* swap with i */ + tmp[lim] = hw; /* now this is inactive */ + hw = -1; + } else if (sw >= 0 && tmp[i] == sw) { + ND("detach sw %d at %d", sw, i); + lim--; + tmp[i] = tmp[lim]; + tmp[lim] = sw; + sw = -1; + } else { + i++; + } + } + if (hw >= 0 || sw >= 0) { + D("XXX delete failed hw %d sw %d, should panic...", hw, sw); + } + + BDG_WLOCK(b); + if (b->bdg_ops->dtor) + b->bdg_ops->dtor(b->bdg_ports[s_hw]); + b->bdg_ports[s_hw] = NULL; + if (s_sw >= 0) { + b->bdg_ports[s_sw] = NULL; + } + memcpy(b->bdg_port_index, b->tmp_bdg_port_index, sizeof(b->tmp_bdg_port_index)); + b->bdg_active_ports = lim; + BDG_WUNLOCK(b); + + ND("now %d active ports", lim); + netmap_bdg_free(b); +} + + +/* nm_bdg_ctl callback for VALE ports */ +int +netmap_vp_bdg_ctl(struct nmreq_header *hdr, struct netmap_adapter *na) +{ + struct netmap_vp_adapter *vpna = (struct netmap_vp_adapter *)na; + struct nm_bridge *b = vpna->na_bdg; + + if (hdr->nr_reqtype == NETMAP_REQ_VALE_ATTACH) { + return 0; /* nothing to do */ + } + if (b) { + netmap_set_all_rings(na, 0 /* disable */); + netmap_bdg_detach_common(b, vpna->bdg_port, -1); + vpna->na_bdg = NULL; + netmap_set_all_rings(na, 1 /* enable */); + } + /* I have took reference just for attach */ + netmap_adapter_put(na); + return 0; +} + +int +netmap_default_bdg_attach(const char *name, struct netmap_adapter *na, + struct nm_bridge *b) +{ + return NM_NEED_BWRAP; +} + +/* Try to get a reference to a netmap adapter attached to a VALE switch. + * If the adapter is found (or is created), this function returns 0, a + * non NULL pointer is returned into *na, and the caller holds a + * reference to the adapter. + * If an adapter is not found, then no reference is grabbed and the + * function returns an error code, or 0 if there is just a VALE prefix + * mismatch. Therefore the caller holds a reference when + * (*na != NULL && return == 0). + */ +int +netmap_get_bdg_na(struct nmreq_header *hdr, struct netmap_adapter **na, + struct netmap_mem_d *nmd, int create, struct netmap_bdg_ops *ops) +{ + char *nr_name = hdr->nr_name; + const char *ifname; + struct ifnet *ifp = NULL; + int error = 0; + struct netmap_vp_adapter *vpna, *hostna = NULL; + struct nm_bridge *b; + uint32_t i, j; + uint32_t cand = NM_BDG_NOPORT, cand2 = NM_BDG_NOPORT; + int needed; + + *na = NULL; /* default return value */ + + /* first try to see if this is a bridge port. */ + NMG_LOCK_ASSERT(); + if (strncmp(nr_name, ops->name, strlen(ops->name) - 1)) { + return 0; /* no error, but no VALE prefix */ + } + + b = nm_find_bridge(nr_name, create, ops); + if (b == NULL) { + ND("no bridges available for '%s'", nr_name); + return (create ? ENOMEM : ENXIO); + } + if (strlen(nr_name) < b->bdg_namelen) /* impossible */ + panic("x"); + + /* Now we are sure that name starts with the bridge's name, + * lookup the port in the bridge. We need to scan the entire + * list. It is not important to hold a WLOCK on the bridge + * during the search because NMG_LOCK already guarantees + * that there are no other possible writers. + */ + + /* lookup in the local list of ports */ + for (j = 0; j < b->bdg_active_ports; j++) { + i = b->bdg_port_index[j]; + vpna = b->bdg_ports[i]; + ND("checking %s", vpna->up.name); + if (!strcmp(vpna->up.name, nr_name)) { + netmap_adapter_get(&vpna->up); + ND("found existing if %s refs %d", nr_name) + *na = &vpna->up; + return 0; + } + } + /* not found, should we create it? */ + if (!create) + return ENXIO; + /* yes we should, see if we have space to attach entries */ + needed = 2; /* in some cases we only need 1 */ + if (b->bdg_active_ports + needed >= NM_BDG_MAXPORTS) { + D("bridge full %d, cannot create new port", b->bdg_active_ports); + return ENOMEM; + } + /* record the next two ports available, but do not allocate yet */ + cand = b->bdg_port_index[b->bdg_active_ports]; + cand2 = b->bdg_port_index[b->bdg_active_ports + 1]; + ND("+++ bridge %s port %s used %d avail %d %d", + b->bdg_basename, ifname, b->bdg_active_ports, cand, cand2); + + /* + * try see if there is a matching NIC with this name + * (after the bridge's name) + */ + ifname = nr_name + b->bdg_namelen + 1; + ifp = ifunit_ref(ifname); + if (!ifp) { + /* Create an ephemeral virtual port. + * This block contains all the ephemeral-specific logic. + */ + + if (hdr->nr_reqtype != NETMAP_REQ_REGISTER) { + error = EINVAL; + goto out; + } + + /* bdg_netmap_attach creates a struct netmap_adapter */ + error = b->bdg_ops->vp_create(hdr, NULL, nmd, &vpna); + if (error) { + D("error %d", error); + goto out; + } + /* shortcut - we can skip get_hw_na(), + * ownership check and nm_bdg_attach() + */ + + } else { + struct netmap_adapter *hw; + + /* the vale:nic syntax is only valid for some commands */ + switch (hdr->nr_reqtype) { + case NETMAP_REQ_VALE_ATTACH: + case NETMAP_REQ_VALE_DETACH: + case NETMAP_REQ_VALE_POLLING_ENABLE: + case NETMAP_REQ_VALE_POLLING_DISABLE: + break; /* ok */ + default: + error = EINVAL; + goto out; + } + + error = netmap_get_hw_na(ifp, nmd, &hw); + if (error || hw == NULL) + goto out; + + /* host adapter might not be created */ + error = hw->nm_bdg_attach(nr_name, hw, b); + if (error == NM_NEED_BWRAP) { + error = b->bdg_ops->bwrap_attach(nr_name, hw); + } + if (error) + goto out; + vpna = hw->na_vp; + hostna = hw->na_hostvp; + if (hdr->nr_reqtype == NETMAP_REQ_VALE_ATTACH) { + /* Check if we need to skip the host rings. */ + struct nmreq_vale_attach *areq = + (struct nmreq_vale_attach *)(uintptr_t)hdr->nr_body; + if (areq->reg.nr_mode != NR_REG_NIC_SW) { + hostna = NULL; + } + } + } + + BDG_WLOCK(b); + vpna->bdg_port = cand; + ND("NIC %p to bridge port %d", vpna, cand); + /* bind the port to the bridge (virtual ports are not active) */ + b->bdg_ports[cand] = vpna; + vpna->na_bdg = b; + b->bdg_active_ports++; + if (hostna != NULL) { + /* also bind the host stack to the bridge */ + b->bdg_ports[cand2] = hostna; + hostna->bdg_port = cand2; + hostna->na_bdg = b; + b->bdg_active_ports++; + ND("host %p to bridge port %d", hostna, cand2); + } + ND("if %s refs %d", ifname, vpna->up.na_refcount); + BDG_WUNLOCK(b); + *na = &vpna->up; + netmap_adapter_get(*na); + +out: + if (ifp) + if_rele(ifp); + + return error; +} + +/* Process NETMAP_REQ_VALE_ATTACH. + */ +int +nm_bdg_ctl_attach(struct nmreq_header *hdr, void *auth_token) +{ + struct nmreq_vale_attach *req = + (struct nmreq_vale_attach *)(uintptr_t)hdr->nr_body; + struct netmap_vp_adapter * vpna; + struct netmap_adapter *na = NULL; + struct netmap_mem_d *nmd = NULL; + struct nm_bridge *b = NULL; + int error; + + NMG_LOCK(); + /* permission check for modified bridges */ + b = nm_find_bridge(hdr->nr_name, 0 /* don't create */, NULL); + if (b && !nm_bdg_valid_auth_token(b, auth_token)) { + error = EACCES; + goto unlock_exit; + } + + if (req->reg.nr_mem_id) { + nmd = netmap_mem_find(req->reg.nr_mem_id); + if (nmd == NULL) { + error = EINVAL; + goto unlock_exit; + } + } + + /* check for existing one */ + error = netmap_get_vale_na(hdr, &na, nmd, 0); + if (na) { + error = EBUSY; + goto unref_exit; + } + error = netmap_get_vale_na(hdr, &na, + nmd, 1 /* create if not exists */); + if (error) { /* no device */ + goto unlock_exit; + } + + if (na == NULL) { /* VALE prefix missing */ + error = EINVAL; + goto unlock_exit; + } + + if (NETMAP_OWNED_BY_ANY(na)) { + error = EBUSY; + goto unref_exit; + } + + if (na->nm_bdg_ctl) { + /* nop for VALE ports. The bwrap needs to put the hwna + * in netmap mode (see netmap_bwrap_bdg_ctl) + */ + error = na->nm_bdg_ctl(hdr, na); + if (error) + goto unref_exit; + ND("registered %s to netmap-mode", na->name); + } + vpna = (struct netmap_vp_adapter *)na; + req->port_index = vpna->bdg_port; + NMG_UNLOCK(); + return 0; + +unref_exit: + netmap_adapter_put(na); +unlock_exit: + NMG_UNLOCK(); + return error; +} + +static inline int +nm_is_bwrap(struct netmap_adapter *na) +{ + return na->nm_register == netmap_bwrap_reg; +} + +/* Process NETMAP_REQ_VALE_DETACH. + */ +int +nm_bdg_ctl_detach(struct nmreq_header *hdr, void *auth_token) +{ + struct nmreq_vale_detach *nmreq_det = (void *)(uintptr_t)hdr->nr_body; + struct netmap_vp_adapter *vpna; + struct netmap_adapter *na; + struct nm_bridge *b = NULL; + int error; + + NMG_LOCK(); + /* permission check for modified bridges */ + b = nm_find_bridge(hdr->nr_name, 0 /* don't create */, NULL); + if (b && !nm_bdg_valid_auth_token(b, auth_token)) { + error = EACCES; + goto unlock_exit; + } + + error = netmap_get_vale_na(hdr, &na, NULL, 0 /* don't create */); + if (error) { /* no device, or another bridge or user owns the device */ + goto unlock_exit; + } + + if (na == NULL) { /* VALE prefix missing */ + error = EINVAL; + goto unlock_exit; + } else if (nm_is_bwrap(na) && + ((struct netmap_bwrap_adapter *)na)->na_polling_state) { + /* Don't detach a NIC with polling */ + error = EBUSY; + goto unref_exit; + } + + vpna = (struct netmap_vp_adapter *)na; + if (na->na_vp != vpna) { + /* trying to detach first attach of VALE persistent port attached + * to 2 bridges + */ + error = EBUSY; + goto unref_exit; + } + nmreq_det->port_index = vpna->bdg_port; + + if (na->nm_bdg_ctl) { + /* remove the port from bridge. The bwrap + * also needs to put the hwna in normal mode + */ + error = na->nm_bdg_ctl(hdr, na); + } + +unref_exit: + netmap_adapter_put(na); +unlock_exit: + NMG_UNLOCK(); + return error; + +} + +struct nm_bdg_polling_state; +struct +nm_bdg_kthread { + struct nm_kctx *nmk; + u_int qfirst; + u_int qlast; + struct nm_bdg_polling_state *bps; +}; + +struct nm_bdg_polling_state { + bool configured; + bool stopped; + struct netmap_bwrap_adapter *bna; + uint32_t mode; + u_int qfirst; + u_int qlast; + u_int cpu_from; + u_int ncpus; + struct nm_bdg_kthread *kthreads; +}; + +static void +netmap_bwrap_polling(void *data, int is_kthread) +{ + struct nm_bdg_kthread *nbk = data; + struct netmap_bwrap_adapter *bna; + u_int qfirst, qlast, i; + struct netmap_kring **kring0, *kring; + + if (!nbk) + return; + qfirst = nbk->qfirst; + qlast = nbk->qlast; + bna = nbk->bps->bna; + kring0 = NMR(bna->hwna, NR_RX); + + for (i = qfirst; i < qlast; i++) { + kring = kring0[i]; + kring->nm_notify(kring, 0); + } +} + +static int +nm_bdg_create_kthreads(struct nm_bdg_polling_state *bps) +{ + struct nm_kctx_cfg kcfg; + int i, j; + + bps->kthreads = nm_os_malloc(sizeof(struct nm_bdg_kthread) * bps->ncpus); + if (bps->kthreads == NULL) + return ENOMEM; + + bzero(&kcfg, sizeof(kcfg)); + kcfg.worker_fn = netmap_bwrap_polling; + kcfg.use_kthread = 1; + for (i = 0; i < bps->ncpus; i++) { + struct nm_bdg_kthread *t = bps->kthreads + i; + int all = (bps->ncpus == 1 && + bps->mode == NETMAP_POLLING_MODE_SINGLE_CPU); + int affinity = bps->cpu_from + i; + + t->bps = bps; + t->qfirst = all ? bps->qfirst /* must be 0 */: affinity; + t->qlast = all ? bps->qlast : t->qfirst + 1; + D("kthread %d a:%u qf:%u ql:%u", i, affinity, t->qfirst, + t->qlast); + + kcfg.type = i; + kcfg.worker_private = t; + t->nmk = nm_os_kctx_create(&kcfg, NULL); + if (t->nmk == NULL) { + goto cleanup; + } + nm_os_kctx_worker_setaff(t->nmk, affinity); + } + return 0; + +cleanup: + for (j = 0; j < i; j++) { + struct nm_bdg_kthread *t = bps->kthreads + i; + nm_os_kctx_destroy(t->nmk); + } + nm_os_free(bps->kthreads); + return EFAULT; +} + +/* A variant of ptnetmap_start_kthreads() */ +static int +nm_bdg_polling_start_kthreads(struct nm_bdg_polling_state *bps) +{ + int error, i, j; + + if (!bps) { + D("polling is not configured"); + return EFAULT; + } + bps->stopped = false; + + for (i = 0; i < bps->ncpus; i++) { + struct nm_bdg_kthread *t = bps->kthreads + i; + error = nm_os_kctx_worker_start(t->nmk); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Oct 30 09:36:32 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 09:43:28 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 09:53:58 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 10:01:17 2018 Return-Path: Delivered-To: svn-src-all@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 D367910DDB40; Tue, 30 Oct 2018 10:01:16 +0000 (UTC) (envelope-from vmaffione@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 869A57AF31; Tue, 30 Oct 2018 10:01:16 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 66F4C1BDDE; Tue, 30 Oct 2018 10:01:16 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9UA1GTF043755; Tue, 30 Oct 2018 10:01:16 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UA1FUK043750; Tue, 30 Oct 2018 10:01:15 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201810301001.w9UA1FUK043750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Tue, 30 Oct 2018 10:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339910 - in stable/12: share/man/man4 tools/tools/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in stable/12: share/man/man4 tools/tools/netmap X-SVN-Commit-Revision: 339910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 10:01:17 -0000 Author: vmaffione Date: Tue Oct 30 10:01:15 2018 New Revision: 339910 URL: https://svnweb.freebsd.org/changeset/base/339910 Log: MFC r339659: netmap: add man page for the bridge program Added bridge(8). Also, minor fixes to the netmap "bridge" application: - indentation fixes and code cleanup - better usage description - better processing of netmap flags Approved by: re (rgrimes) Added: stable/12/tools/tools/netmap/bridge.8 - copied unchanged from r339659, head/tools/tools/netmap/bridge.8 Modified: stable/12/share/man/man4/netmap.4 stable/12/tools/tools/netmap/bridge.c stable/12/tools/tools/netmap/pkt-gen.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/netmap.4 ============================================================================== --- stable/12/share/man/man4/netmap.4 Tue Oct 30 09:53:57 2018 (r339909) +++ stable/12/share/man/man4/netmap.4 Tue Oct 30 10:01:15 2018 (r339910) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 2, 2017 +.Dd October 23, 2018 .Dt NETMAP 4 .Os .Sh NAME @@ -1073,6 +1073,9 @@ Other clients attached to the same switch can now communicate with the network card or the host. .Sh SEE ALSO +.Xr pkt-gen 8 , +.Xr bridge 8 +.Pp .Pa http://info.iet.unipi.it/~luigi/netmap/ .Pp Luigi Rizzo, Revisiting network I/O APIs: the netmap framework, Copied: stable/12/tools/tools/netmap/bridge.8 (from r339659, head/tools/tools/netmap/bridge.8) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/tools/netmap/bridge.8 Tue Oct 30 10:01:15 2018 (r339910, copy of r339659, head/tools/tools/netmap/bridge.8) @@ -0,0 +1,82 @@ +.\" Copyright (c) 2016 Luigi Rizzo, Universita` di Pisa +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 23, 2018 +.Dt BRIDGE 8 +.Os +.Sh NAME +.Nm bridge +.Nd netmap client to bridge two netmap ports +.Sh SYNOPSIS +.Bk -words +.Bl -tag -width "bridge" +.It Nm +.Op Fl i Ar port +.Op Fl b Ar batch size +.Op Fl w Ar wait-link +.Op Fl v +.Op Fl c +.El +.Ek +.Sh DESCRIPTION +.Nm +is a simple netmap application that bridges packets between two netmap ports. +If the two netmap ports use the same netmap memory region +.Nm +forwards packets without copying the packets payload (zero-copy mode), unless +explicitly prevented by the +.Fl c +flag. +.Bl -tag -width Ds +.It Fl i Ar port +Name of the netmap port. +It can be supplied up to two times to identify the ports that must be bridged. +Any netmap port type (physical interface, VALE switch, pipe, monitor port...) +can be used. +If the option is supplied only once, then it must be for a physical interface and, in that case, +.Nm +will bridge the port and the host stack. +.It Fl b Ar batch-size +Maximum number of packets to send in one operation. +.It Fl w Ar wait-link +indicates the number of seconds to wait before transmitting. +It defaults to 2, and may be useful when talking to physical +ports to let link negotiation complete before starting transmission. +.It Fl v +Enable verbose mode +.It Fl c +Disable zero-copy mode. +.El +.Sh SEE ALSO +.Xr netmap 4 , +.Xr pkt-gen 8 +.Sh AUTHORS +.An -nosplit +.Nm +has been written by +.An Luigi Rizzo +and +.An Matteo Landi +at the Universita` di Pisa, Italy. Modified: stable/12/tools/tools/netmap/bridge.c ============================================================================== --- stable/12/tools/tools/netmap/bridge.c Tue Oct 30 09:53:57 2018 (r339909) +++ stable/12/tools/tools/netmap/bridge.c Tue Oct 30 10:01:15 2018 (r339910) @@ -34,18 +34,18 @@ sigint_h(int sig) int pkt_queued(struct nm_desc *d, int tx) { - u_int i, tot = 0; + u_int i, tot = 0; - if (tx) { - for (i = d->first_tx_ring; i <= d->last_tx_ring; i++) { - tot += nm_ring_space(NETMAP_TXRING(d->nifp, i)); - } - } else { - for (i = d->first_rx_ring; i <= d->last_rx_ring; i++) { - tot += nm_ring_space(NETMAP_RXRING(d->nifp, i)); - } - } - return tot; + if (tx) { + for (i = d->first_tx_ring; i <= d->last_tx_ring; i++) { + tot += nm_ring_space(NETMAP_TXRING(d->nifp, i)); + } + } else { + for (i = d->first_rx_ring; i <= d->last_rx_ring; i++) { + tot += nm_ring_space(NETMAP_RXRING(d->nifp, i)); + } + } + return tot; } /* @@ -76,13 +76,13 @@ process_rings(struct netmap_ring *rxring, struct netma /* swap packets */ if (ts->buf_idx < 2 || rs->buf_idx < 2) { - D("wrong index rx[%d] = %d -> tx[%d] = %d", + RD(5, "wrong index rx[%d] = %d -> tx[%d] = %d", j, rs->buf_idx, k, ts->buf_idx); sleep(2); } /* copy the packet length. */ - if (rs->len > 2048) { - D("wrong len %d rx[%d] -> tx[%d]", rs->len, j, k); + if (rs->len > rxring->nr_buf_size) { + RD(5, "wrong len %d rx[%d] -> tx[%d]", rs->len, j, k); rs->len = 0; } else if (verbose > 1) { D("%s send len %d rx[%d] -> tx[%d]", msg, rs->len, j, k); @@ -95,6 +95,8 @@ process_rings(struct netmap_ring *rxring, struct netma /* report the buffer change. */ ts->flags |= NS_BUF_CHANGED; rs->flags |= NS_BUF_CHANGED; + /* copy the NS_MOREFRAG */ + rs->flags = (rs->flags & ~NS_MOREFRAG) | (ts->flags & NS_MOREFRAG); } else { char *rxbuf = NETMAP_BUF(rxring, rs->buf_idx); char *txbuf = NETMAP_BUF(txring, ts->buf_idx); @@ -117,7 +119,7 @@ move(struct nm_desc *src, struct nm_desc *dst, u_int l { struct netmap_ring *txring, *rxring; u_int m = 0, si = src->first_rx_ring, di = dst->first_tx_ring; - const char *msg = (src->req.nr_ringid & NETMAP_SW_RING) ? + const char *msg = (src->req.nr_flags == NR_REG_SW) ? "host->net" : "net->host"; while (si <= src->last_rx_ring && di <= dst->last_tx_ring) { @@ -143,7 +145,20 @@ static void usage(void) { fprintf(stderr, - "usage: bridge [-v] [-i ifa] [-i ifb] [-b burst] [-w wait_time] [ifa [ifb [burst]]]\n"); + "netmap bridge program: forward packets between two " + "network interfaces\n" + " usage(1): bridge [-v] [-i ifa] [-i ifb] [-b burst] " + "[-w wait_time] [-L]\n" + " usage(2): bridge [-v] [-w wait_time] [-L] " + "[ifa [ifb [burst]]]\n" + "\n" + " ifa and ifb are specified using the nm_open() syntax.\n" + " When ifb is missing (or is equal to ifa), bridge will\n" + " forward between between ifa and the host stack if -L\n" + " is not specified, otherwise loopback traffic on ifa.\n" + "\n" + " example: bridge -w 10 -i netmap:eth3 -i netmap:eth1\n" + ); exit(1); } @@ -163,14 +178,16 @@ main(int argc, char **argv) struct nm_desc *pa = NULL, *pb = NULL; char *ifa = NULL, *ifb = NULL; char ifabuf[64] = { 0 }; + int loopback = 0; - fprintf(stderr, "%s built %s %s\n", - argv[0], __DATE__, __TIME__); + fprintf(stderr, "%s built %s %s\n\n", argv[0], __DATE__, __TIME__); - while ( (ch = getopt(argc, argv, "b:ci:vw:")) != -1) { + while ((ch = getopt(argc, argv, "hb:ci:vw:L")) != -1) { switch (ch) { default: D("bad option %c %s", ch, optarg); + /* fallthrough */ + case 'h': usage(); break; case 'b': /* burst */ @@ -194,6 +211,9 @@ main(int argc, char **argv) case 'w': wait_link = atoi(optarg); break; + case 'L': + loopback = 1; + break; } } @@ -222,9 +242,13 @@ main(int argc, char **argv) wait_link = 4; } if (!strcmp(ifa, ifb)) { - D("same interface, endpoint 0 goes to host"); - snprintf(ifabuf, sizeof(ifabuf) - 1, "%s^", ifa); - ifa = ifabuf; + if (!loopback) { + D("same interface, endpoint 0 goes to host"); + snprintf(ifabuf, sizeof(ifabuf) - 1, "%s^", ifa); + ifa = ifabuf; + } else { + D("same interface, loopbacking traffic"); + } } else { /* two different interfaces. Take all rings on if1 */ } @@ -243,7 +267,7 @@ main(int argc, char **argv) zerocopy = zerocopy && (pa->mem == pb->mem); D("------- zerocopy %ssupported", zerocopy ? "" : "NOT "); - /* setup poll(2) variables. */ + /* setup poll(2) array */ memset(pollfd, 0, sizeof(pollfd)); pollfd[0].fd = pa->fd; pollfd[1].fd = pb->fd; @@ -263,18 +287,16 @@ main(int argc, char **argv) n0 = pkt_queued(pa, 0); n1 = pkt_queued(pb, 0); #if defined(_WIN32) || defined(BUSYWAIT) - if (n0){ + if (n0) { ioctl(pollfd[1].fd, NIOCTXSYNC, NULL); pollfd[1].revents = POLLOUT; - } - else { + } else { ioctl(pollfd[0].fd, NIOCRXSYNC, NULL); } - if (n1){ + if (n1) { ioctl(pollfd[0].fd, NIOCTXSYNC, NULL); pollfd[0].revents = POLLOUT; - } - else { + } else { ioctl(pollfd[1].fd, NIOCRXSYNC, NULL); } ret = 1; @@ -287,8 +309,10 @@ main(int argc, char **argv) pollfd[0].events |= POLLOUT; else pollfd[1].events |= POLLIN; + + /* poll() also cause kernel to txsync/rxsync the NICs */ ret = poll(pollfd, 2, 2500); -#endif //defined(_WIN32) || defined(BUSYWAIT) +#endif /* defined(_WIN32) || defined(BUSYWAIT) */ if (ret <= 0 || verbose) D("poll %s [0] ev %x %x rx %d@%d tx %d," " [1] ev %x %x rx %d@%d tx %d", @@ -316,18 +340,15 @@ main(int argc, char **argv) D("error on fd1, rx [%d,%d,%d)", rx->head, rx->cur, rx->tail); } - if (pollfd[0].revents & POLLOUT) { + if (pollfd[0].revents & POLLOUT) move(pb, pa, burst); - // XXX we don't need the ioctl */ - // ioctl(me[0].fd, NIOCTXSYNC, NULL); - } - if (pollfd[1].revents & POLLOUT) { + + if (pollfd[1].revents & POLLOUT) move(pa, pb, burst); - // XXX we don't need the ioctl */ - // ioctl(me[1].fd, NIOCTXSYNC, NULL); - } + + /* We don't need ioctl(NIOCTXSYNC) on the two file descriptors here, + * kernel will txsync on next poll(). */ } - D("exiting"); nm_close(pb); nm_close(pa); Modified: stable/12/tools/tools/netmap/pkt-gen.8 ============================================================================== --- stable/12/tools/tools/netmap/pkt-gen.8 Tue Oct 30 09:53:57 2018 (r339909) +++ stable/12/tools/tools/netmap/pkt-gen.8 Tue Oct 30 10:01:15 2018 (r339910) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 1, 2016 +.Dd October 23, 2018 .Dt PKT-GEN 8 .Os .Sh NAME @@ -170,10 +170,9 @@ packets to be received by the target host. .Dl .Nm -i netmap:ncxl0 -f tx -s 172.16.0.1:53 -d 172.16.1.3:53 -D 00:07:43:29:2a:e0 -.Sh FILES -.Xr netmap 4 .Sh SEE ALSO -.Xr netmap 4 +.Xr netmap 4 , +.Xr bridge 8 .Sh AUTHORS This manual page was written by .An George V. Neville-Neil Aq gnn@FreeBSD.org . From owner-svn-src-all@freebsd.org Tue Oct 30 10:02:24 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 10:16:22 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 10:17:44 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 11:19:48 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 11:51:10 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 14:25:17 2018 Return-Path: Delivered-To: svn-src-all@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 5B30E10E9C7F; Tue, 30 Oct 2018 14:25:17 +0000 (UTC) (envelope-from vmaffione@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 0EA9886A2B; Tue, 30 Oct 2018 14:25:17 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E3D7D1E9C7; Tue, 30 Oct 2018 14:25:16 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9UEPGmT082648; Tue, 30 Oct 2018 14:25:16 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UEPGQr082647; Tue, 30 Oct 2018 14:25:16 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201810301425.w9UEPGQr082647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Tue, 30 Oct 2018 14:25:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339915 - stable/12/tools/tools/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/tools/tools/netmap X-SVN-Commit-Revision: 339915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 14:25:17 -0000 Author: vmaffione Date: Tue Oct 30 14:25:16 2018 New Revision: 339915 URL: https://svnweb.freebsd.org/changeset/base/339915 Log: MFC r339685 netmap: add man page for the vale-ctl program Added man page for vale-ctl program. Small fixes to vale-ctl, including the support for -m option (to specify the netmap memory allocator id). Approved by: re (rgrimes) Added: stable/12/tools/tools/netmap/vale-ctl.4 - copied unchanged from r339685, head/tools/tools/netmap/vale-ctl.4 Modified: stable/12/tools/tools/netmap/vale-ctl.c Directory Properties: stable/12/ (props changed) Copied: stable/12/tools/tools/netmap/vale-ctl.4 (from r339685, head/tools/tools/netmap/vale-ctl.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/tools/netmap/vale-ctl.4 Tue Oct 30 14:25:16 2018 (r339915, copy of r339685, head/tools/tools/netmap/vale-ctl.4) @@ -0,0 +1,163 @@ +.\" Copyright (c) 2016 Michio Honda. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 24, 2018 +.Dt VALE-CTL 4 +.Os +.Sh NAME +.Nm vale-ctl +.Nd manage VALE switches provided by netmap +.Sh SYNOPSIS +.Bk -words +.Bl -tag -width "vale-ctl" +.It Nm +.Op Fl g Ar valeSSS:PPP +.Op Fl a Ar valeSSS:interface +.Op Fl h Ar valeSSS:interface +.Op Fl d Ar valeSSS:interface +.Op Fl n Ar interface +.Op Fl r Ar interface +.Op Fl l Ar valeSSS:PPP +.Op Fl l +.Op Fl p Ar valeSSS:PPP +.Op Fl P Ar valeSSS:PPP +.Op Fl C Ar spec +.Op Fl m Ar memid +.El +.Ek +.Sh DESCRIPTION +.Nm +manages and inspects +.Xr vale 4 +switches, for instance attaching and detaching interfaces, creating +and deleting persistent VALE ports, or listing the existing switches +and their ports. +In the following, +.Ar valeSSS +is the name of a VALE switch, while +.Ar valeSSS:PPP +is the name of a VALE port of +.Ar valeSSS . +.Pp +When issued without options it lists all the existing switch ports together +with their internal bridge number and port number. +.Bl -tag -width Ds +.It Fl g Ar valeSSS:PPP +Print the number of receive rings of +.Ar valeSSS:PPP . +.It Fl a Ar valeSSS:interface +Attach +.Ar interface +(which must be an existing network interface) to +.Ar valeSSS +and detach it from the host stack. +.It Fl h Ar valeSSS:interface +Attach +.Ar interface +(which must be an existing network interface) to +.Ar valeSSS +while keeping it attached to the host stack. +More precisely, packets coming from +the host stack and directed to the interface will go through the switch, where +they can still reach the interface if the switch rules allow it. +Conversely, packets coming from the interface will go through the switch and, +if appropriate, will reach the host stack. +.It Fl d Ar valeSSS:interface +Detach +.Ar interface +from +.Ar valeSSS . +.It Fl n Ar interface +Create a new persistent VALE port with name +.Ar interface . +The name must be different from any other network interface +already present in the system. +.It Fl d Ar interface +Destroy the persistent VALE port with name +.Ar inteface . +.It Fl l Ar valeSSS:PPP +Show the internal bridge number and port number of the given switch port. +.It Fl p Ar valeSSS:PPP +Enable polling mode for +.Ar valeSSS:PPP . +In polling mode, a dedicated kernel thread is spawned to handle packets +received from +.Ar valeSSS:PPP +and push them into the switch. +The kernel thread busy waits on the switch port rather than relying on +interrupts or notifications. +Polling mode can only be used on physical NICs attached to a VALE switch. +.It Fl P Ar valeSSS:PPP +Disable polling mode for +.Ar valeSSS:PPP . +.It Fl C Ar x | Ar x,y | Ar x,y,z | Ar x,y,z,w +When used in conjunction with +.Fl n +it supplies the number of tx and rx rings and slots. +The full format with four numbers gives, in order, number of tx slots, number +of rx slots, number of tx rings and number of rx rings. +The form with three numbers uses +.Ar z +for both the number of tx and the number of rx rings. +The forms with less than two numbers use the default values for the number +of rings. +The form with two numbers supplies the numbers of tx and rx slots. +The form with only one number uses +.Ar x +for both the number of tx and the number of rx slots. +.Pp +When used in conjunction with +.Fl p +only the first three forms are used. +The first number may be either 0 or 1. +If 0, then all interface rings will be polled by a single thread, running +on the core id given by the second number (the third number, if present, +must be 1). +If the first number is 1, then the ring identified by the second number will +be polled by the core with the same id. +If a third number is given, then this is repeated for as many consecutive +rings and cores. +.It Fl m Ar memid +Used in conjunction with +.Fl n +supplies the netmap memory region identifier to use together with the newly +created persistent VALE port. +These ports use a private memory region by default. +Using this option you can let them share memory with other ports. +Pass 1 as +.Ar memid +to use the global memory region already shared by all +harware netmap ports. +.El +.Sh SEE ALSO +.Xr netmap 4 , +.Xr vale 4 +.Sh AUTHORS +.An -nosplit +.Nm +has been written by +.An Michio Honda +at NetApp. Modified: stable/12/tools/tools/netmap/vale-ctl.c ============================================================================== --- stable/12/tools/tools/netmap/vale-ctl.c Tue Oct 30 11:51:09 2018 (r339914) +++ stable/12/tools/tools/netmap/vale-ctl.c Tue Oct 30 14:25:16 2018 (r339915) @@ -82,7 +82,7 @@ void parse_nmr_config(const char* conf, struct nmreq * } static int -bdg_ctl(const char *name, int nr_cmd, int nr_arg, char *nmr_config) +bdg_ctl(const char *name, int nr_cmd, int nr_arg, char *nmr_config, int nr_arg2) { struct nmreq nmr; int error = 0; @@ -96,9 +96,10 @@ bdg_ctl(const char *name, int nr_cmd, int nr_arg, char bzero(&nmr, sizeof(nmr)); nmr.nr_version = NETMAP_API; if (name != NULL) /* might be NULL */ - strncpy(nmr.nr_name, name, sizeof(nmr.nr_name)); + strncpy(nmr.nr_name, name, sizeof(nmr.nr_name)-1); nmr.nr_cmd = nr_cmd; parse_nmr_config(nmr_config, &nmr); + nmr.nr_arg2 = nr_arg2; switch (nr_cmd) { case NETMAP_BDG_DELIF: @@ -195,42 +196,44 @@ bdg_ctl(const char *name, int nr_cmd, int nr_arg, char return error; } +static void +usage(int errcode) +{ + fprintf(stderr, + "Usage:\n" + "vale-ctl arguments\n" + "\t-g interface interface name to get info\n" + "\t-d interface interface name to be detached\n" + "\t-a interface interface name to be attached\n" + "\t-h interface interface name to be attached with the host stack\n" + "\t-n interface interface name to be created\n" + "\t-r interface interface name to be deleted\n" + "\t-l list all or specified bridge's interfaces (default)\n" + "\t-C string ring/slot setting of an interface creating by -n\n" + "\t-p interface start polling. Additional -C x,y,z configures\n" + "\t\t x: 0 (REG_ALL_NIC) or 1 (REG_ONE_NIC),\n" + "\t\t y: CPU core id for ALL_NIC and core/ring for ONE_NIC\n" + "\t\t z: (ONE_NIC only) num of total cores/rings\n" + "\t-P interface stop polling\n" + "\t-m memid to use when creating a new interface\n"); + exit(errcode); +} + int main(int argc, char *argv[]) { int ch, nr_cmd = 0, nr_arg = 0; - const char *command = basename(argv[0]); char *name = NULL, *nmr_config = NULL; + int nr_arg2 = 0; - if (argc > 5) { -usage: - fprintf(stderr, - "Usage:\n" - "%s arguments\n" - "\t-g interface interface name to get info\n" - "\t-d interface interface name to be detached\n" - "\t-a interface interface name to be attached\n" - "\t-h interface interface name to be attached with the host stack\n" - "\t-n interface interface name to be created\n" - "\t-r interface interface name to be deleted\n" - "\t-l list all or specified bridge's interfaces (default)\n" - "\t-C string ring/slot setting of an interface creating by -n\n" - "\t-p interface start polling. Additional -C x,y,z configures\n" - "\t\t x: 0 (REG_ALL_NIC) or 1 (REG_ONE_NIC),\n" - "\t\t y: CPU core id for ALL_NIC and core/ring for ONE_NIC\n" - "\t\t z: (ONE_NIC only) num of total cores/rings\n" - "\t-P interface stop polling\n" - "", command); - return 0; - } - - while ((ch = getopt(argc, argv, "d:a:h:g:l:n:r:C:p:P:")) != -1) { - if (ch != 'C') + while ((ch = getopt(argc, argv, "d:a:h:g:l:n:r:C:p:P:m:")) != -1) { + if (ch != 'C' && ch != 'm') name = optarg; /* default */ switch (ch) { default: fprintf(stderr, "bad option %c %s", ch, optarg); - goto usage; + usage(-1); + break; case 'd': nr_cmd = NETMAP_BDG_DETACH; break; @@ -252,8 +255,6 @@ usage: break; case 'l': nr_cmd = NETMAP_BDG_LIST; - if (optind < argc && argv[optind][0] == '-') - name = NULL; break; case 'C': nmr_config = strdup(optarg); @@ -264,13 +265,18 @@ usage: case 'P': nr_cmd = NETMAP_BDG_POLLING_OFF; break; + case 'm': + nr_arg2 = atoi(optarg); + break; } } if (optind != argc) { // fprintf(stderr, "optind %d argc %d\n", optind, argc); - goto usage; + usage(-1); } - if (argc == 1) + if (argc == 1) { nr_cmd = NETMAP_BDG_LIST; - return bdg_ctl(name, nr_cmd, nr_arg, nmr_config) ? 1 : 0; + name = NULL; + } + return bdg_ctl(name, nr_cmd, nr_arg, nmr_config, nr_arg2) ? 1 : 0; } From owner-svn-src-all@freebsd.org Tue Oct 30 14:44:14 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 14:54:16 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 15:11:35 2018 Return-Path: Delivered-To: svn-src-all@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 3573410EB276; Tue, 30 Oct 2018 15:11:35 +0000 (UTC) (envelope-from delphij@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 DF1766A96B; Tue, 30 Oct 2018 15:11:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7C091F18B; Tue, 30 Oct 2018 15:11:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9UFBY02008297; Tue, 30 Oct 2018 15:11:34 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UFBYEq008296; Tue, 30 Oct 2018 15:11:34 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201810301511.w9UFBYEq008296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 30 Oct 2018 15:11:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339918 - stable/12/sys/geom/eli X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/12/sys/geom/eli X-SVN-Commit-Revision: 339918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 15:11:35 -0000 Author: delphij Date: Tue Oct 30 15:11:34 2018 New Revision: 339918 URL: https://svnweb.freebsd.org/changeset/base/339918 Log: Restore backward compatibility for "attach" verb. In r332361 and r333439, two new parameters were added to geli attach verb using gctl_get_paraml, which requires the value to be present. This would prevent old geli(8) binary from attaching geli(4) device as they have no knowledge about the new parameters. Restore backward compatibility by treating the absense of these two values as seeing the default value supplied by userland. PR: 232595 Reviewed by: oshogbo Approved by: re (rgrimes) Modified: stable/12/sys/geom/eli/g_eli_ctl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/geom/eli/g_eli_ctl.c ============================================================================== --- stable/12/sys/geom/eli/g_eli_ctl.c Tue Oct 30 14:54:15 2018 (r339917) +++ stable/12/sys/geom/eli/g_eli_ctl.c Tue Oct 30 15:11:34 2018 (r339918) @@ -59,8 +59,8 @@ g_eli_ctl_attach(struct gctl_req *req, struct g_class struct g_provider *pp; const char *name; u_char *key, mkey[G_ELI_DATAIVKEYLEN]; - int *nargs, *detach, *readonly, *dryrun; - int keysize, error, nkey; + int *nargs, *detach, *readonly, *dryrunp; + int keysize, error, nkey, dryrun, dummy; intmax_t *valp; g_topology_assert(); @@ -81,12 +81,14 @@ g_eli_ctl_attach(struct gctl_req *req, struct g_class return; } - valp = gctl_get_paraml(req, "keyno", sizeof(*valp)); - if (valp == NULL) { - gctl_error(req, "No '%s' argument.", "keyno"); - return; + /* "keyno" is optional for backward compatibility */ + nkey = -1; + valp = gctl_get_param(req, "keyno", &dummy); + if (valp != NULL) { + valp = gctl_get_paraml(req, "keyno", sizeof(*valp)); + if (valp != NULL) + nkey = *valp; } - nkey = *valp; if (nkey < -1 || nkey >= G_ELI_MAXMKEYS) { gctl_error(req, "Invalid '%s' argument.", "keyno"); return; @@ -98,10 +100,13 @@ g_eli_ctl_attach(struct gctl_req *req, struct g_class return; } - dryrun = gctl_get_paraml(req, "dryrun", sizeof(*dryrun)); - if (dryrun == NULL) { - gctl_error(req, "No '%s' argument.", "dryrun"); - return; + /* "dryrun" is optional for backward compatibility */ + dryrun = 0; + dryrunp = gctl_get_param(req, "dryrun", &dummy); + if (dryrunp != NULL) { + dryrunp = gctl_get_paraml(req, "dryrun", sizeof(*dryrunp)); + if (dryrunp != NULL) + dryrun = *dryrunp; } if (*detach && *readonly) { @@ -161,7 +166,7 @@ g_eli_ctl_attach(struct gctl_req *req, struct g_class md.md_flags |= G_ELI_FLAG_WO_DETACH; if (*readonly) md.md_flags |= G_ELI_FLAG_RO; - if (!*dryrun) + if (!dryrun) g_eli_create(req, mp, pp, &md, mkey, nkey); explicit_bzero(mkey, sizeof(mkey)); explicit_bzero(&md, sizeof(md)); From owner-svn-src-all@freebsd.org Tue Oct 30 15:33:00 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 15:39:35 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 15:43:07 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 15:44:17 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 15:46:31 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 15:51:13 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 15:55:11 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 16:03:40 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 16:23:11 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 16:32:53 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 16:40:33 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 16:42:58 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 17:31:47 2018 Return-Path: Delivered-To: svn-src-all@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 C9EC210EF3F6 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 4C3BA70F1A 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 17:57:42 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 18:04:04 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 18:20:35 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 18:26:40 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 19:10:42 2018 Return-Path: Delivered-To: svn-src-all@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 6A6C110F1A80; Tue, 30 Oct 2018 19:10:42 +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 200CD75050; Tue, 30 Oct 2018 19:10:42 +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 012232181B; Tue, 30 Oct 2018 19:10:42 +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 w9UJAfA0030116; Tue, 30 Oct 2018 19:10:41 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UJAfxJ030114; Tue, 30 Oct 2018 19:10:41 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201810301910.w9UJAfxJ030114@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 19:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339928 - stable/11/sys/x86/isa X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/sys/x86/isa X-SVN-Commit-Revision: 339928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 19:10:42 -0000 Author: jhb Date: Tue Oct 30 19:10:41 2018 New Revision: 339928 URL: https://svnweb.freebsd.org/changeset/base/339928 Log: MFC 338148: Remove 'imen' global variable from atpic(4). In pre-SMPng, the global 'imen' was used to track mask state of the hardware interrupts and was aligned to the masks used by spl*(). When the atpic code was converted to using the x86 interrupt source abstraction, the global 'imen' was preserved by having each PIC instance point to an individual byte in the global 'imen' to hold its 8-bit interrupt mask. The global 'imen' is no longer used for anything however, so rather than storing pointers in 'struct atpic', just store the individual 8-bit mask for each PIC as a char. While here, convert the ATPIC macro to using C99 initializers. Modified: stable/11/sys/x86/isa/atpic.c stable/11/sys/x86/isa/icu.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/isa/atpic.c ============================================================================== --- stable/11/sys/x86/isa/atpic.c Tue Oct 30 18:26:34 2018 (r339927) +++ stable/11/sys/x86/isa/atpic.c Tue Oct 30 19:10:41 2018 (r339928) @@ -73,12 +73,12 @@ __FBSDID("$FreeBSD$"); #define MASTER 0 #define SLAVE 1 +#define IMEN_MASK(ai) (IRQ_MASK((ai)->at_irq)) + #define NUM_ISA_IRQS 16 static void atpic_init(void *dummy); -unsigned int imen; /* XXX */ - inthand_t IDTVEC(atpic_intr0), IDTVEC(atpic_intr1), IDTVEC(atpic_intr2), IDTVEC(atpic_intr3), IDTVEC(atpic_intr4), IDTVEC(atpic_intr5), @@ -99,12 +99,24 @@ inthand_t #define IRQ(ap, ai) ((ap)->at_irqbase + (ai)->at_irq) -#define ATPIC(io, base, eoi, imenptr) \ - { { atpic_enable_source, atpic_disable_source, (eoi), \ - atpic_enable_intr, atpic_disable_intr, atpic_vector, \ - atpic_source_pending, NULL, atpic_resume, atpic_config_intr,\ - atpic_assign_cpu }, (io), (base), IDT_IO_INTS + (base), \ - (imenptr) } +#define ATPIC(io, base, eoi) { \ + .at_pic = { \ + .pic_enable_source = atpic_enable_source, \ + .pic_disable_source = atpic_disable_source, \ + .pic_eoi_source = (eoi), \ + .pic_enable_intr = atpic_enable_intr, \ + .pic_disable_intr = atpic_disable_intr, \ + .pic_vector = atpic_vector, \ + .pic_source_pending = atpic_source_pending, \ + .pic_resume = atpic_resume, \ + .pic_config_intr = atpic_config_intr, \ + .pic_assign_cpu = atpic_assign_cpu \ + }, \ + .at_ioaddr = (io), \ + .at_irqbase = (base), \ + .at_intbase = IDT_IO_INTS + (base), \ + .at_imen = 0xff, \ + } #define INTSRC(irq) \ { { &atpics[(irq) / 8].at_pic }, IDTVEC(atpic_intr ## irq ), \ @@ -115,7 +127,7 @@ struct atpic { int at_ioaddr; int at_irqbase; uint8_t at_intbase; - uint8_t *at_imen; + uint8_t at_imen; }; struct atpic_intsrc { @@ -142,8 +154,8 @@ static int atpic_assign_cpu(struct intsrc *isrc, u_int static void i8259_init(struct atpic *pic, int slave); static struct atpic atpics[] = { - ATPIC(IO_ICU1, 0, atpic_eoi_master, (uint8_t *)&imen), - ATPIC(IO_ICU2, 8, atpic_eoi_slave, ((uint8_t *)&imen) + 1) + ATPIC(IO_ICU1, 0, atpic_eoi_master), + ATPIC(IO_ICU2, 8, atpic_eoi_slave) }; static struct atpic_intsrc atintrs[] = { @@ -203,9 +215,9 @@ atpic_enable_source(struct intsrc *isrc) struct atpic *ap = (struct atpic *)isrc->is_pic; spinlock_enter(); - if (*ap->at_imen & IMEN_MASK(ai)) { - *ap->at_imen &= ~IMEN_MASK(ai); - outb(ap->at_ioaddr + ICU_IMR_OFFSET, *ap->at_imen); + if (ap->at_imen & IMEN_MASK(ai)) { + ap->at_imen &= ~IMEN_MASK(ai); + outb(ap->at_ioaddr + ICU_IMR_OFFSET, ap->at_imen); } spinlock_exit(); } @@ -218,8 +230,8 @@ atpic_disable_source(struct intsrc *isrc, int eoi) spinlock_enter(); if (ai->at_trigger != INTR_TRIGGER_EDGE) { - *ap->at_imen |= IMEN_MASK(ai); - outb(ap->at_ioaddr + ICU_IMR_OFFSET, *ap->at_imen); + ap->at_imen |= IMEN_MASK(ai); + outb(ap->at_ioaddr + ICU_IMR_OFFSET, ap->at_imen); } /* @@ -413,7 +425,7 @@ i8259_init(struct atpic *pic, int slave) outb(imr_addr, MASTER_MODE); /* Set interrupt enable mask. */ - outb(imr_addr, *pic->at_imen); + outb(imr_addr, pic->at_imen); /* Reset is finished, default to IRR on read. */ outb(pic->at_ioaddr, OCW3_SEL | OCW3_RR); @@ -433,7 +445,6 @@ atpic_startup(void) int i; /* Start off with all interrupts disabled. */ - imen = 0xffff; i8259_init(&atpics[MASTER], 0); i8259_init(&atpics[SLAVE], 1); atpic_enable_source((struct intsrc *)&atintrs[ICU_SLAVEID]); Modified: stable/11/sys/x86/isa/icu.h ============================================================================== --- stable/11/sys/x86/isa/icu.h Tue Oct 30 18:26:34 2018 (r339927) +++ stable/11/sys/x86/isa/icu.h Tue Oct 30 19:10:41 2018 (r339928) @@ -87,7 +87,6 @@ #endif #define IRQ_MASK(irq) (1 << (irq)) -#define IMEN_MASK(ai) (IRQ_MASK((ai)->at_irq)) void atpic_handle_intr(u_int vector, struct trapframe *frame); void atpic_startup(void); From owner-svn-src-all@freebsd.org Tue Oct 30 20:08:52 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 20:45:16 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 20:51:04 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 21:31:33 2018 Return-Path: Delivered-To: svn-src-all@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 8763510F534D; Tue, 30 Oct 2018 21:31:33 +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 3CDF67B600; Tue, 30 Oct 2018 21:31:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DF9623030; Tue, 30 Oct 2018 21:31:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9ULVWYe005791; Tue, 30 Oct 2018 21:31:32 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9ULVWlT005790; Tue, 30 Oct 2018 21:31:32 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201810302131.w9ULVWlT005790@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 21:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r339932 - in stable: 10/sys/dev/pci 11/sys/dev/pci X-SVN-Group: stable-10 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/dev/pci 11/sys/dev/pci X-SVN-Commit-Revision: 339932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 21:31:33 -0000 Author: jhb Date: Tue Oct 30 21:31:32 2018 New Revision: 339932 URL: https://svnweb.freebsd.org/changeset/base/339932 Log: MFC 338408: Don't directly dereference a user pointer in the VPD ioctl. The PCIOCLISTVPD ioctl on /dev/pci is used to fetch a list of VPD key-value pairs for a specific PCI function. It is used by 'pciconf -l -V'. The list is stored in a userland-supplied buffer as an array of variable-length structures where the key and data length are stored in a fixed-size header followed by the variable-length value as a byte array. To facilitate walking this array in userland, provides a PVE_NEXT() helper macro to return a pointer to the next array element by reading the the length out of the current header and using it to compute the address of the next header. To simplify the implementation, the ioctl handler was also using PVE_NEXT() when on the user address of the user buffer to compute the user address of the next array element. However, the PVE_NEXT() macro when used with a user address was reading the value's length by indirecting the user pointer. The value was ready after the current record had been copied out to the user buffer, so it appeared to work on architectures where user addresses are directly dereferencable from the kernel (all but powerpc and i386 after the 4:4 split). The recent enablement of SMAP on amd64 caught this violation however. To fix, add a variant of PVE_NEXT() for use in the ioctl handler that takes an explicit value length. Modified: stable/10/sys/dev/pci/pci_user.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/pci/pci_user.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/dev/pci/pci_user.c ============================================================================== --- stable/10/sys/dev/pci/pci_user.c Tue Oct 30 20:51:03 2018 (r339931) +++ stable/10/sys/dev/pci/pci_user.c Tue Oct 30 21:31:32 2018 (r339932) @@ -406,6 +406,14 @@ pci_conf_match_old32(struct pci_match_conf_old32 *matc #endif /* COMPAT_FREEBSD32 */ #endif /* PRE7_COMPAT */ +/* + * Like PVE_NEXT but takes an explicit length since 'pve' is a user + * pointer that cannot be dereferenced. + */ +#define PVE_NEXT_LEN(pve, datalen) \ + ((struct pci_vpd_element *)((char *)(pve) + \ + sizeof(struct pci_vpd_element) + (datalen))) + static int pci_list_vpd(device_t dev, struct pci_list_vpd_io *lvio) { @@ -454,7 +462,7 @@ pci_list_vpd(device_t dev, struct pci_list_vpd_io *lvi strlen(vpd->vpd_ident)); if (error) return (error); - vpd_user = PVE_NEXT(vpd_user); + vpd_user = PVE_NEXT_LEN(vpd_user, vpd_element.pve_datalen); vpd_element.pve_flags = 0; for (i = 0; i < vpd->vpd_rocnt; i++) { vpd_element.pve_keyword[0] = vpd->vpd_ros[i].keyword[0]; @@ -467,7 +475,7 @@ pci_list_vpd(device_t dev, struct pci_list_vpd_io *lvi vpd->vpd_ros[i].len); if (error) return (error); - vpd_user = PVE_NEXT(vpd_user); + vpd_user = PVE_NEXT_LEN(vpd_user, vpd_element.pve_datalen); } vpd_element.pve_flags = PVE_FLAG_RW; for (i = 0; i < vpd->vpd_wcnt; i++) { @@ -481,7 +489,7 @@ pci_list_vpd(device_t dev, struct pci_list_vpd_io *lvi vpd->vpd_w[i].len); if (error) return (error); - vpd_user = PVE_NEXT(vpd_user); + vpd_user = PVE_NEXT_LEN(vpd_user, vpd_element.pve_datalen); } KASSERT((char *)vpd_user - (char *)lvio->plvi_data == len, ("length mismatch")); From owner-svn-src-all@freebsd.org Tue Oct 30 21:31:34 2018 Return-Path: Delivered-To: svn-src-all@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 ECE2510F5353; Tue, 30 Oct 2018 21:31:33 +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 790B17B602; Tue, 30 Oct 2018 21:31:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A33823031; Tue, 30 Oct 2018 21:31:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9ULVXEL005797; Tue, 30 Oct 2018 21:31:33 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9ULVXjk005796; Tue, 30 Oct 2018 21:31:33 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201810302131.w9ULVXjk005796@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 21:31:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339932 - in stable: 10/sys/dev/pci 11/sys/dev/pci X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/dev/pci 11/sys/dev/pci X-SVN-Commit-Revision: 339932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 21:31:34 -0000 Author: jhb Date: Tue Oct 30 21:31:32 2018 New Revision: 339932 URL: https://svnweb.freebsd.org/changeset/base/339932 Log: MFC 338408: Don't directly dereference a user pointer in the VPD ioctl. The PCIOCLISTVPD ioctl on /dev/pci is used to fetch a list of VPD key-value pairs for a specific PCI function. It is used by 'pciconf -l -V'. The list is stored in a userland-supplied buffer as an array of variable-length structures where the key and data length are stored in a fixed-size header followed by the variable-length value as a byte array. To facilitate walking this array in userland, provides a PVE_NEXT() helper macro to return a pointer to the next array element by reading the the length out of the current header and using it to compute the address of the next header. To simplify the implementation, the ioctl handler was also using PVE_NEXT() when on the user address of the user buffer to compute the user address of the next array element. However, the PVE_NEXT() macro when used with a user address was reading the value's length by indirecting the user pointer. The value was ready after the current record had been copied out to the user buffer, so it appeared to work on architectures where user addresses are directly dereferencable from the kernel (all but powerpc and i386 after the 4:4 split). The recent enablement of SMAP on amd64 caught this violation however. To fix, add a variant of PVE_NEXT() for use in the ioctl handler that takes an explicit value length. Modified: stable/11/sys/dev/pci/pci_user.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/pci/pci_user.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/dev/pci/pci_user.c ============================================================================== --- stable/11/sys/dev/pci/pci_user.c Tue Oct 30 20:51:03 2018 (r339931) +++ stable/11/sys/dev/pci/pci_user.c Tue Oct 30 21:31:32 2018 (r339932) @@ -406,6 +406,14 @@ pci_conf_match_old32(struct pci_match_conf_old32 *matc #endif /* COMPAT_FREEBSD32 */ #endif /* PRE7_COMPAT */ +/* + * Like PVE_NEXT but takes an explicit length since 'pve' is a user + * pointer that cannot be dereferenced. + */ +#define PVE_NEXT_LEN(pve, datalen) \ + ((struct pci_vpd_element *)((char *)(pve) + \ + sizeof(struct pci_vpd_element) + (datalen))) + static int pci_list_vpd(device_t dev, struct pci_list_vpd_io *lvio) { @@ -454,7 +462,7 @@ pci_list_vpd(device_t dev, struct pci_list_vpd_io *lvi strlen(vpd->vpd_ident)); if (error) return (error); - vpd_user = PVE_NEXT(vpd_user); + vpd_user = PVE_NEXT_LEN(vpd_user, vpd_element.pve_datalen); vpd_element.pve_flags = 0; for (i = 0; i < vpd->vpd_rocnt; i++) { vpd_element.pve_keyword[0] = vpd->vpd_ros[i].keyword[0]; @@ -467,7 +475,7 @@ pci_list_vpd(device_t dev, struct pci_list_vpd_io *lvi vpd->vpd_ros[i].len); if (error) return (error); - vpd_user = PVE_NEXT(vpd_user); + vpd_user = PVE_NEXT_LEN(vpd_user, vpd_element.pve_datalen); } vpd_element.pve_flags = PVE_FLAG_RW; for (i = 0; i < vpd->vpd_wcnt; i++) { @@ -481,7 +489,7 @@ pci_list_vpd(device_t dev, struct pci_list_vpd_io *lvi vpd->vpd_w[i].len); if (error) return (error); - vpd_user = PVE_NEXT(vpd_user); + vpd_user = PVE_NEXT_LEN(vpd_user, vpd_element.pve_datalen); } KASSERT((char *)vpd_user - (char *)lvio->plvi_data == len, ("length mismatch")); From owner-svn-src-all@freebsd.org Tue Oct 30 21:35:57 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 22:40:41 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Oct 30 23:09:05 2018 Return-Path: Delivered-To: svn-src-all@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 694B31037167; Tue, 30 Oct 2018 23:09:05 +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 1F7D47F34E; Tue, 30 Oct 2018 23:09:05 +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 F05C124051; Tue, 30 Oct 2018 23:09:04 +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 w9UN94lv054039; Tue, 30 Oct 2018 23:09:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UN94jg054038; Tue, 30 Oct 2018 23:09:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810302309.w9UN94jg054038@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 23:09:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339935 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 339935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 23:09:05 -0000 Author: markj Date: Tue Oct 30 23:09:04 2018 New Revision: 339935 URL: https://svnweb.freebsd.org/changeset/base/339935 Log: MFC r339934: Revert r336984. Approved by: re (kib) Modified: stable/12/sys/vm/vm_object.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_object.c ============================================================================== --- stable/12/sys/vm/vm_object.c Tue Oct 30 22:40:40 2018 (r339934) +++ stable/12/sys/vm/vm_object.c Tue Oct 30 23:09:04 2018 (r339935) @@ -2142,9 +2142,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-all@freebsd.org Wed Oct 31 01:27:45 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 01:57:54 2018 Return-Path: Delivered-To: svn-src-all@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 F2BC4107251B; Wed, 31 Oct 2018 01:57:53 +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 A5A3F84DCB; Wed, 31 Oct 2018 01:57:53 +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 8697825C3B; Wed, 31 Oct 2018 01:57:53 +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 w9V1vrig040855; Wed, 31 Oct 2018 01:57:53 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9V1vp4S040847; Wed, 31 Oct 2018 01:57:51 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201810310157.w9V1vp4S040847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Wed, 31 Oct 2018 01:57:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339937 - stable/12/contrib/tzdata X-SVN-Group: stable-12 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/12/contrib/tzdata X-SVN-Commit-Revision: 339937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 01:57:54 -0000 Author: philip Date: Wed Oct 31 01:57:51 2018 New Revision: 339937 URL: https://svnweb.freebsd.org/changeset/base/339937 Log: MFC r339848: mport tzdata 2018g Approved by: re (kib) Modified: stable/12/contrib/tzdata/NEWS stable/12/contrib/tzdata/africa stable/12/contrib/tzdata/europe stable/12/contrib/tzdata/northamerica stable/12/contrib/tzdata/theory.html stable/12/contrib/tzdata/version stable/12/contrib/tzdata/ziguard.awk stable/12/contrib/tzdata/zishrink.awk Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/tzdata/NEWS ============================================================================== --- stable/12/contrib/tzdata/NEWS Wed Oct 31 01:27:44 2018 (r339936) +++ stable/12/contrib/tzdata/NEWS Wed Oct 31 01:57:51 2018 (r339937) @@ -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: stable/12/contrib/tzdata/africa ============================================================================== --- stable/12/contrib/tzdata/africa Wed Oct 31 01:27:44 2018 (r339936) +++ stable/12/contrib/tzdata/africa Wed Oct 31 01:57:51 2018 (r339937) @@ -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: stable/12/contrib/tzdata/europe ============================================================================== --- stable/12/contrib/tzdata/europe Wed Oct 31 01:27:44 2018 (r339936) +++ stable/12/contrib/tzdata/europe Wed Oct 31 01:57:51 2018 (r339937) @@ -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: stable/12/contrib/tzdata/northamerica ============================================================================== --- stable/12/contrib/tzdata/northamerica Wed Oct 31 01:27:44 2018 (r339936) +++ stable/12/contrib/tzdata/northamerica Wed Oct 31 01:57:51 2018 (r339937) @@ -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: stable/12/contrib/tzdata/theory.html ============================================================================== --- stable/12/contrib/tzdata/theory.html Wed Oct 31 01:27:44 2018 (r339936) +++ stable/12/contrib/tzdata/theory.html Wed Oct 31 01:57:51 2018 (r339937) @@ -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: stable/12/contrib/tzdata/version ============================================================================== --- stable/12/contrib/tzdata/version Wed Oct 31 01:27:44 2018 (r339936) +++ stable/12/contrib/tzdata/version Wed Oct 31 01:57:51 2018 (r339937) @@ -1 +1 @@ -2018f +2018g Modified: stable/12/contrib/tzdata/ziguard.awk ============================================================================== --- stable/12/contrib/tzdata/ziguard.awk Wed Oct 31 01:27:44 2018 (r339936) +++ stable/12/contrib/tzdata/ziguard.awk Wed Oct 31 01:57:51 2018 (r339937) @@ -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: stable/12/contrib/tzdata/zishrink.awk ============================================================================== --- stable/12/contrib/tzdata/zishrink.awk Wed Oct 31 01:27:44 2018 (r339936) +++ stable/12/contrib/tzdata/zishrink.awk Wed Oct 31 01:57:51 2018 (r339937) @@ -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-all@freebsd.org Wed Oct 31 02:01:31 2018 Return-Path: Delivered-To: svn-src-all@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 2024310727D5; Wed, 31 Oct 2018 02:01:31 +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 CA462850F0; Wed, 31 Oct 2018 02:01:30 +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 AB4FF25C8E; Wed, 31 Oct 2018 02:01:30 +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 w9V21UO5045897; Wed, 31 Oct 2018 02:01:30 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9V21Sks045889; Wed, 31 Oct 2018 02:01:28 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201810310201.w9V21Sks045889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Wed, 31 Oct 2018 02:01:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339938 - stable/11/contrib/tzdata X-SVN-Group: stable-11 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/11/contrib/tzdata X-SVN-Commit-Revision: 339938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 02:01:31 -0000 Author: philip Date: Wed Oct 31 02:01:28 2018 New Revision: 339938 URL: https://svnweb.freebsd.org/changeset/base/339938 Log: MFC r339848: Import tzdata 2018g Modified: stable/11/contrib/tzdata/NEWS stable/11/contrib/tzdata/africa stable/11/contrib/tzdata/europe stable/11/contrib/tzdata/northamerica stable/11/contrib/tzdata/theory.html stable/11/contrib/tzdata/version stable/11/contrib/tzdata/ziguard.awk stable/11/contrib/tzdata/zishrink.awk Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tzdata/NEWS ============================================================================== --- stable/11/contrib/tzdata/NEWS Wed Oct 31 01:57:51 2018 (r339937) +++ stable/11/contrib/tzdata/NEWS Wed Oct 31 02:01:28 2018 (r339938) @@ -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: stable/11/contrib/tzdata/africa ============================================================================== --- stable/11/contrib/tzdata/africa Wed Oct 31 01:57:51 2018 (r339937) +++ stable/11/contrib/tzdata/africa Wed Oct 31 02:01:28 2018 (r339938) @@ -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: stable/11/contrib/tzdata/europe ============================================================================== --- stable/11/contrib/tzdata/europe Wed Oct 31 01:57:51 2018 (r339937) +++ stable/11/contrib/tzdata/europe Wed Oct 31 02:01:28 2018 (r339938) @@ -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: stable/11/contrib/tzdata/northamerica ============================================================================== --- stable/11/contrib/tzdata/northamerica Wed Oct 31 01:57:51 2018 (r339937) +++ stable/11/contrib/tzdata/northamerica Wed Oct 31 02:01:28 2018 (r339938) @@ -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: stable/11/contrib/tzdata/theory.html ============================================================================== --- stable/11/contrib/tzdata/theory.html Wed Oct 31 01:57:51 2018 (r339937) +++ stable/11/contrib/tzdata/theory.html Wed Oct 31 02:01:28 2018 (r339938) @@ -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: stable/11/contrib/tzdata/version ============================================================================== --- stable/11/contrib/tzdata/version Wed Oct 31 01:57:51 2018 (r339937) +++ stable/11/contrib/tzdata/version Wed Oct 31 02:01:28 2018 (r339938) @@ -1 +1 @@ -2018f +2018g Modified: stable/11/contrib/tzdata/ziguard.awk ============================================================================== --- stable/11/contrib/tzdata/ziguard.awk Wed Oct 31 01:57:51 2018 (r339937) +++ stable/11/contrib/tzdata/ziguard.awk Wed Oct 31 02:01:28 2018 (r339938) @@ -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: stable/11/contrib/tzdata/zishrink.awk ============================================================================== --- stable/11/contrib/tzdata/zishrink.awk Wed Oct 31 01:57:51 2018 (r339937) +++ stable/11/contrib/tzdata/zishrink.awk Wed Oct 31 02:01:28 2018 (r339938) @@ -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-all@freebsd.org Wed Oct 31 02:02:14 2018 Return-Path: Delivered-To: svn-src-all@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 B0FEA1072837; Wed, 31 Oct 2018 02:02:14 +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 65BBD8539C; Wed, 31 Oct 2018 02:02:14 +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 478A325CC0; Wed, 31 Oct 2018 02:02:14 +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 w9V22EKv045995; Wed, 31 Oct 2018 02:02:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9V22C20045988; Wed, 31 Oct 2018 02:02:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810310202.w9V22C20045988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 31 Oct 2018 02:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339939 - in stable/12: share/man/man9 sys/kern sys/sys sys/vm sys/x86/acpica X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: share/man/man9 sys/kern sys/sys sys/vm sys/x86/acpica X-SVN-Commit-Revision: 339939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 02:02:15 -0000 Author: markj Date: Wed Oct 31 02:02:12 2018 New Revision: 339939 URL: https://svnweb.freebsd.org/changeset/base/339939 Log: MFC r339452, r339664: Create some global domainsets and refactor NUMA registration. Approved by: re (kib) Modified: stable/12/share/man/man9/domainset.9 stable/12/sys/kern/kern_cpuset.c stable/12/sys/sys/domainset.h stable/12/sys/vm/vm_init.c stable/12/sys/vm/vm_phys.c stable/12/sys/vm/vm_phys.h stable/12/sys/x86/acpica/srat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/domainset.9 ============================================================================== --- stable/12/share/man/man9/domainset.9 Wed Oct 31 02:01:28 2018 (r339938) +++ stable/12/share/man/man9/domainset.9 Wed Oct 31 02:02:12 2018 (r339939) @@ -24,14 +24,11 @@ .\" .\" $FreeBSD$ .\" -.Dd March 24, 2018 +.Dd October 20, 2018 .Dt DOMAINSET 9 .Os .Sh NAME .Nm domainset(9) -\(em -.Nm domainset_create , -.Nm sysctl_handle_domainset . .Nd domainset functions and operation .Sh SYNOPSIS .In sys/_domainset.h @@ -46,6 +43,8 @@ struct domainset { }; .Ed .Pp +.Fn DOMAINSET_RR +.Fn DOMAINSET_PREF domain .Ft struct domainset * .Fn domainset_create "const struct domainset *key" .Ft int @@ -98,6 +97,12 @@ This gives good distribution among memory domains whil efficiency higher and is preferential to round-robin for general use. .El .Pp +The +.Fn DOMAINSET_RR +and +.Fn DOMAINSET_PREF +provide pointers to global pre-defined policies for use when the +desired policy is known at compile time. The .Fn domainset_create function takes a partially filled in domainset as a key and returns a Modified: stable/12/sys/kern/kern_cpuset.c ============================================================================== --- stable/12/sys/kern/kern_cpuset.c Wed Oct 31 02:01:28 2018 (r339938) +++ stable/12/sys/kern/kern_cpuset.c Wed Oct 31 02:02:12 2018 (r339939) @@ -119,6 +119,8 @@ __FBSDID("$FreeBSD$"); */ LIST_HEAD(domainlist, domainset); +struct domainset __read_mostly domainset_prefer[MAXMEMDOM]; +struct domainset __read_mostly domainset_roundrobin; static uma_zone_t cpuset_zone; static uma_zone_t domainset_zone; @@ -1369,28 +1371,53 @@ cpuset_setithread(lwpid_t id, int cpu) } /* + * Initialize static domainsets after NUMA information is available. This is + * called very early during boot. + */ +void +domainset_init(void) +{ + struct domainset *dset; + int i; + + dset = &domainset_roundrobin; + DOMAINSET_COPY(&all_domains, &dset->ds_mask); + dset->ds_policy = DOMAINSET_POLICY_ROUNDROBIN; + dset->ds_prefer = -1; + _domainset_create(dset, NULL); + + for (i = 0; i < vm_ndomains; i++) { + dset = &domainset_prefer[i]; + DOMAINSET_COPY(&all_domains, &dset->ds_mask); + dset->ds_policy = DOMAINSET_POLICY_PREFER; + dset->ds_prefer = i; + _domainset_create(dset, NULL); + } +} + +/* * Create the domainset for cpuset 0, 1 and cpuset 2. */ void domainset_zero(void) { struct domainset *dset; - int i; mtx_init(&cpuset_lock, "cpuset", NULL, MTX_SPIN | MTX_RECURSE); dset = &domainset0; - DOMAINSET_ZERO(&dset->ds_mask); - for (i = 0; i < vm_ndomains; i++) - DOMAINSET_SET(i, &dset->ds_mask); + DOMAINSET_COPY(&all_domains, &dset->ds_mask); dset->ds_policy = DOMAINSET_POLICY_FIRSTTOUCH; dset->ds_prefer = -1; - (void)domainset_empty_vm(dset); curthread->td_domain.dr_policy = _domainset_create(dset, NULL); domainset_copy(dset, &domainset2); domainset2.ds_policy = DOMAINSET_POLICY_INTERLEAVE; 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); } /* Modified: stable/12/sys/sys/domainset.h ============================================================================== --- stable/12/sys/sys/domainset.h Wed Oct 31 02:01:28 2018 (r339938) +++ stable/12/sys/sys/domainset.h Wed Oct 31 02:02:12 2018 (r339939) @@ -32,8 +32,8 @@ #define _SYS_DOMAINSET_H_ #include - #include +#include #define _NDOMAINSETBITS _BITSET_BITS #define _NDOMAINSETWORDS __bitset_words(DOMAINSET_SETSIZE) @@ -96,6 +96,12 @@ struct domainset { domainid_t ds_order[MAXMEMDOM]; /* nth domain table. */ }; +extern struct domainset domainset_prefer[MAXMEMDOM]; +#define DOMAINSET_PREF(domain) (&domainset_prefer[(domain)]) +extern struct domainset domainset_roundrobin; +#define DOMAINSET_RR() (&domainset_roundrobin) + +void domainset_init(void); void domainset_zero(void); /* Modified: stable/12/sys/vm/vm_init.c ============================================================================== --- stable/12/sys/vm/vm_init.c Wed Oct 31 02:01:28 2018 (r339938) +++ stable/12/sys/vm/vm_init.c Wed Oct 31 02:02:12 2018 (r339939) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -115,6 +116,11 @@ SYSINIT(vm_mem, SI_SUB_VM, SI_ORDER_FIRST, vm_mem_init static void vm_mem_init(void *dummy) { + + /* + * Initialize static domainsets, used by various allocators. + */ + domainset_init(); /* * Initializes resident memory structures. From here on, all physical Modified: stable/12/sys/vm/vm_phys.c ============================================================================== --- stable/12/sys/vm/vm_phys.c Wed Oct 31 02:01:28 2018 (r339938) +++ stable/12/sys/vm/vm_phys.c Wed Oct 31 02:02:12 2018 (r339939) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -584,6 +585,31 @@ vm_phys_init(void) } rw_init(&vm_phys_fictitious_reg_lock, "vmfctr"); +} + +/* + * Register info about the NUMA topology of the system. + * + * Invoked by platform-dependent code prior to vm_phys_init(). + */ +void +vm_phys_register_domains(int ndomains, struct mem_affinity *affinity, + int *locality) +{ +#ifdef NUMA + int i; + + vm_ndomains = ndomains; + mem_affinity = affinity; + mem_locality = locality; + + for (i = 0; i < vm_ndomains; i++) + DOMAINSET_SET(i, &all_domains); +#else + (void)ndomains; + (void)affinity; + (void)locality; +#endif } /* Modified: stable/12/sys/vm/vm_phys.h ============================================================================== --- stable/12/sys/vm/vm_phys.h Wed Oct 31 02:01:28 2018 (r339938) +++ stable/12/sys/vm/vm_phys.h Wed Oct 31 02:02:12 2018 (r339939) @@ -88,6 +88,8 @@ void vm_phys_free_contig(vm_page_t m, u_long npages); void vm_phys_free_pages(vm_page_t m, int order); void vm_phys_init(void); vm_page_t vm_phys_paddr_to_vm_page(vm_paddr_t pa); +void vm_phys_register_domains(int ndomains, struct mem_affinity *affinity, + int *locality); vm_page_t vm_phys_scan_contig(int domain, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, int options); void vm_phys_set_pool(int pool, vm_page_t m, int order); Modified: stable/12/sys/x86/acpica/srat.c ============================================================================== --- stable/12/sys/x86/acpica/srat.c Wed Oct 31 02:01:28 2018 (r339938) +++ stable/12/sys/x86/acpica/srat.c Wed Oct 31 02:02:12 2018 (r339939) @@ -153,10 +153,6 @@ parse_slit(void) acpi_unmap_table(slit); slit = NULL; -#ifdef NUMA - /* Tell the VM about it! */ - mem_locality = vm_locality_table; -#endif return (0); } @@ -481,13 +477,6 @@ parse_srat(void) return (-1); } -#ifdef NUMA - vm_ndomains = ndomain; - for (int i = 0; i < vm_ndomains; i++) - DOMAINSET_SET(i, &all_domains); - mem_affinity = mem_info; -#endif - return (0); } @@ -511,7 +500,8 @@ parse_acpi_tables(void *dummy) if (parse_srat() < 0) return; init_mem_locality(); - (void) parse_slit(); + (void)parse_slit(); + vm_phys_register_domains(ndomain, mem_info, vm_locality_table); } SYSINIT(parse_acpi_tables, SI_SUB_VM - 1, SI_ORDER_FIRST, parse_acpi_tables, NULL); From owner-svn-src-all@freebsd.org Wed Oct 31 02:02:43 2018 Return-Path: Delivered-To: svn-src-all@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 9859A10728A3; Wed, 31 Oct 2018 02:02:43 +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 45343856A3; Wed, 31 Oct 2018 02:02:43 +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 2646225DE7; Wed, 31 Oct 2018 02:02:43 +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 w9V22h9O046061; Wed, 31 Oct 2018 02:02:43 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9V22feO046054; Wed, 31 Oct 2018 02:02:41 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201810310202.w9V22feO046054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Wed, 31 Oct 2018 02:02:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r339940 - stable/10/contrib/tzdata X-SVN-Group: stable-10 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/10/contrib/tzdata X-SVN-Commit-Revision: 339940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 02:02:43 -0000 Author: philip Date: Wed Oct 31 02:02:41 2018 New Revision: 339940 URL: https://svnweb.freebsd.org/changeset/base/339940 Log: MFC r339848: Import tzdata 2018g Modified: stable/10/contrib/tzdata/NEWS stable/10/contrib/tzdata/africa stable/10/contrib/tzdata/europe stable/10/contrib/tzdata/northamerica stable/10/contrib/tzdata/theory.html stable/10/contrib/tzdata/version stable/10/contrib/tzdata/ziguard.awk stable/10/contrib/tzdata/zishrink.awk Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/tzdata/NEWS ============================================================================== --- stable/10/contrib/tzdata/NEWS Wed Oct 31 02:02:12 2018 (r339939) +++ stable/10/contrib/tzdata/NEWS Wed Oct 31 02:02:41 2018 (r339940) @@ -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: stable/10/contrib/tzdata/africa ============================================================================== --- stable/10/contrib/tzdata/africa Wed Oct 31 02:02:12 2018 (r339939) +++ stable/10/contrib/tzdata/africa Wed Oct 31 02:02:41 2018 (r339940) @@ -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: stable/10/contrib/tzdata/europe ============================================================================== --- stable/10/contrib/tzdata/europe Wed Oct 31 02:02:12 2018 (r339939) +++ stable/10/contrib/tzdata/europe Wed Oct 31 02:02:41 2018 (r339940) @@ -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: stable/10/contrib/tzdata/northamerica ============================================================================== --- stable/10/contrib/tzdata/northamerica Wed Oct 31 02:02:12 2018 (r339939) +++ stable/10/contrib/tzdata/northamerica Wed Oct 31 02:02:41 2018 (r339940) @@ -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: stable/10/contrib/tzdata/theory.html ============================================================================== --- stable/10/contrib/tzdata/theory.html Wed Oct 31 02:02:12 2018 (r339939) +++ stable/10/contrib/tzdata/theory.html Wed Oct 31 02:02:41 2018 (r339940) @@ -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: stable/10/contrib/tzdata/version ============================================================================== --- stable/10/contrib/tzdata/version Wed Oct 31 02:02:12 2018 (r339939) +++ stable/10/contrib/tzdata/version Wed Oct 31 02:02:41 2018 (r339940) @@ -1 +1 @@ -2018f +2018g Modified: stable/10/contrib/tzdata/ziguard.awk ============================================================================== --- stable/10/contrib/tzdata/ziguard.awk Wed Oct 31 02:02:12 2018 (r339939) +++ stable/10/contrib/tzdata/ziguard.awk Wed Oct 31 02:02:41 2018 (r339940) @@ -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: stable/10/contrib/tzdata/zishrink.awk ============================================================================== --- stable/10/contrib/tzdata/zishrink.awk Wed Oct 31 02:02:12 2018 (r339939) +++ stable/10/contrib/tzdata/zishrink.awk Wed Oct 31 02:02:41 2018 (r339940) @@ -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-all@freebsd.org Wed Oct 31 05:17:55 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 06:24:08 2018 Return-Path: Delivered-To: svn-src-all@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 D612C107ADAE; Wed, 31 Oct 2018 06:24:08 +0000 (UTC) (envelope-from whu@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 8B8D38DD7E; Wed, 31 Oct 2018 06:24:08 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6C96F8D8; Wed, 31 Oct 2018 06:24:08 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9V6O8Ei079631; Wed, 31 Oct 2018 06:24:08 GMT (envelope-from whu@FreeBSD.org) Received: (from whu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9V6O8L5079630; Wed, 31 Oct 2018 06:24:08 GMT (envelope-from whu@FreeBSD.org) Message-Id: <201810310624.w9V6O8L5079630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: whu set sender to whu@FreeBSD.org using -f From: Wei Hu Date: Wed, 31 Oct 2018 06:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r339942 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 X-SVN-Commit-Author: whu X-SVN-Commit-Paths: stable/10/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 339942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 06:24:09 -0000 Author: whu Date: Wed Oct 31 06:24:07 2018 New Revision: 339942 URL: https://svnweb.freebsd.org/changeset/base/339942 Log: MFC: 339585 r339585: Do not drop UDP traffic when TXCSUM_IPV6 flag is on PR: 231797 Submitted by: whu Reviewed by: dexuan Obtained from: Kevin Morse Sponsored by: Microsoft Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Wed Oct 31 05:17:53 2018 (r339941) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Wed Oct 31 06:24:07 2018 (r339942) @@ -857,7 +857,8 @@ hn_set_hlen(struct mbuf *m_head) PULLUP_HDR(m_head, ehlen + sizeof(*ip6)); ip6 = mtodo(m_head, ehlen); - if (ip6->ip6_nxt != IPPROTO_TCP) { + if (ip6->ip6_nxt != IPPROTO_TCP && + ip6->ip6_nxt != IPPROTO_UDP) { m_freem(m_head); return (NULL); } From owner-svn-src-all@freebsd.org Wed Oct 31 07:53:40 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 09:25:18 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 09:39:40 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 10:30:20 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 10:45:29 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 11:37:06 2018 Return-Path: Delivered-To: svn-src-all@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 C907E10D443C; Wed, 31 Oct 2018 11:37:06 +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 7992170845; Wed, 31 Oct 2018 11:37:06 +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 575053F0F; Wed, 31 Oct 2018 11:37:06 +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 w9VBb6td038622; Wed, 31 Oct 2018 11:37:06 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VBb5hb038618; Wed, 31 Oct 2018 11:37:05 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201810311137.w9VBb5hb038618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 31 Oct 2018 11:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339947 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: stable/11/usr.sbin/bhyve X-SVN-Commit-Revision: 339947 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 11:37:07 -0000 Author: bz Date: Wed Oct 31 11:37:05 2018 New Revision: 339947 URL: https://svnweb.freebsd.org/changeset/base/339947 Log: MFC r339586: In bhyve's fbuf emulation improve the overall "usage" message and for the vga option, rather than printing the entire option string, only print vga (as we do for everything else). MFC r339681: Allow the bhyve VNC server to listen on IPv6 for incoming connections. Alternatively to IPv4 address:port this will allow to listen on IPv6 link-local (incl. scope), a specific address, or ::. Addresses have to be given in RFC2732 format so that [::]:port parsing will work. This patch also starts to introduce WITH_INET/INET6_SUPPORT to bhyve. PR: 232018 Submitted by: Dave Rush (northwoodlogic.free gmail.com) (original) Reviewed by: Dave Rush (updated verison) Modified: stable/11/usr.sbin/bhyve/Makefile stable/11/usr.sbin/bhyve/bhyve.8 stable/11/usr.sbin/bhyve/pci_fbuf.c stable/11/usr.sbin/bhyve/rfb.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/Makefile ============================================================================== --- stable/11/usr.sbin/bhyve/Makefile Wed Oct 31 10:45:28 2018 (r339946) +++ stable/11/usr.sbin/bhyve/Makefile Wed Oct 31 11:37:05 2018 (r339947) @@ -65,6 +65,12 @@ SRCS+= vmm_instruction_emul.c LIBADD= vmmapi md pthread z +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+=-DINET +.endif +.if ${MK_INET6_SUPPORT} != "no" +CFLAGS+=-DINET6 +.endif .if ${MK_OPENSSL} == "no" CFLAGS+=-DNO_OPENSSL .else Modified: stable/11/usr.sbin/bhyve/bhyve.8 ============================================================================== --- stable/11/usr.sbin/bhyve/bhyve.8 Wed Oct 31 10:45:28 2018 (r339946) +++ stable/11/usr.sbin/bhyve/bhyve.8 Wed Oct 31 11:37:05 2018 (r339947) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jul 11, 2018 +.Dd October 24, 2018 .Dt BHYVE 8 .Os .Sh NAME @@ -311,14 +311,15 @@ Framebuffer devices: .Bl -tag -width 10n .It Oo rfb= Ns Oo Ar IP: Oc Ns Ar port Oc Ns Oo ,w= Ns Ar width Oc Ns Oo ,h= Ns Ar height Oc Ns Oo ,vga= Ns Ar vgaconf Oc Ns Oo Ns ,wait Oc Ns Oo ,password= Ns Ar password Oc .Bl -tag -width 8n -.It Ar IP:port +.It Ar IPv4:port No or Ar [IPv6%zone]:port An .Ar IP address and a .Ar port VNC should listen on. The default is to listen on localhost IPv4 address and default VNC port 5900. -Listening on an IPv6 address is not supported. +An IPv6 address must be enclosed in square brackets and may contain an +optional zone identifer. .It Ar width No and Ar height A display resolution, width and height, respectively. If not specified, a default resolution of 1024x768 pixels will be used. @@ -485,6 +486,20 @@ bhyve -c 2 -m 4G -w -H \\ -s 4,ahci-hd,disk.img \\ -s 5,virtio-net,tap0 \\ -s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,wait \\ + -s 30,xhci,tablet \\ + -s 31,lpc -l com1,stdio \\ + -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\ + uefivm +.Ed +.Pp +Run a UEFI virtual machine with a VNC display that is bound to all IPv6 +addresses on port 5900. +.Bd -literal -offset indent +bhyve -c 2 -m 4G -w -H \\ + -s 0,hostbridge \\ + -s 4,ahci-hd,disk.img \\ + -s 5,virtio-net,tap0 \\ + -s 29,fbuf,tcp=[::]:5900,w=800,h=600 \\ -s 30,xhci,tablet \\ -s 31,lpc -l com1,stdio \\ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\ Modified: stable/11/usr.sbin/bhyve/pci_fbuf.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_fbuf.c Wed Oct 31 10:45:28 2018 (r339946) +++ stable/11/usr.sbin/bhyve/pci_fbuf.c Wed Oct 31 11:37:05 2018 (r339947) @@ -117,8 +117,9 @@ static void pci_fbuf_usage(char *opt) { - fprintf(stderr, "Invalid fbuf emulation \"%s\"\r\n", opt); - fprintf(stderr, "fbuf: {wait,}{vga=on|io|off,}rfb=:port\r\n"); + fprintf(stderr, "Invalid fbuf emulation option \"%s\"\r\n", opt); + fprintf(stderr, "fbuf: {wait,}{vga=on|io|off,}rfb=:port" + "{,w=width}{,h=height}\r\n"); } static void @@ -250,13 +251,33 @@ pci_fbuf_parse_opts(struct pci_fbuf_softc *sc, char *o xopts, config)); if (!strcmp(xopts, "tcp") || !strcmp(xopts, "rfb")) { - /* parse host-ip:port */ - tmpstr = strsep(&config, ":"); - if (!config) - sc->rfb_port = atoi(tmpstr); - else { - sc->rfb_port = atoi(config); + /* + * IPv4 -- host-ip:port + * IPv6 -- [host-ip%zone]:port + * XXX for now port is mandatory. + */ + tmpstr = strsep(&config, "]"); + if (config) { + if (tmpstr[0] == '[') + tmpstr++; sc->rfb_host = tmpstr; + if (config[0] == ':') + config++; + else { + pci_fbuf_usage(xopts); + ret = -1; + goto done; + } + sc->rfb_port = atoi(config); + } else { + config = tmpstr; + tmpstr = strsep(&config, ":"); + if (!config) + sc->rfb_port = atoi(tmpstr); + else { + sc->rfb_port = atoi(config); + sc->rfb_host = tmpstr; + } } } else if (!strcmp(xopts, "vga")) { if (!strcmp(config, "off")) { @@ -268,7 +289,7 @@ pci_fbuf_parse_opts(struct pci_fbuf_softc *sc, char *o sc->vga_enabled = 1; sc->vga_full = 1; } else { - pci_fbuf_usage(opts); + pci_fbuf_usage(xopts); ret = -1; goto done; } Modified: stable/11/usr.sbin/bhyve/rfb.c ============================================================================== --- stable/11/usr.sbin/bhyve/rfb.c Wed Oct 31 10:45:28 2018 (r339946) +++ stable/11/usr.sbin/bhyve/rfb.c Wed Oct 31 11:37:05 2018 (r339947) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -977,8 +978,11 @@ sse42_supported(void) int rfb_init(char *hostname, int port, int wait, char *password) { + int e; + char servname[6]; struct rfb_softc *rc; - struct sockaddr_in sin; + struct addrinfo *ai; + struct addrinfo hints; int on = 1; #ifndef WITHOUT_CAPSICUM cap_rights_t rights; @@ -995,29 +999,43 @@ rfb_init(char *hostname, int port, int wait, char *pas rc->password = password; - rc->sfd = socket(AF_INET, SOCK_STREAM, 0); + snprintf(servname, sizeof(servname), "%d", port ? port : 5900); + + if (!hostname || strlen(hostname) == 0) +#if defined(INET) + hostname = "127.0.0.1"; +#elif defined(INET6) + hostname = "[::1]"; +#endif + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV | AI_PASSIVE; + + if ((e = getaddrinfo(hostname, servname, &hints, &ai)) != 0) { + fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(e)); + return(-1); + } + + rc->sfd = socket(ai->ai_family, ai->ai_socktype, 0); if (rc->sfd < 0) { perror("socket"); + freeaddrinfo(ai); return (-1); } setsockopt(rc->sfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); - sin.sin_len = sizeof(sin); - sin.sin_family = AF_INET; - sin.sin_port = port ? htons(port) : htons(5900); - if (hostname && strlen(hostname) > 0) - inet_pton(AF_INET, hostname, &(sin.sin_addr)); - else - sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - - if (bind(rc->sfd, (struct sockaddr *)&sin, sizeof(sin)) < 0) { + if (bind(rc->sfd, ai->ai_addr, ai->ai_addrlen) < 0) { perror("bind"); + freeaddrinfo(ai); return (-1); } if (listen(rc->sfd, 1) < 0) { perror("listen"); + freeaddrinfo(ai); return (-1); } @@ -1045,5 +1063,6 @@ rfb_init(char *hostname, int port, int wait, char *pas pthread_mutex_unlock(&rc->mtx); } + freeaddrinfo(ai); return (0); } From owner-svn-src-all@freebsd.org Wed Oct 31 12:00:36 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 12:05:47 2018 Return-Path: Delivered-To: svn-src-all@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 20F2F10D5C8D; Wed, 31 Oct 2018 12:05:47 +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 C825771C22; Wed, 31 Oct 2018 12:05:46 +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 A4ECA4424; Wed, 31 Oct 2018 12:05:46 +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 w9VC5klH053959; Wed, 31 Oct 2018 12:05:46 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VC5jM4053953; Wed, 31 Oct 2018 12:05:45 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201810311205.w9VC5jM4053953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 31 Oct 2018 12:05:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339949 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 339949 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 12:05:47 -0000 Author: bz Date: Wed Oct 31 12:05:45 2018 New Revision: 339949 URL: https://svnweb.freebsd.org/changeset/base/339949 Log: MFC r339586: In bhyve's fbuf emulation improve the overall "usage" message and for the vga option, rather than printing the entire option string, only print vga (as we do for everything else). MFC r339681: Allow the bhyve VNC server to listen on IPv6 for incoming connections. Alternatively to IPv4 address:port this will allow to listen on IPv6 link-local (incl. scope), a specific address, or ::. Addresses have to be given in RFC2732 format so that [::]:port parsing will work. This patch also starts to introduce WITH_INET/INET6_SUPPORT to bhyve. PR: 232018 Submitted by: Dave Rush (northwoodlogic.free gmail.com) (original) Reviewed by: Dave Rush (updated verison) Approved by: re (kib) Modified: stable/12/usr.sbin/bhyve/Makefile stable/12/usr.sbin/bhyve/bhyve.8 stable/12/usr.sbin/bhyve/pci_fbuf.c stable/12/usr.sbin/bhyve/rfb.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/Makefile ============================================================================== --- stable/12/usr.sbin/bhyve/Makefile Wed Oct 31 12:00:35 2018 (r339948) +++ stable/12/usr.sbin/bhyve/Makefile Wed Oct 31 12:05:45 2018 (r339949) @@ -73,6 +73,12 @@ SRCS+= vmm_instruction_emul.c LIBADD= vmmapi md pthread z util sbuf cam +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+=-DINET +.endif +.if ${MK_INET6_SUPPORT} != "no" +CFLAGS+=-DINET6 +.endif .if ${MK_OPENSSL} == "no" CFLAGS+=-DNO_OPENSSL .else Modified: stable/12/usr.sbin/bhyve/bhyve.8 ============================================================================== --- stable/12/usr.sbin/bhyve/bhyve.8 Wed Oct 31 12:00:35 2018 (r339948) +++ stable/12/usr.sbin/bhyve/bhyve.8 Wed Oct 31 12:05:45 2018 (r339949) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Aug 23, 2018 +.Dd October 24, 2018 .Dt BHYVE 8 .Os .Sh NAME @@ -369,14 +369,15 @@ Framebuffer devices: .Bl -tag -width 10n .It Oo rfb= Ns Oo Ar IP: Oc Ns Ar port Oc Ns Oo ,w= Ns Ar width Oc Ns Oo ,h= Ns Ar height Oc Ns Oo ,vga= Ns Ar vgaconf Oc Ns Oo Ns ,wait Oc Ns Oo ,password= Ns Ar password Oc .Bl -tag -width 8n -.It Ar IP:port +.It Ar IPv4:port No or Ar [IPv6%zone]:port An .Ar IP address and a .Ar port VNC should listen on. The default is to listen on localhost IPv4 address and default VNC port 5900. -Listening on an IPv6 address is not supported. +An IPv6 address must be enclosed in square brackets and may contain an +optional zone identifer. .It Ar width No and Ar height A display resolution, width and height, respectively. If not specified, a default resolution of 1024x768 pixels will be used. @@ -582,6 +583,20 @@ bhyve -c 2 -m 4G -w -H \\ -s 4,ahci-hd,disk.img \\ -s 5,virtio-net,tap0 \\ -s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,wait \\ + -s 30,xhci,tablet \\ + -s 31,lpc -l com1,stdio \\ + -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\ + uefivm +.Ed +.Pp +Run a UEFI virtual machine with a VNC display that is bound to all IPv6 +addresses on port 5900. +.Bd -literal -offset indent +bhyve -c 2 -m 4G -w -H \\ + -s 0,hostbridge \\ + -s 4,ahci-hd,disk.img \\ + -s 5,virtio-net,tap0 \\ + -s 29,fbuf,tcp=[::]:5900,w=800,h=600 \\ -s 30,xhci,tablet \\ -s 31,lpc -l com1,stdio \\ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\ Modified: stable/12/usr.sbin/bhyve/pci_fbuf.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_fbuf.c Wed Oct 31 12:00:35 2018 (r339948) +++ stable/12/usr.sbin/bhyve/pci_fbuf.c Wed Oct 31 12:05:45 2018 (r339949) @@ -117,8 +117,9 @@ static void pci_fbuf_usage(char *opt) { - fprintf(stderr, "Invalid fbuf emulation \"%s\"\r\n", opt); - fprintf(stderr, "fbuf: {wait,}{vga=on|io|off,}rfb=:port\r\n"); + fprintf(stderr, "Invalid fbuf emulation option \"%s\"\r\n", opt); + fprintf(stderr, "fbuf: {wait,}{vga=on|io|off,}rfb=:port" + "{,w=width}{,h=height}\r\n"); } static void @@ -250,13 +251,33 @@ pci_fbuf_parse_opts(struct pci_fbuf_softc *sc, char *o xopts, config)); if (!strcmp(xopts, "tcp") || !strcmp(xopts, "rfb")) { - /* parse host-ip:port */ - tmpstr = strsep(&config, ":"); - if (!config) - sc->rfb_port = atoi(tmpstr); - else { - sc->rfb_port = atoi(config); + /* + * IPv4 -- host-ip:port + * IPv6 -- [host-ip%zone]:port + * XXX for now port is mandatory. + */ + tmpstr = strsep(&config, "]"); + if (config) { + if (tmpstr[0] == '[') + tmpstr++; sc->rfb_host = tmpstr; + if (config[0] == ':') + config++; + else { + pci_fbuf_usage(xopts); + ret = -1; + goto done; + } + sc->rfb_port = atoi(config); + } else { + config = tmpstr; + tmpstr = strsep(&config, ":"); + if (!config) + sc->rfb_port = atoi(tmpstr); + else { + sc->rfb_port = atoi(config); + sc->rfb_host = tmpstr; + } } } else if (!strcmp(xopts, "vga")) { if (!strcmp(config, "off")) { @@ -268,7 +289,7 @@ pci_fbuf_parse_opts(struct pci_fbuf_softc *sc, char *o sc->vga_enabled = 1; sc->vga_full = 1; } else { - pci_fbuf_usage(opts); + pci_fbuf_usage(xopts); ret = -1; goto done; } Modified: stable/12/usr.sbin/bhyve/rfb.c ============================================================================== --- stable/12/usr.sbin/bhyve/rfb.c Wed Oct 31 12:00:35 2018 (r339948) +++ stable/12/usr.sbin/bhyve/rfb.c Wed Oct 31 12:05:45 2018 (r339949) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -960,8 +961,11 @@ sse42_supported(void) int rfb_init(char *hostname, int port, int wait, char *password) { + int e; + char servname[6]; struct rfb_softc *rc; - struct sockaddr_in sin; + struct addrinfo *ai; + struct addrinfo hints; int on = 1; #ifndef WITHOUT_CAPSICUM cap_rights_t rights; @@ -978,29 +982,43 @@ rfb_init(char *hostname, int port, int wait, char *pas rc->password = password; - rc->sfd = socket(AF_INET, SOCK_STREAM, 0); + snprintf(servname, sizeof(servname), "%d", port ? port : 5900); + + if (!hostname || strlen(hostname) == 0) +#if defined(INET) + hostname = "127.0.0.1"; +#elif defined(INET6) + hostname = "[::1]"; +#endif + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV | AI_PASSIVE; + + if ((e = getaddrinfo(hostname, servname, &hints, &ai)) != 0) { + fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(e)); + return(-1); + } + + rc->sfd = socket(ai->ai_family, ai->ai_socktype, 0); if (rc->sfd < 0) { perror("socket"); + freeaddrinfo(ai); return (-1); } setsockopt(rc->sfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); - sin.sin_len = sizeof(sin); - sin.sin_family = AF_INET; - sin.sin_port = port ? htons(port) : htons(5900); - if (hostname && strlen(hostname) > 0) - inet_pton(AF_INET, hostname, &(sin.sin_addr)); - else - sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - - if (bind(rc->sfd, (struct sockaddr *)&sin, sizeof(sin)) < 0) { + if (bind(rc->sfd, ai->ai_addr, ai->ai_addrlen) < 0) { perror("bind"); + freeaddrinfo(ai); return (-1); } if (listen(rc->sfd, 1) < 0) { perror("listen"); + freeaddrinfo(ai); return (-1); } @@ -1028,5 +1046,6 @@ rfb_init(char *hostname, int port, int wait, char *pas pthread_mutex_unlock(&rc->mtx); } + freeaddrinfo(ai); return (0); } From owner-svn-src-all@freebsd.org Wed Oct 31 12:49:19 2018 Return-Path: Delivered-To: svn-src-all@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 A12F010D70AE; Wed, 31 Oct 2018 12:49: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 504C373418; Wed, 31 Oct 2018 12:49:19 +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 2BABC4AA1; Wed, 31 Oct 2018 12:49:19 +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 w9VCnJJM075471; Wed, 31 Oct 2018 12:49:19 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VCnJWf075470; Wed, 31 Oct 2018 12:49:19 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201810311249.w9VCnJWf075470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 31 Oct 2018 12:49:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339950 - stable/12/sys/netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: stable/12/sys/netinet6 X-SVN-Commit-Revision: 339950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 12:49:19 -0000 Author: bz Date: Wed Oct 31 12:49:18 2018 New Revision: 339950 URL: https://svnweb.freebsd.org/changeset/base/339950 Log: MFC r339682: rip6_input() inp validation after epoch(9) After r335924 rip6_input() needs inp validation to avoid working on FREED inps. Apply the relevant bits from r335497,r335501 (rip_input() change) to the IPv6 counterpart. PR: 232194 Reviewed by: rgrimes, ae (,hps) Approved by: re (kib) Modified: stable/12/sys/netinet6/raw_ip6.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet6/raw_ip6.c ============================================================================== --- stable/12/sys/netinet6/raw_ip6.c Wed Oct 31 12:05:45 2018 (r339949) +++ stable/12/sys/netinet6/raw_ip6.c Wed Oct 31 12:49:18 2018 (r339950) @@ -187,6 +187,45 @@ rip6_input(struct mbuf **mp, int *offp, int proto) if (!IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_faddr) && !IN6_ARE_ADDR_EQUAL(&in6p->in6p_faddr, &ip6->ip6_src)) continue; + if (last != NULL) { + struct mbuf *n = m_copym(m, 0, M_COPYALL, M_NOWAIT); + +#if defined(IPSEC) || defined(IPSEC_SUPPORT) + /* + * Check AH/ESP integrity. + */ + if (IPSEC_ENABLED(ipv6)) { + if (n != NULL && + IPSEC_CHECK_POLICY(ipv6, n, last) != 0) { + m_freem(n); + /* Do not inject data into pcb. */ + n = NULL; + } + } +#endif /* IPSEC */ + if (n) { + if (last->inp_flags & INP_CONTROLOPTS || + last->inp_socket->so_options & SO_TIMESTAMP) + ip6_savecontrol(last, n, &opts); + /* strip intermediate headers */ + m_adj(n, *offp); + if (sbappendaddr(&last->inp_socket->so_rcv, + (struct sockaddr *)&fromsa, + n, opts) == 0) { + m_freem(n); + if (opts) + m_freem(opts); + RIP6STAT_INC(rip6s_fullsock); + } else + sorwakeup(last->inp_socket); + opts = NULL; + } + INP_RUNLOCK(last); + last = NULL; + } + INP_RLOCK(in6p); + if (__predict_false(in6p->inp_flags2 & INP_FREED)) + goto skip_2; if (jailed_without_vnet(in6p->inp_cred)) { /* * Allow raw socket in jail to receive multicast; @@ -196,16 +235,14 @@ rip6_input(struct mbuf **mp, int *offp, int proto) if (!IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) && prison_check_ip6(in6p->inp_cred, &ip6->ip6_dst) != 0) - continue; + goto skip_2; } - INP_RLOCK(in6p); if (in6p->in6p_cksum != -1) { RIP6STAT_INC(rip6s_isum); if (in6_cksum(m, proto, *offp, m->m_pkthdr.len - *offp)) { - INP_RUNLOCK(in6p); RIP6STAT_INC(rip6s_badsum); - continue; + goto skip_2; } } /* @@ -251,46 +288,13 @@ rip6_input(struct mbuf **mp, int *offp, int proto) } if (blocked != MCAST_PASS) { IP6STAT_INC(ip6s_notmember); - INP_RUNLOCK(in6p); - continue; + goto skip_2; } } - if (last != NULL) { - struct mbuf *n = m_copym(m, 0, M_COPYALL, M_NOWAIT); - -#if defined(IPSEC) || defined(IPSEC_SUPPORT) - /* - * Check AH/ESP integrity. - */ - if (IPSEC_ENABLED(ipv6)) { - if (n != NULL && - IPSEC_CHECK_POLICY(ipv6, n, last) != 0) { - m_freem(n); - /* Do not inject data into pcb. */ - n = NULL; - } - } -#endif /* IPSEC */ - if (n) { - if (last->inp_flags & INP_CONTROLOPTS || - last->inp_socket->so_options & SO_TIMESTAMP) - ip6_savecontrol(last, n, &opts); - /* strip intermediate headers */ - m_adj(n, *offp); - if (sbappendaddr(&last->inp_socket->so_rcv, - (struct sockaddr *)&fromsa, - n, opts) == 0) { - m_freem(n); - if (opts) - m_freem(opts); - RIP6STAT_INC(rip6s_fullsock); - } else - sorwakeup(last->inp_socket); - opts = NULL; - } - INP_RUNLOCK(last); - } last = in6p; + continue; +skip_2: + INP_RUNLOCK(in6p); } INP_INFO_RUNLOCK_ET(&V_ripcbinfo, et); #if defined(IPSEC) || defined(IPSEC_SUPPORT) From owner-svn-src-all@freebsd.org Wed Oct 31 12:50:40 2018 Return-Path: Delivered-To: svn-src-all@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 79DEF10D7186; Wed, 31 Oct 2018 12:50:40 +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 3004B73595; Wed, 31 Oct 2018 12:50:40 +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 114544AAC; Wed, 31 Oct 2018 12:50:40 +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 w9VCodML075622; Wed, 31 Oct 2018 12:50:39 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VCodFN075621; Wed, 31 Oct 2018 12:50:39 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201810311250.w9VCodFN075621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 31 Oct 2018 12:50:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339951 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 339951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 12:50:40 -0000 Author: bz Date: Wed Oct 31 12:50:39 2018 New Revision: 339951 URL: https://svnweb.freebsd.org/changeset/base/339951 Log: MFC r339930: 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 Approved by: re (kib) Modified: stable/12/sys/net/vnet.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/vnet.c ============================================================================== --- stable/12/sys/net/vnet.c Wed Oct 31 12:49:18 2018 (r339950) +++ stable/12/sys/net/vnet.c Wed Oct 31 12:50:39 2018 (r339951) @@ -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-all@freebsd.org Wed Oct 31 12:53:59 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 14:03:49 2018 Return-Path: Delivered-To: svn-src-all@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 5485E10DA152; Wed, 31 Oct 2018 14:03:49 +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 09F4F76409; Wed, 31 Oct 2018 14:03:49 +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 C3BE357C7; Wed, 31 Oct 2018 14:03:48 +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 w9VE3mFn017575; Wed, 31 Oct 2018 14:03:48 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VE3m9S017572; Wed, 31 Oct 2018 14:03:48 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201810311403.w9VE3m9S017572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 31 Oct 2018 14:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339953 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 339953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 14:03:49 -0000 Author: bz Date: Wed Oct 31 14:03:48 2018 New Revision: 339953 URL: https://svnweb.freebsd.org/changeset/base/339953 Log: MFC r339931,r339933: As a follow-up to r339930 (r339951 in stable/12) 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 Approved by: re (kib) Modified: stable/12/sys/kern/link_elf.c stable/12/sys/kern/link_elf_obj.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/link_elf.c ============================================================================== --- stable/12/sys/kern/link_elf.c Wed Oct 31 12:53:58 2018 (r339952) +++ stable/12/sys/kern/link_elf.c Wed Oct 31 14:03:48 2018 (r339953) @@ -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: stable/12/sys/kern/link_elf_obj.c ============================================================================== --- stable/12/sys/kern/link_elf_obj.c Wed Oct 31 12:53:58 2018 (r339952) +++ stable/12/sys/kern/link_elf_obj.c Wed Oct 31 14:03:48 2018 (r339953) @@ -368,6 +368,11 @@ 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 %#jx " + "for %s\n", __func__, + (uintmax_t)shdr[i].sh_size, + filename); error = ENOSPC; goto out; } @@ -382,6 +387,11 @@ 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 %#jx " + "for %s\n", __func__, + (uintmax_t)shdr[i].sh_size, + filename); error = ENOSPC; goto out; } @@ -847,14 +857,30 @@ 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 %#jx " + "for %s\n", __func__, + (uintmax_t)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 %#jx " + "for %s\n", __func__, + (uintmax_t)shdr[i].sh_size, + filename); + } + } #endif else ef->progtab[pb].addr = From owner-svn-src-all@freebsd.org Wed Oct 31 14:07:17 2018 Return-Path: Delivered-To: svn-src-all@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 1137B10DA594 for ; Wed, 31 Oct 2018 14:07:17 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) (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 89AF2768AD for ; Wed, 31 Oct 2018 14:07:16 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-ed1-x544.google.com with SMTP id w19-v6so13726076eds.1 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=Cju0515OUUdGC8eHC6cLdanhoLTD9VfUyC8xXQNtJPXAsaM2GFq2wETXDzqLp0Nujr ja+4EnAoMJBfkeaMliiawrrwSF69lUxYHps5uPPb4RZOoqpBmmdgzMhb9JnHGCjGL+5X PF/yq6KiO+m2aUNI2lNYP5pSi6ygPjAzWX+lI9N2cHA8WqYGuiGMXNXeoCUPVZlTnqct egn6dBe+HkhTHhRS9ngJkyn9MG7c94hOhELYej4DJMGMpqSsD92dyIkZGFm7gIUFCooY 2IpklRs1rScgfBrTGGZBZCl0C6Feq3cYcsM2UEjbwW4AcKIFdSy55DDwIQSo5eqOIPVe iOsQ== X-Gm-Message-State: AGRZ1gLZfW8wf8iq4VobtbYWYtmKDJdf+9se+xFngN6N2FUzH73FFVZM HW+pf4qRDAGYByuAgTumNg/3Gw43wYcXsg== 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 14:12:19 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 14:19:59 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 14:49:29 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 14:52:41 2018 Return-Path: Delivered-To: svn-src-all@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 73E5510DC308 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 E554D79508 for ; Wed, 31 Oct 2018 14:52:40 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1540997552; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=eF4F8zvbTSDOSI2n6rocJCcr25scG1wNLP8dTatqoBwMmlc7rcc0XEX/5ajeT3Z/+k7YTxYl0KCit W0E6koi+w9Uo+85zUJkAJLCG/CCJpbvU7+3uMkNz43j3+QB8EJszH0h+GQ/O3lKzqmO/zXbstlKWiT QcuAosAHFkVMZfWZZxkUubS1BKJEl9FEZzRBarWJg7ttCV1pWDm+M3ZYex+a/+H3ZOCSFROnGBtqho MReAfbxSADLFuM+N45L56exckqN/rXe2IltaVasuywEtlC++6KnBlYhWGutMuafNONwCRnspKumde2 H77joG/jMIueoEwvKi2xUynxDqmWJAg== 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 15:04:41 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 15:29:27 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 16:10:05 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 16:17:46 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 16:42:41 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 16:45:46 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 16:58:44 2018 Return-Path: Delivered-To: svn-src-all@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 BE27C10DF1CC 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 2FCB47E252 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 s10-v6so15837641wmc.5 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=eVRONJlA4Nit/+WgJ/sQCwPg4lUyBJ7WmFkCZT5D9S2I4fyGcXop8K4QmPdCunQ62V zZUdJMP+93xBmkBbkYOzkiRoeKxV6OTgDOp9QRR7HL0dIo8GdM17ozfpKzLAvp63H4K+ O93o67+na3JndsnRf8xR60AiOGRxbivss6kH/mZ/VQ65E5pufzba1Ihs3MTVimZZbHO7 tlvxegqY3pd7mLv/IAa8XRRZNZuFpzyP4g5dOCTuyruKHYqLVwZNOfIuh7EwbhAARtGe xiH7DuffK92JkjlCvSDdebQ0VRvNzCBu5gJOvoglrQ522Rd+DW6tinpIKGfTrigK7GOk Tj5Q== X-Gm-Message-State: AGRZ1gIld2UN8T1igDecYrQWfo7UqdDZq3EmkFMfWsjP4iWSmkVJi+zg x+Uf0w+hB47ObB403FKuMVWoiA== 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 17:37:54 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 17:41:54 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 17:47:10 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 18:01:02 2018 Return-Path: Delivered-To: svn-src-all@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 DB64210E104A; Wed, 31 Oct 2018 18:01:02 +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 8DF4D81351; Wed, 31 Oct 2018 18:01:02 +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 6F2007E37; Wed, 31 Oct 2018 18:01:02 +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 w9VI12PN045535; Wed, 31 Oct 2018 18:01:02 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VI12EC045534; Wed, 31 Oct 2018 18:01:02 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201810311801.w9VI12EC045534@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 18:01:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339963 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 339963 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 18:01:03 -0000 Author: glebius Date: Wed Oct 31 18:01:02 2018 New Revision: 339963 URL: https://svnweb.freebsd.org/changeset/base/339963 Log: MFhead r339596: If we lost race or were migrated during bucket allocation for the per-CPU cache, then we put new bucket on generic bucket cache. However, code didn't honor UMA_ZONE_NOBUCKETCACHE flag, so potentially we could start a cache on a zone that clearly forbids that. Fix this. Approved by: re (gjb) Modified: stable/12/sys/vm/uma_core.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/uma_core.c ============================================================================== --- stable/12/sys/vm/uma_core.c Wed Oct 31 17:47:08 2018 (r339962) +++ stable/12/sys/vm/uma_core.c Wed Oct 31 18:01:02 2018 (r339963) @@ -2410,6 +2410,7 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags * the current cache; when we re-acquire the critical section, we * must detect and handle migration if it has occurred. */ +zalloc_restart: critical_enter(); cpu = curcpu; cache = &zone->uz_cpu[cpu]; @@ -2551,12 +2552,18 @@ zalloc_start: * initialized bucket to make this less likely or claim * the memory directly. */ - if (cache->uc_allocbucket != NULL || - (zone->uz_flags & UMA_ZONE_NUMA && - domain != PCPU_GET(domain))) - LIST_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link); - else + if (cache->uc_allocbucket == NULL && + ((zone->uz_flags & UMA_ZONE_NUMA) == 0 || + domain == PCPU_GET(domain))) { cache->uc_allocbucket = bucket; + } else if ((zone->uz_flags & UMA_ZONE_NOBUCKETCACHE) != 0) { + critical_exit(); + ZONE_UNLOCK(zone); + bucket_drain(zone, bucket); + bucket_free(zone, bucket, udata); + goto zalloc_restart; + } else + LIST_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link); ZONE_UNLOCK(zone); goto zalloc_start; } From owner-svn-src-all@freebsd.org Wed Oct 31 18:08:13 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 18:30:18 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 19:09:49 2018 Return-Path: Delivered-To: svn-src-all@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 35A6310E2B3B; Wed, 31 Oct 2018 19:09:49 +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 DEE8E843C5; Wed, 31 Oct 2018 19:09:48 +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 BBAFB1099B; Wed, 31 Oct 2018 19:09:48 +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 w9VJ9mgc081385; Wed, 31 Oct 2018 19:09:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VJ9m8R081384; Wed, 31 Oct 2018 19:09:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810311909.w9VJ9m8R081384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 31 Oct 2018 19:09:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339966 - stable/11/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/conf X-SVN-Commit-Revision: 339966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 19:09:49 -0000 Author: markj Date: Wed Oct 31 19:09:48 2018 New Revision: 339966 URL: https://svnweb.freebsd.org/changeset/base/339966 Log: MFC r313557 (by bz): Allow Dtrace to be compiled into the kernel again after r313177. PR: 232825 Modified: stable/11/sys/conf/files Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Wed Oct 31 18:30:17 2018 (r339965) +++ stable/11/sys/conf/files Wed Oct 31 19:09:48 2018 (r339966) @@ -310,6 +310,7 @@ cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lzio.c # dtrace specific cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c optional dtrace compile-with "${DTRACE_C}" \ warning "kernel contains CDDL licensed DTRACE" +cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/dtmalloc/dtmalloc.c optional dtmalloc | dtraceall compile-with "${CDDL_C}" cddl/dev/profile/profile.c optional dtrace_profile | dtraceall compile-with "${CDDL_C}" cddl/dev/sdt/sdt.c optional dtrace_sdt | dtraceall compile-with "${CDDL_C}" From owner-svn-src-all@freebsd.org Wed Oct 31 19:19:14 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 19:28:06 2018 Return-Path: Delivered-To: svn-src-all@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 BF58C10E3265; Wed, 31 Oct 2018 19:28:06 +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 6DBF3850D1; Wed, 31 Oct 2018 19:28:06 +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 4C59210CDB; Wed, 31 Oct 2018 19:28:06 +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 w9VJS6IM091686; Wed, 31 Oct 2018 19:28:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VJS5QK091684; Wed, 31 Oct 2018 19:28:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810311928.w9VJS5QK091684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 31 Oct 2018 19:28:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339968 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 339968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 19:28:07 -0000 Author: markj Date: Wed Oct 31 19:28:05 2018 New Revision: 339968 URL: https://svnweb.freebsd.org/changeset/base/339968 Log: MFC r339601, r339603: Swap in processes unless there's a global memory shortage. Approved by: re (gjb) Modified: stable/12/sys/vm/vm_glue.c stable/12/sys/vm/vm_swapout.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_glue.c ============================================================================== --- stable/12/sys/vm/vm_glue.c Wed Oct 31 19:19:13 2018 (r339967) +++ stable/12/sys/vm/vm_glue.c Wed Oct 31 19:28:05 2018 (r339968) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -298,7 +299,7 @@ vm_sync_icache(vm_map_t map, vm_offset_t va, vm_offset struct kstack_cache_entry *kstack_cache; static int kstack_cache_size = 128; -static int kstacks; +static int kstacks, kstack_domain_iter; static struct mtx kstack_cache_mtx; MTX_SYSINIT(kstack_cache, &kstack_cache_mtx, "kstkch", MTX_DEF); @@ -367,6 +368,17 @@ vm_thread_new(struct thread *td, int pages) printf("vm_thread_new: kstack allocation failed\n"); vm_object_deallocate(ksobj); return (0); + } + + /* + * Ensure that kstack objects can draw pages from any memory + * domain. Otherwise a local memory shortage can block a process + * swap-in. + */ + if (vm_ndomains > 1) { + ksobj->domain.dr_policy = DOMAINSET_RR(); + ksobj->domain.dr_iterator = + atomic_fetchadd_int(&kstack_domain_iter, 1); } atomic_add_int(&kstacks, 1); Modified: stable/12/sys/vm/vm_swapout.c ============================================================================== --- stable/12/sys/vm/vm_swapout.c Wed Oct 31 19:19:13 2018 (r339967) +++ stable/12/sys/vm/vm_swapout.c Wed Oct 31 19:28:05 2018 (r339968) @@ -742,7 +742,8 @@ swapper_selector(bool wkilled_only) /* * Limit swapper to swap in one non-WKILLED process in MAXSLP/2 * interval, assuming that there is: - * - no memory shortage; + * - there exists at least one domain that is not suffering from a shortage of + * free memory; * - no parallel swap-ins; * - no other swap-ins in the current SWAPIN_INTERVAL. */ @@ -750,7 +751,7 @@ static bool swapper_wkilled_only(void) { - return (vm_page_count_min() || swap_inprogress > 0 || + return (vm_page_count_min_set(&all_domains) || swap_inprogress > 0 || (u_int)(ticks - last_swapin) < SWAPIN_INTERVAL); } From owner-svn-src-all@freebsd.org Wed Oct 31 19:37:12 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 19:59:21 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 20:37:14 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 20:42:19 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 22:38:23 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 22:55:44 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 23:03:00 2018 Return-Path: Delivered-To: svn-src-all@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 33CC910EBF1A; Wed, 31 Oct 2018 23:03:00 +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 CA9366FA87; Wed, 31 Oct 2018 23:02:59 +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 A6097130D3; Wed, 31 Oct 2018 23:02:59 +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 w9VN2x5o008916; Wed, 31 Oct 2018 23:02:59 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VN2xxw008915; Wed, 31 Oct 2018 23:02:59 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201810312302.w9VN2xxw008915@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 23:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339975 - stable/12/sys/dev/ipw X-SVN-Group: stable-12 X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: stable/12/sys/dev/ipw X-SVN-Commit-Revision: 339975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 23:03:00 -0000 Author: glebius Date: Wed Oct 31 23:02:59 2018 New Revision: 339975 URL: https://svnweb.freebsd.org/changeset/base/339975 Log: MFhead r339643: Fix ipw_start(), where logic was reverted in r287197. PR 232554 Approved by: re (kib) Modified: stable/12/sys/dev/ipw/if_ipw.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/ipw/if_ipw.c ============================================================================== --- stable/12/sys/dev/ipw/if_ipw.c Wed Oct 31 22:55:43 2018 (r339974) +++ stable/12/sys/dev/ipw/if_ipw.c Wed Oct 31 23:02:59 2018 (r339975) @@ -1732,7 +1732,7 @@ ipw_start(struct ipw_softc *sc) IPW_LOCK_ASSERT(sc); - while (sc->txfree < 1 + IPW_MAX_NSEG && + while (sc->txfree >= 1 + IPW_MAX_NSEG && (m = mbufq_dequeue(&sc->sc_snd)) != NULL) { ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; if (ipw_tx_start(sc, m, ni) != 0) { From owner-svn-src-all@freebsd.org Wed Oct 31 23:05:47 2018 Return-Path: Delivered-To: svn-src-all@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 DE995108807B; Wed, 31 Oct 2018 23:05:47 +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 89C986FD54; Wed, 31 Oct 2018 23:05:47 +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 B4F19130D6; Wed, 31 Oct 2018 23:05:44 +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 w9VN5iFn009392; Wed, 31 Oct 2018 23:05:44 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VN5im8009391; Wed, 31 Oct 2018 23:05:44 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201810312305.w9VN5im8009391@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 23:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339976 - stable/11/sys/dev/ipw X-SVN-Group: stable-11 X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: stable/11/sys/dev/ipw X-SVN-Commit-Revision: 339976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 23:05:48 -0000 Author: glebius Date: Wed Oct 31 23:05:44 2018 New Revision: 339976 URL: https://svnweb.freebsd.org/changeset/base/339976 Log: MFhead r339643: Fix ipw_start(), where logic was reverted in r287197. PR: 232554 Modified: stable/11/sys/dev/ipw/if_ipw.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ipw/if_ipw.c ============================================================================== --- stable/11/sys/dev/ipw/if_ipw.c Wed Oct 31 23:02:59 2018 (r339975) +++ stable/11/sys/dev/ipw/if_ipw.c Wed Oct 31 23:05:44 2018 (r339976) @@ -1728,7 +1728,7 @@ ipw_start(struct ipw_softc *sc) IPW_LOCK_ASSERT(sc); - while (sc->txfree < 1 + IPW_MAX_NSEG && + while (sc->txfree >= 1 + IPW_MAX_NSEG && (m = mbufq_dequeue(&sc->sc_snd)) != NULL) { ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; if (ipw_tx_start(sc, m, ni) != 0) { From owner-svn-src-all@freebsd.org Wed Oct 31 23:07:49 2018 Return-Path: Delivered-To: svn-src-all@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 E6BC5108823B; Wed, 31 Oct 2018 23:07:48 +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 9CC0170167; Wed, 31 Oct 2018 23:07: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 66948130DD; Wed, 31 Oct 2018 23:07: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 w9VN7mYF009563; Wed, 31 Oct 2018 23:07:48 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VN7lfW009560; Wed, 31 Oct 2018 23:07:47 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201810312307.w9VN7lfW009560@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 23:07:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339977 - stable/12/share/examples/jails X-SVN-Group: stable-12 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: stable/12/share/examples/jails X-SVN-Commit-Revision: 339977 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 23:07:49 -0000 Author: dteske Date: Wed Oct 31 23:07:47 2018 New Revision: 339977 URL: https://svnweb.freebsd.org/changeset/base/339977 Log: MFC r339843: Fix jail examples in jib, jng, README Submitted by: Ryan Moeller Reported by: Ryan Moeller Approved by: re (gjb) Sponsored by: Smule, Inc. Differential Revision: https://reviews.freebsd.org/D17697 Modified: stable/12/share/examples/jails/README stable/12/share/examples/jails/jib stable/12/share/examples/jails/jng Directory Properties: stable/12/ (props changed) Modified: stable/12/share/examples/jails/README ============================================================================== --- stable/12/share/examples/jails/README Wed Oct 31 23:05:44 2018 (r339976) +++ stable/12/share/examples/jails/README Wed Oct 31 23:07:47 2018 (r339977) @@ -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: stable/12/share/examples/jails/jib ============================================================================== --- stable/12/share/examples/jails/jib Wed Oct 31 23:05:44 2018 (r339976) +++ stable/12/share/examples/jails/jib Wed Oct 31 23:07:47 2018 (r339977) @@ -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: stable/12/share/examples/jails/jng ============================================================================== --- stable/12/share/examples/jails/jng Wed Oct 31 23:05:44 2018 (r339976) +++ stable/12/share/examples/jails/jng Wed Oct 31 23:07:47 2018 (r339977) @@ -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-all@freebsd.org Wed Oct 31 23:08:51 2018 Return-Path: Delivered-To: svn-src-all@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 5E2031088348; Wed, 31 Oct 2018 23:08:51 +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 B346F70391; Wed, 31 Oct 2018 23:08:50 +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 940CA130DE; Wed, 31 Oct 2018 23:08:50 +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 w9VN8ooq009676; Wed, 31 Oct 2018 23:08:50 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VN8oU1009673; Wed, 31 Oct 2018 23:08:50 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201810312308.w9VN8oU1009673@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 23:08:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339978 - in stable/12/stand: liblua lua X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12/stand: liblua lua X-SVN-Commit-Revision: 339978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 23:08:51 -0000 Author: kevans Date: Wed Oct 31 23:08:49 2018 New Revision: 339978 URL: https://svnweb.freebsd.org/changeset/base/339978 Log: MFC r339677-r339678, r339702, r339805: Lualoader Bugfixes r339677: lualoader: unload upon kernel change if a kernel was previously loaded In the majority of cases, a kernel is not loaded before we hit the menu. However, if a password is set, we'll trigger autoboot and have loadelf'd beforehand. We also need to take into account one dropping to the loader prompt and twiddling with things manually; if they try to toggle through kernels, we'll assume they mean it. r339678: menu.lua: Abort autoboot sequence on failed command Currently, a timeout in the menu autoboot sequence would effectively do nothing. We would return from the autoboot handling, then begin processing the menu without redrawing it. This change makes the behavior a little more friendly. Returning the user to the menu can't have any good effects, so abort the autoboot sequence and drop to the loader prompt. r339702: lualoader: Improve module loading diagnostics Some fixes: - Maintain historical behavior more accurately w.r.t verbose_loading; verbose_loading strictly prints "${module_name...}" and later "failed!" or "ok" based on load success - With or without verbose_loading, dump command_errbuf on load failure. This usually happens prior to ok/failed if we're verbose_loading r339805: lualoader: Always return a proper dictionary for blacklist If module_blacklist isn't specified, we have an empty blacklist; effectively the same as if module_blacklist="" were specified in loader.conf(5). This was reported when switching to a BE that predated the module_blacklist introduction, but the problem is valid all the same and likely to be tripped over in other scenarios. Approved by: re (kib) Modified: stable/12/stand/liblua/lutils.c stable/12/stand/lua/config.lua stable/12/stand/lua/menu.lua Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/liblua/lutils.c ============================================================================== --- stable/12/stand/liblua/lutils.c Wed Oct 31 23:07:47 2018 (r339977) +++ stable/12/stand/liblua/lutils.c Wed Oct 31 23:08:49 2018 (r339978) @@ -77,6 +77,14 @@ lua_perform(lua_State *L) return 1; } +static int +lua_command_error(lua_State *L) +{ + + lua_pushstring(L, command_errbuf); + return 1; +} + /* * Accepts a space-delimited loader command and runs it through the standard * loader parsing, as if it were executed at the loader prompt by the user. @@ -341,6 +349,7 @@ lua_writefile(lua_State *L) #define REG_SIMPLE(n) { #n, lua_ ## n } static const struct luaL_Reg loaderlib[] = { REG_SIMPLE(delay), + REG_SIMPLE(command_error), REG_SIMPLE(command), REG_SIMPLE(interpret), REG_SIMPLE(parse), Modified: stable/12/stand/lua/config.lua ============================================================================== --- stable/12/stand/lua/config.lua Wed Oct 31 23:07:47 2018 (r339977) +++ stable/12/stand/lua/config.lua Wed Oct 31 23:08:49 2018 (r339978) @@ -55,7 +55,6 @@ local MSG_XENKERNLOADING = "Loading Xen kernel..." local MSG_KERNLOADING = "Loading kernel..." local MSG_MODLOADING = "Loading configured modules..." local MSG_MODBLACKLIST = "Not loading blacklisted module '%s'" -local MSG_MODLOADFAIL = "Could not load one or more modules!" local MODULEEXPR = '([%w-_]+)' local QVALEXPR = "\"([%w%s%p]-)\"" @@ -267,12 +266,12 @@ local function isValidComment(line) end local function getBlacklist() + local blacklist = {} local blacklist_str = loader.getenv('module_blacklist') if blacklist_str == nil then - return nil + return blacklist end - local blacklist = {} for mod in blacklist_str:gmatch("[;, ]?([%w-_]+)[;, ]?") do blacklist[mod] = true end @@ -292,6 +291,9 @@ local function loadModule(mod, silent) end goto continue end + if not silent then + loader.printc(module_name .. "...") + end local str = "load " if v.type ~= nil then str = str .. "-t " .. v.type .. " " @@ -309,23 +311,29 @@ local function loadModule(mod, silent) end if cli_execute_unparsed(str) ~= 0 then + -- XXX Temporary shim: don't break the boot if + -- loader hadn't been recompiled with this + -- function exposed. + if loader.command_error then + print(loader.command_error()) + end if not silent then - print(MSG_FAILEXMOD:format(str)) + print("failed!") end if v.error ~= nil then cli_execute_unparsed(v.error) end status = false - end - - if v.after ~= nil then + elseif v.after ~= nil then pstatus = cli_execute_unparsed(v.after) == 0 if not pstatus and not silent then print(MSG_FAILEXAF:format(v.after, k)) end + if not silent then + print("ok") + end status = status and pstatus end - end ::continue:: end @@ -622,20 +630,18 @@ function config.loadelf() print(MSG_XENKERNLOADING) if cli_execute_unparsed('load ' .. xen_kernel) ~= 0 then print(MSG_XENKERNFAIL:format(xen_kernel)) - return + return false end end print(MSG_KERNLOADING) loaded = config.loadKernel(kernel) if not loaded then - return + return false end print(MSG_MODLOADING) - if not loadModule(modules, not config.verbose) then - print(MSG_MODLOADFAIL) - end + return loadModule(modules, not config.verbose) end hook.registerType("config.loaded") Modified: stable/12/stand/lua/menu.lua ============================================================================== --- stable/12/stand/lua/menu.lua Wed Oct 31 23:07:47 2018 (r339977) +++ stable/12/stand/lua/menu.lua Wed Oct 31 23:08:49 2018 (r339978) @@ -312,6 +312,9 @@ menu.welcome = { #all_choices .. ")" end, func = function(_, choice, _) + if loader.getenv("kernelname") ~= nil then + loader.perform("unload") + end config.selectKernel(choice) end, alias = {"k", "K"}, @@ -370,7 +373,9 @@ function menu.process(menudef, keypress) break elseif key == core.KEY_ENTER then core.boot() - -- Should not return + -- Should not return. If it does, escape menu handling + -- and drop to loader prompt. + return false end key = string.char(key) @@ -401,6 +406,7 @@ function menu.process(menudef, keypress) end function menu.run() + local autoboot_key local delay = loader.getenv("autoboot_delay") if delay ~= nil and delay:lower() == "no" then @@ -416,8 +422,17 @@ function menu.run() menu.draw(menu.default) - local autoboot_key = menu.autoboot(delay) + if delay ~= nil then + autoboot_key = menu.autoboot(delay) + -- autoboot_key should return the key pressed. It will only + -- return nil if we hit the timeout and executed the timeout + -- command. Bail out. + if autoboot_key == nil then + return + end + end + menu.process(menu.default, autoboot_key) drawn_menu = nil @@ -426,11 +441,6 @@ function menu.run() end function menu.autoboot(delay) - -- If we've specified a nil delay, we can do nothing but assume that - -- we aren't supposed to be autobooting. - if delay == nil then - return nil - end local x = loader.getenv("loader_menu_timeout_x") or 4 local y = loader.getenv("loader_menu_timeout_y") or 23 local endtime = loader.time() + delay @@ -464,6 +474,7 @@ function menu.autoboot(delay) local cmd = loader.getenv("menu_timeout_command") or "boot" cli_execute_unparsed(cmd) + return nil end -- CLI commands From owner-svn-src-all@freebsd.org Wed Oct 31 23:17:02 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-all@freebsd.org Wed Oct 31 23:54:37 2018 Return-Path: Delivered-To: svn-src-all@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 304AA10D2928; Wed, 31 Oct 2018 23:54:37 +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 D80B57279A; Wed, 31 Oct 2018 23:54:36 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAB7C13927; Wed, 31 Oct 2018 23:54:36 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9VNsaJj036183; Wed, 31 Oct 2018 23:54:36 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9VNsaBd036181; Wed, 31 Oct 2018 23:54:36 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201810312354.w9VNsaBd036181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 31 Oct 2018 23:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339980 - stable/12/release X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/12/release X-SVN-Commit-Revision: 339980 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 23:54:37 -0000 Author: gjb Date: Wed Oct 31 23:54:36 2018 New Revision: 339980 URL: https://svnweb.freebsd.org/changeset/base/339980 Log: MFC r339873: 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 r339875: Pass _BRANCH in the reldoc target to ensure the correct src branch is used when generating the hardware.html page. Approved by: re (kib) Sponsored by: The FreeBSD Foundation Modified: stable/12/release/Makefile stable/12/release/release.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/release/Makefile ============================================================================== --- stable/12/release/Makefile Wed Oct 31 23:17:00 2018 (r339979) +++ stable/12/release/Makefile Wed Oct 31 23:54:36 2018 (r339980) @@ -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 Modified: stable/12/release/release.sh ============================================================================== --- stable/12/release/release.sh Wed Oct 31 23:17:00 2018 (r339979) +++ stable/12/release/release.sh Wed Oct 31 23:54:36 2018 (r339980) @@ -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-all@freebsd.org Thu Nov 1 03:38:58 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 02:10:56 2018 Return-Path: Delivered-To: svn-src-all@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 2FDE010DF5F7; Thu, 1 Nov 2018 02:10:56 +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 D9EA9786F8; Thu, 1 Nov 2018 02:10:55 +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 A168615346; Thu, 1 Nov 2018 02:10:55 +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 wA12At0q003683; Thu, 1 Nov 2018 02:10:55 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA12AtIN003682; Thu, 1 Nov 2018 02:10:55 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811010210.wA12AtIN003682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 1 Nov 2018 02:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r339982 - vendor-sys/acpica/20181031 X-SVN-Group: vendor-sys X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: vendor-sys/acpica/20181031 X-SVN-Commit-Revision: 339982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 02:10:56 -0000 Author: jkim Date: Thu Nov 1 02:10:55 2018 New Revision: 339982 URL: https://svnweb.freebsd.org/changeset/base/339982 Log: Tag ACPICA 20181031. Added: vendor-sys/acpica/20181031/ - copied from r339981, vendor-sys/acpica/dist/ From owner-svn-src-all@freebsd.org Thu Nov 1 02:09:59 2018 Return-Path: Delivered-To: svn-src-all@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 07FB010DF3A6; Thu, 1 Nov 2018 02:09:59 +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 ABF2E78577; Thu, 1 Nov 2018 02:09:58 +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 7442115328; Thu, 1 Nov 2018 02:09:58 +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 wA129wrD002878; Thu, 1 Nov 2018 02:09:58 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA129rVY002851; Thu, 1 Nov 2018 02:09:53 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811010209.wA129rVY002851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 1 Nov 2018 02:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r339981 - in vendor-sys/acpica/dist: . source/common source/compiler source/components/debugger source/components/dispatcher source/components/namespace source/components/parser source/... X-SVN-Group: vendor-sys X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in vendor-sys/acpica/dist: . source/common source/compiler source/components/debugger source/components/dispatcher source/components/namespace source/components/parser source/components/tables source/... X-SVN-Commit-Revision: 339981 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 02:09:59 -0000 Author: jkim Date: Thu Nov 1 02:09:52 2018 New Revision: 339981 URL: https://svnweb.freebsd.org/changeset/base/339981 Log: Import ACPICA 20181031. Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/source/common/dmtbdump3.c vendor-sys/acpica/dist/source/common/dmtbinfo3.c vendor-sys/acpica/dist/source/compiler/aslcompile.c vendor-sys/acpica/dist/source/compiler/aslerror.c vendor-sys/acpica/dist/source/compiler/aslload.c vendor-sys/acpica/dist/source/compiler/aslmain.c vendor-sys/acpica/dist/source/compiler/aslmessages.c vendor-sys/acpica/dist/source/compiler/aslmessages.h vendor-sys/acpica/dist/source/compiler/aslpredef.c vendor-sys/acpica/dist/source/compiler/aslxref.c vendor-sys/acpica/dist/source/compiler/dtio.c vendor-sys/acpica/dist/source/compiler/dttable2.c vendor-sys/acpica/dist/source/compiler/prscan.c vendor-sys/acpica/dist/source/components/debugger/dbxface.c vendor-sys/acpica/dist/source/components/dispatcher/dsopcode.c vendor-sys/acpica/dist/source/components/dispatcher/dswload2.c vendor-sys/acpica/dist/source/components/namespace/nsaccess.c vendor-sys/acpica/dist/source/components/parser/psloop.c vendor-sys/acpica/dist/source/components/parser/psobject.c vendor-sys/acpica/dist/source/components/tables/tbxfload.c vendor-sys/acpica/dist/source/include/acdisasm.h vendor-sys/acpica/dist/source/include/acnamesp.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/actbinfo.h vendor-sys/acpica/dist/source/include/actbl3.h vendor-sys/acpica/dist/source/tools/acpidump/apmain.c vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c vendor-sys/acpica/dist/source/tools/acpiexec/aetables.c vendor-sys/acpica/dist/source/tools/acpinames/anmain.c vendor-sys/acpica/dist/source/tools/acpisrc/astable.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/changes.txt Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/common/dmtbdump3.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbdump3.c Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/common/dmtbdump3.c Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/common/dmtbinfo3.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbinfo3.c Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/common/dmtbinfo3.c Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/compiler/aslcompile.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompile.c Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/compiler/aslcompile.c Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/compiler/aslerror.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslerror.c Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/compiler/aslerror.c Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/compiler/aslload.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslload.c Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/compiler/aslload.c Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/compiler/aslmain.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmain.c Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/compiler/aslmain.c Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/compiler/aslmessages.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmessages.c Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/compiler/aslmessages.c Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/compiler/aslmessages.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmessages.h Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/compiler/aslmessages.h Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/compiler/aslpredef.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslpredef.c Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/compiler/aslpredef.c Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/compiler/aslxref.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslxref.c Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/compiler/aslxref.c Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/compiler/dtio.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dtio.c Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/compiler/dtio.c Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/compiler/dttable2.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dttable2.c Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/compiler/dttable2.c Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/compiler/prscan.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/prscan.c Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/compiler/prscan.c Thu Nov 1 02:09:52 2018 (r339981) @@ -1259,7 +1259,6 @@ PrPopDirective ( AslGbl_DirectiveInfo[Info->Directive].Name, Info->Argument, AslGbl_IgnoringThisCodeBlock ? "TRUE" : "FALSE"); - ACPI_FREE (Info); return (AE_OK); } Modified: vendor-sys/acpica/dist/source/components/debugger/dbxface.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbxface.c Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/components/debugger/dbxface.c Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/components/dispatcher/dsopcode.c ============================================================================== --- vendor-sys/acpica/dist/source/components/dispatcher/dsopcode.c Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/components/dispatcher/dsopcode.c Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/components/dispatcher/dswload2.c ============================================================================== --- vendor-sys/acpica/dist/source/components/dispatcher/dswload2.c Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/components/dispatcher/dswload2.c Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/components/namespace/nsaccess.c ============================================================================== --- vendor-sys/acpica/dist/source/components/namespace/nsaccess.c Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/components/namespace/nsaccess.c Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/components/parser/psloop.c ============================================================================== --- vendor-sys/acpica/dist/source/components/parser/psloop.c Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/components/parser/psloop.c Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/components/parser/psobject.c ============================================================================== --- vendor-sys/acpica/dist/source/components/parser/psobject.c Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/components/parser/psobject.c Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/components/tables/tbxfload.c ============================================================================== --- vendor-sys/acpica/dist/source/components/tables/tbxfload.c Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/components/tables/tbxfload.c Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/include/acdisasm.h ============================================================================== --- vendor-sys/acpica/dist/source/include/acdisasm.h Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/include/acdisasm.h Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/include/acnamesp.h ============================================================================== --- vendor-sys/acpica/dist/source/include/acnamesp.h Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/include/acnamesp.h Thu Nov 1 02:09:52 2018 (r339981) @@ -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: vendor-sys/acpica/dist/source/include/acpixf.h ============================================================================== --- vendor-sys/acpica/dist/source/include/acpixf.h Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/include/acpixf.h Thu Nov 1 02:09:52 2018 (r339981) @@ -154,7 +154,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20181003 +#define ACPI_CA_VERSION 0x20181031 #include "acconfig.h" #include "actypes.h" @@ -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: vendor-sys/acpica/dist/source/include/actbinfo.h ============================================================================== --- vendor-sys/acpica/dist/source/include/actbinfo.h Wed Oct 31 23:54:36 2018 (r339980) +++ vendor-sys/acpica/dist/source/include/actbinfo.h Thu Nov 1 02:09:52 2018 (r339981) @@ -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-all@freebsd.org Thu Nov 1 06:06:26 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 08:08:09 2018 Return-Path: Delivered-To: svn-src-all@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 ECAAB10F014C; Thu, 1 Nov 2018 08:08:08 +0000 (UTC) (envelope-from whu@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 9EFC26F494; Thu, 1 Nov 2018 08:08:08 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 80F1318F2D; Thu, 1 Nov 2018 08:08:08 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA1888G6088713; Thu, 1 Nov 2018 08:08:08 GMT (envelope-from whu@FreeBSD.org) Received: (from whu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1888vX088712; Thu, 1 Nov 2018 08:08:08 GMT (envelope-from whu@FreeBSD.org) Message-Id: <201811010808.wA1888vX088712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: whu set sender to whu@FreeBSD.org using -f From: Wei Hu Date: Thu, 1 Nov 2018 08:08:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339984 - stable/12/sys/dev/hyperv/netvsc X-SVN-Group: stable-12 X-SVN-Commit-Author: whu X-SVN-Commit-Paths: stable/12/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 339984 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 08:08:09 -0000 Author: whu Date: Thu Nov 1 08:08:08 2018 New Revision: 339984 URL: https://svnweb.freebsd.org/changeset/base/339984 Log: MFC r339585: Do not drop UDP traffic when TXCSUM_IPV6 flag is on. PR: 231797 Submitted by: whu Reviewed by: dexuan Obtained from: Kevin Morse Approved by: re (rgrimes) Sponsored by: Microsoft Modified: stable/12/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/12/sys/dev/hyperv/netvsc/if_hn.c Thu Nov 1 03:38:57 2018 (r339983) +++ stable/12/sys/dev/hyperv/netvsc/if_hn.c Thu Nov 1 08:08:08 2018 (r339984) @@ -861,7 +861,8 @@ hn_set_hlen(struct mbuf *m_head) PULLUP_HDR(m_head, ehlen + sizeof(*ip6)); ip6 = mtodo(m_head, ehlen); - if (ip6->ip6_nxt != IPPROTO_TCP) { + if (ip6->ip6_nxt != IPPROTO_TCP && + ip6->ip6_nxt != IPPROTO_UDP) { m_freem(m_head); return (NULL); } From owner-svn-src-all@freebsd.org Thu Nov 1 10:09:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06DB810D2CCE; Thu, 1 Nov 2018 10:09:03 +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 BC33371B98; Thu, 1 Nov 2018 08:59:18 +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 9D25F1976E; Thu, 1 Nov 2018 08:59:18 +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 wA18xIp5014360; Thu, 1 Nov 2018 08:59:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA18xI91014359; Thu, 1 Nov 2018 08:59:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811010859.wA18xI91014359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 1 Nov 2018 08:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339986 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 339986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 10:09:03 -0000 Author: hselasky Date: Thu Nov 1 08:59:18 2018 New Revision: 339986 URL: https://svnweb.freebsd.org/changeset/base/339986 Log: MFC r339868: Implement dma_pool_zalloc() in the LinuxKPI. Approved by: re (rgrimes) Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/dmapool.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/dmapool.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/dmapool.h Thu Nov 1 08:17:27 2018 (r339985) +++ stable/12/sys/compat/linuxkpi/common/include/linux/dmapool.h Thu Nov 1 08:59:18 2018 (r339986) @@ -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-all@freebsd.org Thu Nov 1 08:17:28 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 10:09:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89ECA10D2C90; Thu, 1 Nov 2018 10:09:02 +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 9B93471DEB; Thu, 1 Nov 2018 09:00: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 7D1C219775; Thu, 1 Nov 2018 09:00:37 +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 wA190bib014604; Thu, 1 Nov 2018 09:00:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA190bap014603; Thu, 1 Nov 2018 09:00:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811010900.wA190bap014603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 1 Nov 2018 09:00:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339987 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 339987 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 10:09:02 -0000 Author: hselasky Date: Thu Nov 1 09:00:37 2018 New Revision: 339987 URL: https://svnweb.freebsd.org/changeset/base/339987 Log: MFC r339868: Implement dma_pool_zalloc() in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/dmapool.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/dmapool.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/dmapool.h Thu Nov 1 08:59:18 2018 (r339986) +++ stable/11/sys/compat/linuxkpi/common/include/linux/dmapool.h Thu Nov 1 09:00:37 2018 (r339987) @@ -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-all@freebsd.org Thu Nov 1 10:25:23 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 11:35:29 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 11:37:20 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 11:41:41 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 13:12:06 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 13:29:56 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 14:00:56 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 14:24:13 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 14:42:15 2018 Return-Path: Delivered-To: svn-src-all@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 3944810F4950; Thu, 1 Nov 2018 14:42:15 +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 DE9F4788C1; Thu, 1 Nov 2018 14:42:14 +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 C0C641D1D5; Thu, 1 Nov 2018 14:42:14 +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 wA1EgE92091465; Thu, 1 Nov 2018 14:42:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1EgE7H091464; Thu, 1 Nov 2018 14:42:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811011442.wA1EgE7H091464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 1 Nov 2018 14:42:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339996 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 339996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 14:42:15 -0000 Author: hselasky Date: Thu Nov 1 14:42:14 2018 New Revision: 339996 URL: https://svnweb.freebsd.org/changeset/base/339996 Log: MFC r339923: Implement __KERNEL_DIV_ROUND_UP() function macro in the LinuxKPI. Approved by: re (kib) Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Nov 1 14:24:12 2018 (r339995) +++ stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Nov 1 14:42:14 2018 (r339996) @@ -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-all@freebsd.org Thu Nov 1 14:43:35 2018 Return-Path: Delivered-To: svn-src-all@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 3F91110F4A30; Thu, 1 Nov 2018 14:43:35 +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 E2ED378F7C; Thu, 1 Nov 2018 14:43:34 +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 C42011D1F9; Thu, 1 Nov 2018 14:43:34 +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 wA1EhYlC092394; Thu, 1 Nov 2018 14:43:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1EhYvR092393; Thu, 1 Nov 2018 14:43:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811011443.wA1EhYvR092393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 1 Nov 2018 14:43:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339997 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 339997 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 14:43:35 -0000 Author: hselasky Date: Thu Nov 1 14:43:34 2018 New Revision: 339997 URL: https://svnweb.freebsd.org/changeset/base/339997 Log: MFC r339923: Implement __KERNEL_DIV_ROUND_UP() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Nov 1 14:42:14 2018 (r339996) +++ stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Nov 1 14:43:34 2018 (r339997) @@ -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-all@freebsd.org Thu Nov 1 15:19:38 2018 Return-Path: Delivered-To: svn-src-all@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 84AC410F58FB; Thu, 1 Nov 2018 15:19:38 +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 3145F7A97B; Thu, 1 Nov 2018 15:19:38 +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 107761D70F; Thu, 1 Nov 2018 15:19:38 +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 wA1FJb7K009431; Thu, 1 Nov 2018 15:19:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1FJaxd009424; Thu, 1 Nov 2018 15:19:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811011519.wA1FJaxd009424@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:19:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r339998 - in stable/12/sys: sys vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: sys vm X-SVN-Commit-Revision: 339998 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 15:19:38 -0000 Author: markj Date: Thu Nov 1 15:19:36 2018 New Revision: 339998 URL: https://svnweb.freebsd.org/changeset/base/339998 Log: MFC r339661, r339669: Refactor domainset iterators for use by malloc(9) and UMA. Approved by: re (gjb) Modified: stable/12/sys/sys/_domainset.h stable/12/sys/vm/vm_domainset.c stable/12/sys/vm/vm_domainset.h stable/12/sys/vm/vm_glue.c stable/12/sys/vm/vm_kern.c stable/12/sys/vm/vm_object.c stable/12/sys/vm/vm_page.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/sys/_domainset.h ============================================================================== --- stable/12/sys/sys/_domainset.h Thu Nov 1 14:43:34 2018 (r339997) +++ stable/12/sys/sys/_domainset.h Thu Nov 1 15:19:36 2018 (r339998) @@ -54,7 +54,7 @@ typedef struct _domainset domainset_t; struct domainset; struct domainset_ref { struct domainset * volatile dr_policy; - unsigned int dr_iterator; + unsigned int dr_iter; }; #endif /* !_SYS__DOMAINSET_H_ */ Modified: stable/12/sys/vm/vm_domainset.c ============================================================================== --- stable/12/sys/vm/vm_domainset.c Thu Nov 1 14:43:34 2018 (r339997) +++ stable/12/sys/vm/vm_domainset.c Thu Nov 1 15:19:36 2018 (r339998) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -62,26 +63,13 @@ static int vm_domainset_default_stride = 64; * Determine which policy is to be used for this allocation. */ static void -vm_domainset_iter_init(struct vm_domainset_iter *di, struct vm_object *obj, - vm_pindex_t pindex) +vm_domainset_iter_init(struct vm_domainset_iter *di, struct domainset *ds, + int *iter, struct vm_object *obj, vm_pindex_t pindex) { - struct domainset *domain; - struct thread *td; - /* - * object policy takes precedence over thread policy. The policies - * are immutable and unsynchronized. Updates can race but pointer - * loads are assumed to be atomic. - */ - if (obj != NULL && (domain = obj->domain.dr_policy) != NULL) { - di->di_domain = domain; - di->di_iter = &obj->domain.dr_iterator; - } else { - td = curthread; - di->di_domain = td->td_domain.dr_policy; - di->di_iter = &td->td_domain.dr_iterator; - } - di->di_policy = di->di_domain->ds_policy; + di->di_domain = ds; + di->di_iter = iter; + di->di_policy = ds->ds_policy; if (di->di_policy == DOMAINSET_POLICY_INTERLEAVE) { #if VM_NRESERVLEVEL > 0 if (vm_object_reserv(obj)) { @@ -211,33 +199,39 @@ void vm_domainset_iter_page_init(struct vm_domainset_iter *di, struct vm_object *obj, vm_pindex_t pindex, int *domain, int *req) { + struct domainset_ref *dr; - vm_domainset_iter_init(di, obj, pindex); + /* + * Object policy takes precedence over thread policy. The policies + * are immutable and unsynchronized. Updates can race but pointer + * loads are assumed to be atomic. + */ + if (obj != NULL && obj->domain.dr_policy != NULL) + dr = &obj->domain; + else + dr = &curthread->td_domain; + vm_domainset_iter_init(di, dr->dr_policy, &dr->dr_iter, obj, pindex); di->di_flags = *req; *req = (di->di_flags & ~(VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL)) | VM_ALLOC_NOWAIT; vm_domainset_iter_first(di, domain); if (vm_page_count_min_domain(*domain)) - vm_domainset_iter_page(di, domain, req); + vm_domainset_iter_page(di, obj, domain); } int -vm_domainset_iter_page(struct vm_domainset_iter *di, int *domain, int *req) +vm_domainset_iter_page(struct vm_domainset_iter *di, struct vm_object *obj, + int *domain) { - /* - * If we exhausted all options with NOWAIT and did a WAITFAIL it - * is time to return an error to the caller. - */ - if ((*req & VM_ALLOC_WAITFAIL) != 0) - return (ENOMEM); - /* If there are more domains to visit we run the iterator. */ while (--di->di_n != 0) { vm_domainset_iter_next(di, domain); if (!di->di_minskip || !vm_page_count_min_domain(*domain)) return (0); } + + /* If we skipped domains below min restart the search. */ if (di->di_minskip) { di->di_minskip = false; vm_domainset_iter_first(di, domain); @@ -248,34 +242,53 @@ vm_domainset_iter_page(struct vm_domainset_iter *di, i if ((di->di_flags & (VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL)) == 0) return (ENOMEM); - /* - * We have visited all domains with non-blocking allocations, try - * from the beginning with a blocking allocation. - */ + /* Wait for one of the domains to accumulate some free pages. */ + if (obj != NULL) + VM_OBJECT_WUNLOCK(obj); + vm_wait_doms(&di->di_domain->ds_mask); + if (obj != NULL) + VM_OBJECT_WLOCK(obj); + if ((di->di_flags & VM_ALLOC_WAITFAIL) != 0) + return (ENOMEM); + + /* Restart the search. */ vm_domainset_iter_first(di, domain); - *req = di->di_flags; return (0); } - -void -vm_domainset_iter_malloc_init(struct vm_domainset_iter *di, - struct vm_object *obj, int *domain, int *flags) +static void +_vm_domainset_iter_policy_init(struct vm_domainset_iter *di, int *domain, + int *flags) { - vm_domainset_iter_init(di, obj, 0); - if (di->di_policy == DOMAINSET_POLICY_INTERLEAVE) - di->di_policy = DOMAINSET_POLICY_ROUNDROBIN; di->di_flags = *flags; *flags = (di->di_flags & ~M_WAITOK) | M_NOWAIT; vm_domainset_iter_first(di, domain); if (vm_page_count_min_domain(*domain)) - vm_domainset_iter_malloc(di, domain, flags); + vm_domainset_iter_policy(di, domain); } +void +vm_domainset_iter_policy_init(struct vm_domainset_iter *di, + struct domainset *ds, int *domain, int *flags) +{ + + vm_domainset_iter_init(di, ds, &curthread->td_domain.dr_iter, NULL, 0); + _vm_domainset_iter_policy_init(di, domain, flags); +} + +void +vm_domainset_iter_policy_ref_init(struct vm_domainset_iter *di, + struct domainset_ref *dr, int *domain, int *flags) +{ + + vm_domainset_iter_init(di, dr->dr_policy, &dr->dr_iter, NULL, 0); + _vm_domainset_iter_policy_init(di, domain, flags); +} + int -vm_domainset_iter_malloc(struct vm_domainset_iter *di, int *domain, int *flags) +vm_domainset_iter_policy(struct vm_domainset_iter *di, int *domain) { /* If there are more domains to visit we run the iterator. */ @@ -296,45 +309,54 @@ vm_domainset_iter_malloc(struct vm_domainset_iter *di, if ((di->di_flags & M_WAITOK) == 0) return (ENOMEM); - /* - * We have visited all domains with non-blocking allocations, try - * from the beginning with a blocking allocation. - */ + /* Wait for one of the domains to accumulate some free pages. */ + vm_wait_doms(&di->di_domain->ds_mask); + + /* Restart the search. */ vm_domainset_iter_first(di, domain); - *flags = di->di_flags; return (0); } #else /* !NUMA */ + int -vm_domainset_iter_page(struct vm_domainset_iter *di, int *domain, int *flags) +vm_domainset_iter_page(struct vm_domainset_iter *di, struct vm_object *obj, + int *domain) { return (EJUSTRETURN); } void -vm_domainset_iter_page_init(struct vm_domainset_iter *di, - struct vm_object *obj, vm_pindex_t pindex, int *domain, int *flags) +vm_domainset_iter_page_init(struct vm_domainset_iter *di, struct vm_object *obj, + vm_pindex_t pindex, int *domain, int *flags) { *domain = 0; } int -vm_domainset_iter_malloc(struct vm_domainset_iter *di, int *domain, int *flags) +vm_domainset_iter_policy(struct vm_domainset_iter *di, int *domain) { return (EJUSTRETURN); } void -vm_domainset_iter_malloc_init(struct vm_domainset_iter *di, - struct vm_object *obj, int *domain, int *flags) +vm_domainset_iter_policy_init(struct vm_domainset_iter *di, + struct domainset *ds, int *domain, int *flags) { *domain = 0; } -#endif +void +vm_domainset_iter_policy_ref_init(struct vm_domainset_iter *di, + struct domainset_ref *dr, int *domain, int *flags) +{ + + *domain = 0; +} + +#endif /* NUMA */ Modified: stable/12/sys/vm/vm_domainset.h ============================================================================== --- stable/12/sys/vm/vm_domainset.h Thu Nov 1 14:43:34 2018 (r339997) +++ stable/12/sys/vm/vm_domainset.h Thu Nov 1 15:19:36 2018 (r339998) @@ -40,12 +40,15 @@ struct vm_domainset_iter { bool di_minskip; }; -int vm_domainset_iter_page(struct vm_domainset_iter *, int *, int *); +int vm_domainset_iter_page(struct vm_domainset_iter *, struct vm_object *, + int *); void vm_domainset_iter_page_init(struct vm_domainset_iter *, struct vm_object *, vm_pindex_t, int *, int *); -int vm_domainset_iter_malloc(struct vm_domainset_iter *, int *, int *); -void vm_domainset_iter_malloc_init(struct vm_domainset_iter *, - struct vm_object *, int *, int *); +int vm_domainset_iter_policy(struct vm_domainset_iter *, int *); +void vm_domainset_iter_policy_init(struct vm_domainset_iter *, + struct domainset *, int *, int *); +void vm_domainset_iter_policy_ref_init(struct vm_domainset_iter *, + struct domainset_ref *, int *, int *); void vm_wait_doms(const domainset_t *); Modified: stable/12/sys/vm/vm_glue.c ============================================================================== --- stable/12/sys/vm/vm_glue.c Thu Nov 1 14:43:34 2018 (r339997) +++ stable/12/sys/vm/vm_glue.c Thu Nov 1 15:19:36 2018 (r339998) @@ -377,7 +377,7 @@ vm_thread_new(struct thread *td, int pages) */ if (vm_ndomains > 1) { ksobj->domain.dr_policy = DOMAINSET_RR(); - ksobj->domain.dr_iterator = + ksobj->domain.dr_iter = atomic_fetchadd_int(&kstack_domain_iter, 1); } Modified: stable/12/sys/vm/vm_kern.c ============================================================================== --- stable/12/sys/vm/vm_kern.c Thu Nov 1 14:43:34 2018 (r339997) +++ stable/12/sys/vm/vm_kern.c Thu Nov 1 15:19:36 2018 (r339998) @@ -235,13 +235,13 @@ kmem_alloc_attr(vm_size_t size, int flags, vm_paddr_t vm_offset_t addr; int domain; - vm_domainset_iter_malloc_init(&di, kernel_object, &domain, &flags); + vm_domainset_iter_policy_init(&di, DOMAINSET_RR(), &domain, &flags); do { addr = kmem_alloc_attr_domain(domain, size, flags, low, high, memattr); if (addr != 0) break; - } while (vm_domainset_iter_malloc(&di, &domain, &flags) == 0); + } while (vm_domainset_iter_policy(&di, &domain) == 0); return (addr); } @@ -319,13 +319,13 @@ kmem_alloc_contig(vm_size_t size, int flags, vm_paddr_ vm_offset_t addr; int domain; - vm_domainset_iter_malloc_init(&di, kernel_object, &domain, &flags); + vm_domainset_iter_policy_init(&di, DOMAINSET_RR(), &domain, &flags); do { addr = kmem_alloc_contig_domain(domain, size, flags, low, high, alignment, boundary, memattr); if (addr != 0) break; - } while (vm_domainset_iter_malloc(&di, &domain, &flags) == 0); + } while (vm_domainset_iter_policy(&di, &domain) == 0); return (addr); } @@ -406,12 +406,12 @@ kmem_malloc(vm_size_t size, int flags) vm_offset_t addr; int domain; - vm_domainset_iter_malloc_init(&di, kernel_object, &domain, &flags); + vm_domainset_iter_policy_init(&di, DOMAINSET_RR(), &domain, &flags); do { addr = kmem_malloc_domain(domain, size, flags); if (addr != 0) break; - } while (vm_domainset_iter_malloc(&di, &domain, &flags) == 0); + } while (vm_domainset_iter_policy(&di, &domain) == 0); return (addr); } Modified: stable/12/sys/vm/vm_object.c ============================================================================== --- stable/12/sys/vm/vm_object.c Thu Nov 1 14:43:34 2018 (r339997) +++ stable/12/sys/vm/vm_object.c Thu Nov 1 15:19:36 2018 (r339998) @@ -274,6 +274,7 @@ _vm_object_allocate(objtype_t type, vm_pindex_t size, panic("_vm_object_allocate: type %d is undefined", type); } object->size = size; + object->domain.dr_policy = NULL; object->generation = 1; object->ref_count = 1; object->memattr = VM_MEMATTR_DEFAULT; Modified: stable/12/sys/vm/vm_page.c ============================================================================== --- stable/12/sys/vm/vm_page.c Thu Nov 1 14:43:34 2018 (r339997) +++ stable/12/sys/vm/vm_page.c Thu Nov 1 15:19:36 2018 (r339998) @@ -1753,7 +1753,7 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi mpred); if (m != NULL) break; - } while (vm_domainset_iter_page(&di, &domain, &req) == 0); + } while (vm_domainset_iter_page(&di, object, &domain) == 0); return (m); } @@ -1990,7 +1990,7 @@ vm_page_alloc_contig(vm_object_t object, vm_pindex_t p npages, low, high, alignment, boundary, memattr); if (m != NULL) break; - } while (vm_domainset_iter_page(&di, &domain, &req) == 0); + } while (vm_domainset_iter_page(&di, object, &domain) == 0); return (m); } @@ -2191,7 +2191,7 @@ vm_page_alloc_freelist(int freelist, int req) m = vm_page_alloc_freelist_domain(domain, freelist, req); if (m != NULL) break; - } while (vm_domainset_iter_page(&di, &domain, &req) == 0); + } while (vm_domainset_iter_page(&di, NULL, &domain) == 0); return (m); } @@ -2830,7 +2830,7 @@ vm_page_reclaim_contig(int req, u_long npages, vm_padd high, alignment, boundary); if (ret) break; - } while (vm_domainset_iter_page(&di, &domain, &req) == 0); + } while (vm_domainset_iter_page(&di, NULL, &domain) == 0); return (ret); } From owner-svn-src-all@freebsd.org Thu Nov 1 15:27:23 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 15:30:05 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 15:40:58 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 15:47:09 2018 Return-Path: Delivered-To: svn-src-all@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 5BDBE10F6748; Thu, 1 Nov 2018 15:47:09 +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 962C67C225; Thu, 1 Nov 2018 15:47:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72BD71DC4B; Thu, 1 Nov 2018 15:47:08 +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 wA1Fl8W0025266; Thu, 1 Nov 2018 15:47:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1Fl7SX025262; Thu, 1 Nov 2018 15:47:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811011547.wA1Fl7SX025262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 1 Nov 2018 15:47:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340002 - in stable/12/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src modules/linuxkpi X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src modules/linuxkpi X-SVN-Commit-Revision: 340002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 15:47:09 -0000 Author: hselasky Date: Thu Nov 1 15:47:07 2018 New Revision: 340002 URL: https://svnweb.freebsd.org/changeset/base/340002 Log: MFC r339924: Implement the dump_stack() function in the LinuxKPI. Approved by: re (gjb) Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h stable/12/sys/compat/linuxkpi/common/src/linux_compat.c stable/12/sys/modules/linuxkpi/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Nov 1 15:40:57 2018 (r340001) +++ stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Nov 1 15:47:07 2018 (r340002) @@ -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: stable/12/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Thu Nov 1 15:40:57 2018 (r340001) +++ stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Thu Nov 1 15:47:07 2018 (r340002) @@ -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: stable/12/sys/modules/linuxkpi/Makefile ============================================================================== --- stable/12/sys/modules/linuxkpi/Makefile Thu Nov 1 15:40:57 2018 (r340001) +++ stable/12/sys/modules/linuxkpi/Makefile Thu Nov 1 15:47:07 2018 (r340002) @@ -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-all@freebsd.org Thu Nov 1 15:50:59 2018 Return-Path: Delivered-To: svn-src-all@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 7EA4410F68DF; Thu, 1 Nov 2018 15:50:59 +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 32C1C7C621; Thu, 1 Nov 2018 15:50:59 +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 EF0051DD6B; Thu, 1 Nov 2018 15:50:58 +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 wA1Fowxp025608; Thu, 1 Nov 2018 15:50:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1Fowv6025605; Thu, 1 Nov 2018 15:50:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811011550.wA1Fowv6025605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 1 Nov 2018 15:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340003 - in stable/11/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src modules/linuxkpi X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src modules/linuxkpi X-SVN-Commit-Revision: 340003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 15:50:59 -0000 Author: hselasky Date: Thu Nov 1 15:50:57 2018 New Revision: 340003 URL: https://svnweb.freebsd.org/changeset/base/340003 Log: MFC r339924: Implement the dump_stack() function in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h stable/11/sys/compat/linuxkpi/common/src/linux_compat.c stable/11/sys/modules/linuxkpi/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Nov 1 15:47:07 2018 (r340002) +++ stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Nov 1 15:50:57 2018 (r340003) @@ -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: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Thu Nov 1 15:47:07 2018 (r340002) +++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Thu Nov 1 15:50:57 2018 (r340003) @@ -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: stable/11/sys/modules/linuxkpi/Makefile ============================================================================== --- stable/11/sys/modules/linuxkpi/Makefile Thu Nov 1 15:47:07 2018 (r340002) +++ stable/11/sys/modules/linuxkpi/Makefile Thu Nov 1 15:50:57 2018 (r340003) @@ -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-all@freebsd.org Thu Nov 1 15:51:50 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 15:52:50 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 16:00:01 2018 Return-Path: Delivered-To: svn-src-all@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 A74B710F7040; Thu, 1 Nov 2018 16:00:01 +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 4E2557D13C; Thu, 1 Nov 2018 16:00:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 119F21DE33; Thu, 1 Nov 2018 16:00:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA1G00A1030953; Thu, 1 Nov 2018 16:00:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1G00og030952; Thu, 1 Nov 2018 16:00:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811011600.wA1G00og030952@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 16:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340006 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 340006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 16:00:01 -0000 Author: markj Date: Thu Nov 1 16:00:00 2018 New Revision: 340006 URL: https://svnweb.freebsd.org/changeset/base/340006 Log: MFC r339686: Use a vm_domainset iterator in keg_fetch_slab(). Approved by: re (kib) Modified: stable/12/sys/vm/uma_core.c stable/12/sys/vm/uma_int.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/uma_core.c ============================================================================== --- stable/12/sys/vm/uma_core.c Thu Nov 1 15:52:49 2018 (r340005) +++ stable/12/sys/vm/uma_core.c Thu Nov 1 16:00:00 2018 (r340006) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -79,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -991,6 +993,8 @@ zone_drain(uma_zone_t zone) /* * Allocate a new slab for a keg. This does not insert the slab onto a list. + * If the allocation was successful, the keg lock will be held upon return, + * otherwise the keg will be left unlocked. * * Arguments: * wait Shall we wait? @@ -1012,13 +1016,12 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom KASSERT(domain >= 0 && domain < vm_ndomains, ("keg_alloc_slab: domain %d out of range", domain)); mtx_assert(&keg->uk_lock, MA_OWNED); - slab = NULL; - mem = NULL; allocf = keg->uk_allocf; KEG_UNLOCK(keg); - size = keg->uk_ppera * PAGE_SIZE; + slab = NULL; + mem = NULL; if (keg->uk_flags & UMA_ZONE_OFFPAGE) { slab = zone_alloc_item(keg->uk_slabzone, NULL, domain, wait); if (slab == NULL) @@ -1041,6 +1044,7 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom wait |= M_NODUMP; /* zone is passed for legacy reasons. */ + size = keg->uk_ppera * PAGE_SIZE; mem = allocf(zone, size, domain, &flags, wait); if (mem == NULL) { if (keg->uk_flags & UMA_ZONE_OFFPAGE) @@ -1079,20 +1083,18 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom goto out; } } -out: KEG_LOCK(keg); CTR3(KTR_UMA, "keg_alloc_slab: allocated slab %p for %s(%p)", slab, keg->uk_name, keg); - if (slab != NULL) { - if (keg->uk_flags & UMA_ZONE_HASH) - UMA_HASH_INSERT(&keg->uk_hash, slab, mem); + if (keg->uk_flags & UMA_ZONE_HASH) + UMA_HASH_INSERT(&keg->uk_hash, slab, mem); - keg->uk_pages += keg->uk_ppera; - keg->uk_free += keg->uk_ipers; - } + keg->uk_pages += keg->uk_ppera; + keg->uk_free += keg->uk_ipers; +out: return (slab); } @@ -1559,7 +1561,6 @@ keg_ctor(void *mem, int size, void *udata, int flags) keg->uk_init = arg->uminit; keg->uk_fini = arg->fini; keg->uk_align = arg->align; - keg->uk_cursor = 0; keg->uk_free = 0; keg->uk_reserve = 0; keg->uk_pages = 0; @@ -1567,6 +1568,14 @@ keg_ctor(void *mem, int size, void *udata, int flags) keg->uk_slabzone = NULL; /* + * We use a global round-robin policy by default. Zones with + * UMA_ZONE_NUMA set will use first-touch instead, in which case the + * iterator is never run. + */ + keg->uk_dr.dr_policy = DOMAINSET_RR(); + keg->uk_dr.dr_iter = 0; + + /* * The master zone is passed to us at keg-creation time. */ zone = arg->zone; @@ -2607,7 +2616,7 @@ uma_zalloc_domain(uma_zone_t zone, void *udata, int do * only 'domain'. */ static uma_slab_t -keg_first_slab(uma_keg_t keg, int domain, int rr) +keg_first_slab(uma_keg_t keg, int domain, bool rr) { uma_domain_t dom; uma_slab_t slab; @@ -2636,43 +2645,51 @@ keg_first_slab(uma_keg_t keg, int domain, int rr) } static uma_slab_t -keg_fetch_slab(uma_keg_t keg, uma_zone_t zone, int rdomain, int flags) +keg_fetch_free_slab(uma_keg_t keg, int domain, bool rr, int flags) { + uint32_t reserve; + + mtx_assert(&keg->uk_lock, MA_OWNED); + + reserve = (flags & M_USE_RESERVE) != 0 ? 0 : keg->uk_reserve; + if (keg->uk_free <= reserve) + return (NULL); + return (keg_first_slab(keg, domain, rr)); +} + +static uma_slab_t +keg_fetch_slab(uma_keg_t keg, uma_zone_t zone, int rdomain, const int flags) +{ + struct vm_domainset_iter di; uma_domain_t dom; uma_slab_t slab; - int allocflags, domain, reserve, rr, start; + int aflags, domain; + bool rr; +restart: mtx_assert(&keg->uk_lock, MA_OWNED); - slab = NULL; - reserve = 0; - allocflags = flags; - if ((flags & M_USE_RESERVE) == 0) - reserve = keg->uk_reserve; /* - * Round-robin for non first-touch zones when there is more than one - * domain. + * Use the keg's policy if upper layers haven't already specified a + * domain (as happens with first-touch zones). + * + * To avoid races we run the iterator with the keg lock held, but that + * means that we cannot allow the vm_domainset layer to sleep. Thus, + * clear M_WAITOK and handle low memory conditions locally. */ - if (vm_ndomains == 1) - rdomain = 0; rr = rdomain == UMA_ANYDOMAIN; if (rr) { - start = keg->uk_cursor; - do { - keg->uk_cursor = (keg->uk_cursor + 1) % vm_ndomains; - domain = keg->uk_cursor; - } while (VM_DOMAIN_EMPTY(domain) && domain != start); - domain = start = keg->uk_cursor; - /* Only block on the second pass. */ - if ((flags & (M_WAITOK | M_NOVM)) == M_WAITOK) - allocflags = (allocflags & ~M_WAITOK) | M_NOWAIT; - } else - domain = start = rdomain; + aflags = (flags & ~M_WAITOK) | M_NOWAIT; + vm_domainset_iter_policy_ref_init(&di, &keg->uk_dr, &domain, + &aflags); + } else { + aflags = flags; + domain = rdomain; + } -again: - do { - if (keg->uk_free > reserve && - (slab = keg_first_slab(keg, domain, rr)) != NULL) { + for (;;) { + slab = keg_fetch_free_slab(keg, domain, rr, flags); + if (slab != NULL) { MPASS(slab->us_keg == keg); return (slab); } @@ -2700,7 +2717,7 @@ again: msleep(keg, &keg->uk_lock, PVM, "keglimit", 0); continue; } - slab = keg_alloc_slab(keg, zone, domain, allocflags); + slab = keg_alloc_slab(keg, zone, domain, aflags); /* * If we got a slab here it's safe to mark it partially used * and return. We assume that the caller is going to remove @@ -2712,17 +2729,16 @@ again: LIST_INSERT_HEAD(&dom->ud_part_slab, slab, us_link); return (slab); } - if (rr) { - do { - domain = (domain + 1) % vm_ndomains; - } while (VM_DOMAIN_EMPTY(domain) && domain != start); + KEG_LOCK(keg); + if (rr && vm_domainset_iter_policy(&di, &domain) != 0) { + if ((flags & M_WAITOK) != 0) { + KEG_UNLOCK(keg); + vm_wait_doms(&keg->uk_dr.dr_policy->ds_mask); + KEG_LOCK(keg); + goto restart; + } + break; } - } while (domain != start); - - /* Retry domain scan with blocking. */ - if (allocflags != flags) { - allocflags = flags; - goto again; } /* @@ -2730,8 +2746,7 @@ again: * could have while we were unlocked. Check again before we * fail. */ - if (keg->uk_free > reserve && - (slab = keg_first_slab(keg, domain, rr)) != NULL) { + if ((slab = keg_fetch_free_slab(keg, domain, rr, flags)) != NULL) { MPASS(slab->us_keg == keg); return (slab); } @@ -3606,14 +3621,13 @@ uma_prealloc(uma_zone_t zone, int items) domain = 0; if (slabs * keg->uk_ipers < items) slabs++; - while (slabs > 0) { + while (slabs-- > 0) { slab = keg_alloc_slab(keg, zone, domain, M_WAITOK); if (slab == NULL) - break; + return; MPASS(slab->us_keg == keg); dom = &keg->uk_domain[slab->us_domain]; LIST_INSERT_HEAD(&dom->ud_free_slab, slab, us_link); - slabs--; do { domain = (domain + 1) % vm_ndomains; } while (VM_DOMAIN_EMPTY(domain)); Modified: stable/12/sys/vm/uma_int.h ============================================================================== --- stable/12/sys/vm/uma_int.h Thu Nov 1 15:52:49 2018 (r340005) +++ stable/12/sys/vm/uma_int.h Thu Nov 1 16:00:00 2018 (r340006) @@ -226,7 +226,7 @@ struct uma_keg { struct uma_hash uk_hash; LIST_HEAD(,uma_zone) uk_zones; /* Keg's zones */ - uint32_t uk_cursor; /* Domain alloc cursor. */ + struct domainset_ref uk_dr; /* Domain selection policy. */ uint32_t uk_align; /* Alignment mask */ uint32_t uk_pages; /* Total page count */ uint32_t uk_free; /* Count of items free in slabs */ From owner-svn-src-all@freebsd.org Thu Nov 1 16:36:35 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 16:50:21 2018 Return-Path: Delivered-To: svn-src-all@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 5438C10F835C; Thu, 1 Nov 2018 16:50:21 +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 056097F51C; Thu, 1 Nov 2018 16:50:21 +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 D960E1E690; Thu, 1 Nov 2018 16:50:20 +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 wA1GoKT0056918; Thu, 1 Nov 2018 16:50:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1GoJ4a056913; Thu, 1 Nov 2018 16:50:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811011650.wA1GoJ4a056913@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 16:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340007 - in stable/12: share/man/man4 sys/arm64/arm64 sys/kern sys/vm sys/x86/acpica X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/arm64/arm64 sys/kern sys/vm sys/x86/acpica X-SVN-Commit-Revision: 340007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 16:50:21 -0000 Author: markj Date: Thu Nov 1 16:50:19 2018 New Revision: 340007 URL: https://svnweb.freebsd.org/changeset/base/340007 Log: MFC r339616: Make it possible to disable NUMA support with a tunable. PR: 231460 Approved by: re (gjb) Modified: stable/12/share/man/man4/numa.4 stable/12/sys/arm64/arm64/mp_machdep.c stable/12/sys/kern/kern_cpuset.c stable/12/sys/vm/vm_phys.c stable/12/sys/x86/acpica/srat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/numa.4 ============================================================================== --- stable/12/share/man/man4/numa.4 Thu Nov 1 16:00:00 2018 (r340006) +++ stable/12/share/man/man4/numa.4 Thu Nov 1 16:50:19 2018 (r340007) @@ -24,18 +24,16 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2018 +.Dd October 22, 2018 .Dt NUMA 4 .Os .Sh NAME .Nm NUMA .Nd Non-Uniform Memory Access .Sh SYNOPSIS -.Cd options SMP -.Cd options MAXMEMDOM=16 +.Cd options MAXMEMDOM +.Cd options NUMA .Pp -.In sys/cpuset.h -.In sys/bus.h .Sh DESCRIPTION Non-Uniform Memory Access is a computer architecture design which involves unequal costs between processors, memory and IO devices @@ -47,14 +45,26 @@ architecture, the latency to access specific memory or depends upon which processor the memory or device is attached to. Accessing memory local to a processor is faster than accessing memory that is connected to one of the other processors. +.Fx +implements NUMA-aware memory allocation policies. +By default it attempts to ensure that allocations are balanced across +each domain. +Users may override the default domain selection policy using +.Xr cpuset 1 . .Pp .Nm -is enabled when the +support is enabled when the .Cd NUMA -option is used in a kernel configuration -file and the +option is specified in the kernel configuration file. +Each platform defines the .Cd MAXMEMDOM -option is set to a value greater than 1. +constant, which specifies the maximum number of supported NUMA domains. +This constant may be specified in the kernel configuration file. +.Nm +support can be disabled at boot time by setting the +.Va vm.numa.disabled +tunable to 1. +Other values for this tunable are currently ignored. .Pp Thread and process .Nm @@ -128,7 +138,7 @@ tool first appeared in .Fx 11.0 and were removed in .Fx 12.0 . -Current implementation appeared in +The current implementation appeared in .Fx 12.0 . .Pp .Sh AUTHORS Modified: stable/12/sys/arm64/arm64/mp_machdep.c ============================================================================== --- stable/12/sys/arm64/arm64/mp_machdep.c Thu Nov 1 16:00:00 2018 (r340006) +++ stable/12/sys/arm64/arm64/mp_machdep.c Thu Nov 1 16:50:19 2018 (r340007) @@ -576,11 +576,12 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size return (FALSE); /* Try to read the numa node of this cpu */ - if (OF_getencprop(node, "numa-node-id", &domain, sizeof(domain)) > 0) { - __pcpu[id].pc_domain = domain; - if (domain < MAXMEMDOM) - CPU_SET(id, &cpuset_domain[domain]); - } + if (vm_ndomains == 1 || + OF_getencprop(node, "numa-node-id", &domain, sizeof(domain)) <= 0) + domain = 0; + __pcpu[id].pc_domain = domain; + if (domain < MAXMEMDOM) + CPU_SET(id, &cpuset_domain[domain]); return (TRUE); } Modified: stable/12/sys/kern/kern_cpuset.c ============================================================================== --- stable/12/sys/kern/kern_cpuset.c Thu Nov 1 16:00:00 2018 (r340006) +++ stable/12/sys/kern/kern_cpuset.c Thu Nov 1 16:50:19 2018 (r340007) @@ -458,6 +458,12 @@ _domainset_create(struct domainset *domain, struct dom struct domainset *ndomain; int i, j, max; + KASSERT(domain->ds_cnt <= vm_ndomains, + ("invalid domain count in domainset %p", domain)); + KASSERT(domain->ds_policy != DOMAINSET_POLICY_PREFER || + domain->ds_prefer < vm_ndomains, + ("invalid preferred domain in domains %p", domain)); + mtx_lock_spin(&cpuset_lock); LIST_FOREACH(ndomain, &cpuset_domains, ds_link) if (domainset_equal(ndomain, domain)) Modified: stable/12/sys/vm/vm_phys.c ============================================================================== --- stable/12/sys/vm/vm_phys.c Thu Nov 1 16:00:00 2018 (r340006) +++ stable/12/sys/vm/vm_phys.c Thu Nov 1 16:50:19 2018 (r340007) @@ -597,11 +597,22 @@ vm_phys_register_domains(int ndomains, struct mem_affi int *locality) { #ifdef NUMA - int i; + int d, i; - vm_ndomains = ndomains; - mem_affinity = affinity; - mem_locality = locality; + /* + * For now the only override value that we support is 1, which + * effectively disables NUMA-awareness in the allocators. + */ + d = 0; + TUNABLE_INT_FETCH("vm.numa.disabled", &d); + if (d) + ndomains = 1; + + if (ndomains > 1) { + vm_ndomains = ndomains; + mem_affinity = affinity; + mem_locality = locality; + } for (i = 0; i < vm_ndomains; i++) DOMAINSET_SET(i, &all_domains); Modified: stable/12/sys/x86/acpica/srat.c ============================================================================== --- stable/12/sys/x86/acpica/srat.c Thu Nov 1 16:00:00 2018 (r340006) +++ stable/12/sys/x86/acpica/srat.c Thu Nov 1 16:50:19 2018 (r340007) @@ -535,11 +535,7 @@ srat_set_cpus(void *dummy) if (!cpu->enabled) panic("SRAT: CPU with APIC ID %u is not known", pc->pc_apic_id); -#ifdef NUMA - pc->pc_domain = cpu->domain; -#else - pc->pc_domain = 0; -#endif + pc->pc_domain = vm_ndomains > 1 ? cpu->domain : 0; CPU_SET(i, &cpuset_domain[pc->pc_domain]); if (bootverbose) printf("SRAT: CPU %u has memory domain %d\n", i, @@ -564,7 +560,7 @@ acpi_map_pxm_to_vm_domainid(int pxm) for (i = 0; i < ndomain; i++) { if (domain_pxm[i] == pxm) - return (i); + return (vm_ndomains > 1 ? i : 0); } return (-1); From owner-svn-src-all@freebsd.org Thu Nov 1 17:05:11 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 17:26:19 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 17:29:16 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 17:36:43 2018 Return-Path: Delivered-To: svn-src-all@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 D6BFB10F9791; Thu, 1 Nov 2018 17:36:43 +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 8CBDB8179A; Thu, 1 Nov 2018 17:36:43 +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 6EFAF1EECE; Thu, 1 Nov 2018 17:36:43 +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 wA1Hah1K082544; Thu, 1 Nov 2018 17:36:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1Hahmn082543; Thu, 1 Nov 2018 17:36:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811011736.wA1Hahmn082543@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:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340011 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 340011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 17:36:44 -0000 Author: markj Date: Thu Nov 1 17:36:42 2018 New Revision: 340011 URL: https://svnweb.freebsd.org/changeset/base/340011 Log: MFC r339688: Add an #include required after r339686. Reported by: lwhsu Approved by: re (gjb) Modified: stable/12/sys/vm/uma_int.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/uma_int.h ============================================================================== --- stable/12/sys/vm/uma_int.h Thu Nov 1 17:29:14 2018 (r340010) +++ stable/12/sys/vm/uma_int.h Thu Nov 1 17:36:42 2018 (r340011) @@ -31,6 +31,7 @@ */ #include +#include #include /* From owner-svn-src-all@freebsd.org Thu Nov 1 17:37:21 2018 Return-Path: Delivered-To: svn-src-all@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 5810310F981D; Thu, 1 Nov 2018 17:37:21 +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 09E9A818DF; Thu, 1 Nov 2018 17:37:21 +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 C60831EED1; Thu, 1 Nov 2018 17:37:20 +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 wA1HbKV1082629; Thu, 1 Nov 2018 17:37:20 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1HbKjJ082627; Thu, 1 Nov 2018 17:37:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811011737.wA1HbKjJ082627@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 17:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340012 - stable/12/stand/lua X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/stand/lua X-SVN-Commit-Revision: 340012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 17:37:21 -0000 Author: kevans Date: Thu Nov 1 17:37:20 2018 New Revision: 340012 URL: https://svnweb.freebsd.org/changeset/base/340012 Log: MFC r339849: 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. Approved by: re (gjb) Modified: stable/12/stand/lua/core.lua Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/lua/core.lua ============================================================================== --- stable/12/stand/lua/core.lua Thu Nov 1 17:36:42 2018 (r340011) +++ stable/12/stand/lua/core.lua Thu Nov 1 17:37:20 2018 (r340012) @@ -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-all@freebsd.org Thu Nov 1 17:43:29 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 17:45:30 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 18:19:11 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 18:33:17 2018 Return-Path: Delivered-To: svn-src-all@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 47B0D10FB283 for ; Thu, 1 Nov 2018 18:33:17 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yw1-xc2b.google.com (mail-yw1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) (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 C043784BA9 for ; Thu, 1 Nov 2018 18:33:16 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yw1-xc2b.google.com with SMTP id j75-v6so8293259ywj.10 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=Cp1HkeVYgDeywyV7mxuqnzmaOgXGMZG2HVGbRPMkA4WA+UQXrhDjJ0ZZ1/XTw69/bn aX1P4E7UeqIvn9syYBTeaF91kQjQDEW5VIF5FWfjJLOVN1Z1VNQ2bNtZeIpkVBQaJDaC JZAm9lOH6s1cQzeAkIDZuSHfjhmochWC0MwCX9aghiuHLxXxUvbLCpiOlXJCy8ejv7Dt IO5MfLods1laTbSGt5Bky+sFBJKdwqfUoFStmOEn6gmMabXbfAJGAAuDDpXcmw5Rb+BR qYb7icCGWQJQhMR6zj6j+C34USExQbOipkRcdQ/WscdhqO/Xx1UTWbAXsQc/oNZckwHd HD2w== X-Gm-Message-State: AGRZ1gKd41NN1E/2hy0jLj5yJF5e6ccTMLJS5iEuSX3qFlH5M0yZSfW3 Ii2VJDaOhk+KB774ey5fGYUIbm+UL9IVFW/lnB0N3A== 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 18:34:30 2018 Return-Path: Delivered-To: svn-src-all@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 54D3910FB2F2; Thu, 1 Nov 2018 18:34:30 +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 EE6FD84D1D; Thu, 1 Nov 2018 18:34:29 +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 CA2331F8FE; Thu, 1 Nov 2018 18:34:29 +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 wA1IYTlT015463; Thu, 1 Nov 2018 18:34:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1IYRqc015449; Thu, 1 Nov 2018 18:34:27 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811011834.wA1IYRqc015449@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 18:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340016 - in stable/11: sys/sys sys/x86/acpica sys/x86/include sys/x86/iommu sys/x86/isa sys/x86/x86 sys/x86/xen sys/xen usr.bin/vmstat X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/11: sys/sys sys/x86/acpica sys/x86/include sys/x86/iommu sys/x86/isa sys/x86/x86 sys/x86/xen sys/xen usr.bin/vmstat X-SVN-Commit-Revision: 340016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 18:34:30 -0000 Author: jhb Date: Thu Nov 1 18:34:26 2018 New Revision: 340016 URL: https://svnweb.freebsd.org/changeset/base/340016 Log: MFC 338360,338415,338624,338630,338631,338725: Dynamic x86 IRQ layout. 338360: Dynamically allocate IRQ ranges on x86. Previously, x86 used static ranges of IRQ values for different types of I/O interrupts. Interrupt pins on I/O APICs and 8259A PICs used IRQ values from 0 to 254. MSI interrupts used a compile-time-defined range starting at 256, and Xen event channels used a compile-time-defined range after MSI. Some recent systems have more than 255 I/O APIC interrupt pins which resulted in those IRQ values overflowing into the MSI range triggering an assertion failure. Replace statically assigned ranges with dynamic ranges. Do a single pass computing the sizes of the IRQ ranges (PICs, MSI, Xen) to determine the total number of IRQs required. Allocate the interrupt source and interrupt count arrays dynamically once this pass has completed. To minimize runtime complexity these arrays are only sized once during bootup. The PIC range is determined by the PICs present in the system. The MSI and Xen ranges continue to use a fixed size, though this does make it possible to turn the MSI range size into a tunable in the future. As a result, various places are updated to use dynamic limits instead of constants. In addition, the vmstat(8) utility has been taught to understand that some kernels may treat 'intrcnt' and 'intrnames' as pointers rather than arrays when extracting interrupt stats from a crashdump. This is determined by the presence (vs absence) of a global 'nintrcnt' symbol. This change reverts r189404 which worked around a buggy BIOS which enumerated an I/O APIC twice (using the same memory mapped address for both entries but using an IRQ base of 256 for one entry and a valid IRQ base for the second entry). Making the "base" of MSI IRQ values dynamic avoids the panic that r189404 worked around, and there may now be valid I/O APICs with an IRQ base above 256 which this workaround would incorrectly skip. If in the future the issue reported in PR 130483 reoccurs, we will have to add a pass over the I/O APIC entries in the MADT to detect duplicates using the memory mapped address and use some strategy to choose the "correct" one. While here, reserve room in intrcnts for the Hyper-V counters. 338415: Fix build of x86 UP kernels after dynamic IRQ changes in r338360. 338624: msi: remove the check that interrupt sources have been added When running as a specific type of Xen guest the hypervisor won't provide any emulated IO-APICs or legacy PICs at all, thus hitting the following assert in the MSI code: panic: Assertion num_io_irqs > 0 failed at /usr/src/sys/x86/x86/msi.c:334 cpuid = 0 time = 1 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffffff826ffa70 vpanic() at vpanic+0x1a3/frame 0xffffffff826ffad0 panic() at panic+0x43/frame 0xffffffff826ffb30 msi_init() at msi_init+0xed/frame 0xffffffff826ffb40 apic_setup_io() at apic_setup_io+0x72/frame 0xffffffff826ffb50 mi_startup() at mi_startup+0x118/frame 0xffffffff826ffb70 start_kernel() at start_kernel+0x10 Fix this by removing the assert in the MSI code, since it's possible to get to the MSI initialization without having registered any other interrupt sources. 338630: lapic: skip setting intrcnt if lapic is not present Instead of panicking. Legacy PVH mode doesn't provide a lapic, and since native_lapic_intrcnt is called unconditionally this would cause the assert to trigger. Change the assert into a continue in order to take into account the possibility of systems without a lapic. 338631: xen: legacy PVH fixes for the new interrupt count Register interrupts using the PIC pic_register_sources method instead of doing it in apic_setup_io. This is now required, since the internal interrupt structures are not yet setup when calling apic_setup_io. 338725: Fix a regression in r338360 when booting an x86 machine without APIC. The atpic_register_sources callback tries to avoid registering interrupt sources that would collide with an I/O APIC. However, the previous implementation was failing to register IRQs 8-15 since the slave PIC saw valid IRQs from the master and assumed an I/O APIC was present. To fix, go back to registering all 8259A interrupt sources in one loop when the master's register_sources method is invoked. PR: 229429, 130483, 231291 Modified: stable/11/sys/sys/interrupt.h stable/11/sys/x86/acpica/madt.c stable/11/sys/x86/include/apicvar.h stable/11/sys/x86/include/intr_machdep.h stable/11/sys/x86/iommu/intel_intrmap.c stable/11/sys/x86/isa/atpic.c stable/11/sys/x86/x86/intr_machdep.c stable/11/sys/x86/x86/io_apic.c stable/11/sys/x86/x86/local_apic.c stable/11/sys/x86/x86/msi.c stable/11/sys/x86/x86/nexus.c stable/11/sys/x86/xen/pvcpu_enum.c stable/11/sys/x86/xen/xen_intr.c stable/11/sys/x86/xen/xen_msi.c stable/11/sys/x86/xen/xen_nexus.c stable/11/sys/xen/xen_intr.h stable/11/usr.bin/vmstat/vmstat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/interrupt.h ============================================================================== --- stable/11/sys/sys/interrupt.h Thu Nov 1 18:19:10 2018 (r340015) +++ stable/11/sys/sys/interrupt.h Thu Nov 1 18:34:26 2018 (r340016) @@ -149,8 +149,13 @@ extern struct intr_event *clk_intr_event; extern void *vm_ih; /* Counts and names for statistics (defined in MD code). */ +#if defined(__amd64__) || defined(__i386__) +extern u_long *intrcnt; /* counts for for each device and stray */ +extern char *intrnames; /* string table containing device names */ +#else extern u_long intrcnt[]; /* counts for for each device and stray */ extern char intrnames[]; /* string table containing device names */ +#endif extern size_t sintrcnt; /* size of intrcnt table */ extern size_t sintrnames; /* size of intrnames table */ Modified: stable/11/sys/x86/acpica/madt.c ============================================================================== --- stable/11/sys/x86/acpica/madt.c Thu Nov 1 18:19:10 2018 (r340015) +++ stable/11/sys/x86/acpica/madt.c Thu Nov 1 18:34:26 2018 (r340016) @@ -370,10 +370,6 @@ madt_parse_apics(ACPI_SUBTABLE_HEADER *entry, void *ar apic->Id); if (ioapics[apic->Id].io_apic != NULL) panic("%s: Double APIC ID %u", __func__, apic->Id); - if (apic->GlobalIrqBase >= FIRST_MSI_INT) { - printf("MADT: Ignoring bogus I/O APIC ID %u", apic->Id); - break; - } ioapics[apic->Id].io_apic = ioapic_create(apic->Address, apic->Id, apic->GlobalIrqBase); ioapics[apic->Id].io_vector = apic->GlobalIrqBase; Modified: stable/11/sys/x86/include/apicvar.h ============================================================================== --- stable/11/sys/x86/include/apicvar.h Thu Nov 1 18:19:10 2018 (r340015) +++ stable/11/sys/x86/include/apicvar.h Thu Nov 1 18:34:26 2018 (r340016) @@ -152,10 +152,10 @@ #define APIC_BUS_PCI 2 #define APIC_BUS_MAX APIC_BUS_PCI -#define IRQ_EXTINT (NUM_IO_INTS + 1) -#define IRQ_NMI (NUM_IO_INTS + 2) -#define IRQ_SMI (NUM_IO_INTS + 3) -#define IRQ_DISABLED (NUM_IO_INTS + 4) +#define IRQ_EXTINT -1 +#define IRQ_NMI -2 +#define IRQ_SMI -3 +#define IRQ_DISABLED -4 /* * An APIC enumerator is a psuedo bus driver that enumerates APIC's including Modified: stable/11/sys/x86/include/intr_machdep.h ============================================================================== --- stable/11/sys/x86/include/intr_machdep.h Thu Nov 1 18:19:10 2018 (r340015) +++ stable/11/sys/x86/include/intr_machdep.h Thu Nov 1 18:34:26 2018 (r340016) @@ -32,55 +32,41 @@ #ifdef _KERNEL /* - * The maximum number of I/O interrupts we allow. This number is rather - * arbitrary as it is just the maximum IRQ resource value. The interrupt - * source for a given IRQ maps that I/O interrupt to device interrupt - * source whether it be a pin on an interrupt controller or an MSI interrupt. - * The 16 ISA IRQs are assigned fixed IDT vectors, but all other device - * interrupts allocate IDT vectors on demand. Currently we have 191 IDT - * vectors available for device interrupts. On many systems with I/O APICs, - * a lot of the IRQs are not used, so this number can be much larger than - * 191 and still be safe since only interrupt sources in actual use will - * allocate IDT vectors. + * Values used in determining the allocation of IRQ values among + * different types of I/O interrupts. These values are used as + * indices into a interrupt source array to map I/O interrupts to a + * device interrupt source whether it be a pin on an interrupt + * controller or an MSI interrupt. The 16 ISA IRQs are assigned fixed + * IDT vectors, but all other device interrupts allocate IDT vectors + * on demand. Currently we have 191 IDT vectors available for device + * interrupts on each CPU. On many systems with I/O APICs, a lot of + * the IRQs are not used, so the total number of IRQ values reserved + * can exceed the number of available IDT slots. * - * The first 255 IRQs (0 - 254) are reserved for ISA IRQs and PCI intline IRQs. - * IRQ values from 256 to 767 are used by MSI. When running under the Xen - * Hypervisor, IRQ values from 768 to 4863 are available for binding to - * event channel events. We leave 255 unused to avoid confusion since 255 is - * used in PCI to indicate an invalid IRQ. + * The first 16 IRQs (0 - 15) are reserved for ISA IRQs. Interrupt + * pins on I/O APICs for non-ISA interrupts use IRQ values starting at + * IRQ 17. This layout matches the GSI numbering used by ACPI so that + * IRQ values returned by ACPI methods such as _CRS can be used + * directly by the ACPI bus driver. + * + * MSI interrupts allocate a block of interrupts starting at either + * the end of the I/O APIC range or 256, whichever is higher. When + * running under the Xen Hypervisor, an additional range of IRQ values + * are available for binding to event channel events. We use 256 as + * the minimum IRQ value for MSI interrupts to attempt to leave 255 + * unused since 255 is used in PCI to indicate an invalid INTx IRQ. */ #define NUM_MSI_INTS 512 -#define FIRST_MSI_INT 256 -#ifdef XENHVM -#include -#include -#define NUM_EVTCHN_INTS NR_EVENT_CHANNELS -#define FIRST_EVTCHN_INT \ - (FIRST_MSI_INT + NUM_MSI_INTS) -#define LAST_EVTCHN_INT \ - (FIRST_EVTCHN_INT + NUM_EVTCHN_INTS - 1) -#else -#define NUM_EVTCHN_INTS 0 -#endif -#define NUM_IO_INTS (FIRST_MSI_INT + NUM_MSI_INTS + NUM_EVTCHN_INTS) +#define MINIMUM_MSI_INT 256 +extern u_int first_msi_irq; +extern u_int num_io_irqs; + /* * Default base address for MSI messages on x86 platforms. */ #define MSI_INTEL_ADDR_BASE 0xfee00000 -/* - * - 1 ??? dummy counter. - * - 2 counters for each I/O interrupt. - * - 1 counter for each CPU for lapic timer. - * - 8 counters for each CPU for IPI counters for SMP. - */ -#ifdef SMP -#define INTRCNT_COUNT (1 + NUM_IO_INTS * 2 + (1 + 8) * MAXCPU) -#else -#define INTRCNT_COUNT (1 + NUM_IO_INTS * 2 + 1) -#endif - #ifndef LOCORE typedef void inthand_t(void); @@ -95,6 +81,7 @@ struct intsrc; * return the vector associated with this source. */ struct pic { + void (*pic_register_sources)(struct pic *); void (*pic_enable_source)(struct intsrc *); void (*pic_disable_source)(struct intsrc *, int); void (*pic_eoi_source)(struct intsrc *); @@ -180,6 +167,9 @@ int msi_map(int irq, uint64_t *addr, uint32_t *data); int msi_release(int *irqs, int count); int msix_alloc(device_t dev, int *irq); int msix_release(int irq); +#ifdef XENHVM +void xen_intr_alloc_irqs(void); +#endif #endif /* !LOCORE */ #endif /* _KERNEL */ Modified: stable/11/sys/x86/iommu/intel_intrmap.c ============================================================================== --- stable/11/sys/x86/iommu/intel_intrmap.c Thu Nov 1 18:19:10 2018 (r340015) +++ stable/11/sys/x86/iommu/intel_intrmap.c Thu Nov 1 18:34:26 2018 (r340016) @@ -337,7 +337,7 @@ dmar_init_irt(struct dmar_unit *unit) "QI disabled, disabling interrupt remapping\n"); return (0); } - unit->irte_cnt = clp2(NUM_IO_INTS); + unit->irte_cnt = clp2(num_io_irqs); unit->irt = (dmar_irte_t *)(uintptr_t)kmem_alloc_contig(kernel_arena, unit->irte_cnt * sizeof(dmar_irte_t), M_ZERO | M_WAITOK, 0, dmar_high, PAGE_SIZE, 0, DMAR_IS_COHERENT(unit) ? Modified: stable/11/sys/x86/isa/atpic.c ============================================================================== --- stable/11/sys/x86/isa/atpic.c Thu Nov 1 18:19:10 2018 (r340015) +++ stable/11/sys/x86/isa/atpic.c Thu Nov 1 18:34:26 2018 (r340016) @@ -101,6 +101,7 @@ inthand_t #define ATPIC(io, base, eoi) { \ .at_pic = { \ + .pic_register_sources = atpic_register_sources, \ .pic_enable_source = atpic_enable_source, \ .pic_disable_source = atpic_disable_source, \ .pic_eoi_source = (eoi), \ @@ -139,6 +140,7 @@ struct atpic_intsrc { u_long at_straycount; }; +static void atpic_register_sources(struct pic *pic); static void atpic_enable_source(struct intsrc *isrc); static void atpic_disable_source(struct intsrc *isrc, int eoi); static void atpic_eoi_master(struct intsrc *isrc); @@ -209,6 +211,42 @@ _atpic_eoi_slave(struct intsrc *isrc) } static void +atpic_register_sources(struct pic *pic) +{ + struct atpic *ap = (struct atpic *)pic; + struct atpic_intsrc *ai; + int i; + + /* + * If any of the ISA IRQs have an interrupt source already, then + * assume that the I/O APICs are being used and don't register any + * of our interrupt sources. This makes sure we don't accidentally + * use mixed mode. The "accidental" use could otherwise occur on + * machines that route the ACPI SCI interrupt to a different ISA + * IRQ (at least one machine routes it to IRQ 13) thus disabling + * that APIC ISA routing and allowing the ATPIC source for that IRQ + * to leak through. We used to depend on this feature for routing + * IRQ0 via mixed mode, but now we don't use mixed mode at all. + * + * To avoid the slave not register sources after the master + * registers its sources, register all IRQs when this function is + * called on the master. + */ + if (ap != &atpics[MASTER]) + return; + for (i = 0; i < NUM_ISA_IRQS; i++) + if (intr_lookup_source(i) != NULL) + return; + + /* Loop through all interrupt sources and add them. */ + for (i = 0, ai = atintrs; i < NUM_ISA_IRQS; i++, ai++) { + if (i == ICU_SLAVEID) + continue; + intr_register_source(&ai->at_intsrc); + } +} + +static void atpic_enable_source(struct intsrc *isrc) { struct atpic_intsrc *ai = (struct atpic_intsrc *)isrc; @@ -517,8 +555,6 @@ atpic_startup(void) static void atpic_init(void *dummy __unused) { - struct atpic_intsrc *ai; - int i; /* * Register our PICs, even if we aren't going to use any of their @@ -528,27 +564,8 @@ atpic_init(void *dummy __unused) intr_register_pic(&atpics[1].at_pic) != 0) panic("Unable to register ATPICs"); - /* - * If any of the ISA IRQs have an interrupt source already, then - * assume that the APICs are being used and don't register any - * of our interrupt sources. This makes sure we don't accidentally - * use mixed mode. The "accidental" use could otherwise occur on - * machines that route the ACPI SCI interrupt to a different ISA - * IRQ (at least one machines routes it to IRQ 13) thus disabling - * that APIC ISA routing and allowing the ATPIC source for that IRQ - * to leak through. We used to depend on this feature for routing - * IRQ0 via mixed mode, but now we don't use mixed mode at all. - */ - for (i = 0; i < NUM_ISA_IRQS; i++) - if (intr_lookup_source(i) != NULL) - return; - - /* Loop through all interrupt sources and add them. */ - for (i = 0, ai = atintrs; i < NUM_ISA_IRQS; i++, ai++) { - if (i == ICU_SLAVEID) - continue; - intr_register_source(&ai->at_intsrc); - } + if (num_io_irqs == 0) + num_io_irqs = NUM_ISA_IRQS; } SYSINIT(atpic_init, SI_SUB_INTR, SI_ORDER_FOURTH, atpic_init, NULL); Modified: stable/11/sys/x86/x86/intr_machdep.c ============================================================================== --- stable/11/sys/x86/x86/intr_machdep.c Thu Nov 1 18:19:10 2018 (r340015) +++ stable/11/sys/x86/x86/intr_machdep.c Thu Nov 1 18:34:26 2018 (r340016) @@ -36,6 +36,7 @@ #include "opt_atpic.h" #include "opt_ddb.h" +#include "opt_smp.h" #include #include @@ -43,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -74,21 +76,25 @@ typedef void (*mask_fn)(void *); static int intrcnt_index; -static struct intsrc *interrupt_sources[NUM_IO_INTS]; +static struct intsrc **interrupt_sources; static struct sx intrsrc_lock; static struct mtx intrpic_lock; static struct mtx intrcnt_lock; static TAILQ_HEAD(pics_head, pic) pics; +u_int num_io_irqs; #if defined(SMP) && !defined(EARLY_AP_STARTUP) static int assign_cpu; #endif -u_long intrcnt[INTRCNT_COUNT]; -char intrnames[INTRCNT_COUNT * (MAXCOMLEN + 1)]; +u_long *intrcnt; +char *intrnames; size_t sintrcnt = sizeof(intrcnt); size_t sintrnames = sizeof(intrnames); +int nintrcnt; +static MALLOC_DEFINE(M_INTR, "intr", "Interrupt Sources"); + static int intr_assign_cpu(void *arg, int cpu); static void intr_disable_src(void *arg); static void intr_init(void *__dummy); @@ -97,6 +103,18 @@ static void intrcnt_setname(const char *name, int inde static void intrcnt_updatename(struct intsrc *is); static void intrcnt_register(struct intsrc *is); +/* + * SYSINIT levels for SI_SUB_INTR: + * + * SI_ORDER_FIRST: Initialize locks and pics TAILQ, xen_hvm_cpu_init + * SI_ORDER_SECOND: Xen PICs + * SI_ORDER_THIRD: Add I/O APIC PICs, alloc MSI and Xen IRQ ranges + * SI_ORDER_FOURTH: Add 8259A PICs + * SI_ORDER_FOURTH + 1: Finalize interrupt count and add interrupt sources + * SI_ORDER_MIDDLE: SMP interrupt counters + * SI_ORDER_ANY: Enable interrupts on BSP + */ + static int intr_pic_registered(struct pic *pic) { @@ -132,6 +150,56 @@ intr_register_pic(struct pic *pic) } /* + * Allocate interrupt source arrays and register interrupt sources + * once the number of interrupts is known. + */ +static void +intr_init_sources(void *arg) +{ + struct pic *pic; + + MPASS(num_io_irqs > 0); + + interrupt_sources = mallocarray(num_io_irqs, sizeof(*interrupt_sources), + M_INTR, M_WAITOK | M_ZERO); + + /* + * - 1 ??? dummy counter. + * - 2 counters for each I/O interrupt. + * - 1 counter for each CPU for lapic timer. + * - 1 counter for each CPU for the Hyper-V vmbus driver. + * - 8 counters for each CPU for IPI counters for SMP. + */ + nintrcnt = 1 + num_io_irqs * 2 + mp_ncpus * 2; +#ifdef COUNT_IPIS + if (mp_ncpus > 1) + nintrcnt += 8 * mp_ncpus; +#endif + intrcnt = mallocarray(nintrcnt, sizeof(u_long), M_INTR, M_WAITOK | + M_ZERO); + intrnames = mallocarray(nintrcnt, MAXCOMLEN + 1, M_INTR, M_WAITOK | + M_ZERO); + sintrcnt = nintrcnt * sizeof(u_long); + sintrnames = nintrcnt * (MAXCOMLEN + 1); + + intrcnt_setname("???", 0); + intrcnt_index = 1; + + /* + * NB: intrpic_lock is not held here to avoid LORs due to + * malloc() in intr_register_source(). However, we are still + * single-threaded at this point in startup so the list of + * PICs shouldn't change. + */ + TAILQ_FOREACH(pic, &pics, pics) { + if (pic->pic_register_sources != NULL) + pic->pic_register_sources(pic); + } +} +SYSINIT(intr_init_sources, SI_SUB_INTR, SI_ORDER_FOURTH + 1, intr_init_sources, + NULL); + +/* * Register a new interrupt source with the global interrupt system. * The global interrupts need to be disabled when this function is * called. @@ -143,6 +211,8 @@ intr_register_source(struct intsrc *isrc) KASSERT(intr_pic_registered(isrc->is_pic), ("unregistered PIC")); vector = isrc->is_pic->pic_vector(isrc); + KASSERT(vector < num_io_irqs, ("IRQ %d too large (%u irqs)", vector, + num_io_irqs)); if (interrupt_sources[vector] != NULL) return (EEXIST); error = intr_event_create(&isrc->is_event, isrc, 0, vector, @@ -168,7 +238,7 @@ struct intsrc * intr_lookup_source(int vector) { - if (vector < 0 || vector >= nitems(interrupt_sources)) + if (vector < 0 || vector >= num_io_irqs) return (NULL); return (interrupt_sources[vector]); } @@ -362,6 +432,7 @@ intrcnt_register(struct intsrc *is) KASSERT(is->is_event != NULL, ("%s: isrc with no event", __func__)); mtx_lock_spin(&intrcnt_lock); + MPASS(intrcnt_index + 2 <= nintrcnt); is->is_index = intrcnt_index; intrcnt_index += 2; snprintf(straystr, MAXCOMLEN + 1, "stray irq%d", @@ -378,6 +449,7 @@ intrcnt_add(const char *name, u_long **countp) { mtx_lock_spin(&intrcnt_lock); + MPASS(intrcnt_index < nintrcnt); *countp = &intrcnt[intrcnt_index]; intrcnt_setname(name, intrcnt_index); intrcnt_index++; @@ -388,8 +460,6 @@ static void intr_init(void *dummy __unused) { - intrcnt_setname("???", 0); - intrcnt_index = 1; TAILQ_INIT(&pics); mtx_init(&intrpic_lock, "intrpic", NULL, MTX_DEF); sx_init(&intrsrc_lock, "intrsrc"); @@ -455,10 +525,10 @@ void intr_reprogram(void) { struct intsrc *is; - int v; + u_int v; sx_xlock(&intrsrc_lock); - for (v = 0; v < NUM_IO_INTS; v++) { + for (v = 0; v < num_io_irqs; v++) { is = interrupt_sources[v]; if (is == NULL) continue; @@ -475,14 +545,15 @@ intr_reprogram(void) DB_SHOW_COMMAND(irqs, db_show_irqs) { struct intsrc **isrc; - int i, verbose; + u_int i; + int verbose; if (strcmp(modif, "v") == 0) verbose = 1; else verbose = 0; isrc = interrupt_sources; - for (i = 0; i < NUM_IO_INTS && !db_pager_quit; i++, isrc++) + for (i = 0; i < num_io_irqs && !db_pager_quit; i++, isrc++) if (*isrc != NULL) db_dump_intr_event((*isrc)->is_event, verbose); } @@ -565,7 +636,7 @@ static void intr_shuffle_irqs(void *arg __unused) { struct intsrc *isrc; - int i; + u_int i; /* Don't bother on UP. */ if (mp_ncpus == 1) @@ -574,7 +645,7 @@ intr_shuffle_irqs(void *arg __unused) /* Round-robin assign a CPU to each enabled source. */ sx_xlock(&intrsrc_lock); assign_cpu = 1; - for (i = 0; i < NUM_IO_INTS; i++) { + for (i = 0; i < num_io_irqs; i++) { isrc = interrupt_sources[i]; if (isrc != NULL && isrc->is_handlers > 0) { /* Modified: stable/11/sys/x86/x86/io_apic.c ============================================================================== --- stable/11/sys/x86/x86/io_apic.c Thu Nov 1 18:19:10 2018 (r340015) +++ stable/11/sys/x86/x86/io_apic.c Thu Nov 1 18:34:26 2018 (r340016) @@ -78,7 +78,7 @@ static MALLOC_DEFINE(M_IOAPIC, "io_apic", "I/O APIC st struct ioapic_intsrc { struct intsrc io_intsrc; - u_int io_irq; + int io_irq; u_int io_intpin:8; u_int io_vector:8; u_int io_cpu; @@ -110,6 +110,7 @@ static u_int ioapic_read(volatile ioapic_t *apic, int static void ioapic_write(volatile ioapic_t *apic, int reg, u_int val); static const char *ioapic_bus_string(int bus_type); static void ioapic_print_irq(struct ioapic_intsrc *intpin); +static void ioapic_register_sources(struct pic *pic); static void ioapic_enable_source(struct intsrc *isrc); static void ioapic_disable_source(struct intsrc *isrc, int eoi); static void ioapic_eoi_source(struct intsrc *isrc); @@ -126,6 +127,7 @@ static void ioapic_reprogram_intpin(struct intsrc *isr static STAILQ_HEAD(,ioapic) ioapic_list = STAILQ_HEAD_INITIALIZER(ioapic_list); struct pic ioapic_template = { + .pic_register_sources = ioapic_register_sources, .pic_enable_source = ioapic_enable_source, .pic_disable_source = ioapic_disable_source, .pic_eoi_source = ioapic_eoi_source, @@ -140,7 +142,7 @@ struct pic ioapic_template = { .pic_reprogram_pin = ioapic_reprogram_intpin, }; -static int next_ioapic_base; +static u_int next_ioapic_base; static u_int next_id; static int enable_extint; @@ -248,7 +250,7 @@ ioapic_print_irq(struct ioapic_intsrc *intpin) printf("SMI"); break; default: - printf("%s IRQ %u", ioapic_bus_string(intpin->io_bus), + printf("%s IRQ %d", ioapic_bus_string(intpin->io_bus), intpin->io_irq); } } @@ -316,7 +318,7 @@ ioapic_program_intpin(struct ioapic_intsrc *intpin) * been enabled yet, just ensure that the pin is masked. */ mtx_assert(&icu_lock, MA_OWNED); - if (intpin->io_irq == IRQ_DISABLED || (intpin->io_irq < NUM_IO_INTS && + if (intpin->io_irq == IRQ_DISABLED || (intpin->io_irq >= 0 && intpin->io_vector == 0)) { low = ioapic_read(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin)); @@ -649,6 +651,8 @@ ioapic_create(vm_paddr_t addr, int32_t apic_id, int in io->io_id, intbase, next_ioapic_base); io->io_intbase = intbase; next_ioapic_base = intbase + numintr; + if (next_ioapic_base > num_io_irqs) + num_io_irqs = next_ioapic_base; io->io_numintr = numintr; io->io_addr = apic; io->io_paddr = addr; @@ -757,7 +761,7 @@ ioapic_remap_vector(void *cookie, u_int pin, int vecto io = (struct ioapic *)cookie; if (pin >= io->io_numintr || vector < 0) return (EINVAL); - if (io->io_pins[pin].io_irq >= NUM_IO_INTS) + if (io->io_pins[pin].io_irq < 0) return (EINVAL); io->io_pins[pin].io_irq = vector; if (bootverbose) @@ -776,7 +780,7 @@ ioapic_set_bus(void *cookie, u_int pin, int bus_type) io = (struct ioapic *)cookie; if (pin >= io->io_numintr) return (EINVAL); - if (io->io_pins[pin].io_irq >= NUM_IO_INTS) + if (io->io_pins[pin].io_irq < 0) return (EINVAL); if (io->io_pins[pin].io_bus == bus_type) return (0); @@ -797,7 +801,7 @@ ioapic_set_nmi(void *cookie, u_int pin) return (EINVAL); if (io->io_pins[pin].io_irq == IRQ_NMI) return (0); - if (io->io_pins[pin].io_irq >= NUM_IO_INTS) + if (io->io_pins[pin].io_irq < 0) return (EINVAL); io->io_pins[pin].io_bus = APIC_BUS_UNKNOWN; io->io_pins[pin].io_irq = IRQ_NMI; @@ -820,7 +824,7 @@ ioapic_set_smi(void *cookie, u_int pin) return (EINVAL); if (io->io_pins[pin].io_irq == IRQ_SMI) return (0); - if (io->io_pins[pin].io_irq >= NUM_IO_INTS) + if (io->io_pins[pin].io_irq < 0) return (EINVAL); io->io_pins[pin].io_bus = APIC_BUS_UNKNOWN; io->io_pins[pin].io_irq = IRQ_SMI; @@ -843,7 +847,7 @@ ioapic_set_extint(void *cookie, u_int pin) return (EINVAL); if (io->io_pins[pin].io_irq == IRQ_EXTINT) return (0); - if (io->io_pins[pin].io_irq >= NUM_IO_INTS) + if (io->io_pins[pin].io_irq < 0) return (EINVAL); io->io_pins[pin].io_bus = APIC_BUS_UNKNOWN; io->io_pins[pin].io_irq = IRQ_EXTINT; @@ -868,7 +872,7 @@ ioapic_set_polarity(void *cookie, u_int pin, enum intr io = (struct ioapic *)cookie; if (pin >= io->io_numintr || pol == INTR_POLARITY_CONFORM) return (EINVAL); - if (io->io_pins[pin].io_irq >= NUM_IO_INTS) + if (io->io_pins[pin].io_irq < 0) return (EINVAL); activehi = (pol == INTR_POLARITY_HIGH); if (io->io_pins[pin].io_activehi == activehi) @@ -889,7 +893,7 @@ ioapic_set_triggermode(void *cookie, u_int pin, enum i io = (struct ioapic *)cookie; if (pin >= io->io_numintr || trigger == INTR_TRIGGER_CONFORM) return (EINVAL); - if (io->io_pins[pin].io_irq >= NUM_IO_INTS) + if (io->io_pins[pin].io_irq < 0) return (EINVAL); edgetrigger = (trigger == INTR_TRIGGER_EDGE); if (io->io_pins[pin].io_edgetrigger == edgetrigger) @@ -925,12 +929,26 @@ ioapic_register(void *cookie) /* * Reprogram pins to handle special case pins (such as NMI and - * SMI) and register valid pins as interrupt sources. + * SMI) and disable normal pins until a handler is registered. */ intr_register_pic(&io->io_pic); - for (i = 0, pin = io->io_pins; i < io->io_numintr; i++, pin++) { + for (i = 0, pin = io->io_pins; i < io->io_numintr; i++, pin++) ioapic_reprogram_intpin(&pin->io_intsrc); - if (pin->io_irq < NUM_IO_INTS) +} + +/* + * Add interrupt sources for I/O APIC interrupt pins. + */ +static void +ioapic_register_sources(struct pic *pic) +{ + struct ioapic_intsrc *pin; + struct ioapic *io; + int i; + + io = (struct ioapic *)pic; + for (i = 0, pin = io->io_pins; i < io->io_numintr; i++, pin++) { + if (pin->io_irq >= 0) intr_register_source(&pin->io_intsrc); } } Modified: stable/11/sys/x86/x86/local_apic.c ============================================================================== --- stable/11/sys/x86/x86/local_apic.c Thu Nov 1 18:19:10 2018 (r340015) +++ stable/11/sys/x86/x86/local_apic.c Thu Nov 1 18:34:26 2018 (r340016) @@ -89,11 +89,16 @@ CTASSERT(APIC_TIMER_INT < APIC_LOCAL_INTS); CTASSERT(APIC_LOCAL_INTS == 240); CTASSERT(IPI_STOP < APIC_SPURIOUS_INT); -/* Magic IRQ values for the timer and syscalls. */ -#define IRQ_TIMER (NUM_IO_INTS + 1) -#define IRQ_SYSCALL (NUM_IO_INTS + 2) -#define IRQ_DTRACE_RET (NUM_IO_INTS + 3) -#define IRQ_EVTCHN (NUM_IO_INTS + 4) +/* + * I/O interrupts use non-negative IRQ values. These values are used + * to mark unused IDT entries or IDT entries reserved for a non-I/O + * interrupt. + */ +#define IRQ_FREE -1 +#define IRQ_TIMER -2 +#define IRQ_SYSCALL -3 +#define IRQ_DTRACE_RET -4 +#define IRQ_EVTCHN -5 enum lat_timer_mode { LAT_MODE_UNDEF = 0, @@ -644,7 +649,7 @@ native_lapic_create(u_int apic_id, int boot_cpu) lapics[apic_id].la_elvts[i].lvt_active = 0; } for (i = 0; i <= APIC_NUM_IOINTS; i++) - lapics[apic_id].la_ioint_irqs[i] = -1; + lapics[apic_id].la_ioint_irqs[i] = IRQ_FREE; lapics[apic_id].la_ioint_irqs[IDT_SYSCALL - APIC_IO_INTS] = IRQ_SYSCALL; lapics[apic_id].la_ioint_irqs[APIC_TIMER_INT - APIC_IO_INTS] = IRQ_TIMER; @@ -747,7 +752,6 @@ native_lapic_setup(int boot) uint32_t version; uint32_t maxlvt; register_t saveintr; - char buf[MAXCOMLEN + 1]; int elvt_count; int i; @@ -776,15 +780,11 @@ native_lapic_setup(int boot) LAPIC_LVT_PCINT)); } - /* Program timer LVT and setup handler. */ + /* Program timer LVT. */ la->lvt_timer_base = lvt_mode(la, APIC_LVT_TIMER, lapic_read32(LAPIC_LVT_TIMER)); la->lvt_timer_last = la->lvt_timer_base; lapic_write32(LAPIC_LVT_TIMER, la->lvt_timer_base); - if (boot) { - snprintf(buf, sizeof(buf), "cpu%d:timer", PCPU_GET(cpuid)); - intrcnt_add(buf, &la->la_timer_count); - } /* Calibrate the timer parameters using BSP. */ if (boot && IS_BSP()) { @@ -839,6 +839,25 @@ native_lapic_setup(int boot) } static void +native_lapic_intrcnt(void *dummy __unused) +{ + struct pcpu *pc; + struct lapic *la; + char buf[MAXCOMLEN + 1]; + + STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) { + la = &lapics[pc->pc_apic_id]; + if (!la->la_present) + continue; + + snprintf(buf, sizeof(buf), "cpu%d:timer", pc->pc_cpuid); + intrcnt_add(buf, &la->la_timer_count); + } +} +SYSINIT(native_lapic_intrcnt, SI_SUB_INTR, SI_ORDER_MIDDLE, native_lapic_intrcnt, + NULL); + +static void native_lapic_reenable_pmc(void) { #ifdef HWPMC_HOOKS @@ -1488,7 +1507,7 @@ native_apic_alloc_vector(u_int apic_id, u_int irq) { u_int vector; - KASSERT(irq < NUM_IO_INTS, ("Invalid IRQ %u", irq)); + KASSERT(irq < num_io_irqs, ("Invalid IRQ %u", irq)); /* * Search for a free vector. Currently we just use a very simple @@ -1496,7 +1515,7 @@ native_apic_alloc_vector(u_int apic_id, u_int irq) */ mtx_lock_spin(&icu_lock); for (vector = 0; vector < APIC_NUM_IOINTS; vector++) { - if (lapics[apic_id].la_ioint_irqs[vector] != -1) + if (lapics[apic_id].la_ioint_irqs[vector] != IRQ_FREE) continue; lapics[apic_id].la_ioint_irqs[vector] = irq; mtx_unlock_spin(&icu_lock); @@ -1522,7 +1541,7 @@ native_apic_alloc_vectors(u_int apic_id, u_int *irqs, KASSERT(align >= count, ("align < count")); #ifdef INVARIANTS for (run = 0; run < count; run++) - KASSERT(irqs[run] < NUM_IO_INTS, ("Invalid IRQ %u at index %u", + KASSERT(irqs[run] < num_io_irqs, ("Invalid IRQ %u at index %u", irqs[run], run)); #endif @@ -1536,7 +1555,7 @@ native_apic_alloc_vectors(u_int apic_id, u_int *irqs, for (vector = 0; vector < APIC_NUM_IOINTS; vector++) { /* Vector is in use, end run. */ - if (lapics[apic_id].la_ioint_irqs[vector] != -1) { + if (lapics[apic_id].la_ioint_irqs[vector] != IRQ_FREE) { run = 0; first = 0; continue; @@ -1617,7 +1636,7 @@ native_apic_free_vector(u_int apic_id, u_int vector, u KASSERT(vector >= APIC_IO_INTS && vector != IDT_SYSCALL && vector <= APIC_IO_INTS + APIC_NUM_IOINTS, ("Vector %u does not map to an IRQ line", vector)); - KASSERT(irq < NUM_IO_INTS, ("Invalid IRQ %u", irq)); + KASSERT(irq < num_io_irqs, ("Invalid IRQ %u", irq)); KASSERT(lapics[apic_id].la_ioint_irqs[vector - APIC_IO_INTS] == irq, ("IRQ mismatch")); #ifdef KDTRACE_HOOKS @@ -1638,7 +1657,7 @@ native_apic_free_vector(u_int apic_id, u_int vector, u thread_unlock(td); } mtx_lock_spin(&icu_lock); - lapics[apic_id].la_ioint_irqs[vector - APIC_IO_INTS] = -1; + lapics[apic_id].la_ioint_irqs[vector - APIC_IO_INTS] = IRQ_FREE; mtx_unlock_spin(&icu_lock); if (!rebooting) { thread_lock(td); @@ -1689,7 +1708,7 @@ DB_SHOW_COMMAND(apic, db_show_apic) db_printf("Interrupts bound to lapic %u\n", apic_id); for (i = 0; i < APIC_NUM_IOINTS + 1 && !db_pager_quit; i++) { irq = lapics[apic_id].la_ioint_irqs[i]; - if (irq == -1 || irq == IRQ_SYSCALL) + if (irq == IRQ_FREE || irq == IRQ_SYSCALL) continue; #ifdef KDTRACE_HOOKS if (irq == IRQ_DTRACE_RET) @@ -1702,7 +1721,7 @@ DB_SHOW_COMMAND(apic, db_show_apic) db_printf("vec 0x%2x -> ", i + APIC_IO_INTS); if (irq == IRQ_TIMER) db_printf("lapic timer\n"); - else if (irq < NUM_IO_INTS) { + else if (irq < num_io_irqs) { isrc = intr_lookup_source(irq); if (isrc == NULL || verbose == 0) db_printf("IRQ %u\n", irq); @@ -1926,6 +1945,10 @@ apic_setup_io(void *dummy __unused) /* Enable the MSI "pic". */ init_ops.msi_init(); + +#ifdef XENHVM + xen_intr_alloc_irqs(); +#endif } SYSINIT(apic_setup_io, SI_SUB_INTR, SI_ORDER_THIRD, apic_setup_io, NULL); Modified: stable/11/sys/x86/x86/msi.c ============================================================================== --- stable/11/sys/x86/x86/msi.c Thu Nov 1 18:19:10 2018 (r340015) +++ stable/11/sys/x86/x86/msi.c Thu Nov 1 18:34:26 2018 (r340016) @@ -118,7 +118,7 @@ struct msi_intsrc { u_int msi_cpu; /* Local APIC ID. (g) */ u_int msi_count:8; /* Messages in this group. (g) */ u_int msi_maxcount:8; /* Alignment for this group. (g) */ - int *msi_irqs; /* Group's IRQ list. (g) */ + u_int *msi_irqs; /* Group's IRQ list. (g) */ u_int msi_remap_cookie; }; @@ -149,6 +149,8 @@ struct pic msi_pic = { .pic_reprogram_pin = NULL, }; +u_int first_msi_irq; + #ifdef SMP /** * Xen hypervisors prior to 4.6.0 do not properly handle updates to @@ -166,7 +168,7 @@ SYSCTL_INT(_machdep, OID_AUTO, disable_msix_migration, #endif static int msi_enabled; -static int msi_last_irq; +static u_int msi_last_irq; static struct mtx msi_lock; static void @@ -327,6 +329,9 @@ msi_init(void) } #endif + first_msi_irq = max(MINIMUM_MSI_INT, num_io_irqs); + num_io_irqs = first_msi_irq + NUM_MSI_INTS; + msi_enabled = 1; intr_register_pic(&msi_pic); mtx_init(&msi_lock, "msi", NULL, MTX_DEF); @@ -343,7 +348,7 @@ msi_create_source(void) mtx_unlock(&msi_lock); return; } - irq = msi_last_irq + FIRST_MSI_INT; + irq = msi_last_irq + first_msi_irq; msi_last_irq++; mtx_unlock(&msi_lock); @@ -361,8 +366,8 @@ int msi_alloc(device_t dev, int count, int maxcount, int *irqs) { struct msi_intsrc *msi, *fsrc; - u_int cpu; - int cnt, i, *mirqs, vector; + u_int cpu, *mirqs; + int cnt, i, vector; #ifdef ACPI_DMAR u_int cookies[count]; int error; @@ -380,7 +385,7 @@ again: /* Try to find 'count' free IRQs. */ cnt = 0; - for (i = FIRST_MSI_INT; i < FIRST_MSI_INT + NUM_MSI_INTS; i++) { + for (i = first_msi_irq; i < first_msi_irq + NUM_MSI_INTS; i++) { msi = (struct msi_intsrc *)intr_lookup_source(i); /* End of allocated sources, so break. */ @@ -399,7 +404,7 @@ again: /* Do we need to create some new sources? */ if (cnt < count) { /* If we would exceed the max, give up. */ - if (i + (count - cnt) >= FIRST_MSI_INT + NUM_MSI_INTS) { + if (i + (count - cnt) >= first_msi_irq + NUM_MSI_INTS) { mtx_unlock(&msi_lock); free(mirqs, M_MSI); return (ENXIO); @@ -574,8 +579,8 @@ msi_map(int irq, uint64_t *addr, uint32_t *data) #ifdef ACPI_DMAR if (!msi->msi_msix) { - for (k = msi->msi_count - 1, i = FIRST_MSI_INT; k > 0 && - i < FIRST_MSI_INT + NUM_MSI_INTS; i++) { + for (k = msi->msi_count - 1, i = first_msi_irq; k > 0 && + i < first_msi_irq + NUM_MSI_INTS; i++) { if (i == msi->msi_irq) continue; msi1 = (struct msi_intsrc *)intr_lookup_source(i); @@ -622,7 +627,7 @@ again: mtx_lock(&msi_lock); /* Find a free IRQ. */ - for (i = FIRST_MSI_INT; i < FIRST_MSI_INT + NUM_MSI_INTS; i++) { + for (i = first_msi_irq; i < first_msi_irq + NUM_MSI_INTS; i++) { msi = (struct msi_intsrc *)intr_lookup_source(i); /* End of allocated sources, so break. */ @@ -637,7 +642,7 @@ again: /* Do we need to create a new source? */ if (msi == NULL) { /* If we would exceed the max, give up. */ - if (i + 1 >= FIRST_MSI_INT + NUM_MSI_INTS) { + if (i + 1 >= first_msi_irq + NUM_MSI_INTS) { mtx_unlock(&msi_lock); return (ENXIO); } Modified: stable/11/sys/x86/x86/nexus.c ============================================================================== --- stable/11/sys/x86/x86/nexus.c Thu Nov 1 18:19:10 2018 (r340015) +++ stable/11/sys/x86/x86/nexus.c Thu Nov 1 18:34:26 2018 (r340016) @@ -226,7 +226,7 @@ nexus_init_resources(void) irq_rman.rm_start = 0; irq_rman.rm_type = RMAN_ARRAY; irq_rman.rm_descr = "Interrupt request lines"; - irq_rman.rm_end = NUM_IO_INTS - 1; + irq_rman.rm_end = num_io_irqs - 1; if (rman_init(&irq_rman)) panic("nexus_init_resources irq_rman"); @@ -234,7 +234,7 @@ nexus_init_resources(void) * We search for regions of existing IRQs and add those to the IRQ * resource manager. */ - for (irq = 0; irq < NUM_IO_INTS; irq++) + for (irq = 0; irq < num_io_irqs; irq++) if (intr_lookup_source(irq) != NULL) if (rman_manage_region(&irq_rman, irq, irq) != 0) panic("nexus_init_resources irq_rman add"); Modified: stable/11/sys/x86/xen/pvcpu_enum.c ============================================================================== --- stable/11/sys/x86/xen/pvcpu_enum.c Thu Nov 1 18:19:10 2018 (r340015) +++ stable/11/sys/x86/xen/pvcpu_enum.c Thu Nov 1 18:34:26 2018 (r340016) @@ -179,52 +179,65 @@ xenpv_setup_io(void) { if (xen_initial_domain()) { - int i, ret; + /* + * NB: we could iterate over the MADT IOAPIC entries in order + * to figure out the exact number of IOAPIC interrupts, but + * this is legacy code so just keep using the previous + * behaviour and assume a maximum of 256 interrupts. + */ + num_io_irqs = max(MINIMUM_MSI_INT - 1, num_io_irqs); - /* Map MADT */ - madt_physaddr = acpi_find_table(ACPI_SIG_MADT); - madt = acpi_map_table(madt_physaddr, ACPI_SIG_MADT); - madt_length = madt->Header.Length; + acpi_SetDefaultIntrModel(ACPI_INTR_APIC); + } + return (0); +} - /* Try to initialize ACPI so that we can access the FADT. */ - i = acpi_Startup(); - if (ACPI_FAILURE(i)) { - printf("MADT: ACPI Startup failed with %s\n", - AcpiFormatException(i)); - printf("Try disabling either ACPI or apic support.\n"); - panic("Using MADT but ACPI doesn't work"); - } +void +xenpv_register_pirqs(struct pic *pic __unused) +{ + unsigned int i; + int ret; - /* Run through the table to see if there are any overrides. */ - madt_walk_table(madt_parse_ints, NULL); + /* Map MADT */ + madt_physaddr = acpi_find_table(ACPI_SIG_MADT); + madt = acpi_map_table(madt_physaddr, ACPI_SIG_MADT); + madt_length = madt->Header.Length; - /* - * If there was not an explicit override entry for the SCI, - * force it to use level trigger and active-low polarity. - */ - if (!madt_found_sci_override) { - printf( - "MADT: Forcing active-low polarity and level trigger for SCI\n"); - ret = xen_register_pirq(AcpiGbl_FADT.SciInterrupt, - INTR_TRIGGER_LEVEL, INTR_POLARITY_LOW); - if (ret != 0) - panic("Unable to register SCI IRQ"); - } + /* Try to initialize ACPI so that we can access the FADT. */ + ret = acpi_Startup(); + if (ACPI_FAILURE(ret)) { + printf("MADT: ACPI Startup failed with %s\n", + AcpiFormatException(ret)); + printf("Try disabling either ACPI or apic support.\n"); + panic("Using MADT but ACPI doesn't work"); + } - /* Register legacy ISA IRQs */ - for (i = 1; i < 16; i++) { - if (intr_lookup_source(i) != NULL) - continue; - ret = xen_register_pirq(i, INTR_TRIGGER_EDGE, - INTR_POLARITY_LOW); - if (ret != 0 && bootverbose) - printf("Unable to register legacy IRQ#%d: %d\n", - i, ret); - } + /* Run through the table to see if there are any overrides. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Nov 1 20:09:47 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 20:42:55 2018 Return-Path: Delivered-To: svn-src-all@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 7E7B510D7004; Thu, 1 Nov 2018 20:42:55 +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 2D0458B5AC; Thu, 1 Nov 2018 20:42:55 +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 0CC4A20DFC; Thu, 1 Nov 2018 20:42:55 +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 wA1Kgsu7086254; Thu, 1 Nov 2018 20:42:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1KgswL086253; Thu, 1 Nov 2018 20:42:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201811012042.wA1KgswL086253@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 20:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340017 - stable/11/sys/arm64/arm64 X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/sys/arm64/arm64 X-SVN-Commit-Revision: 340017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 20:42:55 -0000 Author: jhb Date: Thu Nov 1 20:42:54 2018 New Revision: 340017 URL: https://svnweb.freebsd.org/changeset/base/340017 Log: MFC 338813: Clear all of the VFP state in fill_fpregs(). Zero the entire FP register set structure returned for ptrace() if a thread hasn't used FP registers rather than leaking garbage in the fp_sr and fp_cr fields. Modified: stable/11/sys/arm64/arm64/machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/machdep.c ============================================================================== --- stable/11/sys/arm64/arm64/machdep.c Thu Nov 1 18:34:26 2018 (r340016) +++ stable/11/sys/arm64/arm64/machdep.c Thu Nov 1 20:42:54 2018 (r340017) @@ -222,7 +222,7 @@ fill_fpregs(struct thread *td, struct fpreg *regs) regs->fp_sr = pcb->pcb_fpsr; } else #endif - memset(regs->fp_q, 0, sizeof(regs->fp_q)); + memset(regs, 0, sizeof(*regs)); return (0); } From owner-svn-src-all@freebsd.org Thu Nov 1 21:25:27 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 21:28:23 2018 Return-Path: Delivered-To: svn-src-all@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 A1CCD10D92CB; Thu, 1 Nov 2018 21:28:23 +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 580898CE89; Thu, 1 Nov 2018 21:28:23 +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 34E5F2148E; Thu, 1 Nov 2018 21:28: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 wA1LSMS6007841; Thu, 1 Nov 2018 21:28:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1LSM4p007840; Thu, 1 Nov 2018 21:28:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811012128.wA1LSM4p007840@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:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340019 - stable/12/stand/efi/loader X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/stand/efi/loader X-SVN-Commit-Revision: 340019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 21:28:23 -0000 Author: imp Date: Thu Nov 1 21:28:22 2018 New Revision: 340019 URL: https://svnweb.freebsd.org/changeset/base/340019 Log: MFC: r339800 and r339802: Fixes to ignore partial DEVICE_PATH items in BOOT_PARAM objects that are too short. Approved by: re@ (glen) Modified: stable/12/stand/efi/loader/main.c Modified: stable/12/stand/efi/loader/main.c ============================================================================== --- stable/12/stand/efi/loader/main.c Thu Nov 1 21:25:26 2018 (r340018) +++ stable/12/stand/efi/loader/main.c Thu Nov 1 21:28:22 2018 (r340019) @@ -298,6 +298,8 @@ fix_dosisms(char *p) } } +#define SIZE(dp, edp) (size_t)((intptr_t)(void *)edp - (intptr_t)(void *)dp) + enum { BOOT_INFO_OK = 0, BAD_CHOICE = 1, NOT_SPECIFIC = 2 }; static int match_boot_info(EFI_LOADED_IMAGE *img __unused, char *boot_info, size_t bisz) @@ -349,7 +351,7 @@ match_boot_info(EFI_LOADED_IMAGE *img __unused, char * edp = (EFI_DEVICE_PATH *)(walker + fplen); if ((char *)edp > ep) return NOT_SPECIFIC; - while (dp < edp) { + while (dp < edp && SIZE(dp, edp) > sizeof(EFI_DEVICE_PATH)) { text = efi_devpath_name(dp); if (text != NULL) { printf(" BootInfo Path: %S\n", text); From owner-svn-src-all@freebsd.org Thu Nov 1 21:34:20 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 21:39:34 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 21:46:38 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 21:49:50 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 21:51:43 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 22:11:27 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 22:13:20 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 22:13:23 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 22:15:26 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 22:17:52 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 22:23:17 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 22:50:51 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 22:54:53 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 23:01:25 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 23:06:51 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 23:10:55 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 23:11:49 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 23:42:37 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 23:46:24 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-all@freebsd.org Thu Nov 1 23:56:11 2018 Return-Path: Delivered-To: svn-src-all@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 D037D10DD608; Thu, 1 Nov 2018 23:56:11 +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 8252A6C5D1; Thu, 1 Nov 2018 23:56:11 +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 62AEA22D93; Thu, 1 Nov 2018 23:56:11 +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 wA1NuBte085104; Thu, 1 Nov 2018 23:56:11 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1NuBrh085103; Thu, 1 Nov 2018 23:56:11 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811012356.wA1NuBrh085103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 1 Nov 2018 23:56:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340039 - stable/12/sys/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/12/sys/conf X-SVN-Commit-Revision: 340039 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 23:56:12 -0000 Author: gjb Date: Thu Nov 1 23:56:10 2018 New Revision: 340039 URL: https://svnweb.freebsd.org/changeset/base/340039 Log: Update stable/12 from BETA2 to BETA3 as part of the 12.0-RELEASE cycle. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/conf/newvers.sh Modified: stable/12/sys/conf/newvers.sh ============================================================================== --- stable/12/sys/conf/newvers.sh Thu Nov 1 23:46:23 2018 (r340038) +++ stable/12/sys/conf/newvers.sh Thu Nov 1 23:56:10 2018 (r340039) @@ -46,7 +46,7 @@ TYPE="FreeBSD" REVISION="12.0" -BRANCH="BETA2" +BRANCH="BETA3" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri Nov 2 00:46:11 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 03:25:24 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 03:37:57 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 07:48:24 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 07:57:29 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 07:59:29 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 08:01:43 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 08:03:20 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 08:28:15 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 08:46:21 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 09:47:18 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 10:18:57 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 11:41:59 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 13:35:42 2018 Return-Path: Delivered-To: svn-src-all@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 67AFE10F712A for ; Fri, 2 Nov 2018 13:35:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x12a.google.com (mail-it1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) (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 D6A516AC6E for ; Fri, 2 Nov 2018 13:35:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x12a.google.com with SMTP id p64-v6so3210814itp.0 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=Z1zsp4KZCwuwMqOKHzDMkzWMTv4gzOXTYM6kcxkJPJo1fbxgSUKLWJ2qYTINvolKta kDWqVDxKJhhMelIe1mSpDdn4I8SkEmGTi8lTmB6p9JTUVsM7ZnIWjJzwzR5rabLiX18Y AMPzYQAAl3R18qHHgTLfLNW4PO5/p/ezR68ABerzSzOBW3rx6bDblq3XHwnrbSQLR5bL QNVaoa0wEmqJW2xf4k5QAd6eV0P9mvb3YsVviNhQQmli7p4JkdQGG3Wt6mzqGgwptV3m Ud18a0wDqZ00gcPF8rXxsR2rZMKFvD7sJDh+ap7QIOe1HvdlL0N1xCbuWWcTbBE5FpTo 3mYQ== X-Gm-Message-State: AGRZ1gKHKqob4T6CQ7vp+FnUQpCT7WaVPkkyZER2OAaW0jft4qXZjofh ILtc9RZwUo3jh7SYhc1Ucrhuem5Fqt+P2KAtRvDY4/tj 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 13:37:18 2018 Return-Path: Delivered-To: svn-src-all@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 6E9DD10F726A for ; Fri, 2 Nov 2018 13:37:18 +0000 (UTC) (envelope-from dmitryluhtionov@gmail.com) Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) (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 264766AEDC; Fri, 2 Nov 2018 13:37:18 +0000 (UTC) (envelope-from dmitryluhtionov@gmail.com) Received: by mail-oi1-x22d.google.com with SMTP id u130-v6so1581210oie.7; Fri, 02 Nov 2018 06:37:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=IOKJgr3jltXPGg8pJRO7MNJ7rYTjP5CfeejAevQBHDw=; b=OlKlOM2wjKP+8sFo+g7XUQc00PoMUVyjBL1BC9lAWbIdihFOevHircKVgvzH391B0W wxhA9HZ0GAjIV+AKKjQZaoLb93Dd7EZRzCT0iw07PPqIBEM38esqaoZepUM1tEKbq+BB q7bwaKS2hyAmeZPAas7XEPhH1qvCWReCBvW7x/FWrCWdWgaxyd6sdTwXK5DZixXwx47S VbG9IM8g3UClaiWYILGFxY+KyB2dy5ptVijBlTTi0WdpDG9IWDiiiz69sdHT6PMvAdqn +L3M4Dyufc47gliJyjKg8eQhtJTv+Z4yblDNqvu9ICl8vfmELEakL0BQSqhCAomjx6yT i5CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=IOKJgr3jltXPGg8pJRO7MNJ7rYTjP5CfeejAevQBHDw=; b=IZ0o/5Wd7w5l1c2BaUxFOV8kKWTpXSgKRb1m82CedVQSH83xEReL8SmmTZFkrKi9UN J8igekfjtDxTgVU8dh5noHGh9S9YzOAe4tasfQdX7eZrDeqt8bM85PJgIGL7CL8dH+n8 FwkfGAa/dh8JoVJdo/3/b6eXaX2e7RCRJQjPd+PYutske03ag6N+GJ5KsN3tYiETBK/+ 7rZlJBYvkJAhXXaSTK8jp1LAQWqQgYe4gI4mY6Y5iMOBx56l15arjaZZhJ3SeDzFylUY u2mQcKp7gMu00nbLAU+6vUCbM4WJ0DJT9FUygMrHqCMEO/z2GRThp0cDvkD1bgwP8P/l aAyg== X-Gm-Message-State: AGRZ1gKe0nOmW0vMirI2p+dE3Y6rQ1r/JSWTDr6rtE70C5RaKUkn080i 53MZ/sIy9C0cuRJqyX/ptvWouGhnya/yUmGpvJllGw+B X-Google-Smtp-Source: AJdET5eB6Ka7DFLPr0C8cPngp1Bz6JCUUGiW8AVPBk2/PukhRcPI/ClZnOE+8XxUTTMfBgmvrfsvd7CneCgsm5oIuNU= X-Received: by 2002:aca:2414:: with SMTP id n20-v6mr5425589oic.40.1541165837302; Fri, 02 Nov 2018 06:37:17 -0700 (PDT) MIME-Version: 1.0 From: Dmitry Luhtionov Date: Fri, 2 Nov 2018 15:36:37 +0200 Message-ID: Subject: Re: svn commit: r340046 - head/usr.sbin/bhyve To: svn-src-all@freebsd.org, Marcelo Araujo Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 13:37:18 -0000 I think you need to remove `printf("keysym 0x%x\n", keysym);` from line 322 From owner-svn-src-all@freebsd.org Fri Nov 2 13:48:07 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 13:49:24 2018 Return-Path: Delivered-To: svn-src-all@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 D751110F7731 for ; Fri, 2 Nov 2018 13:49:23 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) (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 466506B8F1; Fri, 2 Nov 2018 13:49:23 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-lf1-x135.google.com with SMTP id n18so1368492lfh.6; Fri, 02 Nov 2018 06:49:23 -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=OUTpq1UXQo6o5ontYnr3vnb7OuJRfUOG5C5kLdXs7V8=; b=Bd9LaskHDpcGBSPbtnN2b4OL2C0ZPkJtOMQzVucBP+jedNT58ZkZr8QCsOLGznf+1X 07AY4k8srqwNhUghPdL6dVV0wPf0Xup3DrR+uf63e3+tZfH2IqGRxd1grpNQzoxH+Rwa 2B2vcLYpfhfh/FhIjBWTMDO7ZG8ihd+5rgncrqflbqtZkHQy7Yxklj4pFsvq5AtW7suF GxVNcu2RdZMiZHfBh3FQYs73Zi+citkFj7X61KUe5stKJoxkYaWkCSen560KXbkGp3VO 1vXIhnpUiJtzb70+KS/RswJ53rl5z5+8RMWsQLGkzoW7Udab/D/kPTzURF9WSfopwOLz DBvA== 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=OUTpq1UXQo6o5ontYnr3vnb7OuJRfUOG5C5kLdXs7V8=; b=aTDIeJU4Gr273VSQhqra+CqB9bgrqczwjCcppbwISX9qE6HG4dMp/5moHD0abFmVlK lsCoNhLpLkpv2P+/C4pQIg9YqNUjjHrSwyE0N1UHXfORzenRHDeSxviB/tkxwC0LlRNH QR53TboncuaYQW0ZhiN1fHU/NZZaSOLL2/nOok1dFH6CVsXlcU3mBxjTbcxKkU7e5xQQ huZWQjViLhIZ+D4YZIJN0+bhUxCnmdu1CDWiCFNQ5EPNh/Aj2NPpGInFhgNnjhPMOp/A GlN4HmJKvCWeArPyJzbAqWcaTUhYbCXg2e6tsI26JTSDqg3q7q+JP+YiqbkXaviyUays 2W9w== X-Gm-Message-State: AGRZ1gIQg3VGMd5Sg1LuJYswPh1AQhlk19PIrnbqyL2DnuMqWs3BgXGK lwf2vmKgzcAT13rm9kWAnp5AE13dVT5QZ/x7lcj9K1dU X-Google-Smtp-Source: AJdET5e/QYg3PdHjmJn9YLVCzCG5zSn1BF3yOtKewgpAbYBPBSIcuy+TOOvXte87sygZcLMvPxl8DhsdV5HfD00mEg0= X-Received: by 2002:a19:2106:: with SMTP id h6mr6845602lfh.29.1541166561780; Fri, 02 Nov 2018 06:49:21 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: araujo@freebsd.org From: Marcelo Araujo Date: Fri, 2 Nov 2018 21:49:09 +0800 Message-ID: Subject: Re: svn commit: r340046 - head/usr.sbin/bhyve To: dmitryluhtionov@gmail.com Cc: svn-src-all@freebsd.org, Marcelo Araujo Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 13:49:24 -0000 Em sex, 2 de nov de 2018 =C3=A0s 21:37, Dmitry Luhtionov < dmitryluhtionov@gmail.com> escreveu: > I think you need to remove `printf("keysym 0x%x\n", keysym);` from line > 322 > Done at: https://svnweb.freebsd.org/changeset/base/340050 Thank you to spot that. Best, --=20 --=20 Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-all@freebsd.org Fri Nov 2 14:07:07 2018 Return-Path: Delivered-To: svn-src-all@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 90DAA10F8017; Fri, 2 Nov 2018 14:07:07 +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 454A46C3C9; Fri, 2 Nov 2018 14:07:07 +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 270BE3D51; Fri, 2 Nov 2018 14:07:07 +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 wA2E77vK041286; Fri, 2 Nov 2018 14:07:07 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2E77vv041285; Fri, 2 Nov 2018 14:07:07 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201811021407.wA2E77vv041285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 2 Nov 2018 14:07:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340051 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 340051 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 14:07:07 -0000 Author: bz Date: Fri Nov 2 14:07:06 2018 New Revision: 340051 URL: https://svnweb.freebsd.org/changeset/base/340051 Log: MFC r339930: 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 Modified: stable/11/sys/net/vnet.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/vnet.c ============================================================================== --- stable/11/sys/net/vnet.c Fri Nov 2 13:48:06 2018 (r340050) +++ stable/11/sys/net/vnet.c Fri Nov 2 14:07:06 2018 (r340051) @@ -169,7 +169,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-all@freebsd.org Fri Nov 2 14:10:30 2018 Return-Path: Delivered-To: svn-src-all@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 8BA4010F826E; Fri, 2 Nov 2018 14:10:30 +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 3EB046C7C8; Fri, 2 Nov 2018 14:10:30 +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 1B8723D5D; Fri, 2 Nov 2018 14:10:30 +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 wA2EAT24041633; Fri, 2 Nov 2018 14:10:29 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2EAT78041632; Fri, 2 Nov 2018 14:10:29 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201811021410.wA2EAT78041632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 2 Nov 2018 14:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340052 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 340052 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 14:10:30 -0000 Author: bz Date: Fri Nov 2 14:10:29 2018 New Revision: 340052 URL: https://svnweb.freebsd.org/changeset/base/340052 Log: MFC r339407: The countp argument passed to linker_file_lookup_set() in linker_load_dependencies() is unused, so no need to ask for the value in first place. Remove the unused "count" variable. Modified: stable/11/sys/kern/kern_linker.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_linker.c ============================================================================== --- stable/11/sys/kern/kern_linker.c Fri Nov 2 14:07:06 2018 (r340051) +++ stable/11/sys/kern/kern_linker.c Fri Nov 2 14:10:29 2018 (r340052) @@ -2084,7 +2084,7 @@ linker_load_dependencies(linker_file_t lf) const struct mod_depend *verinfo; modlist_t mod; const char *modname, *nmodname; - int ver, error = 0, count; + int ver, error = 0; /* * All files are dependent on /kernel. @@ -2097,7 +2097,7 @@ linker_load_dependencies(linker_file_t lf) return (error); } if (linker_file_lookup_set(lf, MDT_SETNAME, &start, &stop, - &count) != 0) + NULL) != 0) return (0); for (mdp = start; mdp < stop; mdp++) { mp = *mdp; From owner-svn-src-all@freebsd.org Fri Nov 2 14:13:32 2018 Return-Path: Delivered-To: svn-src-all@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 B9E3C10F8508; Fri, 2 Nov 2018 14:13:32 +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 680EF6CC19; Fri, 2 Nov 2018 14:13:32 +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 4754E3EFF; Fri, 2 Nov 2018 14:13:32 +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 wA2EDW47046223; Fri, 2 Nov 2018 14:13:32 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2EDWdR046222; Fri, 2 Nov 2018 14:13:32 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201811021413.wA2EDWdR046222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 2 Nov 2018 14:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340053 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 340053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 14:13:33 -0000 Author: bz Date: Fri Nov 2 14:13:31 2018 New Revision: 340053 URL: https://svnweb.freebsd.org/changeset/base/340053 Log: MFC r339431: In r78161 the lookup_set linker method was introduced which optionally returns the section start and stop locations as well as a count if the caller asks for them. There was only one out-of-file consumer of count which did not actually use it and hence was eliminated in r339407. In r194784 parse_dpcpu(), and in r195699 parse_vnet() (a copy of the former) started to use the link_elf_lookup_set() interface internally also asking for the count. count is computed as the difference of the void **stop - void **start locations and as such, if the absoulte numbers (stop - start) % sizeof(void *) != 0 a round-down happens, e.g., **stop 0x1003 - **start 0x1000 => count 0. To get the section size instead of "count is the number of pointer elements in the section", the parse_*() functions do a count *= sizeof(void *). They use the result to allocate memory and copy the section data into the "master" and per-instance memory regions with a size of count. As a result of count possibly round-down this can miss the last bytes of the section. The good news is that we do not touch out of bounds memory during these operations (we may at a later stage if the last bytes would overflow the master sections). Given relocation in elf_relocaddr() works based on the absolute numbers of start and stop, this means that we can possibly try to access relocated data which was never copied and hence we get random garbage or at best zeroed memory. Stop the two (last) consumers of count (the parse_*() functions) from using count as well, and calculate the section size based on the absolute numbers of stop and start and use the proper size for the memory allocation and data copies. This will make the symbols in the last bytes of the pcpu or vnet sections be presented as expected. PR: 232289 Modified: stable/11/sys/kern/link_elf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/link_elf.c ============================================================================== --- stable/11/sys/kern/link_elf.c Fri Nov 2 14:10:29 2018 (r340052) +++ stable/11/sys/kern/link_elf.c Fri Nov 2 14:13:31 2018 (r340053) @@ -611,27 +611,29 @@ parse_dynamic(elf_file_t ef) static int parse_dpcpu(elf_file_t ef) { - int count; - int error; + int error, size; ef->pcpu_start = 0; ef->pcpu_stop = 0; error = link_elf_lookup_set(&ef->lf, "pcpu", (void ***)&ef->pcpu_start, - (void ***)&ef->pcpu_stop, &count); + (void ***)&ef->pcpu_stop, NULL); /* Error just means there is no pcpu set to relocate. */ if (error != 0) return (0); - count *= sizeof(void *); + size = (uintptr_t)ef->pcpu_stop - (uintptr_t)ef->pcpu_start; + /* Empty set? */ + if (size < 1) + return (0); /* * Allocate space in the primary pcpu area. Copy in our * initialization from the data section and then initialize * all per-cpu storage from that. */ - ef->pcpu_base = (Elf_Addr)(uintptr_t)dpcpu_alloc(count); + ef->pcpu_base = (Elf_Addr)(uintptr_t)dpcpu_alloc(size); if (ef->pcpu_base == 0) return (ENOSPC); - memcpy((void *)ef->pcpu_base, (void *)ef->pcpu_start, count); - dpcpu_copy((void *)ef->pcpu_base, count); + 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, ef->pcpu_base); @@ -642,27 +644,29 @@ parse_dpcpu(elf_file_t ef) static int parse_vnet(elf_file_t ef) { - int count; - int error; + int error, size; ef->vnet_start = 0; ef->vnet_stop = 0; error = link_elf_lookup_set(&ef->lf, "vnet", (void ***)&ef->vnet_start, - (void ***)&ef->vnet_stop, &count); + (void ***)&ef->vnet_stop, NULL); /* Error just means there is no vnet data set to relocate. */ if (error != 0) return (0); - count *= sizeof(void *); + size = (uintptr_t)ef->vnet_stop - (uintptr_t)ef->vnet_start; + /* Empty set? */ + if (size < 1) + return (0); /* * Allocate space in the primary vnet area. Copy in our * initialization from the data section and then initialize * all per-vnet storage from that. */ - ef->vnet_base = (Elf_Addr)(uintptr_t)vnet_data_alloc(count); + ef->vnet_base = (Elf_Addr)(uintptr_t)vnet_data_alloc(size); if (ef->vnet_base == 0) return (ENOSPC); - memcpy((void *)ef->vnet_base, (void *)ef->vnet_start, count); - vnet_data_copy((void *)ef->vnet_base, count); + 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, ef->vnet_base); From owner-svn-src-all@freebsd.org Fri Nov 2 14:15:53 2018 Return-Path: Delivered-To: svn-src-all@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 71D8110F85F7; Fri, 2 Nov 2018 14:15:53 +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 190316CE23; Fri, 2 Nov 2018 14:15:53 +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 EFCC53F07; Fri, 2 Nov 2018 14:15:52 +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 wA2EFqOr046421; Fri, 2 Nov 2018 14:15:52 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2EFqmZ046419; Fri, 2 Nov 2018 14:15:52 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201811021415.wA2EFqmZ046419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 2 Nov 2018 14:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340054 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 340054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 14:15:53 -0000 Author: bz Date: Fri Nov 2 14:15:52 2018 New Revision: 340054 URL: https://svnweb.freebsd.org/changeset/base/340054 Log: MFC r339931,r339933 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. PR: 228854 Modified: stable/11/sys/kern/link_elf.c stable/11/sys/kern/link_elf_obj.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/link_elf.c ============================================================================== --- stable/11/sys/kern/link_elf.c Fri Nov 2 14:13:31 2018 (r340053) +++ stable/11/sys/kern/link_elf.c Fri Nov 2 14:15:52 2018 (r340054) @@ -630,8 +630,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, @@ -663,8 +667,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: stable/11/sys/kern/link_elf_obj.c ============================================================================== --- stable/11/sys/kern/link_elf_obj.c Fri Nov 2 14:13:31 2018 (r340053) +++ stable/11/sys/kern/link_elf_obj.c Fri Nov 2 14:15:52 2018 (r340054) @@ -366,6 +366,11 @@ 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 %#jx " + "for %s\n", __func__, + (uintmax_t)shdr[i].sh_size, + filename); error = ENOSPC; goto out; } @@ -380,6 +385,11 @@ 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 %#jx " + "for %s\n", __func__, + (uintmax_t)shdr[i].sh_size, + filename); error = ENOSPC; goto out; } @@ -840,14 +850,30 @@ 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 %#jx " + "for %s\n", __func__, + (uintmax_t)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 %#jx " + "for %s\n", __func__, + (uintmax_t)shdr[i].sh_size, + filename); + } + } #endif else ef->progtab[pb].addr = From owner-svn-src-all@freebsd.org Fri Nov 2 14:42:40 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 14:49:10 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 14:59:53 2018 Return-Path: Delivered-To: svn-src-all@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 A6F1A10FA260; Fri, 2 Nov 2018 14:59:53 +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 5C64C6F4B1; Fri, 2 Nov 2018 14:59:53 +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 3EB4945C8; Fri, 2 Nov 2018 14:59:53 +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 wA2ExrJg067416; Fri, 2 Nov 2018 14:59:53 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2Exrd4067415; Fri, 2 Nov 2018 14:59:53 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201811021459.wA2Exrd4067415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 2 Nov 2018 14:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340056 - stable/11/lib/libsysdecode X-SVN-Group: stable-11 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: stable/11/lib/libsysdecode X-SVN-Commit-Revision: 340056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 14:59:53 -0000 Author: bz Date: Fri Nov 2 14:59:52 2018 New Revision: 340056 URL: https://svnweb.freebsd.org/changeset/base/340056 Log: MFC r330795: The vmresult table was missing most of the values apart from two due to extra "_" in the names we grep for. Add the "_" to the pattern. Reviewed by: jhb Sponsored by: iXsystems, Inc. Modified: stable/11/lib/libsysdecode/mktables Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libsysdecode/mktables ============================================================================== --- stable/11/lib/libsysdecode/mktables Fri Nov 2 14:42:36 2018 (r340055) +++ stable/11/lib/libsysdecode/mktables Fri Nov 2 14:59:52 2018 (r340056) @@ -146,7 +146,7 @@ gen_table "socktype" "SOCK_[A-Z]+[[:space:]]+[1 gen_table "thrcreateflags" "THR_[A-Z]+[[:space:]]+0x[0-9]+" "sys/thr.h" gen_table "umtxop" "UMTX_OP_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/umtx.h" gen_table "vmprot" "VM_PROT_[A-Z]+[[:space:]]+\(\(vm_prot_t\)[[:space:]]+0x[0-9]+\)" "vm/vm.h" -gen_table "vmresult" "KERN_[A-Z]+[[:space:]]+[0-9]+" "vm/vm_param.h" +gen_table "vmresult" "KERN_[A-Z_]+[[:space:]]+[0-9]+" "vm/vm_param.h" gen_table "wait6opt" "W[A-Z]+[[:space:]]+[0-9]+" "sys/wait.h" gen_table "seekwhence" "SEEK_[A-Z]+[[:space:]]+[0-9]+" "sys/unistd.h" gen_table "fcntlcmd" "F_[A-Z0-9_]+[[:space:]]+[0-9]+[[:space:]]+" "sys/fcntl.h" "F_CANCEL|F_..LCK" From owner-svn-src-all@freebsd.org Fri Nov 2 15:02:00 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 15:02:45 2018 Return-Path: Delivered-To: svn-src-all@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 5C31410FA52E; Fri, 2 Nov 2018 15:02:45 +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 114836FA76; Fri, 2 Nov 2018 15:02:45 +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 E8221476D; Fri, 2 Nov 2018 15:02:44 +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 wA2F2iNE072405; Fri, 2 Nov 2018 15:02:44 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2F2iDJ072403; Fri, 2 Nov 2018 15:02:44 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201811021502.wA2F2iDJ072403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 2 Nov 2018 15:02:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340058 - in stable/11: lib/libc/resolv share/man/man5 X-SVN-Group: stable-11 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in stable/11: lib/libc/resolv share/man/man5 X-SVN-Commit-Revision: 340058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 15:02:45 -0000 Author: bz Date: Fri Nov 2 15:02:44 2018 New Revision: 340058 URL: https://svnweb.freebsd.org/changeset/base/340058 Log: MFC r337904: Allow the use of TCP instead of UDP for queries by setting options usevc in resolv.conf which sets RES_USEVC. Reviewed by: ume Modified: stable/11/lib/libc/resolv/res_init.c stable/11/share/man/man5/resolver.5 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/resolv/res_init.c ============================================================================== --- stable/11/lib/libc/resolv/res_init.c Fri Nov 2 15:01:59 2018 (r340057) +++ stable/11/lib/libc/resolv/res_init.c Fri Nov 2 15:02:44 2018 (r340058) @@ -677,6 +677,8 @@ res_setoptions(res_state statp, const char *options, c statp->options |= RES_INSECURE2; } else if (!strncmp(cp, "rotate", sizeof("rotate") - 1)) { statp->options |= RES_ROTATE; + } else if (!strncmp(cp, "usevc", sizeof("usevc") - 1)) { + statp->options |= RES_USEVC; } else if (!strncmp(cp, "no-check-names", sizeof("no-check-names") - 1)) { statp->options |= RES_NOCHECKNAME; Modified: stable/11/share/man/man5/resolver.5 ============================================================================== --- stable/11/share/man/man5/resolver.5 Fri Nov 2 15:01:59 2018 (r340057) +++ stable/11/share/man/man5/resolver.5 Fri Nov 2 15:02:44 2018 (r340058) @@ -28,7 +28,7 @@ .\" @(#)resolver.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 12, 2015 +.Dd August 16, 2018 .Dt RESOLVER 5 .Os .Sh NAME @@ -127,6 +127,10 @@ is one of the following: sets .Dv RES_DEBUG in _res.options. +.It Sy usevc +sets +.Dv RES_USEVC +to use TCP instead of UDP for queries. .It Sy ndots: Ns Ar n sets a threshold for the number of dots which must appear in a name given to .Fn res_query From owner-svn-src-all@freebsd.org Fri Nov 2 15:03:53 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 15:23:58 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 15:26:52 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 15:32:06 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 16:18:59 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 16:21:45 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 16:26:46 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 16:47:09 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 16:50:18 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 16:53:16 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 16:57:25 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 16:59:56 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 17:01:19 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 17:02:11 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 17:03:55 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 17:05:41 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 17:50:58 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 17:50:58 -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-all@freebsd.org Fri Nov 2 18:40:02 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 19:02:04 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 19:14:16 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 19:23:51 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 20:48:30 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 20:50:24 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 20:56:20 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 21:07:07 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 21:20:47 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 22:10:09 2018 Return-Path: Delivered-To: svn-src-all@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 738A510DCD6A; Fri, 2 Nov 2018 22:10:09 +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 1417680934; Fri, 2 Nov 2018 22:10:09 +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 E921610C66; Fri, 2 Nov 2018 22:10:08 +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 wA2MA8nO092084; Fri, 2 Nov 2018 22:10:08 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2MA7Gf092078; Fri, 2 Nov 2018 22:10:07 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811022210.wA2MA7Gf092078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 2 Nov 2018 22:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r340084 - in vendor/expat/dist: . doc examples lib tests tests/benchmark xmlwf X-SVN-Group: vendor X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: in vendor/expat/dist: . doc examples lib tests tests/benchmark xmlwf X-SVN-Commit-Revision: 340084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 22:10:09 -0000 Author: vangyzen Date: Fri Nov 2 22:10:07 2018 New Revision: 340084 URL: https://svnweb.freebsd.org/changeset/base/340084 Log: Vendor import of expat 2.2.6 Sponsored by: Dell EMC Isilon Added: vendor/expat/dist/AUTHORS (contents, props changed) vendor/expat/dist/Makefile.am (contents, props changed) vendor/expat/dist/README.md (contents, props changed) vendor/expat/dist/doc/Makefile.am (contents, props changed) vendor/expat/dist/doc/Makefile.in (contents, props changed) vendor/expat/dist/examples/Makefile.am (contents, props changed) vendor/expat/dist/examples/Makefile.in (contents, props changed) vendor/expat/dist/lib/Makefile.am (contents, props changed) vendor/expat/dist/lib/Makefile.in (contents, props changed) vendor/expat/dist/lib/loadlibrary.c (contents, props changed) vendor/expat/dist/lib/siphash.h (contents, props changed) vendor/expat/dist/run.sh.in (contents, props changed) vendor/expat/dist/test-driver-wrapper.sh (contents, props changed) vendor/expat/dist/tests/Makefile.am (contents, props changed) vendor/expat/dist/tests/Makefile.in (contents, props changed) vendor/expat/dist/tests/benchmark/Makefile.am (contents, props changed) vendor/expat/dist/tests/benchmark/Makefile.in (contents, props changed) vendor/expat/dist/tests/benchmark/benchmark.sln (contents, props changed) vendor/expat/dist/tests/memcheck.c (contents, props changed) vendor/expat/dist/tests/memcheck.h (contents, props changed) vendor/expat/dist/tests/runtests.sln (contents, props changed) vendor/expat/dist/tests/structdata.c (contents, props changed) vendor/expat/dist/tests/structdata.h (contents, props changed) vendor/expat/dist/tests/udiffer.py (contents, props changed) vendor/expat/dist/tests/xmltest.log.expected (contents, props changed) vendor/expat/dist/xmlwf/Makefile.am (contents, props changed) vendor/expat/dist/xmlwf/Makefile.in (contents, props changed) Deleted: vendor/expat/dist/MANIFEST vendor/expat/dist/README Modified: vendor/expat/dist/COPYING (contents, props changed) vendor/expat/dist/Changes (contents, props changed) vendor/expat/dist/FREEBSD-Xlist (contents, props changed) vendor/expat/dist/Makefile.in (contents, props changed) vendor/expat/dist/configure.ac (contents, props changed) vendor/expat/dist/doc/reference.html (contents, props changed) vendor/expat/dist/doc/xmlwf.1 (contents, props changed) vendor/expat/dist/doc/xmlwf.xml (contents, props changed) vendor/expat/dist/examples/elements.c (contents, props changed) vendor/expat/dist/examples/outline.c (contents, props changed) vendor/expat/dist/expat_config.h.in (contents, props changed) vendor/expat/dist/lib/ascii.h (contents, props changed) vendor/expat/dist/lib/asciitab.h (contents, props changed) vendor/expat/dist/lib/expat.h (contents, props changed) vendor/expat/dist/lib/expat_external.h (contents, props changed) vendor/expat/dist/lib/iasciitab.h (contents, props changed) vendor/expat/dist/lib/internal.h (contents, props changed) vendor/expat/dist/lib/latin1tab.h (contents, props changed) vendor/expat/dist/lib/nametab.h (contents, props changed) vendor/expat/dist/lib/utf8tab.h (contents, props changed) vendor/expat/dist/lib/xmlparse.c (contents, props changed) vendor/expat/dist/lib/xmlrole.c (contents, props changed) vendor/expat/dist/lib/xmlrole.h (contents, props changed) vendor/expat/dist/lib/xmltok.c (contents, props changed) vendor/expat/dist/lib/xmltok.h (contents, props changed) vendor/expat/dist/lib/xmltok_impl.c (contents, props changed) vendor/expat/dist/lib/xmltok_impl.h (contents, props changed) vendor/expat/dist/lib/xmltok_ns.c (contents, props changed) vendor/expat/dist/tests/benchmark/benchmark.c (contents, props changed) vendor/expat/dist/tests/chardata.c (contents, props changed) vendor/expat/dist/tests/chardata.h (contents, props changed) vendor/expat/dist/tests/minicheck.c (contents, props changed) vendor/expat/dist/tests/minicheck.h (contents, props changed) vendor/expat/dist/tests/runtests.c (contents, props changed) vendor/expat/dist/tests/runtestspp.cpp (contents, props changed) vendor/expat/dist/tests/xmltest.sh (contents, props changed) vendor/expat/dist/xmlwf/codepage.c (contents, props changed) vendor/expat/dist/xmlwf/codepage.h (contents, props changed) vendor/expat/dist/xmlwf/ct.c (contents, props changed) vendor/expat/dist/xmlwf/filemap.h (contents, props changed) vendor/expat/dist/xmlwf/readfilemap.c (contents, props changed) vendor/expat/dist/xmlwf/unixfilemap.c (contents, props changed) vendor/expat/dist/xmlwf/win32filemap.c (contents, props changed) vendor/expat/dist/xmlwf/xmlfile.c (contents, props changed) vendor/expat/dist/xmlwf/xmlfile.h (contents, props changed) vendor/expat/dist/xmlwf/xmlmime.c (contents, props changed) vendor/expat/dist/xmlwf/xmlmime.h (contents, props changed) vendor/expat/dist/xmlwf/xmltchar.h (contents, props changed) vendor/expat/dist/xmlwf/xmlurl.h (contents, props changed) vendor/expat/dist/xmlwf/xmlwf.c (contents, props changed) vendor/expat/dist/xmlwf/xmlwin32url.cxx (contents, props changed) Directory Properties: vendor/expat/dist/doc/expat.png (props changed) vendor/expat/dist/doc/style.css (props changed) vendor/expat/dist/tests/README.txt (props changed) vendor/expat/dist/tests/benchmark/README.txt (props changed) Added: vendor/expat/dist/AUTHORS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/expat/dist/AUTHORS Fri Nov 2 22:10:07 2018 (r340084) @@ -0,0 +1,10 @@ +Expat is brought to you by: + +Clark Cooper +Fred L. Drake, Jr. +Greg Stein +James Clark +Karl Waclawek +Rhodri James +Sebastian Pipping +Steven Solie Modified: vendor/expat/dist/COPYING ============================================================================== --- vendor/expat/dist/COPYING Fri Nov 2 21:20:46 2018 (r340083) +++ vendor/expat/dist/COPYING Fri Nov 2 22:10:07 2018 (r340084) @@ -1,5 +1,5 @@ Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper -Copyright (c) 2001-2016 Expat maintainers +Copyright (c) 2001-2017 Expat maintainers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Modified: vendor/expat/dist/Changes ============================================================================== --- vendor/expat/dist/Changes Fri Nov 2 21:20:46 2018 (r340083) +++ vendor/expat/dist/Changes Fri Nov 2 22:10:07 2018 (r340084) @@ -1,3 +1,333 @@ +NOTE: We are looking for help with a few things: + https://github.com/libexpat/libexpat/labels/help%20wanted + If you can help, please get in touch. Thanks! + +Release 2.2.6 Sun August 12 2018 + Bug fixes: + #170 #206 Avoid doing arithmetic with NULL pointers in XML_GetBuffer + #204 #205 Fix 2.2.5 regression with suspend-resume while parsing + a document like '' + + Other changes: + #165 #168 Autotools: Fix docbook-related configure syntax error + #166 Autotools: Avoid grep option `-q` for Solaris + #167 Autotools: Support + ./configure DOCBOOK_TO_MAN="xmlto man --skip-validation" + #159 #167 Autotools: Support DOCBOOK_TO_MAN command which produces + xmlwf.1 rather than XMLWF.1; also covers case insensitive + file systems + #181 Autotools: Drop -rpath option passed to libtool + #188 Autotools: Detect and deny SGML docbook2man as ours is XML + #188 Autotools/CMake: Support command db2x_docbook2man as well + #174 CMake: Introduce option WARNINGS_AS_ERRORS, defaults to OFF + #184 #185 CMake: Introduce option MSVC_USE_STATIC_CRT, defaults to OFF + #207 #208 CMake: Introduce option XML_UNICODE and XML_UNICODE_WCHAR_T, + both defaulting to OFF + #175 CMake: Prefer check_symbol_exists over check_function_exists + #176 CMake: Create the same pkg-config file as with GNU Autotools + #178 #179 CMake: Use GNUInstallDirs module to set proper defaults for + install directories + #208 CMake: Utilize expat_config.h.cmake for XML_DEV_URANDOM + #180 Windows: Fix compilation of test suite for Visual Studio 2008 + #131 #173 #202 Address compiler warnings + #187 #190 #200 Fix miscellaneous typos + Version info bumped from 7:7:6 to 7:8:6 + + Special thanks to: + Anton Maklakov + Benjamin Peterson + Brad King + Franek Korta + Frank Rast + Joe Orton + luzpaz + Pedro Vicente + Rainer Jung + Rhodri James + Rolf Ade + Rolf Eike Beer + Thomas Beutlich + Tomasz KÅ‚oczko + +Release 2.2.5 Tue October 31 2017 + Bug fixes: + #8 If the parser runs out of memory, make sure its internal + state reflects the memory it actually has, not the memory + it wanted to have. + #11 The default handler wasn't being called when it should for + a SYSTEM or PUBLIC doctype if an entity declaration handler + was registered. + #137 #138 Fix a case of mistakenly reported parsing success where + XML_StopParser was called from an element handler + #162 Function XML_ErrorString was returning NULL rather than + a message for code XML_ERROR_INVALID_ARGUMENT + introduced with release 2.2.1 + + Other changes: + #106 xmlwf: Add argument -N adding notation declarations + #75 #106 Test suite: Resolve expected failure cases where xmlwf + output was incomplete + #127 Windows: Fix test suite compilation + #126 #127 Windows: Fix compilation for Visual Studio 2012 + Windows: Upgrade shipped project files to Visual Studio 2017 + #33 #132 tests: Mass-fix compilation for XML_UNICODE_WCHAR_T + #129 examples: Fix compilation for XML_UNICODE_WCHAR_T + #130 benchmark: Fix compilation for XML_UNICODE_WCHAR_T + #144 xmlwf: Fix compilation for XML_UNICODE_WCHAR_T; still needs + Windows or MinGW for 2-byte wchar_t + #9 Address two Clang Static Analyzer false positives + #59 Resolve troublesome macros hiding parser struct membership + and dereferencing that pointer + #6 Resolve superfluous internal malloc/realloc switch + #153 #155 Improve docbook2x-man detection + #160 Undefine NDEBUG in the test suite (rather than rejecting it) + #161 Address compiler warnings + Version info bumped from 7:6:6 to 7:7:6 + + Special thanks to: + Benbuck Nason + Hans Wennborg + José Gutiérrez de la Concha + Pedro Monreal Gonzalez + Rhodri James + Rolf Ade + Stephen Groat + and + Core Infrastructure Initiative + +Release 2.2.4 Sat August 19 2017 + Bug fixes: + #115 Fix copying of partial characters for UTF-8 input + + Other changes: + #109 Fix "make check" for non-x86 architectures that default + to unsigned type char (-128..127 rather than 0..255) + #109 coverage.sh: Cover -funsigned-char + Autotools: Introduce --without-xmlwf argument + #65 Autotools: Replace handwritten Makefile with GNU Automake + #43 CMake: Auto-detect high quality entropy extractors, add new + option USE_libbsd=ON to use arc4random_buf of libbsd + #74 CMake: Add -fno-strict-aliasing only where supported + #114 CMake: Always honor manually set BUILD_* options + #114 CMake: Compile man page if docbook2x-man is available, only + #117 Include file tests/xmltest.log.expected in source tarball + (required for "make run-xmltest") + #117 Include (existing) Visual Studio 2013 files in source tarball + Improve test suite error output + #111 Fix some typos in documentation + Version info bumped from 7:5:6 to 7:6:6 + + Special thanks to: + Jakub Wilk + Joe Orton + Lin Tian + Rolf Eike Beer + +Release 2.2.3 Wed August 2 2017 + Security fixes: + #82 CVE-2017-11742 -- Windows: Fix DLL hijacking vulnerability + using Steve Holme's LoadLibrary wrapper for/of cURL + + Bug fixes: + #85 Fix a dangling pointer issue related to realloc + + Other changes: + Increase code coverage + #91 Linux: Allow getrandom to fail if nonblocking pool has not + yet been initialized and read /dev/urandom then, instead. + This is in line with what recent Python does. + #81 Pre-10.7/Lion macOS: Support entropy from arc4random + #86 Check that a UTF-16 encoding in an XML declaration has the + right endianness + #4 #5 #7 Recover correctly when some reallocations fail + Repair "./configure && make" for systems without any + provider of high quality entropy + and try reading /dev/urandom on those + Ensure that user-defined character encodings have converter + functions when they are needed + Fix mis-leading description of argument -c in xmlwf.1 + Rely on macro HAVE_ARC4RANDOM_BUF (rather than __CloudABI__) + for CloudABI + #100 Fix use of SIPHASH_MAIN in siphash.h + #23 Test suite: Fix memory leaks + Version info bumped from 7:4:6 to 7:5:6 + + Special thanks to: + Chanho Park + Joe Orton + Pascal Cuoq + Rhodri James + Simon McVittie + Vadim Zeitlin + Viktor Szakats + and + Core Infrastructure Initiative + +Release 2.2.2 Wed July 12 2017 + Security fixes: + #43 Protect against compilation without any source of high + quality entropy enabled, e.g. with CMake build system; + commit ff0207e6076e9828e536b8d9cd45c9c92069b895 + #60 Windows with _UNICODE: + Unintended use of LoadLibraryW with a non-wide string + resulted in failure to load advapi32.dll and degradation + in quality of used entropy when compiled with _UNICODE for + Windows; you can launch existing binaries with + EXPAT_ENTROPY_DEBUG=1 in the environment to inspect the + quality of entropy used during runtime; commits + * 95b95032f907ef1cd17ee7a9a1768010a825d61d + * 73a5a2e9c081f49f2d775cf7ced864158b68dc80 + [MOX-006] Fix non-NULL parser parameter validation in XML_Parse; + resulted in NULL dereference, previously; + commit ac256dafdffc9622ab0dc2c62fcecb0dfcfa71fe + + Bug fixes: + #69 Fix improper use of unsigned long long integer literals + + Other changes: + #73 Start requiring a C99 compiler + #49 Fix "==" Bashism in configure script + #50 Fix too eager getrandom detection for Debian GNU/kFreeBSD + #52 and macOS + #51 Address lack of stdint.h in Visual Studio 2003 to 2008 + #58 Address compile warnings + #68 Fix "./buildconf.sh && ./configure" for some versions + of Dash for /bin/sh + #72 CMake: Ease use of Expat in context of a parent project + with multiple CMakeLists.txt files + #72 CMake: Resolve mistaken executable permissions + #76 Address compile warning with -DNDEBUG (not recommended!) + #77 Address compile warning about macro redefinition + + Special thanks to: + Alexander Bluhm + Ben Boeckel + Cătălin Răceanu + Kerin Millar + László Böszörményi + S. P. Zeidler + Segev Finer + Václav Slavík + Victor Stinner + Viktor Szakats + and + Radically Open Security + +Release 2.2.1 Sat June 17 2017 + Security fixes: + CVE-2017-9233 -- External entity infinite loop DoS + Details: https://libexpat.github.io/doc/cve-2017-9233/ + Commit c4bf96bb51dd2a1b0e185374362ee136fe2c9d7f + [MOX-002] CVE-2016-9063 -- Detect integer overflow; commit + d4f735b88d9932bd5039df2335eefdd0723dbe20 + (Fixed version of existing downstream patches!) + (SF.net) #539 Fix regression from fix to CVE-2016-0718 cutting off + longer tag names; commits + * 896b6c1fd3b842f377d1b62135dccf0a579cf65d + * af507cef2c93cb8d40062a0abe43a4f4e9158fb2 + #16 * 0dbbf43fdb20f593ddf4fa1ff67288000dd4a7fd + #25 More integer overflow detection (function poolGrow); commits + * 810b74e4703dcfdd8f404e3cb177d44684775143 + * 44178553f3539ce69d34abee77a05e879a7982ac + [MOX-002] Detect overflow from len=INT_MAX call to XML_Parse; commits + * 4be2cb5afcc018d996f34bbbce6374b7befad47f + * 7e5b71b748491b6e459e5c9a1d090820f94544d8 + [MOX-005] #30 Use high quality entropy for hash initialization: + * arc4random_buf on BSD, systems with libbsd + (when configured with --with-libbsd), CloudABI + * RtlGenRandom on Windows XP / Server 2003 and later + * getrandom on Linux 3.17+ + In a way, that's still part of CVE-2016-5300. + https://github.com/libexpat/libexpat/pull/30/commits + [MOX-005] For the low quality entropy extraction fallback code, + the parser instance address can no longer leak, commit + 04ad658bd3079dd15cb60fc67087900f0ff4b083 + [MOX-003] Prevent use of uninitialised variable; commit + [MOX-004] a4dc944f37b664a3ca7199c624a98ee37babdb4b + Add missing parameter validation to public API functions + and dedicated error code XML_ERROR_INVALID_ARGUMENT: + [MOX-006] * NULL checks; commits + * d37f74b2b7149a3a95a680c4c4cd2a451a51d60a (merge/many) + * 9ed727064b675b7180c98cb3d4f75efba6966681 + * 6a747c837c50114dfa413994e07c0ba477be4534 + * Negative length (XML_Parse); commit + [MOX-002] 70db8d2538a10f4c022655d6895e4c3e78692e7f + [MOX-001] #35 Change hash algorithm to William Ahern's version of SipHash + to go further with fixing CVE-2012-0876. + https://github.com/libexpat/libexpat/pull/39/commits + + Bug fixes: + #32 Fix sharing of hash salt across parsers; + relevant where XML_ExternalEntityParserCreate is called + prior to XML_Parse, in particular (e.g. FBReader) + #28 xmlwf: Auto-disable use of memory-mapping (and parsing + as a single chunk) for files larger than ~1 GB (2^30 bytes) + rather than failing with error "out of memory" + #3 Fix double free after malloc failure in DTD code; commit + 7ae9c3d3af433cd4defe95234eae7dc8ed15637f + #17 Fix memory leak on parser error for unbound XML attribute + prefix with new namespaces defined in the same tag; + found by Google's OSS-Fuzz; commits + * 16f87daae5a16132e479e4f71862128c7a915c73 + * b47dbc9745932c160893d433220e462bd605f8cd + xmlwf on Windows: Add missing calls to CloseHandle + + New features: + #30 Introduced environment switch EXPAT_ENTROPY_DEBUG=1 + for runtime debugging of entropy extraction + + Other changes: + Increase code coverage + #33 Reject use of XML_UNICODE_WCHAR_T with sizeof(wchar_t) != 2; + XML_UNICODE_WCHAR_T was never meant to be used outside + of Windows; 4-byte wchar_t is common on Linux + (SF.net) #538 Start using -fno-strict-aliasing + (SF.net) #540 Support compilation against cloudlibc of CloudABI + Allow MinGW cross-compilation + (SF.net) #534 CMake: Introduce option "BUILD_doc" (enabled by default) + to bypass compilation of the xmlwf.1 man page + (SF.net) pr2 CMake: Introduce option "INSTALL" (enabled by default) + to bypass installation of expat files + CMake: Fix ninja support + Autotools: Add parameters --enable-xml-context [COUNT] + and --disable-xml-context; default of context of 1024 + bytes enabled unchanged + #14 Drop AmigaOS 4.x code and includes + #14 Drop ancient build systems: + * Borland C++ Builder + * OpenVMS + * Open Watcom + * Visual Studio 6.0 + * Pre-X Mac OS (MPW Makefile) + If you happen to rely on some of these, please get in + touch for joining with maintenance. + #10 Move from WIN32 to _WIN32 + #13 Fix "make run-xmltest" order instability + Address compile warnings + Bump version info from 7:2:6 to 7:3:6 + Add AUTHORS file + + Infrastructure: + #1 Migrate from SourceForge to GitHub (except downloads): + https://github.com/libexpat/ + #1 Re-create http://libexpat.org/ project website + Start utilizing Travis CI + + Special thanks to: + Andy Wang + Don Lewis + Ed Schouten + Karl Waclawek + Pascal Cuoq + Rhodri James + Sergei Nikulov + Tobias Taschner + Viktor Szakats + and + Core Infrastructure Initiative + Mozilla Foundation (MOSS Track 3: Secure Open Source) + Radically Open Security + Release 2.2.0 Tue June 21 2016 Security fixes: #537 CVE-2016-0718 -- Fix crash on malformed input @@ -63,24 +393,25 @@ Release 2.1.1 Sat March 12 2016 libtool now invoked with --verbose Release 2.1.0 Sat March 24 2012 + - Security fixes: + #2958794: CVE-2012-1148 - Memory leak in poolGrow. + #2895533: CVE-2012-1147 - Resource leak in readfilemap.c. + #3496608: CVE-2012-0876 - Hash DOS attack. + #2894085: CVE-2009-3560 - Buffer over-read and crash in big2_toUtf8(). + #1990430: CVE-2009-3720 - Parser crash with special UTF-8 sequences. - Bug Fixes: #1742315: Harmful XML_ParserCreateNS suggestion. - #2895533: CVE-2012-1147 - Resource leak in readfilemap.c. #1785430: Expat build fails on linux-amd64 with gcc version>=4.1 -O3. #1983953, 2517952, 2517962, 2649838: Build modifications using autoreconf instead of buildconf.sh. #2815947, #2884086: OBJEXT and EXEEXT support while building. - #1990430: CVE-2009-3720 - Parser crash with special UTF-8 sequences. #2517938: xmlwf should return non-zero exit status if not well-formed. #2517946: Wrong statement about XMLDecl in xmlwf.1 and xmlwf.sgml. #2855609: Dangling positionPtr after error. - #2894085: CVE-2009-3560 - Buffer over-read and crash in big2_toUtf8(). - #2958794: CVE-2012-1148 - Memory leak in poolGrow. #2990652: CMake support. #3010819: UNEXPECTED_STATE with a trailing "%" in entity value. - #3206497: Unitialized memory returned from XML_Parse. + #3206497: Uninitialized memory returned from XML_Parse. #3287849: make check fails on mingw-w64. - #3496608: CVE-2012-0876 - Hash DOS attack. - Patches: #1749198: pkg-config support. #3010222: Fix for bug #3010819. Modified: vendor/expat/dist/FREEBSD-Xlist ============================================================================== --- vendor/expat/dist/FREEBSD-Xlist Fri Nov 2 21:20:46 2018 (r340083) +++ vendor/expat/dist/FREEBSD-Xlist Fri Nov 2 22:10:07 2018 (r340084) @@ -6,6 +6,7 @@ *.dsw *.m4 *.pc.in +*.vcxproj* *config.h CMake* Configure* @@ -14,6 +15,7 @@ bcb5 configure conftools doc/valid-xhtml10.png +expat.sln m4 vms win32 Added: vendor/expat/dist/Makefile.am ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/expat/dist/Makefile.am Fri Nov 2 22:10:07 2018 (r340084) @@ -0,0 +1,153 @@ +# +# __ __ _ +# ___\ \/ /_ __ __ _| |_ +# / _ \\ /| '_ \ / _` | __| +# | __// \| |_) | (_| | |_ +# \___/_/\_\ .__/ \__,_|\__| +# |_| XML parser +# +# Copyright (c) 2017 Expat development team +# Licensed under the MIT license: +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to permit +# persons to whom the Software is furnished to do so, subject to the +# following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +# USE OR OTHER DEALINGS IN THE SOFTWARE. + +AUTOMAKE_OPTIONS = \ + dist-bzip2 \ + foreign \ + no-dist-gzip \ + subdir-objects + +ACLOCAL_AMFLAGS = -I m4 +LIBTOOLFLAGS = --verbose + +SUBDIRS = lib examples tests # lib goes first to build first +if WITH_XMLWF +SUBDIRS += xmlwf doc +endif + +pkgconfig_DATA = expat.pc +pkgconfigdir = $(libdir)/pkgconfig + + +_EXTRA_DIST_CMAKE = \ + CMakeLists.txt \ + CMake.README \ + ConfigureChecks.cmake \ + expat_config.h.cmake + +_EXTRA_DIST_WINDOWS = \ + examples/elements.vcxproj \ + examples/elements.vcxproj.filters \ + examples/outline.vcxproj \ + examples/outline.vcxproj.filters \ + \ + lib/expat_static.vcxproj \ + lib/expat_static.vcxproj.filters \ + lib/expat.vcxproj \ + lib/expat.vcxproj.filters \ + lib/expatw_static.vcxproj \ + lib/expatw_static.vcxproj.filters \ + lib/expatw.vcxproj \ + lib/expatw.vcxproj.filters \ + \ + tests/benchmark/benchmark.sln \ + tests/benchmark/benchmark.vcxproj \ + \ + tests/runtests.sln \ + tests/runtests.vcxproj \ + tests/runtests.vcxproj.filters \ + \ + win32/expat.iss \ + win32/MANIFEST.txt \ + win32/README.txt \ + \ + xmlwf/xmlwf.vcxproj \ + xmlwf/xmlwf.vcxproj.filters \ + \ + expat.sln + +EXTRA_DIST = \ + $(_EXTRA_DIST_CMAKE) \ + $(_EXTRA_DIST_WINDOWS) \ + \ + conftools/expat.m4 \ + conftools/get-version.sh \ + conftools/PrintPath \ + \ + Changes \ + README.md \ + test-driver-wrapper.sh + + +.PHONY: buildlib +buildlib: + @echo 'ERROR: Running "make buildlib LIBRARY=libexpatw.la"' >&2 + @echo 'ERROR: is no longer supported. INSTEAD please:' >&2 + @echo 'ERROR:' >&2 + @echo 'ERROR: * Mass-patch Makefile.am, e.g.' >&2 + @echo 'ERROR: # find -name Makefile.am -exec sed \' >&2 + @echo 'ERROR: -e "s,libexpat\.la,libexpatw.la," \' >&2 + @echo 'ERROR: -e "s,libexpat_la,libexpatw_la," \' >&2 + @echo 'ERROR: -i {} +' >&2 + @echo 'ERROR:' >&2 + @echo 'ERROR: * Run automake to re-generate Makefile.in files' >&2 + @echo 'ERROR:' >&2 + @echo 'ERROR: * Use "./configure --without-xmlwf" and/or' >&2 + @echo 'ERROR: "make -C lib all install" to bypass compilation' >&2 + @echo 'ERROR: of xmlwf (e.g. with -DXML_UNICODE)' >&2 + @echo 'ERROR:' >&2 + @false + + +.PHONY: run-benchmark +run-benchmark: + $(MAKE) -C tests/benchmark + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 + +tests/xmlts.zip: + if test "$(XMLTS_ZIP)" = ""; then \ + wget --output-document=tests/xmlts.zip \ + https://www.w3.org/XML/Test/xmlts20080827.zip; \ + else \ + cp $(XMLTS_ZIP) tests/xmlts.zip; \ + fi + +tests/xmlconf: tests/xmlts.zip + cd tests && unzip -q xmlts.zip + +.PHONY: run-xmltest +run-xmltest: tests/xmlconf +if WITH_XMLWF + $(MAKE) -C xmlwf + tests/xmltest.sh "$(PWD)/run.sh $(PWD)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee tests/xmltest.log + dos2unix tests/xmltest.log + diff -u tests/xmltest.log.expected tests/xmltest.log +else + @echo 'ERROR: xmlwf is needed for "make run-xmltest".' >&2 + @echo 'ERROR: Please re-configure without --without-xmlwf.' >&2 + @false +endif + +.PHONY: qa +qa: + ./qa.sh address + ./qa.sh memory + ./qa.sh undefined + ./qa.sh coverage Modified: vendor/expat/dist/Makefile.in ============================================================================== --- vendor/expat/dist/Makefile.in Fri Nov 2 21:20:46 2018 (r340083) +++ vendor/expat/dist/Makefile.in Fri Nov 2 22:10:07 2018 (r340084) @@ -1,194 +1,1019 @@ -################################################################ -# Process this file with top-level configure script to produce Makefile +# Makefile.in generated by automake 1.15.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2017 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + # -# Copyright 2000 Clark Cooper +# __ __ _ +# ___\ \/ /_ __ __ _| |_ +# / _ \\ /| '_ \ / _` | __| +# | __// \| |_) | (_| | |_ +# \___/_/\_\ .__/ \__,_|\__| +# |_| XML parser # -# This file is part of EXPAT. +# Copyright (c) 2017 Expat development team +# Licensed under the MIT license: # -# EXPAT is free software; you can redistribute it and/or modify it -# under the terms of the License (based on the MIT/X license) contained -# in the file COPYING that comes with this distribution. +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to permit +# persons to whom the Software is furnished to do so, subject to the +# following conditions: # -# EXPAT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# SOFTWARE OR THE USE OR OTHER DEALINGS IN EXPAT. +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +# USE OR OTHER DEALINGS IN THE SOFTWARE. +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@WITH_XMLWF_TRUE@am__append_1 = xmlwf doc +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/conftools/ac_c_bigendian_cross.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = expat_config.h +CONFIG_CLEAN_FILES = expat.pc run.sh +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(pkgconfigdir)" +DATA = $(pkgconfig_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)expat_config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DIST_SUBDIRS = lib examples tests xmlwf doc +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/expat.pc.in \ + $(srcdir)/expat_config.h.in $(srcdir)/run.sh.in \ + $(top_srcdir)/conftools/compile \ + $(top_srcdir)/conftools/config.guess \ + $(top_srcdir)/conftools/config.sub \ + $(top_srcdir)/conftools/install-sh \ + $(top_srcdir)/conftools/ltmain.sh \ + $(top_srcdir)/conftools/missing AUTHORS COPYING \ + conftools/compile conftools/config.guess conftools/config.sub \ + conftools/install-sh conftools/ltmain.sh conftools/missing +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +GZIP_ENV = --best +DIST_ARCHIVES = $(distdir).tar.bz2 +DIST_TARGETS = dist-bzip2 +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILEMAP = @FILEMAP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBAGE = @LIBAGE@ +LIBCURRENT = @LIBCURRENT@ +LIBOBJS = @LIBOBJS@ +LIBREVISION = @LIBREVISION@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ - +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -VPATH = @srcdir@ +AUTOMAKE_OPTIONS = \ + dist-bzip2 \ + foreign \ + no-dist-gzip \ + subdir-objects -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -libdir = @libdir@ -includedir = @includedir@ -man1dir = @mandir@/man1 +ACLOCAL_AMFLAGS = -I m4 +LIBTOOLFLAGS = --verbose *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Nov 2 22:12:31 2018 Return-Path: Delivered-To: svn-src-all@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 6988F10DCF9B; Fri, 2 Nov 2018 22:12:31 +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 1BA3980CC2; Fri, 2 Nov 2018 22:12:31 +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 D865310E00; Fri, 2 Nov 2018 22:12:30 +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 wA2MCUsg097213; Fri, 2 Nov 2018 22:12:30 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2MCU8X097212; Fri, 2 Nov 2018 22:12:30 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811022212.wA2MCU8X097212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 2 Nov 2018 22:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r340085 - vendor/expat/2.2.6 X-SVN-Group: vendor X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: vendor/expat/2.2.6 X-SVN-Commit-Revision: 340085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 22:12:31 -0000 Author: vangyzen Date: Fri Nov 2 22:12:30 2018 New Revision: 340085 URL: https://svnweb.freebsd.org/changeset/base/340085 Log: Tag expat 2.2.6 Sponsored by: Dell EMC Isilon Added: vendor/expat/2.2.6/ - copied from r340084, vendor/expat/dist/ From owner-svn-src-all@freebsd.org Fri Nov 2 22:15:31 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 22:15:48 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 22:18:03 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 22:23:26 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 22:28:37 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 22:33:38 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 22:50:19 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 22:57:01 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Nov 2 23:03:41 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Sat Nov 3 00:37:52 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Nov 3 00:47:03 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Nov 3 01:44:38 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Nov 3 01:53:27 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Nov 3 03:43:34 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Nov 3 03:10:07 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Nov 3 12:15:54 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Nov 3 17:11:23 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Nov 3 18:03:25 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Nov 3 19:31:12 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Nov 3 20:05:51 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Nov 3 20:35:40 2018 Return-Path: Delivered-To: svn-src-all@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 9704310E37CD; Sat, 3 Nov 2018 20:35:40 +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 4AA7969C36; Sat, 3 Nov 2018 20:35:40 +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 278231EB08; Sat, 3 Nov 2018 20:35: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 wA3KZeEu086540; Sat, 3 Nov 2018 20:35:40 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA3KZd4i086539; Sat, 3 Nov 2018 20:35:40 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201811032035.wA3KZd4i086539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 3 Nov 2018 20:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340101 - stable/12/sys/powerpc/powermac X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/powerpc/powermac X-SVN-Commit-Revision: 340101 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 20:35:40 -0000 Author: tuexen Date: Sat Nov 3 20:35:39 2018 New Revision: 340101 URL: https://svnweb.freebsd.org/changeset/base/340101 Log: MFC r339914: Bump the number of fans supported from 8 to 12. The number of fans on a PowerMac7,3 with liquid cooling is 9. Approved by: re (kib@) Reviewed by: andreast@ Differential Revision: https://reviews.freebsd.org/D17754 Modified: stable/12/sys/powerpc/powermac/fcu.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/powermac/fcu.c ============================================================================== --- stable/12/sys/powerpc/powermac/fcu.c Sat Nov 3 20:05:50 2018 (r340100) +++ stable/12/sys/powerpc/powermac/fcu.c Sat Nov 3 20:35:39 2018 (r340101) @@ -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-all@freebsd.org Sat Nov 3 20:39:17 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Nov 3 21:59:53 2018 Return-Path: Delivered-To: svn-src-all@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 EE40110E9657; Sat, 3 Nov 2018 21:59:52 +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 A51376C049; Sat, 3 Nov 2018 21:59:52 +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 87DED1F7C7; Sat, 3 Nov 2018 21:59:52 +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 wA3Lxqai027549; Sat, 3 Nov 2018 21:59:52 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA3Lxq0Q027548; Sat, 3 Nov 2018 21:59:52 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201811032159.wA3Lxq0Q027548@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 21:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r340103 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 340103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 21:59:53 -0000 Author: yuripv Date: Sat Nov 3 21:59:52 2018 New Revision: 340103 URL: https://svnweb.freebsd.org/changeset/base/340103 Log: Bump my limit for CLDR update. Approved by: kib (mentor) Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Sat Nov 3 20:39:16 2018 (r340102) +++ svnadmin/conf/sizelimit.conf Sat Nov 3 21:59:52 2018 (r340103) @@ -27,3 +27,4 @@ np obrien peter rwatson +yuripv From owner-svn-src-all@freebsd.org Sat Nov 3 22:02:12 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Nov 3 22:12:22 2018 Return-Path: Delivered-To: svn-src-all@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 3329410E9B91; Sat, 3 Nov 2018 22:12:22 +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 B73B16C876; Sat, 3 Nov 2018 22:12:21 +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 9863B1FAD7; Sat, 3 Nov 2018 22:12:21 +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 wA3MCL9D037943; Sat, 3 Nov 2018 22:12:21 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA3MCLeG037942; Sat, 3 Nov 2018 22:12:21 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201811032212.wA3MCLeG037942@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:12:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r340105 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 340105 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B73B16C876 X-Spamd-Result: default: False [-0.11 / 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]; 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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 22:12:22 -0000 Author: yuripv Date: Sat Nov 3 22:12:21 2018 New Revision: 340105 URL: https://svnweb.freebsd.org/changeset/base/340105 Log: Remove myself. Approved by: kib (mentor, implicit) Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Sat Nov 3 22:02:10 2018 (r340104) +++ svnadmin/conf/sizelimit.conf Sat Nov 3 22:12:21 2018 (r340105) @@ -27,4 +27,3 @@ np obrien peter rwatson -yuripv From owner-svn-src-all@freebsd.org Sat Nov 3 23:37:15 2018 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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;