From owner-svn-src-all@freebsd.org Sun Oct 27 03:46:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6EED159CEB; Sun, 27 Oct 2019 03:46:02 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4713ff5Sjtz4Flb; Sun, 27 Oct 2019 03:46:02 +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 7DF981B6DA; Sun, 27 Oct 2019 03:46:02 +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 x9R3k2P7020136; Sun, 27 Oct 2019 03:46:02 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9R3k2aW020135; Sun, 27 Oct 2019 03:46:02 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201910270346.x9R3k2aW020135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 27 Oct 2019 03:46: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: r354122 - stable/12/sbin/fsck_ffs X-SVN-Group: stable-12 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/12/sbin/fsck_ffs X-SVN-Commit-Revision: 354122 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2019 03:46:03 -0000 Author: mckusick Date: Sun Oct 27 03:46:00 2019 New Revision: 354122 URL: https://svnweb.freebsd.org/changeset/base/354122 Log: MFC of 353903 Fix uninitialized variable in SUJ recovery. Modified: stable/12/sbin/fsck_ffs/suj.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/fsck_ffs/suj.c ============================================================================== --- stable/12/sbin/fsck_ffs/suj.c Sat Oct 26 21:19:55 2019 (r354121) +++ stable/12/sbin/fsck_ffs/suj.c Sun Oct 27 03:46:00 2019 (r354122) @@ -1544,7 +1544,7 @@ ino_trunc(ino_t ino, off_t size) /* If we freed everything in this indirect free the indir. */ if (lastlbn > lbn) continue; - blk_free(DIP(ip, di_ib[i]), 0, frags); + blk_free(DIP(ip, di_ib[i]), 0, fs->fs_frag); DIP_SET(ip, di_ib[i], 0); } ino_dirty(ino); From owner-svn-src-all@freebsd.org Sun Oct 27 03:47:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB351159F60; Sun, 27 Oct 2019 03:47:16 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4713h461wTz4Fvg; Sun, 27 Oct 2019 03:47:16 +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 B33951B6DD; Sun, 27 Oct 2019 03:47:16 +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 x9R3lG7V020243; Sun, 27 Oct 2019 03:47:16 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9R3lGuZ020242; Sun, 27 Oct 2019 03:47:16 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201910270347.x9R3lGuZ020242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 27 Oct 2019 03: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: r354123 - stable/11/sbin/fsck_ffs X-SVN-Group: stable-11 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/11/sbin/fsck_ffs X-SVN-Commit-Revision: 354123 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2019 03:47:17 -0000 Author: mckusick Date: Sun Oct 27 03:47:16 2019 New Revision: 354123 URL: https://svnweb.freebsd.org/changeset/base/354123 Log: MFC of 353903 Fix uninitialized variable in SUJ recovery. Modified: stable/11/sbin/fsck_ffs/suj.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/fsck_ffs/suj.c ============================================================================== --- stable/11/sbin/fsck_ffs/suj.c Sun Oct 27 03:46:00 2019 (r354122) +++ stable/11/sbin/fsck_ffs/suj.c Sun Oct 27 03:47:16 2019 (r354123) @@ -1566,7 +1566,7 @@ ino_trunc(ino_t ino, off_t size) /* If we freed everything in this indirect free the indir. */ if (lastlbn > lbn) continue; - blk_free(DIP(ip, di_ib[i]), 0, frags); + blk_free(DIP(ip, di_ib[i]), 0, fs->fs_frag); DIP_SET(ip, di_ib[i], 0); } ino_dirty(ino); From owner-svn-src-all@freebsd.org Sun Oct 27 04:09:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBC7D15C095; Sun, 27 Oct 2019 04:09:25 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47149d3PL2z4H8L; Sun, 27 Oct 2019 04:09:25 +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 BCB711BA9D; Sun, 27 Oct 2019 04:09:24 +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 x9R49OCk032207; Sun, 27 Oct 2019 04:09:24 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9R49O1w032206; Sun, 27 Oct 2019 04:09:24 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201910270409.x9R49O1w032206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 27 Oct 2019 04:09:24 +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: r354124 - stable/12/sys/ufs/ufs X-SVN-Group: stable-12 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/12/sys/ufs/ufs X-SVN-Commit-Revision: 354124 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2019 04:09:26 -0000 Author: mckusick Date: Sun Oct 27 04:09:24 2019 New Revision: 354124 URL: https://svnweb.freebsd.org/changeset/base/354124 Log: MFC of 354050 Ensure that ctime update is visible immediately Modified: stable/12/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/12/sys/ufs/ufs/ufs_lookup.c Sun Oct 27 03:47:16 2019 (r354123) +++ stable/12/sys/ufs/ufs/ufs_lookup.c Sun Oct 27 04:09:24 2019 (r354124) @@ -1178,6 +1178,7 @@ ufs_dirremove(dvp, ip, flags, isrmdir) */ if (ip) { ip->i_effnlink--; + ip->i_flag |= IN_CHANGE; if (DOINGSOFTDEP(dvp)) { softdep_setup_unlink(dp, ip); } else { @@ -1291,6 +1292,7 @@ ufs_dirrewrite(dp, oip, newinum, newtype, isrmdir) * necessary. */ oip->i_effnlink--; + oip->i_flag |= IN_CHANGE; if (DOINGSOFTDEP(vdp)) { softdep_setup_unlink(dp, oip); } else { From owner-svn-src-all@freebsd.org Sun Oct 27 04:10:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1304215C257; Sun, 27 Oct 2019 04:10:50 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4714CF68qlz4HJR; Sun, 27 Oct 2019 04:10:49 +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 B2B791BAC6; Sun, 27 Oct 2019 04:10:49 +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 x9R4AnYQ032349; Sun, 27 Oct 2019 04:10:49 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9R4AnNI032348; Sun, 27 Oct 2019 04:10:49 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201910270410.x9R4AnNI032348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 27 Oct 2019 04:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r354125 - stable/11/sys/ufs/ufs X-SVN-Group: stable-11 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/11/sys/ufs/ufs X-SVN-Commit-Revision: 354125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2019 04:10:50 -0000 Author: mckusick Date: Sun Oct 27 04:10:49 2019 New Revision: 354125 URL: https://svnweb.freebsd.org/changeset/base/354125 Log: MFC of 354050 Ensure that ctime update is visible immediately Modified: stable/11/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/11/sys/ufs/ufs/ufs_lookup.c Sun Oct 27 04:09:24 2019 (r354124) +++ stable/11/sys/ufs/ufs/ufs_lookup.c Sun Oct 27 04:10:49 2019 (r354125) @@ -1176,6 +1176,7 @@ ufs_dirremove(dvp, ip, flags, isrmdir) */ if (ip) { ip->i_effnlink--; + ip->i_flag |= IN_CHANGE; if (DOINGSOFTDEP(dvp)) { softdep_setup_unlink(dp, ip); } else { @@ -1289,6 +1290,7 @@ ufs_dirrewrite(dp, oip, newinum, newtype, isrmdir) * necessary. */ oip->i_effnlink--; + oip->i_flag |= IN_CHANGE; if (DOINGSOFTDEP(vdp)) { softdep_setup_unlink(dp, oip); } else { From owner-svn-src-all@freebsd.org Sun Oct 27 05:32:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 793FF15FE05; Sun, 27 Oct 2019 05:32:09 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4716152cdcz4LhJ; Sun, 27 Oct 2019 05:32:09 +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 3E7501CA43; Sun, 27 Oct 2019 05:32:09 +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 x9R5W9bY083554; Sun, 27 Oct 2019 05:32:09 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9R5W8GS083551; Sun, 27 Oct 2019 05:32:08 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201910270532.x9R5W8GS083551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 27 Oct 2019 05:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354126 - in head: etc/mtree lib/libexecinfo lib/libexecinfo/tests X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: etc/mtree lib/libexecinfo lib/libexecinfo/tests X-SVN-Commit-Revision: 354126 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2019 05:32:09 -0000 Author: cem Date: Sun Oct 27 05:32:08 2019 New Revision: 354126 URL: https://svnweb.freebsd.org/changeset/base/354126 Log: libexecinfo: Integrate NetBSD test into FreeBSD Added: head/lib/libexecinfo/tests/ head/lib/libexecinfo/tests/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/lib/libexecinfo/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Sun Oct 27 04:10:49 2019 (r354125) +++ head/etc/mtree/BSD.tests.dist Sun Oct 27 05:32:08 2019 (r354126) @@ -384,6 +384,8 @@ .. libdevdctl .. + libexecinfo + .. libkvm .. libmp Modified: head/lib/libexecinfo/Makefile ============================================================================== --- head/lib/libexecinfo/Makefile Sun Oct 27 04:10:49 2019 (r354125) +++ head/lib/libexecinfo/Makefile Sun Oct 27 05:32:08 2019 (r354126) @@ -1,12 +1,13 @@ # $FreeBSD$ PACKAGE=lib${LIB} -LIBEXECINFO= ${SRCTOP}/contrib/libexecinfo +.include + LIB= execinfo SHLIB_MAJOR= 1 -.PATH: ${LIBEXECINFO} +.PATH: ${SRCTOP}/contrib/libexecinfo INCS= execinfo.h SRCS= backtrace.c symtab.c unwind.c @@ -20,5 +21,8 @@ MLINKS+= backtrace.3 backtrace_symbols.3 MLINKS+= backtrace.3 backtrace_symbols_fmt.3 MLINKS+= backtrace.3 backtrace_symbols_fd.3 MLINKS+= backtrace.3 backtrace_symbols_fd_fmt.3 + +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests .include Added: head/lib/libexecinfo/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libexecinfo/tests/Makefile Sun Oct 27 05:32:08 2019 (r354126) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +PACKAGE= tests + +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libexecinfo + +.include + +NETBSD_ATF_TESTS_C+= backtrace_test + +LIBADD.backtrace_test+= execinfo + +.include + +.include From owner-svn-src-all@freebsd.org Sun Oct 27 08:35:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D99BD167464; Sun, 27 Oct 2019 08:35:29 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 471B4d5PGTz4TV9; Sun, 27 Oct 2019 08:35:29 +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 9CA931EA30; Sun, 27 Oct 2019 08:35:29 +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 x9R8ZTMc090604; Sun, 27 Oct 2019 08:35:29 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9R8ZT0e090602; Sun, 27 Oct 2019 08:35:29 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201910270835.x9R8ZT0e090602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 27 Oct 2019 08:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354127 - head/sys/cddl/boot/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/cddl/boot/zfs X-SVN-Commit-Revision: 354127 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2019 08:35:29 -0000 Author: tsoome Date: Sun Oct 27 08:35:29 2019 New Revision: 354127 URL: https://svnweb.freebsd.org/changeset/base/354127 Log: loader: zio_checksum_verify should check byteswap We do have both native and byteswap checksum callbacks in place but the selection is not wired. MFC after: 1 week Modified: head/sys/cddl/boot/zfs/zfsimpl.h head/sys/cddl/boot/zfs/zfssubr.c Modified: head/sys/cddl/boot/zfs/zfsimpl.h ============================================================================== --- head/sys/cddl/boot/zfs/zfsimpl.h Sun Oct 27 05:32:08 2019 (r354126) +++ head/sys/cddl/boot/zfs/zfsimpl.h Sun Oct 27 08:35:29 2019 (r354127) @@ -442,6 +442,13 @@ _NOTE(CONSTCOND) } while (0) ZIO_SET_CHECKSUM(&(bp)->blk_cksum, 0, 0, 0, 0); \ } +#if BYTE_ORDER == _BIG_ENDIAN +#define ZFS_HOST_BYTEORDER (0ULL) +#else +#define ZFS_HOST_BYTEORDER (1ULL) +#endif + +#define BP_SHOULD_BYTESWAP(bp) (BP_GET_BYTEORDER(bp) != ZFS_HOST_BYTEORDER) #define BPE_NUM_WORDS 14 #define BPE_PAYLOAD_SIZE (BPE_NUM_WORDS * sizeof (uint64_t)) #define BPE_IS_PAYLOADWORD(bp, wp) \ Modified: head/sys/cddl/boot/zfs/zfssubr.c ============================================================================== --- head/sys/cddl/boot/zfs/zfssubr.c Sun Oct 27 05:32:08 2019 (r354126) +++ head/sys/cddl/boot/zfs/zfssubr.c Sun Oct 27 08:35:29 2019 (r354127) @@ -318,8 +318,9 @@ zio_checksum_verify(const spa_t *spa, const blkptr_t * byteswap_uint64_array(&expected_cksum, sizeof (zio_cksum_t)); } else { + byteswap = BP_SHOULD_BYTESWAP(bp); expected_cksum = bp->blk_cksum; - ci->ci_func[0](data, size, ctx, &actual_cksum); + ci->ci_func[byteswap](data, size, ctx, &actual_cksum); } if (!ZIO_CHECKSUM_EQUAL(actual_cksum, expected_cksum)) { From owner-svn-src-all@freebsd.org Sun Oct 27 09:28:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A271E170F71; Sun, 27 Oct 2019 09:28:34 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 471CFt3rMPz4WCq; Sun, 27 Oct 2019 09:28:34 +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 66CE91F304; Sun, 27 Oct 2019 09:28:34 +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 x9R9SY5I020252; Sun, 27 Oct 2019 09:28:34 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9R9SXnl020247; Sun, 27 Oct 2019 09:28:33 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201910270928.x9R9SXnl020247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 27 Oct 2019 09:28:33 +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: r354128 - in stable/12: sys/dev/netmap tools/tools/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in stable/12: sys/dev/netmap tools/tools/netmap X-SVN-Commit-Revision: 354128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2019 09:28:34 -0000 Author: vmaffione Date: Sun Oct 27 09:28:33 2019 New Revision: 354128 URL: https://svnweb.freebsd.org/changeset/base/354128 Log: MFC r353775 netmap: minor misc improvements - use ring->head rather than ring->cur in lb(8) - use strlcat() rather than strncat() - fix bandwidth computation in pkt-gen(8) Modified: stable/12/sys/dev/netmap/netmap.c stable/12/sys/dev/netmap/netmap_legacy.c stable/12/sys/dev/netmap/netmap_mem2.c stable/12/tools/tools/netmap/lb.c stable/12/tools/tools/netmap/pkt-gen.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/netmap.c ============================================================================== --- stable/12/sys/dev/netmap/netmap.c Sun Oct 27 08:35:29 2019 (r354127) +++ stable/12/sys/dev/netmap/netmap.c Sun Oct 27 09:28:33 2019 (r354128) @@ -3316,7 +3316,8 @@ nmreq_getoption(struct nmreq_header *hdr, uint16_t req if (!hdr->nr_options) return NULL; - opt_tab = (struct nmreq_option **)(hdr->nr_options) - (NETMAP_REQ_OPT_MAX + 1); + opt_tab = (struct nmreq_option **)((uintptr_t)hdr->nr_options) - + (NETMAP_REQ_OPT_MAX + 1); return opt_tab[reqtype]; } Modified: stable/12/sys/dev/netmap/netmap_legacy.c ============================================================================== --- stable/12/sys/dev/netmap/netmap_legacy.c Sun Oct 27 08:35:29 2019 (r354127) +++ stable/12/sys/dev/netmap/netmap_legacy.c Sun Oct 27 09:28:33 2019 (r354128) @@ -100,7 +100,7 @@ nmreq_register_from_legacy(struct nmreq *nmr, struct n /* No space for the pipe suffix. */ return ENOBUFS; } - strncat(hdr->nr_name, suffix, strlen(suffix)); + strlcat(hdr->nr_name, suffix, sizeof(hdr->nr_name)); req->nr_mode = NR_REG_ALL_NIC; req->nr_ringid = 0; } Modified: stable/12/sys/dev/netmap/netmap_mem2.c ============================================================================== --- stable/12/sys/dev/netmap/netmap_mem2.c Sun Oct 27 08:35:29 2019 (r354127) +++ stable/12/sys/dev/netmap/netmap_mem2.c Sun Oct 27 09:28:33 2019 (r354128) @@ -2447,8 +2447,8 @@ netmap_mem_pt_guest_ifp_del(struct netmap_mem_d *nmd, } else { ptnmd->pt_ifs = curr->next; } - nm_prinf("removed (ifp=%p,nifp_offset=%u)", - curr->ifp, curr->nifp_offset); + nm_prinf("removed (ifp=%s,nifp_offset=%u)", + curr->ifp->if_xname, curr->nifp_offset); nm_os_free(curr); ret = 0; break; Modified: stable/12/tools/tools/netmap/lb.c ============================================================================== --- stable/12/tools/tools/netmap/lb.c Sun Oct 27 08:35:29 2019 (r354127) +++ stable/12/tools/tools/netmap/lb.c Sun Oct 27 09:28:33 2019 (r354128) @@ -652,7 +652,7 @@ int main(int argc, char **argv) /* extract the base name */ char *nscan = strncmp(glob_arg.ifname, "netmap:", 7) ? glob_arg.ifname : glob_arg.ifname + 7; - strncpy(glob_arg.base_name, nscan, MAX_IFNAMELEN-1); + strncpy(glob_arg.base_name, nscan, MAX_IFNAMELEN - 1); for (nscan = glob_arg.base_name; *nscan && !index("-*^{}/@", *nscan); nscan++) ; *nscan = '\0'; @@ -948,8 +948,8 @@ run: struct netmap_ring *rxring = NETMAP_RXRING(rxport->nmd->nifp, i); //D("prepare to scan rings"); - int next_cur = rxring->cur; - struct netmap_slot *next_slot = &rxring->slot[next_cur]; + int next_head = rxring->head; + struct netmap_slot *next_slot = &rxring->slot[next_head]; const char *next_buf = NETMAP_BUF(rxring, next_slot->buf_idx); while (!nm_ring_empty(rxring)) { struct netmap_slot *rs = next_slot; @@ -963,14 +963,14 @@ run: non_ip++; // XXX ?? } // prefetch the buffer for the next round - next_cur = nm_ring_next(rxring, next_cur); - next_slot = &rxring->slot[next_cur]; + next_head = nm_ring_next(rxring, next_head); + next_slot = &rxring->slot[next_head]; next_buf = NETMAP_BUF(rxring, next_slot->buf_idx); __builtin_prefetch(next_buf); // 'B' is just a hashing seed rs->buf_idx = forward_packet(g, rs); rs->flags |= NS_BUF_CHANGED; - rxring->head = rxring->cur = next_cur; + rxring->head = rxring->cur = next_head; batch++; if (unlikely(batch >= glob_arg.batch)) { Modified: stable/12/tools/tools/netmap/pkt-gen.c ============================================================================== --- stable/12/tools/tools/netmap/pkt-gen.c Sun Oct 27 08:35:29 2019 (r354127) +++ stable/12/tools/tools/netmap/pkt-gen.c Sun Oct 27 09:28:33 2019 (r354128) @@ -2634,7 +2634,7 @@ main_thread(struct glob_arg *g) D("%spps %s(%spkts %sbps in %llu usec) %.2f avg_batch %d min_space", norm(b1, pps, normalize), b4, norm(b2, (double)x.pkts, normalize), - norm(b3, (double)x.bytes*8+(double)x.pkts*g->framing, normalize), + norm(b3, 1000000*((double)x.bytes*8+(double)x.pkts*g->framing)/usec, normalize), (unsigned long long)usec, abs, (int)cur.min_space); prev = cur; @@ -2973,6 +2973,7 @@ main(int arc, char **argv) g.options |= OPT_DUMP; break; case 'C': + D("WARNING: the 'C' option is deprecated, use the '+conf:' libnetmap option instead"); g.nmr_config = strdup(optarg); break; case 'H': From owner-svn-src-all@freebsd.org Sun Oct 27 16:59:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D544F17EA17; Sun, 27 Oct 2019 16:59:34 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 471PGG5KX8z3Q6W; Sun, 27 Oct 2019 16:59:34 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id A987114C8B; Sun, 27 Oct 2019 16:59:34 +0000 (UTC) Date: Sun, 27 Oct 2019 16:59:34 +0000 From: Alexey Dokuchaev To: Dimitry Andric Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Enji Cooper Subject: Re: svn commit: r353937 - in head/share: man/man5 mk Message-ID: <20191027165934.GA54960@FreeBSD.org> References: <201910231702.x9NH2jQv045130@repo.freebsd.org> <2B855247-5097-442D-8D4A-77D68D2F6186@gmail.com> <20191024124910.GA93913@FreeBSD.org> <67F6BDD3-B633-4C85-AE85-9B075FF0E49E@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <67F6BDD3-B633-4C85-AE85-9B075FF0E49E@FreeBSD.org> User-Agent: Mutt/1.11.4 (2019-03-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: Sun, 27 Oct 2019 16:59:34 -0000 On Sat, Oct 26, 2019 at 04:34:14PM +0200, Dimitry Andric wrote: > > On 24 Oct 2019, at 14:49, Alexey Dokuchaev wrote: > > What are the benefits of the new order? > > The advantages and disadvantages of dynamic linking are a contentious > and almost religious issue, so I hope you don't mind that I will not go > into this. OK. :-) > > What about those of us who cannot use BEs, VMs, and other "cloudy" > > tech because, well, they might not work as well and reliably as one > > might think? > > There are many possibilities, such as making backups, using > WITHOUT_SHARED_TOOLCHAIN (and hoping that you can compile/link your way > out of a botched installation), or even using NO_SHARED. WITHOUT_SHARED_TOOLCHAIN sounds good, I hope it won't go away one day. > > Very good point. [about regressed performance] > > But if you take this point to its logical conclusion, then you should > link everything statically, and never use dynamic linking at all. :) Toolchain is special: many people prefer (or have to) build their ports and stuff; even those who prefer binary packages may need to test their ports in a tinderbox or p*re. In other words, I don't mind Firefox being dynalinked because I launch it once a month, contrary to the compiler. > I only tested -j24 on a 32-core system, but I could probably repeat the > experiment with lower and higher -j values: [...] > > So ~2.3% difference in real time, which is not too bad I think. Well, I'd say it's acceptable. :-/ > There are probably opportunities to improve the performance of the > dynamic linker, which would be beneficial to every program in the > system. Now that's a good point; I look forward to it! Thanks for replying, ./danfe From owner-svn-src-all@freebsd.org Sun Oct 27 17:03:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B2FE17ECB5; Sun, 27 Oct 2019 17:03:57 +0000 (UTC) (envelope-from SRS0=VToT=YU=vega.codepro.be=kp@codepro.be) Received: from mercury.codepro.be (mercury.codepro.be [IPv6:2001:4b98:dc0:41:216:3eff:fe31:eda8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "monitoring.codepro.be", Issuer "Let's Encrypt Authority X3" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 471PMK1pM9z3QV7; Sun, 27 Oct 2019 17:03:56 +0000 (UTC) (envelope-from SRS0=VToT=YU=vega.codepro.be=kp@codepro.be) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) by mercury.codepro.be (Postfix) with ESMTPS id C98719048D; Sun, 27 Oct 2019 17:02:21 +0000 (UTC) Received: from vega.codepro.be (unknown [172.16.1.3]) by venus.codepro.be (Postfix) with ESMTP id 5A85623381; Sun, 27 Oct 2019 18:03:54 +0100 (CET) Received: by vega.codepro.be (Postfix, from userid 1001) id 550A6538FE; Sun, 27 Oct 2019 18:03:54 +0100 (CET) Date: Sun, 27 Oct 2019 18:03:54 +0100 From: Kristof Provost To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r354121 - in head/tests/sys/netpfil: common pf Message-ID: <20191027170354.GA10284@vega.codepro.be> References: <201910262119.x9QLJtF2086963@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201910262119.x9QLJtF2086963@repo.freebsd.org> X-Checked-By-NSA: Probably User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 471PMK1pM9z3QV7 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.990,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2019 17:03:57 -0000 On 2019-10-26 21:19:55 (+0000), Bjoern A. Zeeb wrote: > Author: bz > Date: Sat Oct 26 21:19:55 2019 > New Revision: 354121 > URL: https://svnweb.freebsd.org/changeset/base/354121 > > Log: > Upgrade (scapy) py2 tests to work on py3. > > In order to move python2 out of the test framework to avoid py2 vs. py3 > confusions upgrade the remaining test cases using scapy to work with py3. > That means only one version of scapy needs to be installed in the CI system. > It also gives a path forward for testing i386 issues observed in the CI > system with some of these tests. > > Fixes are: > - Use default python from environment (which is 3.x these days). > - properly ident some lines as common for the rest of the file to avoid > errors. > - cast the calculated offset to an int as the division result is considered > a float which is not accepted input. > - when comparing payload to a magic number make sure we always add the > payload properly to the packet and do not try to compare string in > the result but convert the data payload back into an integer. > - fix print formating. > > Discussed with: lwhsu, kp (taking it off his todo :) Thank you! Kristof From owner-svn-src-all@freebsd.org Sun Oct 27 18:27:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7BFA1A1F8B; Sun, 27 Oct 2019 18:27:25 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 471RCd4SQRz40VW; Sun, 27 Oct 2019 18:27:25 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C22B25329; Sun, 27 Oct 2019 18:27:25 +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 x9RIRPoM042137; Sun, 27 Oct 2019 18:27:25 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9RIRPeW042136; Sun, 27 Oct 2019 18:27:25 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910271827.x9RIRPeW042136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 27 Oct 2019 18:27:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354129 - head/libexec/rc X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/libexec/rc X-SVN-Commit-Revision: 354129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2019 18:27:25 -0000 Author: cy Date: Sun Oct 27 18:27:25 2019 New Revision: 354129 URL: https://svnweb.freebsd.org/changeset/base/354129 Log: Remove trailing tab. MFC after: 3 days Modified: head/libexec/rc/rc.subr Modified: head/libexec/rc/rc.subr ============================================================================== --- head/libexec/rc/rc.subr Sun Oct 27 09:28:33 2019 (r354128) +++ head/libexec/rc/rc.subr Sun Oct 27 18:27:25 2019 (r354129) @@ -1281,7 +1281,7 @@ $command $rc_flags $command_args" ${PROTECT} -p ${pid} ;; esac - fi + fi ;; esac From owner-svn-src-all@freebsd.org Sun Oct 27 21:07:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F334E1A70C3; Sun, 27 Oct 2019 21:07:50 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 471Vmk6DDyz48ZV; Sun, 27 Oct 2019 21:07:50 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4342270CF; Sun, 27 Oct 2019 21:07:50 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9RL7oYr037380; Sun, 27 Oct 2019 21:07:50 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9RL7o7P037379; Sun, 27 Oct 2019 21:07:50 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201910272107.x9RL7o7P037379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Sun, 27 Oct 2019 21:07:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354130 - head/tests/sys/netpfil/common X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/netpfil/common X-SVN-Commit-Revision: 354130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2019 21:07:51 -0000 Author: lwhsu Date: Sun Oct 27 21:07:50 2019 New Revision: 354130 URL: https://svnweb.freebsd.org/changeset/base/354130 Log: Follow r354121 to fix some python3 errors in sys.netpfil.* stderr: Traceback (most recent call last): File "/usr/tests/sys/netpfil/common/pft_ping.py", line 135, in main() File "/usr/tests/sys/netpfil/common/pft_ping.py", line 124, in main ping(args.sendif[0], args.to[0], args) File "/usr/tests/sys/netpfil/common/pft_ping.py", line 74, in ping raw = sp.raw(str(PAYLOAD_MAGIC)) File "/usr/local/lib/python3.6/site-packages/scapy/compat.py", line 52, in raw return bytes(x) TypeError: string argument without an encoding MFC with: r354121 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/netpfil/common/pft_ping.py Modified: head/tests/sys/netpfil/common/pft_ping.py ============================================================================== --- head/tests/sys/netpfil/common/pft_ping.py Sun Oct 27 18:27:25 2019 (r354129) +++ head/tests/sys/netpfil/common/pft_ping.py Sun Oct 27 21:07:50 2019 (r354130) @@ -5,7 +5,7 @@ import scapy.all as sp import sys from sniffer import Sniffer -PAYLOAD_MAGIC = 0x42c0ffee +PAYLOAD_MAGIC = bytes.fromhex('42c0ffee') def check_ping_request(args, packet): if args.ip6: @@ -34,7 +34,7 @@ def check_ping4_request(args, packet): raw = packet.getlayer(sp.Raw) if not raw: return False - if int(raw.load) != PAYLOAD_MAGIC: + if raw.load != PAYLOAD_MAGIC: return False # Wait to check expectations until we've established this is the packet we @@ -62,7 +62,7 @@ def check_ping6_request(args, packet): icmp = packet.getlayer(sp.ICMPv6EchoRequest) if not icmp: return False - if int(icmp.data) != PAYLOAD_MAGIC: + if icmp.data != PAYLOAD_MAGIC: return False return True @@ -71,7 +71,7 @@ def ping(send_if, dst_ip, args): ether = sp.Ether() ip = sp.IP(dst=dst_ip) icmp = sp.ICMP(type='echo-request') - raw = sp.raw(str(PAYLOAD_MAGIC)) + raw = sp.raw(PAYLOAD_MAGIC) if args.send_tos: ip.tos = int(args.send_tos[0]) @@ -82,7 +82,7 @@ def ping(send_if, dst_ip, args): def ping6(send_if, dst_ip, args): ether = sp.Ether() ip6 = sp.IPv6(dst=dst_ip) - icmp = sp.ICMPv6EchoRequest(data=sp.raw(str(PAYLOAD_MAGIC))) + icmp = sp.ICMPv6EchoRequest(data=sp.raw(PAYLOAD_MAGIC)) req = ether / ip6 / icmp sp.sendp(req, iface=send_if, verbose=False) From owner-svn-src-all@freebsd.org Mon Oct 28 01:44:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E38EC15FBD7; Mon, 28 Oct 2019 01:44:32 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 471cw06TQ3z4N4W; Mon, 28 Oct 2019 01:44:32 +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 C15CE227B; Mon, 28 Oct 2019 01:44:32 +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 x9S1iWO0002631; Mon, 28 Oct 2019 01:44:32 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9S1iVDP002625; Mon, 28 Oct 2019 01:44:31 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201910280144.x9S1iVDP002625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 28 Oct 2019 01:44:31 +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: r354131 - in stable/12/sys/fs: nfs nfsclient X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/12/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 354131 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2019 01:44:33 -0000 Author: rmacklem Date: Mon Oct 28 01:44:31 2019 New Revision: 354131 URL: https://svnweb.freebsd.org/changeset/base/354131 Log: MFC: r352636 Replace all mtx_lock()/mtx_unlock() on n_mtx with the macros. For a long time, some places in the NFS code have locked/unlocked the NFS node lock with the macros NFSLOCKNODE()/NFSUNLOCKNODE() whereas others have simply used mtx_lock()/mtx_unlock(). Since the NFS node mutex needs to change to an sx lock so it can be held when vnode_pager_setsize() is called, replace all occurrences of mtx_lock/mtx_unlock with the macros to simply making the change to an sx lock in future commit. There is no semantic change as a result of this commit. Modified: stable/12/sys/fs/nfs/nfsport.h stable/12/sys/fs/nfsclient/nfs_clbio.c stable/12/sys/fs/nfsclient/nfs_clnode.c stable/12/sys/fs/nfsclient/nfs_clport.c stable/12/sys/fs/nfsclient/nfs_clrpcops.c stable/12/sys/fs/nfsclient/nfs_clsubs.c stable/12/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfs/nfsport.h ============================================================================== --- stable/12/sys/fs/nfs/nfsport.h Sun Oct 27 21:07:50 2019 (r354130) +++ stable/12/sys/fs/nfs/nfsport.h Mon Oct 28 01:44:31 2019 (r354131) @@ -857,11 +857,11 @@ MALLOC_DECLARE(M_NEWNFSDSESSION); #define NFSWRITERPC_SETTIME(w, n, a, v4) \ do { \ if (w) { \ - mtx_lock(&((n)->n_mtx)); \ + NFSLOCKNODE(n); \ (n)->n_mtime = (a)->na_mtime; \ if (v4) \ (n)->n_change = (a)->na_filerev; \ - mtx_unlock(&((n)->n_mtx)); \ + NFSUNLOCKNODE(n); \ } \ } while (0) Modified: stable/12/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clbio.c Sun Oct 27 21:07:50 2019 (r354130) +++ stable/12/sys/fs/nfsclient/nfs_clbio.c Mon Oct 28 01:44:31 2019 (r354131) @@ -101,9 +101,9 @@ ncl_gbp_getblksz(struct vnode *vp, daddr_t lbn) int biosize, bcount; np = VTONFS(vp); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); nsize = np->n_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); biosize = vp->v_bufobj.bo_bsize; bcount = biosize; @@ -144,13 +144,13 @@ ncl_getpages(struct vop_getpages_args *ap) } if (newnfs_directio_enable && !newnfs_directio_allow_mmap) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if ((np->n_flag & NNONCACHE) && (vp->v_type == VREG)) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); printf("ncl_getpages: called on non-cacheable vnode\n"); return (VM_PAGER_ERROR); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } mtx_lock(&nmp->nm_mtx); @@ -301,12 +301,12 @@ ncl_putpages(struct vop_putpages_args *ap) } else mtx_unlock(&nmp->nm_mtx); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (newnfs_directio_enable && !newnfs_directio_allow_mmap && (np->n_flag & NNONCACHE) && (vp->v_type == VREG)) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); printf("ncl_putpages: called on noncache-able vnode\n"); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); } /* * When putting pages, do not extend file past EOF. @@ -316,7 +316,7 @@ ncl_putpages(struct vop_putpages_args *ap) if (count < 0) count = 0; } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); for (i = 0; i < npages; i++) rtvals[i] = VM_PAGER_ERROR; @@ -374,9 +374,9 @@ nfs_bioread_check_cons(struct vnode *vp, struct thread * whether the cache is consistent. */ old_lock = ncl_excl_start(vp); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & NMODIFIED) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (vp->v_type != VREG) { if (vp->v_type != VDIR) panic("nfs: bioread, not dir"); @@ -390,28 +390,28 @@ nfs_bioread_check_cons(struct vnode *vp, struct thread error = VOP_GETATTR(vp, &vattr, cred); if (error) goto out; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_mtime = vattr.va_mtime; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } else { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = VOP_GETATTR(vp, &vattr, cred); if (error) goto out; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if ((np->n_flag & NSIZECHANGED) || (NFS_TIMESPEC_COMPARE(&np->n_mtime, &vattr.va_mtime))) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (vp->v_type == VDIR) ncl_invaldir(vp); error = ncl_vinvalbuf(vp, V_SAVE | V_ALLOWCLEAN, td, 1); if (error != 0) goto out; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_mtime = vattr.va_mtime; np->n_flag &= ~NSIZECHANGED; } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } out: ncl_excl_finish(vp, old_lock); @@ -474,9 +474,9 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int iof do { u_quad_t nsize; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); nsize = np->n_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); switch (vp->v_type) { case VREG: @@ -883,13 +883,13 @@ ncl_write(struct vop_write_args *ap) ("ncl_write proc")); if (vp->v_type != VREG) return (EIO); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & NWRITEERR) { np->n_flag &= ~NWRITEERR; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); return (np->n_error); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); mtx_lock(&nmp->nm_mtx); if ((nmp->nm_flag & NFSMNT_NFSV3) != 0 && (nmp->nm_state & NFSSTA_GOTFSINFO) == 0) { @@ -906,9 +906,9 @@ ncl_write(struct vop_write_args *ap) * mode or if we are appending. */ if (ioflag & (IO_APPEND | IO_SYNC)) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & NMODIFIED) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); #ifdef notyet /* Needs matching nonblock semantics elsewhere, too. */ /* * Require non-blocking, synchronous writes to @@ -925,13 +925,13 @@ ncl_write(struct vop_write_args *ap) if (error != 0) return (error); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } orig_resid = uio->uio_resid; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); orig_size = np->n_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); /* * If IO_APPEND then load uio_offset. We restart here if we cannot @@ -943,9 +943,9 @@ ncl_write(struct vop_write_args *ap) error = VOP_GETATTR(vp, &vattr, cred); if (error) return (error); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); uio->uio_offset = np->n_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } if (uio->uio_offset < 0) @@ -979,9 +979,9 @@ ncl_write(struct vop_write_args *ap) if (!(ioflag & IO_SYNC)) { int nflag; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); nflag = np->n_flag; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (nflag & NMODIFIED) { BO_LOCK(&vp->v_bufobj); if (vp->v_bufobj.bo_dirty.bv_cnt != 0) { @@ -1018,7 +1018,7 @@ again: * Handle direct append and file extension cases, calculate * unaligned buffer size. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if ((np->n_flag & NHASBEENLOCKED) == 0 && (nmp->nm_flag & NFSMNT_NONCONTIGWR) != 0) noncontig_write = 1; @@ -1028,7 +1028,7 @@ again: (noncontig_write != 0 && lbn == (np->n_size / biosize) && uio->uio_offset + n > np->n_size)) && n) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); /* * Get the buffer (in its pre-append state to maintain * B_CACHE if it was previously set). Resize the @@ -1041,11 +1041,11 @@ again: if (bp != NULL) { long save; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_size = uio->uio_offset + n; np->n_flag |= NMODIFIED; vnode_pager_setsize(vp, np->n_size); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); save = bp->b_flags & B_CACHE; bcount = on + n; @@ -1067,15 +1067,15 @@ again: else bcount = np->n_size - (off_t)lbn * biosize; } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); bp = nfs_getcacheblk(vp, lbn, bcount, td); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (uio->uio_offset + n > np->n_size) { np->n_size = uio->uio_offset + n; np->n_flag |= NMODIFIED; vnode_pager_setsize(vp, np->n_size); } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } if (!bp) { @@ -1124,9 +1124,9 @@ again: } if (bp->b_wcred == NOCRED) bp->b_wcred = crhold(cred); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag |= NMODIFIED; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); /* * If dirtyend exceeds file size, chop it down. This should @@ -1369,13 +1369,13 @@ ncl_vinvalbuf(struct vnode *vp, int flags, struct thre * Invalidate the attribute cache, since writes to a DS * won't update the size attribute. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_attrstamp = 0; } else - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_directio_asyncwr == 0) np->n_flag &= ~NMODIFIED; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); out: ncl_excl_finish(vp, old_lock); return error; @@ -1517,10 +1517,10 @@ again: TAILQ_INSERT_TAIL(&nmp->nm_bufq, bp, b_freelist); nmp->nm_bufqlen++; if ((bp->b_flags & B_DIRECT) && bp->b_iocmd == BIO_WRITE) { - mtx_lock(&(VTONFS(bp->b_vp))->n_mtx); + NFSLOCKNODE(VTONFS(bp->b_vp)); VTONFS(bp->b_vp)->n_flag |= NMODIFIED; VTONFS(bp->b_vp)->n_directio_asyncwr++; - mtx_unlock(&(VTONFS(bp->b_vp))->n_mtx); + NFSUNLOCKNODE(VTONFS(bp->b_vp)); } mtx_unlock(&ncl_iod_mutex); return (0); @@ -1552,7 +1552,7 @@ ncl_doio_directwrite(struct buf *bp) free(uiop, M_NFSDIRECTIO); if ((bp->b_flags & B_DIRECT) && bp->b_iocmd == BIO_WRITE) { struct nfsnode *np = VTONFS(bp->b_vp); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (NFSHASPNFS(VFSTONFS(vnode_mount(bp->b_vp)))) { /* * Invalidate the attribute cache, since writes to a DS @@ -1568,7 +1568,7 @@ ncl_doio_directwrite(struct buf *bp) wakeup((caddr_t)&np->n_directio_asyncwr); } } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } bp->b_vp = NULL; relpbuf(bp, &ncl_pbuf_freecnt); @@ -1640,14 +1640,14 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucre } /* ASSERT_VOP_LOCKED(vp, "ncl_doio"); */ if (p && vp->v_writecount <= -1) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (NFS_TIMESPEC_COMPARE(&np->n_mtime, &np->n_vattr.na_mtime)) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); PROC_LOCK(p); killproc(p, "text file modification"); PROC_UNLOCK(p); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } break; case VLNK: @@ -1706,10 +1706,10 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucre /* * Setup for actual write */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if ((off_t)bp->b_blkno * DEV_BSIZE + bp->b_dirtyend > np->n_size) bp->b_dirtyend = np->n_size - (off_t)bp->b_blkno * DEV_BSIZE; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (bp->b_dirtyend > bp->b_dirtyoff) { io.iov_len = uiop->uio_resid = bp->b_dirtyend @@ -1802,11 +1802,11 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucre bp->b_ioflags |= BIO_ERROR; bp->b_flags |= B_INVAL; bp->b_error = np->n_error = error; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag |= NWRITEERR; np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } bp->b_dirtyoff = bp->b_dirtyend = 0; } @@ -1839,10 +1839,10 @@ ncl_meta_setsize(struct vnode *vp, struct thread *td, int biosize = vp->v_bufobj.bo_bsize; int error = 0; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); tsize = np->n_size; np->n_size = nsize; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (nsize < tsize) { struct buf *bp; Modified: stable/12/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clnode.c Sun Oct 27 21:07:50 2019 (r354130) +++ stable/12/sys/fs/nfsclient/nfs_clnode.c Mon Oct 28 01:44:31 2019 (r354131) @@ -219,7 +219,7 @@ ncl_releasesillyrename(struct vnode *vp, struct thread } else sp = NULL; if (sp != NULL) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); (void) ncl_vinvalbuf(vp, 0, td, 1); /* * Remove the silly file that was rename'd earlier @@ -228,7 +228,7 @@ ncl_releasesillyrename(struct vnode *vp, struct thread crfree(sp->s_cred); TASK_INIT(&sp->s_task, 0, nfs_freesillyrename, sp); taskqueue_enqueue(taskqueue_thread, &sp->s_task); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); } } @@ -260,7 +260,7 @@ ncl_inactive(struct vop_inactive_args *ap) } np = VTONFS(vp); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); ncl_releasesillyrename(vp, ap->a_td); /* @@ -271,7 +271,7 @@ ncl_inactive(struct vop_inactive_args *ap) * None of the other flags are meaningful after the vnode is unused. */ np->n_flag &= (NMODIFIED | NDSCOMMIT); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); return (0); } @@ -292,9 +292,9 @@ ncl_reclaim(struct vop_reclaim_args *ap) if (nfs_reclaim_p != NULL) nfs_reclaim_p(ap); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); ncl_releasesillyrename(vp, ap->a_td); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); /* * Destroy the vm object and flush associated pages. @@ -353,11 +353,11 @@ ncl_invalcaches(struct vnode *vp) struct nfsnode *np = VTONFS(vp); int i; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); for (i = 0; i < NFS_ACCESSCACHESIZE; i++) np->n_accesscache[i].stamp = 0; KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp); np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } Modified: stable/12/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clport.c Sun Oct 27 21:07:50 2019 (r354130) +++ stable/12/sys/fs/nfsclient/nfs_clport.c Mon Oct 28 01:44:31 2019 (r354131) @@ -742,12 +742,12 @@ nfscl_wcc_data(struct nfsrv_descript *nd, struct vnode if (*tl == newnfs_true) { NFSM_DISSECT(tl, u_int32_t *, 6 * NFSX_UNSIGNED); if (wccflagp != NULL) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); *wccflagp = (np->n_mtime.tv_sec == fxdr_unsigned(u_int32_t, *(tl + 2)) && np->n_mtime.tv_nsec == fxdr_unsigned(u_int32_t, *(tl + 3))); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } } error = nfscl_postop_attr(nd, nap, flagp, stuff); @@ -768,12 +768,12 @@ nfscl_wcc_data(struct nfsrv_descript *nd, struct vnode nd->nd_flag |= ND_NOMOREDATA; if (wccflagp != NULL && nfsva.na_vattr.va_mtime.tv_sec != 0) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); *wccflagp = (np->n_mtime.tv_sec == nfsva.na_vattr.va_mtime.tv_sec && np->n_mtime.tv_nsec == nfsva.na_vattr.va_mtime.tv_sec); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } } nfsmout: Modified: stable/12/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clrpcops.c Sun Oct 27 21:07:50 2019 (r354130) +++ stable/12/sys/fs/nfsclient/nfs_clrpcops.c Mon Oct 28 01:44:31 2019 (r354131) @@ -5952,9 +5952,9 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *i error = EIO; } else { commit_thru_mds = 0; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag |= NDSCOMMIT; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } if (docommit != 0) { if (error == 0) @@ -5968,9 +5968,9 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *i *eofp = 1; uiop->uio_resid = 0; } else { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag &= ~NDSCOMMIT; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } } else if (rwflag == NFSV4OPEN_ACCESSREAD) error = nfsrpc_readds(vp, uiop, stateidp, eofp, *dspp, @@ -6036,9 +6036,9 @@ nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int * transfer = dp->nfsdi_rsize; else transfer = dp->nfsdi_wsize; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag |= NDSCOMMIT; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (len > transfer && docommit == 0) xfer = transfer; else @@ -6075,9 +6075,9 @@ nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int * *eofp = 1; uiop->uio_resid = 0; } else { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag &= ~NDSCOMMIT; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } } else if (rwflag == NFSV4OPEN_ACCESSREAD) { error = nfsrpc_readds(vp, uiop, stateidp, eofp, *dspp, Modified: stable/12/sys/fs/nfsclient/nfs_clsubs.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clsubs.c Sun Oct 27 21:07:50 2019 (r354130) +++ stable/12/sys/fs/nfsclient/nfs_clsubs.c Mon Oct 28 01:44:31 2019 (r354131) @@ -121,20 +121,20 @@ ncl_uninit(struct vfsconf *vfsp) void ncl_dircookie_lock(struct nfsnode *np) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); while (np->n_flag & NDIRCOOKIELK) (void) msleep(&np->n_flag, &np->n_mtx, PZERO, "nfsdirlk", 0); np->n_flag |= NDIRCOOKIELK; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } void ncl_dircookie_unlock(struct nfsnode *np) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag &= ~NDIRCOOKIELK; wakeup(&np->n_flag); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } bool @@ -190,7 +190,7 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper vap = &np->n_vattr.na_vattr; nmp = VFSTONFS(vp->v_mount); mustflush = nfscl_mustflush(vp); /* must be before mtx_lock() */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); /* XXX n_mtime doesn't seem to be updated on a miss-and-reload */ timeo = (time_second - np->n_mtime.tv_sec) / 10; @@ -225,7 +225,7 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper if ((time_second - np->n_attrstamp) >= timeo && (mustflush != 0 || np->n_attrstamp == 0)) { nfsstatsv1.attrcache_misses++; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); KDTRACE_NFS_ATTRCACHE_GET_MISS(vp); return( ENOENT); } @@ -252,7 +252,7 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper if (np->n_flag & NUPD) vaper->va_mtime = np->n_mtim; } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); KDTRACE_NFS_ATTRCACHE_GET_HIT(vp, vap); return (0); } Modified: stable/12/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clvnops.c Sun Oct 27 21:07:50 2019 (r354130) +++ stable/12/sys/fs/nfsclient/nfs_clvnops.c Mon Oct 28 01:44:31 2019 (r354131) @@ -285,7 +285,7 @@ nfs34_access_otw(struct vnode *vp, int wmode, struct t (void) nfscl_loadattrcache(&vp, &nfsva, NULL, NULL, 0, 1); if (!error) { lrupos = 0; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); for (i = 0; i < NFS_ACCESSCACHESIZE; i++) { if (np->n_accesscache[i].uid == cred->cr_uid) { np->n_accesscache[i].mode = rmode; @@ -301,7 +301,7 @@ nfs34_access_otw(struct vnode *vp, int wmode, struct t np->n_accesscache[lrupos].mode = rmode; np->n_accesscache[lrupos].stamp = time_second; } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (retmode != NULL) *retmode = rmode; KDTRACE_NFS_ACCESSCACHE_LOAD_DONE(vp, cred->cr_uid, rmode, 0); @@ -396,7 +396,7 @@ nfs_access(struct vop_access_args *ap) * this request? */ gotahit = 0; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); for (i = 0; i < NFS_ACCESSCACHESIZE; i++) { if (ap->a_cred->cr_uid == np->n_accesscache[i].uid) { if (time_second < (np->n_accesscache[i].stamp @@ -408,7 +408,7 @@ nfs_access(struct vop_access_args *ap) break; } } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); #ifdef KDTRACE_HOOKS if (gotahit != 0) KDTRACE_NFS_ACCESSCACHE_GET_HIT(vp, @@ -440,14 +440,14 @@ nfs_access(struct vop_access_args *ap) * After calling nfsspec_access, we should have the correct * file size cached. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (ap->a_cred->cr_uid == 0 && (ap->a_accmode & VREAD) && VTONFS(vp)->n_size > 0) { struct iovec aiov; struct uio auio; char buf[1]; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); aiov.iov_base = buf; aiov.iov_len = 1; auio.uio_iov = &aiov; @@ -473,7 +473,7 @@ nfs_access(struct vop_access_args *ap) else error = EACCES; } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); return (error); } } @@ -518,52 +518,52 @@ nfs_open(struct vop_open_args *ap) * Now, if this Open will be doing reading, re-validate/flush the * cache, so that Close/Open coherency is maintained. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & NMODIFIED) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); if (error == EINTR || error == EIO) { if (NFS_ISV4(vp)) (void) nfsrpc_close(vp, 0, ap->a_td); return (error); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); if (vp->v_type == VDIR) np->n_direofoffset = 0; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = VOP_GETATTR(vp, &vattr, ap->a_cred); if (error) { if (NFS_ISV4(vp)) (void) nfsrpc_close(vp, 0, ap->a_td); return (error); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_mtime = vattr.va_mtime; if (NFS_ISV4(vp)) np->n_change = vattr.va_filerev; } else { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = VOP_GETATTR(vp, &vattr, ap->a_cred); if (error) { if (NFS_ISV4(vp)) (void) nfsrpc_close(vp, 0, ap->a_td); return (error); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if ((NFS_ISV4(vp) && np->n_change != vattr.va_filerev) || NFS_TIMESPEC_COMPARE(&np->n_mtime, &vattr.va_mtime)) { if (vp->v_type == VDIR) np->n_direofoffset = 0; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); if (error == EINTR || error == EIO) { if (NFS_ISV4(vp)) (void) nfsrpc_close(vp, 0, ap->a_td); return (error); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_mtime = vattr.va_mtime; if (NFS_ISV4(vp)) np->n_change = vattr.va_filerev; @@ -576,14 +576,14 @@ nfs_open(struct vop_open_args *ap) if (newnfs_directio_enable && (fmode & O_DIRECT) && (vp->v_type == VREG)) { if (np->n_directio_opens == 0) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); if (error) { if (NFS_ISV4(vp)) (void) nfsrpc_close(vp, 0, ap->a_td); return (error); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag |= NNONCACHE; } np->n_directio_opens++; @@ -605,7 +605,7 @@ nfs_open(struct vop_open_args *ap) np->n_writecred = crhold(ap->a_cred); } else cred = NULL; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (cred != NULL) crfree(cred); @@ -632,9 +632,9 @@ nfs_open(struct vop_open_args *ap) /* And, finally, make sure that n_mtime is up to date. */ np = VTONFS(vp); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_mtime = np->n_vattr.na_mtime; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } return (0); } @@ -709,9 +709,9 @@ nfs_close(struct vop_close_args *ap) vm_object_page_clean(vp->v_object, 0, 0, 0); VM_OBJECT_WUNLOCK(vp->v_object); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & NMODIFIED) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (NFS_ISV3(vp)) { /* * Under NFSv3 we have dirty buffers to dispose of. We @@ -745,7 +745,7 @@ nfs_close(struct vop_close_args *ap) } else { error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); } /* * Invalidate the attribute cache in all cases. @@ -770,7 +770,7 @@ nfs_close(struct vop_close_args *ap) np->n_flag &= ~NWRITEERR; error = np->n_error; } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } if (NFS_ISV4(vp)) { @@ -804,13 +804,13 @@ nfs_close(struct vop_close_args *ap) ("nfs_close: dirty unflushed (%d) directio buffers\n", np->n_directio_asyncwr)); if (newnfs_directio_enable && (fmode & O_DIRECT) && (vp->v_type == VREG)) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); KASSERT((np->n_directio_opens > 0), ("nfs_close: unexpectedly value (0) of n_directio_opens\n")); np->n_directio_opens--; if (np->n_directio_opens == 0) np->n_flag &= ~NNONCACHE; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } if (localcred) NFSFREECRED(cred); @@ -834,10 +834,10 @@ nfs_getattr(struct vop_getattr_args *ap) /* * Update local times for special files. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & (NACC | NUPD)) np->n_flag |= NCHG; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); /* * First look in the cache. */ @@ -951,14 +951,14 @@ nfs_setattr(struct vop_setattr_args *ap) * V_SAVE races that might setsize a lower * value. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); tsize = np->n_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = ncl_meta_setsize(vp, td, vap->va_size); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & NMODIFIED) { tsize = np->n_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = ncl_vinvalbuf(vp, vap->va_size == 0 ? 0 : V_SAVE, td, 1); if (error != 0) { @@ -971,34 +971,34 @@ nfs_setattr(struct vop_setattr_args *ap) */ nfscl_delegmodtime(vp); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); /* * np->n_size has already been set to vap->va_size * in ncl_meta_setsize(). We must set it again since * nfs_loadattrcache() could be called through * ncl_meta_setsize() and could modify np->n_size. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_vattr.na_size = np->n_size = vap->va_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } } else { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if ((vap->va_mtime.tv_sec != VNOVAL || vap->va_atime.tv_sec != VNOVAL) && (np->n_flag & NMODIFIED) && vp->v_type == VREG) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = ncl_vinvalbuf(vp, V_SAVE, td, 1); if (error == EINTR || error == EIO) return (error); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } error = nfs_setattrrpc(vp, vap, ap->a_cred, td); if (error && vap->va_size != VNOVAL) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_size = np->n_vattr.na_size = tsize; vnode_pager_setsize(vp, tsize); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } return (error); } @@ -1015,11 +1015,11 @@ nfs_setattrrpc(struct vnode *vp, struct vattr *vap, st struct nfsvattr nfsva; if (NFS_ISV34(vp)) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); for (i = 0; i < NFS_ACCESSCACHESIZE; i++) np->n_accesscache[i].stamp = 0; np->n_flag |= NDELEGMOD; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp); } error = nfsrpc_setattr(vp, vap, NULL, cred, td, &nfsva, &attrflag, @@ -1067,12 +1067,12 @@ nfs_lookup(struct vop_lookup_args *ap) np = VTONFS(dvp); /* For NFSv4, wait until any remove is done. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); while (NFSHASNFSV4(nmp) && (np->n_flag & NREMOVEINPROG)) { np->n_flag |= NREMOVEWANT; (void) msleep((caddr_t)np, &np->n_mtx, PZERO, "nfslkup", 0); } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, td)) != 0) return (error); @@ -1114,10 +1114,10 @@ nfs_lookup(struct vop_lookup_args *ap) if (!(nmp->nm_flag & NFSMNT_NOCTO) && (flags & (ISLASTCN | ISOPEN)) == (ISLASTCN | ISOPEN) && !(newnp->n_flag & NMODIFIED)) { - mtx_lock(&newnp->n_mtx); + NFSLOCKNODE(newnp); newnp->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(newvp); - mtx_unlock(&newnp->n_mtx); + NFSUNLOCKNODE(newnp); } if (nfscl_nodeleg(newvp, 0) == 0 || ((u_int)(ticks - ncticks) < (nmp->nm_nametimeo * hz) && @@ -1200,14 +1200,14 @@ nfs_lookup(struct vop_lookup_args *ap) * has changed. Don't bother adding the entry * if the directory has already changed. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (timespeccmp(&np->n_vattr.na_mtime, &dnfsva.na_mtime, ==)) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); cache_enter_time(dvp, NULL, cnp, &dnfsva.na_mtime, NULL); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } return (ENOENT); } @@ -1295,10 +1295,10 @@ nfs_lookup(struct vop_lookup_args *ap) * are fetched in nfs_open() since we did not * fetch attributes from the LOOKUP reply. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(newvp); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } } if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) @@ -1492,13 +1492,13 @@ nfs_mknodrpc(struct vnode *dvp, struct vnode **vpp, st vap->va_gid); } dnp = VTONFS(dvp); - mtx_lock(&dnp->n_mtx); + NFSLOCKNODE(dnp); dnp->n_flag |= NMODIFIED; if (!dattrflag) { dnp->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp); } - mtx_unlock(&dnp->n_mtx); + NFSUNLOCKNODE(dnp); return (error); } @@ -1569,12 +1569,12 @@ nfs_create(struct vop_create_args *ap) nmp = VFSTONFS(vnode_mount(dvp)); again: /* For NFSv4, wait until any remove is done. */ - mtx_lock(&dnp->n_mtx); + NFSLOCKNODE(dnp); while (NFSHASNFSV4(nmp) && (dnp->n_flag & NREMOVEINPROG)) { dnp->n_flag |= NREMOVEWANT; (void) msleep((caddr_t)dnp, &dnp->n_mtx, PZERO, "nfscrt", 0); } - mtx_unlock(&dnp->n_mtx); + NFSUNLOCKNODE(dnp); cverf = nfs_get_cverf(); error = nfsrpc_create(dvp, cnp->cn_nameptr, cnp->cn_namelen, @@ -1640,13 +1640,13 @@ again: error = nfscl_maperr(cnp->cn_thread, error, vap->va_uid, vap->va_gid); } - mtx_lock(&dnp->n_mtx); + NFSLOCKNODE(dnp); dnp->n_flag |= NMODIFIED; if (!dattrflag) { dnp->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp); } - mtx_unlock(&dnp->n_mtx); + NFSUNLOCKNODE(dnp); return (error); } @@ -1705,9 +1705,9 @@ nfs_remove(struct vop_remove_args *ap) error = 0; } else if (!np->n_sillyrename) error = nfs_sillyrename(dvp, vp, cnp); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_attrstamp = 0; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); return (error); } @@ -1739,29 +1739,29 @@ nfs_removerpc(struct vnode *dvp, struct vnode *vp, cha struct nfsnode *dnp = VTONFS(dvp); int error = 0, dattrflag; - mtx_lock(&dnp->n_mtx); + NFSLOCKNODE(dnp); dnp->n_flag |= NREMOVEINPROG; - mtx_unlock(&dnp->n_mtx); + NFSUNLOCKNODE(dnp); error = nfsrpc_remove(dvp, name, namelen, vp, cred, td, &dnfsva, &dattrflag, NULL); - mtx_lock(&dnp->n_mtx); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Oct 28 10:50:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7ACCC17DCED; Mon, 28 Oct 2019 10:50:38 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 471s262L4Wz3JJf; Mon, 28 Oct 2019 10:50:38 +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 3372C8632; Mon, 28 Oct 2019 10:50:38 +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 x9SAobch019733; Mon, 28 Oct 2019 10:50:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9SAobaC019732; Mon, 28 Oct 2019 10:50:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201910281050.x9SAobaC019732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 28 Oct 2019 10:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354132 - 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: 354132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2019 10:50:38 -0000 Author: kib Date: Mon Oct 28 10:50:37 2019 New Revision: 354132 URL: https://svnweb.freebsd.org/changeset/base/354132 Log: Fix reset of the kernel stack pointer in TSS for !PTI case on pmap activation after r354095. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Oct 28 01:44:31 2019 (r354131) +++ head/sys/amd64/amd64/pmap.c Mon Oct 28 10:50:37 2019 (r354132) @@ -8650,7 +8650,7 @@ pmap_activate_sw_pti_post(struct thread *td, pmap_t pm { PCPU_GET(tssp)->tss_rsp0 = pmap->pm_ucr3 != PMAP_NO_CR3 ? - PCPU_GET(pti_rsp0) : (uintptr_t)td->td_pcb; + PCPU_GET(pti_rsp0) : (uintptr_t)td->td_md.md_stack_base; } static void inline From owner-svn-src-all@freebsd.org Mon Oct 28 13:06:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3584F1A2459; Mon, 28 Oct 2019 13:06:02 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 471w2L0gj3z3Qk4; Mon, 28 Oct 2019 13:06:02 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEA0F9DE1; Mon, 28 Oct 2019 13:06:01 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9SD61BG001670; Mon, 28 Oct 2019 13:06:01 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9SD61LZ001669; Mon, 28 Oct 2019 13:06:01 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201910281306.x9SD61LZ001669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 28 Oct 2019 13:06:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r354134 - stable/11/tests/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: stable/11/tests/sys/kern X-SVN-Commit-Revision: 354134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2019 13:06:02 -0000 Author: lwhsu Date: Mon Oct 28 13:06:01 2019 New Revision: 354134 URL: https://svnweb.freebsd.org/changeset/base/354134 Log: MFC r350211, r350220, r350235, r350238-r350239, r350295, r350512, r350700, r352219 r350211: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__follow_fork_child_detached_unrelated_debugger PR: 239292 Sponsored by: The FreeBSD Foundation r350220: Fix URL. Sponsored by: The FreeBSD Foundation r350235: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__PT_KILL_competing_stop PR: 220841 Sponsored by: The FreeBSD Foundation r350238: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__follow_fork_both_attached_unrelated_debugger PR: 239397 Sponsored by: The FreeBSD Foundation r350239: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__parent_sees_exit_after_child_debugger PR: 239399 Sponsored by: The FreeBSD Foundation r350295: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__follow_fork_parent_detached_unrelated_debugger PR: 239425 Sponsored by: The FreeBSD Foundation r350512: Only skip test cases sometimes failing in CI when they are running in CI Suggested by: jhb Sponsored by: The FreeBSD Foundation r350700: Get configuration variable with default value for not breaking default setting Reported by: markj Sponsored by: The FreeBSD Foundation r352219: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__getppid PR: 240510 Sponsored by: The FreeBSD Foundation Modified: stable/11/tests/sys/kern/ptrace_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/kern/ptrace_test.c ============================================================================== --- stable/11/tests/sys/kern/ptrace_test.c Mon Oct 28 12:40:12 2019 (r354133) +++ stable/11/tests/sys/kern/ptrace_test.c Mon Oct 28 13:06:01 2019 (r354134) @@ -260,6 +260,9 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_child_debug int cpipe[2], dpipe[2], status; char c; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/239399"); + ATF_REQUIRE(pipe(cpipe) == 0); ATF_REQUIRE((child = fork()) != -1); @@ -801,6 +804,9 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached_unrelate pid_t children[2], fpid, wpid; int cpipe[2], status; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/239397"); + ATF_REQUIRE(pipe(cpipe) == 0); ATF_REQUIRE((fpid = fork()) != -1); if (fpid == 0) { @@ -869,6 +875,9 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached_unrelat pid_t children[2], fpid, wpid; int cpipe[2], status; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/239292"); + ATF_REQUIRE(pipe(cpipe) == 0); ATF_REQUIRE((fpid = fork()) != -1); if (fpid == 0) { @@ -932,6 +941,9 @@ ATF_TC_BODY(ptrace__follow_fork_parent_detached_unrela pid_t children[2], fpid, wpid; int cpipe[2], status; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/239425"); + ATF_REQUIRE(pipe(cpipe) == 0); ATF_REQUIRE((fpid = fork()) != -1); if (fpid == 0) { @@ -994,6 +1006,10 @@ ATF_TC_BODY(ptrace__getppid, tc) int cpipe[2], dpipe[2], status; char c; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/240510"); + + ATF_REQUIRE(pipe(cpipe) == 0); ATF_REQUIRE((child = fork()) != -1); @@ -2077,6 +2093,9 @@ ATF_TC_BODY(ptrace__PT_KILL_competing_stop, tc) lwpid_t main_lwp; struct ptrace_lwpinfo pl; struct sched_param sched_param; + + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/220841"); ATF_REQUIRE((fpid = fork()) != -1); if (fpid == 0) { From owner-svn-src-all@freebsd.org Mon Oct 28 17:12:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 902011A7DB9; Mon, 28 Oct 2019 17:12:46 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4721W23BmCz4J5t; Mon, 28 Oct 2019 17:12:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52887CC73; Mon, 28 Oct 2019 17:12:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9SHCkIN054302; Mon, 28 Oct 2019 17:12:46 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9SHCk2o054301; Mon, 28 Oct 2019 17:12:46 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201910281712.x9SHCk2o054301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 28 Oct 2019 17:12:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354135 - head/contrib/netbsd-tests/lib/libexecinfo X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libexecinfo X-SVN-Commit-Revision: 354135 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2019 17:12:46 -0000 Author: cem Date: Mon Oct 28 17:12:45 2019 New Revision: 354135 URL: https://svnweb.freebsd.org/changeset/base/354135 Log: Remove bogus requirement from libexecinfo test The bogus requirement was causing CI infrastructure (which does not mount procfs) to skip the test. Procfs has not been needed by libexecinfo on FreeBSD (nor NetBSD) for years. Both now use a sysctl to obtain the path to the current process image. X-MFC-With: r354126 Modified: head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Modified: head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c ============================================================================== --- head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Mon Oct 28 13:06:01 2019 (r354134) +++ head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Mon Oct 28 17:12:45 2019 (r354135) @@ -147,7 +147,6 @@ ATF_TC(backtrace_fmt_basic); ATF_TC_HEAD(backtrace_fmt_basic, tc) { atf_tc_set_md_var(tc, "descr", "Test backtrace_fmt(3)"); - atf_tc_set_md_var(tc, "require.files", "/proc/self"); } ATF_TC_BODY(backtrace_fmt_basic, tc) From owner-svn-src-all@freebsd.org Mon Oct 28 18:37:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5D6B159C31; Mon, 28 Oct 2019 18:37:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4723Nt3tKyz4Mcc; Mon, 28 Oct 2019 18:37:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FDC5DB2C; Mon, 28 Oct 2019 18:37:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9SIbY6t001506; Mon, 28 Oct 2019 18:37:34 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9SIbXGc001504; Mon, 28 Oct 2019 18:37:33 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201910281837.x9SIbXGc001504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 28 Oct 2019 18:37: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: r354136 - in stable: 11/share/man/man5 11/tools/build/options 12/share/man/man5 12/tools/build/options X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/share/man/man5 11/tools/build/options 12/share/man/man5 12/tools/build/options X-SVN-Commit-Revision: 354136 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2019 18:37:34 -0000 Author: dim Date: Mon Oct 28 18:37:32 2019 New Revision: 354136 URL: https://svnweb.freebsd.org/changeset/base/354136 Log: MFC r353933: Slightly expand description of WITH_SHARED_TOOLCHAIN, add a corresponding WITHOUT_SHARED_TOOLCHAIN description, and regenerate src.conf(5). Added: stable/11/tools/build/options/WITHOUT_SHARED_TOOLCHAIN - copied unchanged from r353933, head/tools/build/options/WITHOUT_SHARED_TOOLCHAIN Modified: stable/11/share/man/man5/src.conf.5 stable/11/tools/build/options/WITH_SHARED_TOOLCHAIN Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Added: stable/12/tools/build/options/WITHOUT_SHARED_TOOLCHAIN - copied unchanged from r353933, head/tools/build/options/WITHOUT_SHARED_TOOLCHAIN Modified: stable/12/share/man/man5/src.conf.5 stable/12/tools/build/options/WITH_SHARED_TOOLCHAIN Directory Properties: stable/12/ (props changed) Modified: stable/11/share/man/man5/src.conf.5 ============================================================================== --- stable/11/share/man/man5/src.conf.5 Mon Oct 28 17:12:45 2019 (r354135) +++ stable/11/share/man/man5/src.conf.5 Mon Oct 28 18:37:32 2019 (r354136) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd October 21, 2019 +.Dd October 28, 2019 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1492,7 +1492,7 @@ Set to not build the .Bx 4.4 legacy docs. .It Va WITH_SHARED_TOOLCHAIN -Set to build the toolchain binaries shared. +Set to build the toolchain binaries as dynamically linked executables. The set includes .Xr cc 1 , .Xr make 1 Copied: stable/11/tools/build/options/WITHOUT_SHARED_TOOLCHAIN (from r353933, head/tools/build/options/WITHOUT_SHARED_TOOLCHAIN) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tools/build/options/WITHOUT_SHARED_TOOLCHAIN Mon Oct 28 18:37:32 2019 (r354136, copy of r353933, head/tools/build/options/WITHOUT_SHARED_TOOLCHAIN) @@ -0,0 +1,6 @@ +.\" $FreeBSD$ +Set to build the toolchain binaries as statically linked executables. +The set includes +.Xr cc 1 , +.Xr make 1 +and necessary utilities like assembler, linker and library archive manager. Modified: stable/11/tools/build/options/WITH_SHARED_TOOLCHAIN ============================================================================== --- stable/11/tools/build/options/WITH_SHARED_TOOLCHAIN Mon Oct 28 17:12:45 2019 (r354135) +++ stable/11/tools/build/options/WITH_SHARED_TOOLCHAIN Mon Oct 28 18:37:32 2019 (r354136) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -Set to build the toolchain binaries shared. +Set to build the toolchain binaries as dynamically linked executables. The set includes .Xr cc 1 , .Xr make 1 From owner-svn-src-all@freebsd.org Mon Oct 28 18:37:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0776159C2B; Mon, 28 Oct 2019 18:37:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4723Ns5Rwrz4Mcb; Mon, 28 Oct 2019 18:37:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98E10DB2B; Mon, 28 Oct 2019 18:37:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9SIbXGY001498; Mon, 28 Oct 2019 18:37:33 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9SIbXj7001496; Mon, 28 Oct 2019 18:37:33 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201910281837.x9SIbXj7001496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 28 Oct 2019 18:37:33 +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: r354136 - in stable: 11/share/man/man5 11/tools/build/options 12/share/man/man5 12/tools/build/options X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/share/man/man5 11/tools/build/options 12/share/man/man5 12/tools/build/options X-SVN-Commit-Revision: 354136 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2019 18:37:33 -0000 Author: dim Date: Mon Oct 28 18:37:32 2019 New Revision: 354136 URL: https://svnweb.freebsd.org/changeset/base/354136 Log: MFC r353933: Slightly expand description of WITH_SHARED_TOOLCHAIN, add a corresponding WITHOUT_SHARED_TOOLCHAIN description, and regenerate src.conf(5). Added: stable/12/tools/build/options/WITHOUT_SHARED_TOOLCHAIN - copied unchanged from r353933, head/tools/build/options/WITHOUT_SHARED_TOOLCHAIN Modified: stable/12/share/man/man5/src.conf.5 stable/12/tools/build/options/WITH_SHARED_TOOLCHAIN Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Added: stable/11/tools/build/options/WITHOUT_SHARED_TOOLCHAIN - copied unchanged from r353933, head/tools/build/options/WITHOUT_SHARED_TOOLCHAIN Modified: stable/11/share/man/man5/src.conf.5 stable/11/tools/build/options/WITH_SHARED_TOOLCHAIN Directory Properties: stable/11/ (props changed) Modified: stable/12/share/man/man5/src.conf.5 ============================================================================== --- stable/12/share/man/man5/src.conf.5 Mon Oct 28 17:12:45 2019 (r354135) +++ stable/12/share/man/man5/src.conf.5 Mon Oct 28 18:37:32 2019 (r354136) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd October 21, 2019 +.Dd October 28, 2019 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1700,7 +1700,7 @@ Set to not build the .Bx 4.4 legacy docs. .It Va WITH_SHARED_TOOLCHAIN -Set to build the toolchain binaries shared. +Set to build the toolchain binaries as dynamically linked executables. The set includes .Xr cc 1 , .Xr make 1 Copied: stable/12/tools/build/options/WITHOUT_SHARED_TOOLCHAIN (from r353933, head/tools/build/options/WITHOUT_SHARED_TOOLCHAIN) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/build/options/WITHOUT_SHARED_TOOLCHAIN Mon Oct 28 18:37:32 2019 (r354136, copy of r353933, head/tools/build/options/WITHOUT_SHARED_TOOLCHAIN) @@ -0,0 +1,6 @@ +.\" $FreeBSD$ +Set to build the toolchain binaries as statically linked executables. +The set includes +.Xr cc 1 , +.Xr make 1 +and necessary utilities like assembler, linker and library archive manager. Modified: stable/12/tools/build/options/WITH_SHARED_TOOLCHAIN ============================================================================== --- stable/12/tools/build/options/WITH_SHARED_TOOLCHAIN Mon Oct 28 17:12:45 2019 (r354135) +++ stable/12/tools/build/options/WITH_SHARED_TOOLCHAIN Mon Oct 28 18:37:32 2019 (r354136) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -Set to build the toolchain binaries shared. +Set to build the toolchain binaries as dynamically linked executables. The set includes .Xr cc 1 , .Xr make 1 From owner-svn-src-all@freebsd.org Mon Oct 28 19:00:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09A8115A372; Mon, 28 Oct 2019 19:00:28 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4723vH674Zz4NVL; Mon, 28 Oct 2019 19:00:27 +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 B6DBCDEAC; Mon, 28 Oct 2019 19:00:27 +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 x9SJ0Rwq013395; Mon, 28 Oct 2019 19:00:27 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9SJ0ROC013394; Mon, 28 Oct 2019 19:00:27 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201910281900.x9SJ0ROC013394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 28 Oct 2019 19:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354137 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 354137 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2019 19:00:28 -0000 Author: vmaffione Date: Mon Oct 28 19:00:27 2019 New Revision: 354137 URL: https://svnweb.freebsd.org/changeset/base/354137 Log: netmap: enter NET_EPOCH on generic txsync After r353292, netmap generic adapter on if_vlan interfaces panics on asserting the NET_EPOCH. In more detail, this happens when nm_os_generic_xmit_frame() is called, that is in the generic txsync routine. Fix the issue by entering the NET_EPOCH during the generic txsync. We amortize the cost of entering/exiting over a whole batch of transmissions. PR: 241489 Reported by: Aleksandr Fedorov Modified: head/sys/dev/netmap/netmap_generic.c Modified: head/sys/dev/netmap/netmap_generic.c ============================================================================== --- head/sys/dev/netmap/netmap_generic.c Mon Oct 28 18:37:32 2019 (r354136) +++ head/sys/dev/netmap/netmap_generic.c Mon Oct 28 19:00:27 2019 (r354137) @@ -669,7 +669,12 @@ generic_netmap_txsync(struct netmap_kring *kring, int if (nm_i != head) { /* we have new packets to send */ struct nm_os_gen_arg a; u_int event = -1; +#ifdef __FreeBSD__ + struct epoch_tracker et; + NET_EPOCH_ENTER(et); +#endif + if (gna->txqdisc && nm_kr_txempty(kring)) { /* In txqdisc mode, we ask for a delayed notification, * but only when cur == hwtail, which means that the @@ -776,6 +781,10 @@ generic_netmap_txsync(struct netmap_kring *kring, int /* Update hwcur to the next slot to transmit. Here nm_i * is not necessarily head, we could break early. */ kring->nr_hwcur = nm_i; + +#ifdef __FreeBSD__ + NET_EPOCH_EXIT(et); +#endif } /* From owner-svn-src-all@freebsd.org Mon Oct 28 20:45:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6225615C958; Mon, 28 Oct 2019 20:45:30 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4726DV21mQz4TQg; Mon, 28 Oct 2019 20:45:30 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28B91F24F; Mon, 28 Oct 2019 20:45:30 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9SKjUpA077837; Mon, 28 Oct 2019 20:45:30 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9SKjTpO077834; Mon, 28 Oct 2019 20:45:29 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201910282045.x9SKjTpO077834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Mon, 28 Oct 2019 20:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354138 - in head: . tools/build X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head: . tools/build X-SVN-Commit-Revision: 354138 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2019 20:45:30 -0000 Author: sjg Date: Mon Oct 28 20:45:29 2019 New Revision: 354138 URL: https://svnweb.freebsd.org/changeset/base/354138 Log: Building head on stable/11 requires libzstd Add lib/libzstd to _elftoolchain_libs tools/build/Makefile needs to create the install dir for libzstd Since this would make the line too long, rework to use a list in one per line format (easier to add in future) and dispense with the .for loop Reviewed by: emaste bapt Differential Revision: https://reviews.freebsd.org/D220134 Modified: head/Makefile.inc1 head/tools/build/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Oct 28 19:00:27 2019 (r354137) +++ head/Makefile.inc1 Mon Oct 28 20:45:29 2019 (r354138) @@ -1697,7 +1697,7 @@ buildkernel: .MAKE .PHONY @echo "--------------------------------------------------------------" @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`" @echo "--------------------------------------------------------------" - + .endfor @seconds=$$(($$(date '+%s') - ${_BUILDKERNEL_START})); \ echo -n ">>> Kernel(s) ${BUILDKERNELS} built in $$seconds seconds, "; \ @@ -2159,7 +2159,7 @@ _bootstrap_tools_links+=m4 lex # r339083 libelf: correct mips64el test to use ELF header # r348347 Add missing powerpc64 relocation support to libdwarf .if ${BOOTSTRAPPING} < 1300030 -_elftoolchain_libs= lib/libelf lib/libdwarf +_elftoolchain_libs= lib/libelf lib/libdwarf lib/libzstd ${_bt}-lib/libelf: ${_bt_m4_depend} ${_bt}-lib/libdwarf: ${_bt_m4_depend} .endif @@ -2360,7 +2360,6 @@ ${_bt}-link-${_tool}: .PHONY .MAKE fi ${_bt}-links: ${_bt}-link-${_tool} .endfor - bootstrap-tools: ${_bt}-links .PHONY Modified: head/tools/build/Makefile ============================================================================== --- head/tools/build/Makefile Mon Oct 28 19:00:27 2019 (r354137) +++ head/tools/build/Makefile Mon Oct 28 20:45:29 2019 (r354138) @@ -120,10 +120,17 @@ host-symlinks: # Create all the directories that are needed during the legacy, bootstrap-tools # and cross-tools stages. We do this here using mkdir since mtree may not exist # yet (this happens if we are crossbuilding from Linux/Mac). +INSTALLDIR_LIST= \ + bin \ + lib/casper \ + lib/geom \ + usr/include/casper \ + usr/include/private/zstd \ + usr/lib \ + installdirs: -.for _dir in bin usr/lib usr/include usr/include/casper lib/geom lib/casper - mkdir -p "${DESTDIR}/${_dir}" -.endfor + mkdir -p ${INSTALLDIR_LIST:S,^,${DESTDIR}/,} + # Link usr/bin, sbin, and usr/sbin to bin so that it doesn't matter whether a # bootstrap tool was added to WORLTMP with a symlink or by building it in the # bootstrap-tools phase. We could also overrride BINDIR when building bootstrap From owner-svn-src-all@freebsd.org Mon Oct 28 21:22:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFEF215D3BF; Mon, 28 Oct 2019 21:22:47 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47273W46hDz4WVh; Mon, 28 Oct 2019 21:22:47 +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 70E04F9AC; Mon, 28 Oct 2019 21:22:47 +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 x9SLMlLu002265; Mon, 28 Oct 2019 21:22:47 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9SLMlX7002263; Mon, 28 Oct 2019 21:22:47 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201910282122.x9SLMlX7002263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 28 Oct 2019 21:22:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354139 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 354139 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2019 21:22:47 -0000 Author: trasz Date: Mon Oct 28 21:22:46 2019 New Revision: 354139 URL: https://svnweb.freebsd.org/changeset/base/354139 Log: Document the fact that Linux binaries depend on pty(4). The source part of the review will be addressed in a different way. Reviewed by: emaste, brooks MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21492 Modified: head/share/man/man4/linux.4 head/share/man/man4/pty.4 Modified: head/share/man/man4/linux.4 ============================================================================== --- head/share/man/man4/linux.4 Mon Oct 28 20:45:29 2019 (r354138) +++ head/share/man/man4/linux.4 Mon Oct 28 21:22:46 2019 (r354139) @@ -139,6 +139,7 @@ limited Linux system file system .El .Sh SEE ALSO .Xr brandelf 1 , +.Xr pty 4 , .Xr elf 5 , .Xr fdescfs 5 , .Xr linprocfs 5 , Modified: head/share/man/man4/pty.4 ============================================================================== --- head/share/man/man4/pty.4 Mon Oct 28 20:45:29 2019 (r354138) +++ head/share/man/man4/pty.4 Mon Oct 28 21:22:46 2019 (r354139) @@ -27,19 +27,21 @@ .\" .\" $FreeBSD$ .\" -.Dd August 20, 2008 +.Dd October 28, 2019 .Dt PTY 4 .Os .Sh NAME .Nm pty -.Nd BSD-style and System V-style compatibility pseudo-terminal driver +.Nd old-style compatibility pseudo-terminal driver .Sh SYNOPSIS .Cd "device pty" .Sh DESCRIPTION The .Nm driver provides support for the traditional BSD naming scheme that was -used for accessing pseudo-terminals. +used for accessing pseudo-terminals before it was replaced by +.Xr pts 4 . +This traditional naming is still used in Linux. When the device .Pa /dev/ptyXX is being opened, a new terminal shall be created with the @@ -59,7 +61,8 @@ interface. It is only provided for compatibility with older C libraries that tried to open such devices when .Xr posix_openpt 2 -was being called. +was being called, +and for running Linux binaries. .Sh FILES The BSD-style compatibility pseudo-terminal driver uses the following device names: From owner-svn-src-all@freebsd.org Mon Oct 28 21:48:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C787315DAD7; Mon, 28 Oct 2019 21:48:21 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4727d14lhHz4XQH; Mon, 28 Oct 2019 21:48:21 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82B6AFD72; Mon, 28 Oct 2019 21:48:21 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9SLmLvc013892; Mon, 28 Oct 2019 21:48:21 GMT (envelope-from jlh@FreeBSD.org) Received: (from jlh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9SLmLkM013891; Mon, 28 Oct 2019 21:48:21 GMT (envelope-from jlh@FreeBSD.org) Message-Id: <201910282148.x9SLmLkM013891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jlh set sender to jlh@FreeBSD.org using -f From: Jeremie Le Hen Date: Mon, 28 Oct 2019 21:48:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354140 - head/usr.bin/fstat X-SVN-Group: head X-SVN-Commit-Author: jlh X-SVN-Commit-Paths: head/usr.bin/fstat X-SVN-Commit-Revision: 354140 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2019 21:48:21 -0000 Author: jlh Date: Mon Oct 28 21:48:20 2019 New Revision: 354140 URL: https://svnweb.freebsd.org/changeset/base/354140 Log: Grammar fix. Reported by: imp Differential Revision: https://reviews.freebsd.org/D21880 Modified: head/usr.bin/fstat/fstat.1 Modified: head/usr.bin/fstat/fstat.1 ============================================================================== --- head/usr.bin/fstat/fstat.1 Mon Oct 28 21:22:46 2019 (r354139) +++ head/usr.bin/fstat/fstat.1 Mon Oct 28 21:48:20 2019 (r354140) @@ -215,7 +215,7 @@ When the .Fl s flag is used, socket endpoint information is shown after the address of the socket. -For internet sockets the local and remote address are shown, separated with +For internet sockets the local and remote addresses are shown, separated with a double arrow (``<->''). For unix/local sockets either the local or remote address is shown, depending on which one is available. From owner-svn-src-all@freebsd.org Mon Oct 28 21:51:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7095A15DE83; Mon, 28 Oct 2019 21:51:46 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4727hy2Nzfz4Xmb; Mon, 28 Oct 2019 21:51:46 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36BA8FEC5; Mon, 28 Oct 2019 21:51:46 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9SLpkLw017175; Mon, 28 Oct 2019 21:51:46 GMT (envelope-from jlh@FreeBSD.org) Received: (from jlh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9SLpjs4017173; Mon, 28 Oct 2019 21:51:45 GMT (envelope-from jlh@FreeBSD.org) Message-Id: <201910282151.x9SLpjs4017173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jlh set sender to jlh@FreeBSD.org using -f From: Jeremie Le Hen Date: Mon, 28 Oct 2019 21:51: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: r354141 - stable/12/usr.bin/fstat X-SVN-Group: stable-12 X-SVN-Commit-Author: jlh X-SVN-Commit-Paths: stable/12/usr.bin/fstat X-SVN-Commit-Revision: 354141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2019 21:51:46 -0000 Author: jlh Date: Mon Oct 28 21:51:45 2019 New Revision: 354141 URL: https://svnweb.freebsd.org/changeset/base/354141 Log: MFC r353769, r354140: Add the fstat -s option to display socket information. Grammar fix. Modified: stable/12/usr.bin/fstat/fstat.1 stable/12/usr.bin/fstat/fstat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/fstat/fstat.1 ============================================================================== --- stable/12/usr.bin/fstat/fstat.1 Mon Oct 28 21:48:20 2019 (r354140) +++ stable/12/usr.bin/fstat/fstat.1 Mon Oct 28 21:51:45 2019 (r354141) @@ -28,7 +28,7 @@ .\" @(#)fstat.1 8.3 (Berkeley) 2/25/94 .\" $FreeBSD$ .\" -.Dd September 28, 2011 +.Dd October 19, 2019 .Dt FSTAT 1 .Os .Sh NAME @@ -36,7 +36,7 @@ .Nd identify active files .Sh SYNOPSIS .Nm -.Op Fl fmnv +.Op Fl fmnsv .Op Fl M Ar core .Op Fl N Ar system .Op Fl p Ar pid @@ -85,6 +85,8 @@ in and print the mode of the file in octal instead of symbolic form. .It Fl p Report all files open by the specified process. +.It Fl s +Print socket endpoint information. .It Fl u Report all files open by the specified user. .It Fl v @@ -199,9 +201,6 @@ For tcp, it is the address of the tcpcb, and for udp, For unix domain sockets, its the address of the socket pcb and the address of the connected pcb (if connected). Otherwise the protocol number and address of the socket itself are printed. -The attempt is to make enough information available to -permit further analysis without duplicating -.Xr netstat 1 . .Pp For example, the addresses mentioned above are the addresses which the .Dq Li netstat -A @@ -211,6 +210,15 @@ connected unix domain stream socket. A unidirectional unix domain socket indicates the direction of flow with an arrow (``<-'' or ``->''), and a full duplex socket shows a double arrow (``<->''). +.Pp +When the +.Fl s +flag is used, socket endpoint information is shown after the address of the +socket. +For internet sockets the local and remote addresses are shown, separated with +a double arrow (``<->''). +For unix/local sockets either the local or remote address is shown, depending +on which one is available. .Sh SEE ALSO .Xr netstat 1 , .Xr nfsstat 1 , Modified: stable/12/usr.bin/fstat/fstat.c ============================================================================== --- stable/12/usr.bin/fstat/fstat.c Mon Oct 28 21:48:20 2019 (r354140) +++ stable/12/usr.bin/fstat/fstat.c Mon Oct 28 21:51:45 2019 (r354141) @@ -40,9 +40,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include + #include #include #include @@ -61,6 +64,7 @@ __FBSDID("$FreeBSD$"); static int fsflg, /* show files on same filesystem as file(s) argument */ pflg, /* show files open by a particular pid */ + sflg, /* show socket details */ uflg; /* show files open by a particular (effective) user */ static int checkfile; /* restrict to particular files or filesystems */ static int nflg; /* (numerical) display f.s. and rdev as dev_t */ @@ -108,7 +112,7 @@ do_fstat(int argc, char **argv) arg = 0; what = KERN_PROC_PROC; nlistf = memf = NULL; - while ((ch = getopt(argc, argv, "fmnp:u:vN:M:")) != -1) + while ((ch = getopt(argc, argv, "fmnp:su:vN:M:")) != -1) switch((char)ch) { case 'f': fsflg = 1; @@ -135,6 +139,9 @@ do_fstat(int argc, char **argv) what = KERN_PROC_PID; arg = atoi(optarg); break; + case 's': + sflg = 1; + break; case 'u': if (uflg++) usage(); @@ -314,6 +321,55 @@ print_file_info(struct procstat *procstat, struct file putchar('\n'); } +static char * +addr_to_string(struct sockaddr_storage *ss, char *buffer, int buflen) +{ + char buffer2[INET6_ADDRSTRLEN]; + struct sockaddr_in6 *sin6; + struct sockaddr_in *sin; + struct sockaddr_un *sun; + + switch (ss->ss_family) { + case AF_LOCAL: + sun = (struct sockaddr_un *)ss; + if (strlen(sun->sun_path) == 0) + strlcpy(buffer, "-", buflen); + else + strlcpy(buffer, sun->sun_path, buflen); + break; + + case AF_INET: + sin = (struct sockaddr_in *)ss; + if (sin->sin_addr.s_addr == INADDR_ANY) + snprintf(buffer, buflen, "%s:%d", "*", + ntohs(sin->sin_port)); + else if (inet_ntop(AF_INET, &sin->sin_addr, buffer2, + sizeof(buffer2)) != NULL) + snprintf(buffer, buflen, "%s:%d", buffer2, + ntohs(sin->sin_port)); + break; + + case AF_INET6: + sin6 = (struct sockaddr_in6 *)ss; + if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) + snprintf(buffer, buflen, "%s.%d", "*", + ntohs(sin6->sin6_port)); + else if (inet_ntop(AF_INET6, &sin6->sin6_addr, buffer2, + sizeof(buffer2)) != NULL) + snprintf(buffer, buflen, "%s.%d", buffer2, + ntohs(sin6->sin6_port)); + else + strlcpy(buffer, "-", buflen); + break; + + default: + strlcpy(buffer, "", buflen); + break; + } + return buffer; +} + + static void print_socket_info(struct procstat *procstat, struct filestat *fst) { @@ -329,6 +385,8 @@ print_socket_info(struct procstat *procstat, struct fi struct sockstat sock; struct protoent *pe; char errbuf[_POSIX2_LINE_MAX]; + char src_addr[PATH_MAX], dst_addr[PATH_MAX]; + struct sockaddr_un *sun; int error; static int isopen; @@ -368,6 +426,11 @@ print_socket_info(struct procstat *procstat, struct fi } else if (sock.so_pcb != 0) printf(" %lx", (u_long)sock.so_pcb); + if (!sflg) + break; + printf(" %s <-> %s", + addr_to_string(&sock.sa_local, src_addr, sizeof(src_addr)), + addr_to_string(&sock.sa_peer, dst_addr, sizeof(dst_addr))); break; case AF_UNIX: /* print address of pcb and connected pcb */ @@ -385,8 +448,25 @@ print_socket_info(struct procstat *procstat, struct fi *cp = '\0'; printf(" %s %lx", shoconn, (u_long)sock.unp_conn); - } + } } + if (!sflg) + break; + sun = (struct sockaddr_un *)&sock.sa_local; + /* + * While generally we like to print two addresses, + * local and peer, for sockets, it turns out to be + * more useful to print the first non-null address for + * local sockets, as typically they aren't bound and + * connected, and the path strings can get long. + */ + if (sun->sun_path[0] != 0) + addr_to_string(&sock.sa_local, + src_addr, sizeof(src_addr)); + else + addr_to_string(&sock.sa_peer, + src_addr, sizeof(src_addr)); + printf(" %s", src_addr); break; default: /* print protocol number and socket address */ From owner-svn-src-all@freebsd.org Mon Oct 28 22:54:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBA3415F0EF; Mon, 28 Oct 2019 22:54:37 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47295T4WdRz4bpl; Mon, 28 Oct 2019 22:54:37 +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 7E6B6189D4; Mon, 28 Oct 2019 22:54:37 +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 x9SMsbMi055057; Mon, 28 Oct 2019 22:54:37 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9SMsaXO055052; Mon, 28 Oct 2019 22:54:36 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201910282254.x9SMsaXO055052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 28 Oct 2019 22: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: r354142 - in stable/12/sys/fs: nfs nfsclient X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/12/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 354142 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2019 22:54:37 -0000 Author: rmacklem Date: Mon Oct 28 22:54:36 2019 New Revision: 354142 URL: https://svnweb.freebsd.org/changeset/base/354142 Log: MFC: r352664 Replace all mtx_lock()/mtx_unlock() on the iod lock with macros. Since the NFS node mutex needs to change to an sx lock so it can be held when vnode_pager_setsize() is called and the iod lock is held when the NFS node lock is acquired, the iod mutex will need to be changed to an sx lock as well. To simply the future commit that changes both the NFS node lock and iod lock to sx locks, this commit replaces all mtx_lock()/mtx_unlock() calls on the iod lock with macros. There is no semantic change as a result of this commit. Modified: stable/12/sys/fs/nfs/nfsport.h stable/12/sys/fs/nfsclient/nfs_clbio.c stable/12/sys/fs/nfsclient/nfs_clnfsiod.c stable/12/sys/fs/nfsclient/nfs_clsubs.c stable/12/sys/fs/nfsclient/nfs_clvfsops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfs/nfsport.h ============================================================================== --- stable/12/sys/fs/nfs/nfsport.h Mon Oct 28 21:51:45 2019 (r354141) +++ stable/12/sys/fs/nfs/nfsport.h Mon Oct 28 22:54:36 2019 (r354142) @@ -690,6 +690,8 @@ void nfsrvd_rcv(struct socket *, void *, int); #define NFSUNLOCKNODE(n) mtx_unlock(&((n)->n_mtx)) #define NFSLOCKMNT(m) mtx_lock(&((m)->nm_mtx)) #define NFSUNLOCKMNT(m) mtx_unlock(&((m)->nm_mtx)) +#define NFSLOCKIOD() mtx_lock(&ncl_iod_mutex) +#define NFSUNLOCKIOD() mtx_unlock(&ncl_iod_mutex) #define NFSLOCKREQUEST(r) mtx_lock(&((r)->r_mtx)) #define NFSUNLOCKREQUEST(r) mtx_unlock(&((r)->r_mtx)) #define NFSPROCLISTLOCK() sx_slock(&allproc_lock) Modified: stable/12/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clbio.c Mon Oct 28 21:51:45 2019 (r354141) +++ stable/12/sys/fs/nfsclient/nfs_clbio.c Mon Oct 28 22:54:36 2019 (r354142) @@ -1410,11 +1410,11 @@ ncl_asyncio(struct nfsmount *nmp, struct buf *bp, stru * To avoid this deadlock, don't allow the async nfsiod threads to * perform Readdirplus RPCs. */ - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); if ((bp->b_iocmd == BIO_WRITE && (bp->b_flags & B_NEEDCOMMIT) && (nmp->nm_bufqiods > ncl_numasync / 2)) || (bp->b_vp->v_type == VDIR && (nmp->nm_flag & NFSMNT_RDIRPLUS))) { - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); return(EIO); } again: @@ -1481,7 +1481,7 @@ again: if (error) { error2 = newnfs_sigintr(nmp, td); if (error2) { - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); return (error2); } if (slpflag == PCATCH) { @@ -1522,11 +1522,11 @@ again: VTONFS(bp->b_vp)->n_directio_asyncwr++; NFSUNLOCKNODE(VTONFS(bp->b_vp)); } - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); return (0); } - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); /* * All the iods are busy on other mounts, so return EIO to Modified: stable/12/sys/fs/nfsclient/nfs_clnfsiod.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clnfsiod.c Mon Oct 28 21:51:45 2019 (r354141) +++ stable/12/sys/fs/nfsclient/nfs_clnfsiod.c Mon Oct 28 22:54:36 2019 (r354142) @@ -106,7 +106,7 @@ sysctl_iodmin(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &newmin, 0, req); if (error || (req->newptr == NULL)) return (error); - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); if (newmin > ncl_iodmax) { error = EINVAL; goto out; @@ -121,7 +121,7 @@ sysctl_iodmin(SYSCTL_HANDLER_ARGS) for (i = nfs_iodmin - ncl_numasync; i > 0; i--) nfs_nfsiodnew_sync(); out: - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); return (0); } SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmin, CTLTYPE_UINT | CTLFLAG_RW, 0, @@ -140,7 +140,7 @@ sysctl_iodmax(SYSCTL_HANDLER_ARGS) return (error); if (newmax > NFS_MAXASYNCDAEMON) return (EINVAL); - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); ncl_iodmax = newmax; if (ncl_numasync <= ncl_iodmax) goto out; @@ -157,7 +157,7 @@ sysctl_iodmax(SYSCTL_HANDLER_ARGS) iod--; } out: - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); return (0); } SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmax, CTLTYPE_UINT | CTLFLAG_RW, 0, @@ -178,10 +178,10 @@ nfs_nfsiodnew_sync(void) } if (i == ncl_iodmax) return (0); - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); error = kproc_create(nfssvc_iod, nfs_asyncdaemon + i, NULL, RFHIGHPID, 0, "newnfs %d", i); - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); if (error == 0) { ncl_numasync++; ncl_iodwant[i] = NFSIOD_AVAILABLE; @@ -194,12 +194,12 @@ void ncl_nfsiodnew_tq(__unused void *arg, int pending) { - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); while (pending > 0) { pending--; nfs_nfsiodnew_sync(); } - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); } void @@ -217,7 +217,7 @@ nfsiod_setup(void *dummy) TUNABLE_INT_FETCH("vfs.nfs.iodmin", &nfs_iodmin); nfscl_init(); - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); /* Silently limit the start number of nfsiod's */ if (nfs_iodmin > NFS_MAXASYNCDAEMON) nfs_iodmin = NFS_MAXASYNCDAEMON; @@ -227,7 +227,7 @@ nfsiod_setup(void *dummy) if (error == -1) panic("nfsiod_setup: nfs_nfsiodnew failed"); } - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); } SYSINIT(newnfsiod, SI_SUB_KTHREAD_IDLE, SI_ORDER_ANY, nfsiod_setup, NULL); @@ -248,7 +248,7 @@ nfssvc_iod(void *instance) int myiod, timo; int error = 0; - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); myiod = (int *)instance - nfs_asyncdaemon; /* * Main loop @@ -291,7 +291,7 @@ nfssvc_iod(void *instance) nmp->nm_bufqwant = 0; wakeup(&nmp->nm_bufq); } - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); if (bp->b_flags & B_DIRECT) { KASSERT((bp->b_iocmd == BIO_WRITE), ("nfscvs_iod: BIO_WRITE not set")); (void)ncl_doio_directwrite(bp); @@ -303,7 +303,7 @@ nfssvc_iod(void *instance) (void) ncl_doio(bp->b_vp, bp, bp->b_wcred, NULL, 0); } - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); /* * Make sure the nmp hasn't been dismounted as soon as * ncl_doio() completes for the last buffer. @@ -335,7 +335,7 @@ finish: /* Someone may be waiting for the last nfsiod to terminate. */ if (--ncl_numasync == 0) wakeup(&ncl_numasync); - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); if ((error == 0) || (error == EWOULDBLOCK)) kproc_exit(0); /* Abnormal termination */ Modified: stable/12/sys/fs/nfsclient/nfs_clsubs.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clsubs.c Mon Oct 28 21:51:45 2019 (r354141) +++ stable/12/sys/fs/nfsclient/nfs_clsubs.c Mon Oct 28 22:54:36 2019 (r354142) @@ -102,7 +102,7 @@ ncl_uninit(struct vfsconf *vfsp) * Tell all nfsiod processes to exit. Clear ncl_iodmax, and wakeup * any sleeping nfsiods so they check ncl_iodmax and exit. */ - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); ncl_iodmax = 0; for (i = 0; i < ncl_numasync; i++) if (ncl_iodwant[i] == NFSIOD_AVAILABLE) @@ -110,7 +110,7 @@ ncl_uninit(struct vfsconf *vfsp) /* The last nfsiod to exit will wake us up when ncl_numasync hits 0 */ while (ncl_numasync) msleep(&ncl_numasync, &ncl_iod_mutex, PWAIT, "ioddie", 0); - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); ncl_nhuninit(); return (0); #else Modified: stable/12/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clvfsops.c Mon Oct 28 21:51:45 2019 (r354141) +++ stable/12/sys/fs/nfsclient/nfs_clvfsops.c Mon Oct 28 22:54:36 2019 (r354142) @@ -1714,13 +1714,13 @@ nfs_unmount(struct mount *mp, int mntflags) mtx_unlock(&nmp->nm_mtx); } /* Make sure no nfsiods are assigned to this mount. */ - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); for (i = 0; i < NFS_MAXASYNCDAEMON; i++) if (ncl_iodmount[i] == nmp) { ncl_iodwant[i] = NFSIOD_AVAILABLE; ncl_iodmount[i] = NULL; } - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); /* * We can now set mnt_data to NULL and wait for From owner-svn-src-all@freebsd.org Mon Oct 28 23:31:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4813215FBF4; Mon, 28 Oct 2019 23:31:23 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4729vv19Bhz4dL9; Mon, 28 Oct 2019 23:31:23 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CC8D19074; Mon, 28 Oct 2019 23:31:23 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9SNVMNh075824; Mon, 28 Oct 2019 23:31:22 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9SNVMk9075822; Mon, 28 Oct 2019 23:31:22 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201910282331.x9SNVMk9075822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Mon, 28 Oct 2019 23:31:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354143 - head/sys/dev/sound/pci/hda X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 354143 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2019 23:31:23 -0000 Author: scottl Date: Mon Oct 28 23:31:22 2019 New Revision: 354143 URL: https://svnweb.freebsd.org/changeset/base/354143 Log: Add device IDs for the next generation of Intel HDA audio. MFC after: 3 days Modified: head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/hda/hdac.h head/sys/dev/sound/pci/hda/hdacc.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Mon Oct 28 22:54:36 2019 (r354142) +++ head/sys/dev/sound/pci/hda/hdac.c Mon Oct 28 23:31:22 2019 (r354143) @@ -103,6 +103,10 @@ static const struct { { HDA_INTEL_KBLKH, "Intel Kaby Lake-H", 0, 0 }, { HDA_INTEL_CFLK, "Intel Coffee Lake", 0, 0 }, { HDA_INTEL_CNLK, "Intel Cannon Lake", 0, 0 }, + { HDA_INTEL_ICLK, "Intel Ice Lake", 0, 0 }, + { HDA_INTEL_CMLKLP, "Intel Comet Lake-LP", 0, 0 }, + { HDA_INTEL_CMLKH, "Intel Comet Lake-H", 0, 0 }, + { HDA_INTEL_GMLK, "Intel Gemini Lake", 0, 0 }, { HDA_INTEL_82801F, "Intel 82801F", 0, 0 }, { HDA_INTEL_63XXESB, "Intel 631x/632xESB", 0, 0 }, { HDA_INTEL_82801G, "Intel 82801G", 0, 0 }, Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Mon Oct 28 22:54:36 2019 (r354142) +++ head/sys/dev/sound/pci/hda/hdac.h Mon Oct 28 23:31:22 2019 (r354143) @@ -78,6 +78,10 @@ #define HDA_INTEL_KBLKH HDA_MODEL_CONSTRUCT(INTEL, 0xa2f0) #define HDA_INTEL_CFLK HDA_MODEL_CONSTRUCT(INTEL, 0xa348) #define HDA_INTEL_CNLK HDA_MODEL_CONSTRUCT(INTEL, 0x9dc8) +#define HDA_INTEL_ICLK HDA_MODEL_CONSTRUCT(INTEL, 0x34c8) +#define HDA_INTEL_CMLKLP HDA_MODEL_CONSTRUCT(INTEL, 0x02c8) +#define HDA_INTEL_CMLKH HDA_MODEL_CONSTRUCT(INTEL, 0x06c8) +#define HDA_INTEL_GMLK HDA_MODEL_CONSTRUCT(INTEL, 0x3198) #define HDA_INTEL_ALL HDA_MODEL_CONSTRUCT(INTEL, 0xffff) /* Nvidia */ @@ -684,6 +688,7 @@ /* INTEL */ #define HDA_CODEC_INTELIP HDA_CODEC_CONSTRUCT(INTEL, 0x0054) +#define HDA_CODEC_INTELGMLK HDA_CODEC_CONSTRUCT(INTEL, 0x2800) #define HDA_CODEC_INTELBL HDA_CODEC_CONSTRUCT(INTEL, 0x2801) #define HDA_CODEC_INTELCA HDA_CODEC_CONSTRUCT(INTEL, 0x2802) #define HDA_CODEC_INTELEL HDA_CODEC_CONSTRUCT(INTEL, 0x2803) @@ -693,7 +698,11 @@ #define HDA_CODEC_INTELHSW HDA_CODEC_CONSTRUCT(INTEL, 0x2807) #define HDA_CODEC_INTELBDW HDA_CODEC_CONSTRUCT(INTEL, 0x2808) #define HDA_CODEC_INTELSKLK HDA_CODEC_CONSTRUCT(INTEL, 0x2809) +#define HDA_CODEC_INTELBXTN HDA_CODEC_CONSTRUCT(INTEL, 0x280a) #define HDA_CODEC_INTELKBLK HDA_CODEC_CONSTRUCT(INTEL, 0x280b) +#define HDA_CODEC_INTELCNLK HDA_CODEC_CONSTRUCT(INTEL, 0x280c) +#define HDA_CODEC_INTELGMLK1 HDA_CODEC_CONSTRUCT(INTEL, 0x280d) +#define HDA_CODEC_INTELICLK HDA_CODEC_CONSTRUCT(INTEL, 0x280f) #define HDA_CODEC_INTELCL HDA_CODEC_CONSTRUCT(INTEL, 0x29fb) #define HDA_CODEC_INTELXXXX HDA_CODEC_CONSTRUCT(INTEL, 0xffff) Modified: head/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdacc.c Mon Oct 28 22:54:36 2019 (r354142) +++ head/sys/dev/sound/pci/hda/hdacc.c Mon Oct 28 23:31:22 2019 (r354143) @@ -370,6 +370,11 @@ static const struct { { HDA_CODEC_INTELSKLK, 0, "Intel Skylake" }, { HDA_CODEC_INTELKBLK, 0, "Intel Kaby Lake" }, { HDA_CODEC_INTELCL, 0, "Intel Crestline" }, + { HDA_CODEC_INTELBXTN, 0, "Intel Broxton" }, + { HDA_CODEC_INTELCNLK, 0, "Intel Cannonlake" }, + { HDA_CODEC_INTELGMLK, 0, "Intel Geminilake" }, + { HDA_CODEC_INTELGMLK1, 0, "Intel Geminilake" }, + { HDA_CODEC_INTELICLK, 0, "Intel Icelake" }, { HDA_CODEC_SII1390, 0, "Silicon Image SiI1390" }, { HDA_CODEC_SII1392, 0, "Silicon Image SiI1392" }, /* Unknown CODECs */ From owner-svn-src-all@freebsd.org Tue Oct 29 04:28:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2016117596D; Tue, 29 Oct 2019 04:28:25 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472JVc6npdz4051; Tue, 29 Oct 2019 04:28:24 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC3A61C6D0; Tue, 29 Oct 2019 04:28:24 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9T4SOkl050253; Tue, 29 Oct 2019 04:28:24 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9T4SO5I050252; Tue, 29 Oct 2019 04:28:24 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201910290428.x9T4SO5I050252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 29 Oct 2019 04:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354144 - head/contrib/netbsd-tests/lib/libexecinfo X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libexecinfo X-SVN-Commit-Revision: 354144 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2019 04:28:25 -0000 Author: lwhsu Date: Tue Oct 29 04:28:24 2019 New Revision: 354144 URL: https://svnweb.freebsd.org/changeset/base/354144 Log: Temporarily disable failing case in CI: - lib.libexecinfo.backtrace_test.backtrace_fmt_basic PR: 241562 Sponsored by: The FreeBSD Foundation Modified: head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Modified: head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c ============================================================================== --- head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Mon Oct 28 23:31:22 2019 (r354143) +++ head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Tue Oct 29 04:28:24 2019 (r354144) @@ -151,6 +151,9 @@ ATF_TC_HEAD(backtrace_fmt_basic, tc) ATF_TC_BODY(backtrace_fmt_basic, tc) { + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/241562"); + myfunc(12); if (prevent_inline) From owner-svn-src-all@freebsd.org Tue Oct 29 07:04:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 321D017C3C8; Tue, 29 Oct 2019 07:04:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472MyS0XtXz49QG; Tue, 29 Oct 2019 07:04:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id BBDD81AED4; Tue, 29 Oct 2019 07:04:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::3185:9ec5:f0ef:c62] (unknown [IPv6:2001:470:7a58:0:3185:9ec5:f0ef:c62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 8F3384D3D9; Tue, 29 Oct 2019 08:04:13 +0100 (CET) From: Dimitry Andric Message-Id: <0938D185-8BF4-45CD-925E-328F03695518@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_6E4C7B7A-7B2C-477B-85D1-D57CA08D0830"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r353937 - in head/share: man/man5 mk Date: Tue, 29 Oct 2019 08:04:07 +0100 In-Reply-To: <20191027165934.GA54960@FreeBSD.org> Cc: svn-src-head , svn-src-all , src-committers , Enji Cooper To: Alexey Dokuchaev References: <201910231702.x9NH2jQv045130@repo.freebsd.org> <2B855247-5097-442D-8D4A-77D68D2F6186@gmail.com> <20191024124910.GA93913@FreeBSD.org> <67F6BDD3-B633-4C85-AE85-9B075FF0E49E@FreeBSD.org> <20191027165934.GA54960@FreeBSD.org> X-Mailer: Apple Mail (2.3445.104.11) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2019 07:04:16 -0000 --Apple-Mail=_6E4C7B7A-7B2C-477B-85D1-D57CA08D0830 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 27 Oct 2019, at 17:59, Alexey Dokuchaev wrote: > > On Sat, Oct 26, 2019 at 04:34:14PM +0200, Dimitry Andric wrote: ... >> I only tested -j24 on a 32-core system, but I could probably repeat the >> experiment with lower and higher -j values: [...] >> >> So ~2.3% difference in real time, which is not too bad I think. > > Well, I'd say it's acceptable. :-/ I also tested at low (-j4) and high (-j32) levels. It turns out that at low -j levels, the difference is less pronounced, just ~1.1% in real time. And at high -j levels, it is more pronounced, ~4.3% in real time. Note also that at high -j levels, the difference in system time seems to get more influence, e.g. at low -j the difference is ~4.5%, while at high -j the difference is ~7.2%. I guess it is because dynamic linking uses more syscalls. At -j4: Results for real time: --------------------------------------------------------------------------- x j4-static-real.txt + j4-dynamic-real.txt N Min Max Median Avg Stddev x 7 5508.58 5548.05 5533.25 5530.2829 12.323855 + 7 5514.68 5660.1 5591.25 5593.5143 59.98042 Difference at 95.0% confidence 63.2314 +/- 50.4309 1.14337% +/- 0.912329% (Student's t, pooled s = 43.2985) Results for user time: --------------------------------------------------------------------------- x j4-static-user.txt + j4-dynamic-user.txt N Min Max Median Avg Stddev x 7 19525.34 19607.74 19593.1 19582.78 29.037717 + 7 20178.84 20348.11 20214.28 20235.057 57.31409 Difference at 95.0% confidence 652.277 +/- 52.9155 3.33087% +/- 0.272077% (Student's t, pooled s = 45.4318) Results for system time: --------------------------------------------------------------------------- x j4-static-sys.txt + j4-dynamic-sys.txt N Min Max Median Avg Stddev x 7 1622.63 1634.98 1629.87 1629.1229 4.7234017 + 7 1672.25 1722.23 1704.49 1703.1729 15.724862 Difference at 95.0% confidence 74.05 +/- 13.5224 4.54539% +/- 0.833228% (Student's t, pooled s = 11.6099) At -j32: Results for real time: --------------------------------------------------------------------------- x j32-static-real.txt + j32-dynamic-real.txt N Min Max Median Avg Stddev x 7 1689.19 1735.36 1707.32 1707.8471 16.500078 + 7 1754.98 1812.57 1777.96 1781.6329 19.554159 Difference at 95.0% confidence 73.7857 +/- 21.0718 4.32039% +/- 1.25627% (Student's t, pooled s = 18.0917) Results for user time: --------------------------------------------------------------------------- x j32-static-user.txt + j32-dynamic-user.txt N Min Max Median Avg Stddev x 7 38545.36 38802.6 38609.87 38641.009 105.11904 + 7 39430.93 39924.98 39856.91 39769.979 185.3612 Difference at 95.0% confidence 1128.97 +/- 175.5 2.92169% +/- 0.457446% (Student's t, pooled s = 150.68) Results for system time: --------------------------------------------------------------------------- x j32-static-sys.txt + j32-dynamic-sys.txt N Min Max Median Avg Stddev x 7 2752.81 2809.97 2781.46 2781.4986 21.86523 + 7 2906.22 3151.93 2932.59 2981.5757 103.79842 Difference at 95.0% confidence 200.077 +/- 87.3629 7.19314% +/- 3.15079% (Student's t, pooled s = 75.0073) -Dimitry --Apple-Mail=_6E4C7B7A-7B2C-477B-85D1-D57CA08D0830 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCXbfkZwAKCRCwXqMKLiCW o+dQAJ9VqY02eR4RPIMEH0SVVSrx0YuKrACgpV9MELP+FnIpZGjEFHYJc+/NbdI= =YAIF -----END PGP SIGNATURE----- --Apple-Mail=_6E4C7B7A-7B2C-477B-85D1-D57CA08D0830-- From owner-svn-src-all@freebsd.org Tue Oct 29 07:10:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E3DD17C736; Tue, 29 Oct 2019 07:10:18 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472N5Q21VCz49nS; Tue, 29 Oct 2019 07:10:18 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 25038EB2F; Tue, 29 Oct 2019 07:10:18 +0000 (UTC) Date: Tue, 29 Oct 2019 07:10:18 +0000 From: Alexey Dokuchaev To: Dimitry Andric Cc: svn-src-head , svn-src-all , src-committers , Enji Cooper Subject: Re: svn commit: r353937 - in head/share: man/man5 mk Message-ID: <20191029071018.GB32637@FreeBSD.org> References: <201910231702.x9NH2jQv045130@repo.freebsd.org> <2B855247-5097-442D-8D4A-77D68D2F6186@gmail.com> <20191024124910.GA93913@FreeBSD.org> <67F6BDD3-B633-4C85-AE85-9B075FF0E49E@FreeBSD.org> <20191027165934.GA54960@FreeBSD.org> <0938D185-8BF4-45CD-925E-328F03695518@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0938D185-8BF4-45CD-925E-328F03695518@FreeBSD.org> User-Agent: Mutt/1.11.4 (2019-03-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, 29 Oct 2019 07:10:18 -0000 On Tue, Oct 29, 2019 at 08:04:07AM +0100, Dimitry Andric wrote: > On 27 Oct 2019, at 17:59, Alexey Dokuchaev wrote: > > > > On Sat, Oct 26, 2019 at 04:34:14PM +0200, Dimitry Andric wrote: > ... > >> I only tested -j24 on a 32-core system, but I could probably repeat the > >> experiment with lower and higher -j values: [...] > >> > >> So ~2.3% difference in real time, which is not too bad I think. > > > > Well, I'd say it's acceptable. :-/ > > I also tested at low (-j4) and high (-j32) levels. It turns out that at > low -j levels, the difference is less pronounced, just ~1.1% in real > time. And at high -j levels, it is more pronounced, ~4.3% in real time. > > Note also that at high -j levels, the difference in system time seems > to get more influence, e.g. at low -j the difference is ~4.5%, while at > high -j the difference is ~7.2%. I guess it is because dynamic linking > uses more syscalls. Yeah, it would be definitely nice if we could optimize runtime linker. Thanks for conducting these tests by the way, much appreciated, Dimitry! ./danfe From owner-svn-src-all@freebsd.org Tue Oct 29 09:47:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31D801A1D52; Tue, 29 Oct 2019 09:47:17 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472RZY1Jfcz4K69; Tue, 29 Oct 2019 09:47:17 +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 103532015E; Tue, 29 Oct 2019 09:47:17 +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 x9T9lHfL038108; Tue, 29 Oct 2019 09:47:17 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9T9lC5i038086; Tue, 29 Oct 2019 09:47:12 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201910290947.x9T9lC5i038086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 29 Oct 2019 09:47:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354145 - in head/tests/sys/netpfil: common pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head/tests/sys/netpfil: common pf X-SVN-Commit-Revision: 354145 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2019 09:47:17 -0000 Author: kp Date: Tue Oct 29 09:47:12 2019 New Revision: 354145 URL: https://svnweb.freebsd.org/changeset/base/354145 Log: netpfil tests: Add missing copyright & license statements Modified: head/tests/sys/netpfil/common/pft_ping.py head/tests/sys/netpfil/common/sniffer.py head/tests/sys/netpfil/pf/CVE-2019-5597.py head/tests/sys/netpfil/pf/CVE-2019-5598.py head/tests/sys/netpfil/pf/anchor.sh head/tests/sys/netpfil/pf/echo_inetd.conf head/tests/sys/netpfil/pf/forward.sh head/tests/sys/netpfil/pf/fragmentation.sh head/tests/sys/netpfil/pf/icmp.sh head/tests/sys/netpfil/pf/names.sh head/tests/sys/netpfil/pf/nat.sh head/tests/sys/netpfil/pf/pass_block.sh head/tests/sys/netpfil/pf/pfsync.sh head/tests/sys/netpfil/pf/rdr.sh head/tests/sys/netpfil/pf/route_to.sh head/tests/sys/netpfil/pf/set_skip.sh head/tests/sys/netpfil/pf/set_tos.sh head/tests/sys/netpfil/pf/synproxy.sh head/tests/sys/netpfil/pf/utils.subr Modified: head/tests/sys/netpfil/common/pft_ping.py ============================================================================== --- head/tests/sys/netpfil/common/pft_ping.py Tue Oct 29 04:28:24 2019 (r354144) +++ head/tests/sys/netpfil/common/pft_ping.py Tue Oct 29 09:47:12 2019 (r354145) @@ -1,4 +1,30 @@ #!/usr/bin/env python +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2017 Kristof Provost +# +# 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. +# import argparse import scapy.all as sp Modified: head/tests/sys/netpfil/common/sniffer.py ============================================================================== --- head/tests/sys/netpfil/common/sniffer.py Tue Oct 29 04:28:24 2019 (r354144) +++ head/tests/sys/netpfil/common/sniffer.py Tue Oct 29 09:47:12 2019 (r354145) @@ -1,4 +1,30 @@ # $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2017 Kristof Provost +# +# 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. +# import threading import scapy.all as sp Modified: head/tests/sys/netpfil/pf/CVE-2019-5597.py ============================================================================== --- head/tests/sys/netpfil/pf/CVE-2019-5597.py Tue Oct 29 04:28:24 2019 (r354144) +++ head/tests/sys/netpfil/pf/CVE-2019-5597.py Tue Oct 29 09:47:12 2019 (r354145) @@ -1,4 +1,29 @@ #!/usr/bin/env python +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Synacktiv +# +# 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. import random import scapy.all as sp Modified: head/tests/sys/netpfil/pf/CVE-2019-5598.py ============================================================================== --- head/tests/sys/netpfil/pf/CVE-2019-5598.py Tue Oct 29 04:28:24 2019 (r354144) +++ head/tests/sys/netpfil/pf/CVE-2019-5598.py Tue Oct 29 09:47:12 2019 (r354145) @@ -1,4 +1,29 @@ #!/usr/bin/env python +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Kristof Provost +# +# 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. import argparse import scapy.all as sp Modified: head/tests/sys/netpfil/pf/anchor.sh ============================================================================== --- head/tests/sys/netpfil/pf/anchor.sh Tue Oct 29 04:28:24 2019 (r354144) +++ head/tests/sys/netpfil/pf/anchor.sh Tue Oct 29 09:47:12 2019 (r354145) @@ -1,4 +1,29 @@ # $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2018 Kristof Provost +# +# 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. . $(atf_get_srcdir)/utils.subr Modified: head/tests/sys/netpfil/pf/echo_inetd.conf ============================================================================== --- head/tests/sys/netpfil/pf/echo_inetd.conf Tue Oct 29 04:28:24 2019 (r354144) +++ head/tests/sys/netpfil/pf/echo_inetd.conf Tue Oct 29 09:47:12 2019 (r354145) @@ -1,4 +1,29 @@ # $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Kristof Provost +# +# 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. echo stream tcp nowait root internal echo stream tcp6 nowait root internal Modified: head/tests/sys/netpfil/pf/forward.sh ============================================================================== --- head/tests/sys/netpfil/pf/forward.sh Tue Oct 29 04:28:24 2019 (r354144) +++ head/tests/sys/netpfil/pf/forward.sh Tue Oct 29 09:47:12 2019 (r354145) @@ -1,4 +1,29 @@ # $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2017 Kristof Provost +# +# 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. . $(atf_get_srcdir)/utils.subr Modified: head/tests/sys/netpfil/pf/fragmentation.sh ============================================================================== --- head/tests/sys/netpfil/pf/fragmentation.sh Tue Oct 29 04:28:24 2019 (r354144) +++ head/tests/sys/netpfil/pf/fragmentation.sh Tue Oct 29 09:47:12 2019 (r354145) @@ -1,4 +1,29 @@ # $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2017 Kristof Provost +# +# 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. . $(atf_get_srcdir)/utils.subr Modified: head/tests/sys/netpfil/pf/icmp.sh ============================================================================== --- head/tests/sys/netpfil/pf/icmp.sh Tue Oct 29 04:28:24 2019 (r354144) +++ head/tests/sys/netpfil/pf/icmp.sh Tue Oct 29 09:47:12 2019 (r354145) @@ -1,4 +1,29 @@ # $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Kristof Provost +# +# 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. . $(atf_get_srcdir)/utils.subr Modified: head/tests/sys/netpfil/pf/names.sh ============================================================================== --- head/tests/sys/netpfil/pf/names.sh Tue Oct 29 04:28:24 2019 (r354144) +++ head/tests/sys/netpfil/pf/names.sh Tue Oct 29 09:47:12 2019 (r354145) @@ -1,4 +1,29 @@ # $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2018 Kristof Provost +# +# 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. . $(atf_get_srcdir)/utils.subr Modified: head/tests/sys/netpfil/pf/nat.sh ============================================================================== --- head/tests/sys/netpfil/pf/nat.sh Tue Oct 29 04:28:24 2019 (r354144) +++ head/tests/sys/netpfil/pf/nat.sh Tue Oct 29 09:47:12 2019 (r354145) @@ -1,4 +1,29 @@ # $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2018 Kristof Provost +# +# 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. . $(atf_get_srcdir)/utils.subr Modified: head/tests/sys/netpfil/pf/pass_block.sh ============================================================================== --- head/tests/sys/netpfil/pf/pass_block.sh Tue Oct 29 04:28:24 2019 (r354144) +++ head/tests/sys/netpfil/pf/pass_block.sh Tue Oct 29 09:47:12 2019 (r354145) @@ -1,4 +1,29 @@ # $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2018 Kristof Provost +# +# 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. . $(atf_get_srcdir)/utils.subr Modified: head/tests/sys/netpfil/pf/pfsync.sh ============================================================================== --- head/tests/sys/netpfil/pf/pfsync.sh Tue Oct 29 04:28:24 2019 (r354144) +++ head/tests/sys/netpfil/pf/pfsync.sh Tue Oct 29 09:47:12 2019 (r354145) @@ -1,4 +1,29 @@ # $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2018 Orange Business Services +# +# 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. . $(atf_get_srcdir)/utils.subr Modified: head/tests/sys/netpfil/pf/rdr.sh ============================================================================== --- head/tests/sys/netpfil/pf/rdr.sh Tue Oct 29 04:28:24 2019 (r354144) +++ head/tests/sys/netpfil/pf/rdr.sh Tue Oct 29 09:47:12 2019 (r354145) @@ -1,4 +1,29 @@ # $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2018 Kristof Provost +# +# 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. . $(atf_get_srcdir)/utils.subr Modified: head/tests/sys/netpfil/pf/route_to.sh ============================================================================== --- head/tests/sys/netpfil/pf/route_to.sh Tue Oct 29 04:28:24 2019 (r354144) +++ head/tests/sys/netpfil/pf/route_to.sh Tue Oct 29 09:47:12 2019 (r354145) @@ -1,4 +1,29 @@ # $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2018 Kristof Provost +# +# 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. . $(atf_get_srcdir)/utils.subr Modified: head/tests/sys/netpfil/pf/set_skip.sh ============================================================================== --- head/tests/sys/netpfil/pf/set_skip.sh Tue Oct 29 04:28:24 2019 (r354144) +++ head/tests/sys/netpfil/pf/set_skip.sh Tue Oct 29 09:47:12 2019 (r354145) @@ -1,4 +1,29 @@ # $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2018 Kristof Provost +# +# 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. . $(atf_get_srcdir)/utils.subr Modified: head/tests/sys/netpfil/pf/set_tos.sh ============================================================================== --- head/tests/sys/netpfil/pf/set_tos.sh Tue Oct 29 04:28:24 2019 (r354144) +++ head/tests/sys/netpfil/pf/set_tos.sh Tue Oct 29 09:47:12 2019 (r354145) @@ -1,4 +1,29 @@ # $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2017 Kristof Provost +# +# 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. . $(atf_get_srcdir)/utils.subr Modified: head/tests/sys/netpfil/pf/synproxy.sh ============================================================================== --- head/tests/sys/netpfil/pf/synproxy.sh Tue Oct 29 04:28:24 2019 (r354144) +++ head/tests/sys/netpfil/pf/synproxy.sh Tue Oct 29 09:47:12 2019 (r354145) @@ -1,4 +1,29 @@ # $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2018 Kristof Provost +# +# 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. . $(atf_get_srcdir)/utils.subr Modified: head/tests/sys/netpfil/pf/utils.subr ============================================================================== --- head/tests/sys/netpfil/pf/utils.subr Tue Oct 29 04:28:24 2019 (r354144) +++ head/tests/sys/netpfil/pf/utils.subr Tue Oct 29 09:47:12 2019 (r354145) @@ -1,6 +1,30 @@ # $FreeBSD$ # Utility functions ## +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2017 Kristof Provost +# +# 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. . $(atf_get_srcdir)/../../common/vnet.subr From owner-svn-src-all@freebsd.org Tue Oct 29 16:51:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E829915C750; Tue, 29 Oct 2019 16:51:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472czh5sCxz3Hs9; Tue, 29 Oct 2019 16:51:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9396924E04; Tue, 29 Oct 2019 16:51:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9TGpCTs089283; Tue, 29 Oct 2019 16:51:12 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9TGpC2b089282; Tue, 29 Oct 2019 16:51:12 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201910291651.x9TGpC2b089282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 29 Oct 2019 16:51:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354146 - head/contrib/llvm/lib/TableGen X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/lib/TableGen X-SVN-Commit-Revision: 354146 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2019 16:51:13 -0000 Author: dim Date: Tue Oct 29 16:51:12 2019 New Revision: 354146 URL: https://svnweb.freebsd.org/changeset/base/354146 Log: Pull in r373338 from upstream llvm trunk (by Simon Pilgrim): Revert rL349624 : Let TableGen write output only if it changed, instead of doing so in cmake, attempt 2 Differential Revision: https://reviews.llvm.org/D55842 ----------------- As discussed on PR43385 this is causing Visual Studio msbuilds to perpetually rebuild all tablegen generated files Pull in r373664 from upstream llvm trunk (by Nico Weber): Reland r349624: Let TableGen write output only if it changed, instead of doing so in cmake Move the write-if-changed logic behind a flag and don't pass it with the MSVC generator. msbuild doesn't have a restat optimization, so not doing write-if-change there doesn't have a cost, and it should fix whatever causes PR43385. This should fix the scenario where an incremental build from before r353358 (the clang 9.0.0 upgrade) to r353358 or later fails to update the timestamp of the generated lib/clang/headers/arm_fp16.h header. After such a build, installing world from read-only source and object directories would attempt to generate the header again, leading to "clang-tblgen: error opening arm_fp16.h.d:Read-only file system". Reported by: avg, np PR: 241402 MFC after: 1 month X-MFC-With: r353358 Modified: head/contrib/llvm/lib/TableGen/Main.cpp Modified: head/contrib/llvm/lib/TableGen/Main.cpp ============================================================================== --- head/contrib/llvm/lib/TableGen/Main.cpp Tue Oct 29 09:47:12 2019 (r354145) +++ head/contrib/llvm/lib/TableGen/Main.cpp Tue Oct 29 16:51:12 2019 (r354146) @@ -49,6 +49,9 @@ static cl::list MacroNames("D", cl::desc("Name of the macro to be defined"), cl::value_desc("macro name"), cl::Prefix); +static cl::opt +WriteIfChanged("write-if-changed", cl::desc("Only write output if it changed")); + static int reportError(const char *ProgName, Twine Msg) { errs() << ProgName << ": " << Msg; errs().flush(); @@ -114,12 +117,14 @@ int llvm::TableGenMain(char *argv0, TableGenMainFn *Ma return Ret; } - // Only updates the real output file if there are any differences. - // This prevents recompilation of all the files depending on it if there - // aren't any. - if (auto ExistingOrErr = MemoryBuffer::getFile(OutputFilename)) - if (std::move(ExistingOrErr.get())->getBuffer() == Out.str()) - return 0; + if (WriteIfChanged) { + // Only updates the real output file if there are any differences. + // This prevents recompilation of all the files depending on it if there + // aren't any. + if (auto ExistingOrErr = MemoryBuffer::getFile(OutputFilename)) + if (std::move(ExistingOrErr.get())->getBuffer() == Out.str()) + return 0; + } std::error_code EC; ToolOutputFile OutFile(OutputFilename, EC, sys::fs::F_Text); From owner-svn-src-all@freebsd.org Tue Oct 29 17:19:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D9F715DC38; Tue, 29 Oct 2019 17:19:37 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472dcS752Qz3Kjc; Tue, 29 Oct 2019 17:19:36 +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 D28C225232; Tue, 29 Oct 2019 17:19:36 +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 x9THJatW006901; Tue, 29 Oct 2019 17:19:36 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9THJaIf006900; Tue, 29 Oct 2019 17:19:36 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201910291719.x9THJaIf006900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 29 Oct 2019 17:19:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354147 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 354147 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2019 17:19:37 -0000 Author: glebius Date: Tue Oct 29 17:19:36 2019 New Revision: 354147 URL: https://svnweb.freebsd.org/changeset/base/354147 Log: Augment macros that manipulate td_no_sleeping with assertions to check underleak and overflow of the counter. Reviewed by: kib Modified: head/sys/sys/proc.h Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Tue Oct 29 16:51:12 2019 (r354146) +++ head/sys/sys/proc.h Tue Oct 29 17:19:36 2019 (r354147) @@ -246,8 +246,7 @@ struct thread { u_char td_lend_user_pri; /* (t) Lend user pri. */ /* Cleared during fork1() */ -#define td_startzero td_epochnest - u_char td_epochnest; /* (k) Epoch nest counter. */ +#define td_startzero td_flags int td_flags; /* (t) TDF_* flags. */ int td_inhibitors; /* (t) Why can not run. */ int td_pflags; /* (k) Private thread (TDP_*) flags. */ @@ -299,7 +298,7 @@ struct thread { struct vm_map_entry *td_map_def_user; /* (k) Deferred entries. */ pid_t td_dbg_forked; /* (c) Child pid for debugger. */ u_int td_vp_reserv; /* (k) Count of reserved vnodes. */ - int td_no_sleeping; /* (k) Sleeping disabled count. */ + u_int td_no_sleeping; /* (k) Sleeping disabled count. */ void *td_su; /* (k) FFS SU private */ sbintime_t td_sleeptimo; /* (t) Sleep timeout. */ int td_rtcgen; /* (s) rtc_generation of abs. sleep */ @@ -948,9 +947,15 @@ extern pid_t pid_max; #define thread_safetoswapout(td) ((td)->td_flags & TDF_CANSWAP) /* Control whether or not it is safe for curthread to sleep. */ -#define THREAD_NO_SLEEPING() ((curthread)->td_no_sleeping++) +#define THREAD_NO_SLEEPING() do { \ + curthread->td_no_sleeping++; \ + MPASS(curthread->td_no_sleeping > 0); \ +} while (0) -#define THREAD_SLEEPING_OK() ((curthread)->td_no_sleeping--) +#define THREAD_SLEEPING_OK() do { \ + MPASS(curthread->td_no_sleeping > 0); \ + curthread->td_no_sleeping--; \ +} while (0) #define THREAD_CAN_SLEEP() ((curthread)->td_no_sleeping == 0) From owner-svn-src-all@freebsd.org Tue Oct 29 17:28:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 64CDB15E18D; Tue, 29 Oct 2019 17:28:27 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472dpg22NXz3L8v; Tue, 29 Oct 2019 17:28:27 +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 2600B253F0; Tue, 29 Oct 2019 17:28:27 +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 x9THSR5J012455; Tue, 29 Oct 2019 17:28:27 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9THSPYL012449; Tue, 29 Oct 2019 17:28:25 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201910291728.x9THSPYL012449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 29 Oct 2019 17:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354148 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 354148 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2019 17:28:27 -0000 Author: glebius Date: Tue Oct 29 17:28:25 2019 New Revision: 354148 URL: https://svnweb.freebsd.org/changeset/base/354148 Log: Merge td_epochnest with td_no_sleeping. Epoch itself doesn't rely on the counter and it is provided merely for sleeping subsystems to check it. - In functions that sleep use THREAD_CAN_SLEEP() to assert correctness. With EPOCH_TRACE compiled print epoch info. - _sleep() was a wrong place to put the assertion for epoch, right place is sleepq_add(), as there ways to call the latter bypassing _sleep(). - Do not increase td_no_sleeping in non-preemptible epochs. The critical section would trigger all possible safeguards, no sleeping counter is extraneous. Reviewed by: kib Modified: head/sys/kern/genoffset.c head/sys/kern/kern_malloc.c head/sys/kern/kern_synch.c head/sys/kern/subr_epoch.c head/sys/kern/subr_sleepqueue.c head/sys/kern/subr_trap.c Modified: head/sys/kern/genoffset.c ============================================================================== --- head/sys/kern/genoffset.c Tue Oct 29 17:19:36 2019 (r354147) +++ head/sys/kern/genoffset.c Tue Oct 29 17:28:25 2019 (r354148) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include OFFSYM(td_priority, thread, u_char); -OFFSYM(td_epochnest, thread, u_char); OFFSYM(td_critnest, thread, u_int); OFFSYM(td_pinned, thread, int); OFFSYM(td_owepreempt, thread, u_char); Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Tue Oct 29 17:19:36 2019 (r354147) +++ head/sys/kern/kern_malloc.c Tue Oct 29 17:28:25 2019 (r354148) @@ -523,12 +523,13 @@ malloc_dbg(caddr_t *vap, size_t *sizep, struct malloc_ if (flags & M_WAITOK) { KASSERT(curthread->td_intr_nesting_level == 0, ("malloc(M_WAITOK) in interrupt context")); + if (__predict_false(!THREAD_CAN_SLEEP())) { #ifdef EPOCH_TRACE - if (__predict_false(curthread->td_epochnest > 0)) epoch_trace_list(curthread); #endif - KASSERT(curthread->td_epochnest == 0, - ("malloc(M_WAITOK) in epoch context")); + KASSERT(1, + ("malloc(M_WAITOK) with sleeping prohibited")); + } } KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(), ("malloc: called with spinlock or critical section held")); Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Tue Oct 29 17:19:36 2019 (r354147) +++ head/sys/kern/kern_synch.c Tue Oct 29 17:28:25 2019 (r354148) @@ -151,11 +151,6 @@ _sleep(void *ident, struct lock_object *lock, int prio ("sleeping without a lock")); KASSERT(ident != NULL, ("_sleep: NULL ident")); KASSERT(TD_IS_RUNNING(td), ("_sleep: curthread not running")); -#ifdef EPOCH_TRACE - if (__predict_false(curthread->td_epochnest > 0)) - epoch_trace_list(curthread); -#endif - KASSERT(td->td_epochnest == 0, ("sleeping in an epoch section")); if (priority & PDROP) KASSERT(lock != NULL && lock != &Giant.lock_object, ("PDROP requires a non-Giant lock")); Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Tue Oct 29 17:19:36 2019 (r354147) +++ head/sys/kern/subr_epoch.c Tue Oct 29 17:28:25 2019 (r354148) @@ -377,7 +377,7 @@ _epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et epoch_trace_enter(td, epoch, et, file, line); #endif et->et_td = td; - td->td_epochnest++; + THREAD_NO_SLEEPING(); critical_enter(); sched_pin(); td->td_pre_epoch_prio = td->td_priority; @@ -390,13 +390,10 @@ _epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et void epoch_enter(epoch_t epoch) { - struct thread *td; epoch_record_t er; MPASS(cold || epoch != NULL); INIT_CHECK(epoch); - td = curthread; - td->td_epochnest++; critical_enter(); er = epoch_currecord(epoch); ck_epoch_begin(&er->er_record, NULL); @@ -412,8 +409,7 @@ _epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et td = curthread; critical_enter(); sched_unpin(); - MPASS(td->td_epochnest); - td->td_epochnest--; + THREAD_SLEEPING_OK(); er = epoch_currecord(epoch); MPASS(epoch->e_flags & EPOCH_PREEMPT); MPASS(et != NULL); @@ -435,13 +431,9 @@ _epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et void epoch_exit(epoch_t epoch) { - struct thread *td; epoch_record_t er; INIT_CHECK(epoch); - td = curthread; - MPASS(td->td_epochnest); - td->td_epochnest--; er = epoch_currecord(epoch); ck_epoch_end(&er->er_record, NULL); critical_exit(); @@ -740,7 +732,7 @@ in_epoch_verbose(epoch_t epoch, int dump_onfail) epoch_record_t er; td = curthread; - if (td->td_epochnest == 0) + if (THREAD_CAN_SLEEP()) return (0); if (__predict_false((epoch) == NULL)) return (0); Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Tue Oct 29 17:19:36 2019 (r354147) +++ head/sys/kern/subr_sleepqueue.c Tue Oct 29 17:28:25 2019 (r354148) @@ -80,6 +80,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef EPOCH_TRACE +#include +#endif #include @@ -315,9 +318,14 @@ sleepq_add(void *wchan, struct lock_object *lock, cons MPASS((queue >= 0) && (queue < NR_SLEEPQS)); /* If this thread is not allowed to sleep, die a horrible death. */ - KASSERT(THREAD_CAN_SLEEP(), - ("%s: td %p to sleep on wchan %p with sleeping prohibited", - __func__, td, wchan)); + if (__predict_false(!THREAD_CAN_SLEEP())) { +#ifdef EPOCH_TRACE + epoch_trace_list(curthread); +#endif + KASSERT(1, + ("%s: td %p to sleep on wchan %p with sleeping prohibited", + __func__, td, wchan)); + } /* Look up the sleep queue associated with the wait channel 'wchan'. */ sq = sleepq_lookup(wchan); Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Tue Oct 29 17:19:36 2019 (r354147) +++ head/sys/kern/subr_trap.c Tue Oct 29 17:28:25 2019 (r354148) @@ -166,12 +166,6 @@ userret(struct thread *td, struct trapframe *frame) WITNESS_WARN(WARN_PANIC, NULL, "userret: returning"); KASSERT(td->td_critnest == 0, ("userret: Returning in a critical section")); -#ifdef EPOCH_TRACE - if (__predict_false(curthread->td_epochnest > 0)) - epoch_trace_list(curthread); -#endif - KASSERT(td->td_epochnest == 0, - ("userret: Returning in an epoch section")); KASSERT(td->td_locks == 0, ("userret: Returning with %d locks held", td->td_locks)); KASSERT(td->td_rw_rlocks == 0, @@ -185,8 +179,12 @@ userret(struct thread *td, struct trapframe *frame) td->td_lk_slocks)); KASSERT((td->td_pflags & TDP_NOFAULTING) == 0, ("userret: Returning with pagefaults disabled")); - KASSERT(THREAD_CAN_SLEEP(), - ("userret: Returning with sleep disabled")); + if (__predict_false(!THREAD_CAN_SLEEP())) { +#ifdef EPOCH_TRACE + epoch_trace_list(curthread); +#endif + KASSERT(1, ("userret: Returning with sleep disabled")); + } KASSERT(td->td_pinned == 0 || (td->td_pflags & TDP_CALLCHAIN) != 0, ("userret: Returning with with pinned thread")); KASSERT(td->td_vp_reserv == 0, From owner-svn-src-all@freebsd.org Tue Oct 29 17:36:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1275415E781; Tue, 29 Oct 2019 17:36:07 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472dzV6kxSz3Lgs; Tue, 29 Oct 2019 17:36:06 +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 CBEA4255B5; Tue, 29 Oct 2019 17:36:06 +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 x9THa6x4018032; Tue, 29 Oct 2019 17:36:06 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9THa6Gd018030; Tue, 29 Oct 2019 17:36:06 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201910291736.x9THa6Gd018030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 29 Oct 2019 17:36:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354149 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 354149 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2019 17:36:07 -0000 Author: glebius Date: Tue Oct 29 17:36:06 2019 New Revision: 354149 URL: https://svnweb.freebsd.org/changeset/base/354149 Log: There is a long standing problem with multicast programming for NICs and IPv6. With IPv6 we may call if_addmulti() in context of processing of an incoming packet. Usually this is interrupt context. While most of the NIC drivers are able to reprogram multicast filters without sleeping, some of them can't. An example is e1000 family of drivers. With iflib conversion the problem was somewhat hidden. Iflib processes packets in private taskqueue, so going to sleep doesn't trigger an assertion. However, the sleep would block operation of the driver and following incoming packets would fill the ring and eventually would start being dropped. Enabling epoch for the full time of a packet processing again started to trigger assertions for e1000. Fix this problem once and for all using a general taskqueue to call if_ioctl() method in all cases when if_addmulti() is called in a non sleeping context. Note that nobody cares about returned value. Reviewed by: hselasky, kib Differential Revision: https://reviews.freebsd.org/D22154 Modified: head/sys/net/if.c head/sys/net/if_var.h Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Oct 29 17:28:25 2019 (r354148) +++ head/sys/net/if.c Tue Oct 29 17:36:06 2019 (r354149) @@ -271,6 +271,7 @@ static int if_getgroupmembers(struct ifgroupreq *); static void if_delgroups(struct ifnet *); static void if_attach_internal(struct ifnet *, int, struct if_clone *); static int if_detach_internal(struct ifnet *, int, struct if_clone **); +static void if_siocaddmulti(void *, int); #ifdef VIMAGE static void if_vmove(struct ifnet *, struct vnet *); #endif @@ -556,6 +557,7 @@ if_alloc_domain(u_char type, int numa_domain) IF_ADDR_LOCK_INIT(ifp); TASK_INIT(&ifp->if_linktask, 0, do_link_state_change, ifp); + TASK_INIT(&ifp->if_addmultitask, 0, if_siocaddmulti, ifp); ifp->if_afdata_initialized = 0; IF_AFDATA_LOCK_INIT(ifp); CK_STAILQ_INIT(&ifp->if_addrhead); @@ -1131,6 +1133,7 @@ if_detach_internal(struct ifnet *ifp, int vmove, struc if_delgroups(ifp); taskqueue_drain(taskqueue_swi, &ifp->if_linktask); + taskqueue_drain(taskqueue_swi, &ifp->if_addmultitask); /* * Check if this is a cloned interface or not. Must do even if @@ -3538,7 +3541,10 @@ if_addmulti(struct ifnet *ifp, struct sockaddr *sa, * interface to let them know about it. */ if (ifp->if_ioctl != NULL) { - (void) (*ifp->if_ioctl)(ifp, SIOCADDMULTI, 0); + if (THREAD_CAN_SLEEP()) + (void )(*ifp->if_ioctl)(ifp, SIOCADDMULTI, 0); + else + taskqueue_enqueue(taskqueue_swi, &ifp->if_addmultitask); } if ((llsa != NULL) && (llsa != (struct sockaddr *)&sdl)) @@ -3553,6 +3559,19 @@ free_llsa_out: unlock_out: IF_ADDR_WUNLOCK(ifp); return (error); +} + +static void +if_siocaddmulti(void *arg, int pending) +{ + struct ifnet *ifp; + + ifp = arg; +#ifdef DIAGNOSTIC + if (pending > 1) + if_printf(ifp, "%d SIOCADDMULTI coalesced\n", pending); +#endif + (void )(*ifp->if_ioctl)(ifp, SIOCADDMULTI, 0); } /* Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Tue Oct 29 17:28:25 2019 (r354148) +++ head/sys/net/if_var.h Tue Oct 29 17:36:06 2019 (r354149) @@ -317,6 +317,7 @@ struct ifnet { struct ifaltq if_snd; /* output queue (includes altq) */ struct task if_linktask; /* task for link change events */ + struct task if_addmultitask; /* task for SIOCADDMULTI */ /* Addresses of different protocol families assigned to this if. */ struct mtx if_addr_lock; /* lock to protect address lists */ From owner-svn-src-all@freebsd.org Tue Oct 29 18:06:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C463615F341; Tue, 29 Oct 2019 18:06:00 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472ff04qwfz3NDC; Tue, 29 Oct 2019 18:06:00 +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 8944225B79; Tue, 29 Oct 2019 18:06:00 +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 x9TI60Jh035838; Tue, 29 Oct 2019 18:06:00 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9TI60qC035837; Tue, 29 Oct 2019 18:06:00 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201910291806.x9TI60qC035837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 29 Oct 2019 18:06: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: r354150 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 354150 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2019 18:06:00 -0000 Author: jkim Date: Tue Oct 29 18:06:00 2019 New Revision: 354150 URL: https://svnweb.freebsd.org/changeset/base/354150 Log: MFC: r353907 Belatedly remove stale debug symbols. Modified: stable/12/ObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Tue Oct 29 17:36:06 2019 (r354149) +++ stable/12/ObsoleteFiles.inc Tue Oct 29 18:06:00 2019 (r354150) @@ -516,6 +516,16 @@ OLD_FILES+=usr/include/openssl/kssl.h OLD_FILES+=usr/include/openssl/pqueue.h OLD_FILES+=usr/include/openssl/ssl23.h OLD_FILES+=usr/include/openssl/ui_compat.h +OLD_FILES+=usr/lib/debug/usr/lib/engines/lib4758cca.so.debug +OLD_FILES+=usr/lib/debug/usr/lib/engines/libaep.so.debug +OLD_FILES+=usr/lib/debug/usr/lib/engines/libatalla.so.debug +OLD_FILES+=usr/lib/debug/usr/lib/engines/libcapi.so.debug +OLD_FILES+=usr/lib/debug/usr/lib/engines/libchil.so.debug +OLD_FILES+=usr/lib/debug/usr/lib/engines/libcswift.so.debug +OLD_FILES+=usr/lib/debug/usr/lib/engines/libgost.so.debug +OLD_FILES+=usr/lib/debug/usr/lib/engines/libnuron.so.debug +OLD_FILES+=usr/lib/debug/usr/lib/engines/libsureware.so.debug +OLD_FILES+=usr/lib/debug/usr/lib/engines/libubsec.so.debug OLD_FILES+=usr/share/openssl/man/man1/dss1.1.gz OLD_FILES+=usr/share/openssl/man/man1/md2.1.gz OLD_FILES+=usr/share/openssl/man/man1/md4.1.gz From owner-svn-src-all@freebsd.org Tue Oct 29 18:24:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5AE08160284; Tue, 29 Oct 2019 18:24:37 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472g3T1Qtrz3Pn3; Tue, 29 Oct 2019 18:24:37 +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 142AD25F1D; Tue, 29 Oct 2019 18:24:37 +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 x9TIOaZp047899; Tue, 29 Oct 2019 18:24:36 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9TIOagq047897; Tue, 29 Oct 2019 18:24:36 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201910291824.x9TIOagq047897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 29 Oct 2019 18:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354151 - in head: contrib/netbsd-tests/lib/libexecinfo lib/libexecinfo/tests X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: contrib/netbsd-tests/lib/libexecinfo lib/libexecinfo/tests X-SVN-Commit-Revision: 354151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2019 18:24:37 -0000 Author: cem Date: Tue Oct 29 18:24:36 2019 New Revision: 354151 URL: https://svnweb.freebsd.org/changeset/base/354151 Log: libexecinfo test: Don't strip installed test It turns out that a test of backtrace symbol resolution and formatting requires symbols. Another option mightt be building with -rdynamic instead, but this works for now. Re-enabled skipped CI test, as it should now pass. PR: 241562 Submitted by: lwhsu Reported by: lwhsu X-MFC-With: r354126, r354135, r354144 Modified: head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c head/lib/libexecinfo/tests/Makefile Modified: head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c ============================================================================== --- head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Tue Oct 29 18:06:00 2019 (r354150) +++ head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Tue Oct 29 18:24:36 2019 (r354151) @@ -151,9 +151,6 @@ ATF_TC_HEAD(backtrace_fmt_basic, tc) ATF_TC_BODY(backtrace_fmt_basic, tc) { - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/241562"); - myfunc(12); if (prevent_inline) Modified: head/lib/libexecinfo/tests/Makefile ============================================================================== --- head/lib/libexecinfo/tests/Makefile Tue Oct 29 18:06:00 2019 (r354150) +++ head/lib/libexecinfo/tests/Makefile Tue Oct 29 18:24:36 2019 (r354151) @@ -6,6 +6,12 @@ TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libexecinf .include +# Perhaps not surprisingly, the backtrace symbol test needs symbols. Leave +# them in: +STRIP= +# It could probably be made to work without symbols by checking pointer values +# instead, but part of the tested functionality is the symbol resolution logic, +# so that doesn't seem useful. NETBSD_ATF_TESTS_C+= backtrace_test LIBADD.backtrace_test+= execinfo From owner-svn-src-all@freebsd.org Tue Oct 29 18:36:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8E38160A16; Tue, 29 Oct 2019 18:36:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472gJw5q4lz3Qb4; Tue, 29 Oct 2019 18:36:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC2A9260E7; Tue, 29 Oct 2019 18:36:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9TIaGgG053904; Tue, 29 Oct 2019 18:36:16 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9TIaGw4053903; Tue, 29 Oct 2019 18:36:16 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201910291836.x9TIaGw4053903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 29 Oct 2019 18:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354152 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 354152 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2019 18:36:17 -0000 Author: manu Date: Tue Oct 29 18:36:16 2019 New Revision: 354152 URL: https://svnweb.freebsd.org/changeset/base/354152 Log: arm64: rockchip: typec_phy: Rename timeout to retry Declare retry in the function scope. Rename it to retry as there is a timeout function which was causing to code to compile. Reported by: jhibbits MFC after: 1 month X-MFC-WITH: r354089 Modified: head/sys/arm64/rockchip/rk_typec_phy.c Modified: head/sys/arm64/rockchip/rk_typec_phy.c ============================================================================== --- head/sys/arm64/rockchip/rk_typec_phy.c Tue Oct 29 18:24:36 2019 (r354151) +++ head/sys/arm64/rockchip/rk_typec_phy.c Tue Oct 29 18:36:16 2019 (r354152) @@ -191,7 +191,7 @@ rk_typec_phy_enable(struct phynode *phynode, bool enab device_t dev; intptr_t phy; uint32_t reg; - int err; + int err, retry; dev = phynode_get_device(phynode); phy = phynode_get_id(phynode); @@ -271,13 +271,13 @@ rk_typec_phy_enable(struct phynode *phynode, bool enab hwreset_deassert(sc->rst_uphy); - for (int timeout = 10000; timeout > 0; timeout--) { + for (retry = 10000; retry > 0; retry--) { reg = RK_TYPEC_PHY_READ(sc, PMA_CMN_CTRL1); if (reg & PMA_CMN_CTRL1_READY) break; DELAY(10); } - if (timeout == 0) { + if (retry == 0) { device_printf(sc->dev, "Timeout waiting for PMA\n"); return (ENXIO); } From owner-svn-src-all@freebsd.org Tue Oct 29 19:36:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE3841624EC; Tue, 29 Oct 2019 19:36:22 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472hfG3lZdz3ylc; Tue, 29 Oct 2019 19:36:22 +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 6148926BC6; Tue, 29 Oct 2019 19:36:22 +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 x9TJaM19089565; Tue, 29 Oct 2019 19:36:22 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9TJaMkt089564; Tue, 29 Oct 2019 19:36:22 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910291936.x9TJaMkt089564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 29 Oct 2019 19:36: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: r354153 - in stable: 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Commit-Revision: 354153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2019 19:36:22 -0000 Author: cy Date: Tue Oct 29 19:36:21 2019 New Revision: 354153 URL: https://svnweb.freebsd.org/changeset/base/354153 Log: MFC r352784: Sync with source: Only a role of "ipf" is currently supported as the other documented (and undocumented) roles are #ifdef'd out. The plan is to complete ippool(8) as it is even in its current state a powerful feature/tool. PR: 218433 Modified: stable/12/contrib/ipfilter/man/ippool.8 Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/ipfilter/man/ippool.8 Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/ipfilter/man/ippool.8 ============================================================================== --- stable/12/contrib/ipfilter/man/ippool.8 Tue Oct 29 18:36:16 2019 (r354152) +++ stable/12/contrib/ipfilter/man/ippool.8 Tue Oct 29 19:36:21 2019 (r354153) @@ -96,11 +96,8 @@ retrieving statistical information. .TP .B -o Sets the role with which this pool is to be used. Currently only -.B ipf, -.B auth -and -.B count -are accepted as arguments to this option. +.B ipf +(the default) is accepted as arguments to this option. .TP .B -S Sets the hashing seed to the number specified. Only for use with From owner-svn-src-all@freebsd.org Tue Oct 29 19:36:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 684FA1624E7; Tue, 29 Oct 2019 19:36:22 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472hfG1JD7z3ylb; Tue, 29 Oct 2019 19:36:22 +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 1166126BC5; Tue, 29 Oct 2019 19:36:22 +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 x9TJaLJg089559; Tue, 29 Oct 2019 19:36:21 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9TJaLJW089558; Tue, 29 Oct 2019 19:36:21 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910291936.x9TJaLJW089558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 29 Oct 2019 19:36:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r354153 - in stable: 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Commit-Revision: 354153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2019 19:36:22 -0000 Author: cy Date: Tue Oct 29 19:36:21 2019 New Revision: 354153 URL: https://svnweb.freebsd.org/changeset/base/354153 Log: MFC r352784: Sync with source: Only a role of "ipf" is currently supported as the other documented (and undocumented) roles are #ifdef'd out. The plan is to complete ippool(8) as it is even in its current state a powerful feature/tool. PR: 218433 Modified: stable/11/contrib/ipfilter/man/ippool.8 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/ipfilter/man/ippool.8 Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/ipfilter/man/ippool.8 ============================================================================== --- stable/11/contrib/ipfilter/man/ippool.8 Tue Oct 29 18:36:16 2019 (r354152) +++ stable/11/contrib/ipfilter/man/ippool.8 Tue Oct 29 19:36:21 2019 (r354153) @@ -96,11 +96,8 @@ retrieving statistical information. .TP .B -o Sets the role with which this pool is to be used. Currently only -.B ipf, -.B auth -and -.B count -are accepted as arguments to this option. +.B ipf +(the default) is accepted as arguments to this option. .TP .B -S Sets the hashing seed to the number specified. Only for use with From owner-svn-src-all@freebsd.org Tue Oct 29 20:28:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C47EE16356A; Tue, 29 Oct 2019 20:28:03 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472jnv4Wt3z4234; Tue, 29 Oct 2019 20:28:03 +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 7FF75274EF; Tue, 29 Oct 2019 20:28:03 +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 x9TKS3iB019089; Tue, 29 Oct 2019 20:28:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9TKS3KN019088; Tue, 29 Oct 2019 20:28:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201910292028.x9TKS3KN019088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 29 Oct 2019 20:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354154 - head/usr.bin/vmstat X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.bin/vmstat X-SVN-Commit-Revision: 354154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2019 20:28:03 -0000 Author: trasz Date: Tue Oct 29 20:28:02 2019 New Revision: 354154 URL: https://svnweb.freebsd.org/changeset/base/354154 Log: Fix column title alignment. MFC after: 2 weeks Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Tue Oct 29 19:36:21 2019 (r354153) +++ head/usr.bin/vmstat/vmstat.c Tue Oct 29 20:28:02 2019 (r354154) @@ -867,11 +867,11 @@ printhdr(int maxid, u_long cpumask) num_shown = MIN(num_selected, maxshowdevs); if (hflag) - xo_emit("{T:procs} {T:memory} {T:/page%*s}", 19, ""); + xo_emit("{T:procs} {T:memory} {T:/page%*s}", 19, ""); else - xo_emit("{T:procs} {T:memory} {T:/page%*s}", 19, ""); + xo_emit("{T:procs} {T:memory} {T:/page%*s}", 19, ""); if (num_shown > 1) - xo_emit(" {T:/disks %*s}", num_shown * 4 - 7, ""); + xo_emit(" {T:/disks %*s}", num_shown * 4 - 7, ""); else if (num_shown == 1) xo_emit(" {T:disks}"); xo_emit(" {T:faults} "); From owner-svn-src-all@freebsd.org Tue Oct 29 20:38:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88E87163C3F; Tue, 29 Oct 2019 20:38:00 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472k1N3BCsz42fw; Tue, 29 Oct 2019 20:38:00 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51C2A276C2; Tue, 29 Oct 2019 20:38:00 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9TKc0Rw025023; Tue, 29 Oct 2019 20:38:00 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9TKbx9c025017; Tue, 29 Oct 2019 20:37:59 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201910292037.x9TKbx9c025017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 29 Oct 2019 20:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354155 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 354155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2019 20:38:00 -0000 Author: jeff Date: Tue Oct 29 20:37:59 2019 New Revision: 354155 URL: https://svnweb.freebsd.org/changeset/base/354155 Log: Drop the object lock in vfs_bio and cluster where it is now safe to do so. Recent changes to busy/valid/dirty have enabled page based synchronization and the object lock is no longer required in many cases. Reviewed by: kib Sponsored by: Netflix, Intel Differential Revision: https://reviews.freebsd.org/D21597 Modified: head/sys/kern/vfs_bio.c head/sys/kern/vfs_cluster.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Tue Oct 29 20:28:02 2019 (r354154) +++ head/sys/kern/vfs_bio.c Tue Oct 29 20:37:59 2019 (r354155) @@ -162,7 +162,7 @@ static void vfs_page_set_valid(struct buf *bp, vm_ooff static void vfs_page_set_validclean(struct buf *bp, vm_ooffset_t off, vm_page_t m); static void vfs_clean_pages_dirty_buf(struct buf *bp); -static void vfs_setdirty_locked_object(struct buf *bp); +static void vfs_setdirty_range(struct buf *bp); static void vfs_vmio_invalidate(struct buf *bp); static void vfs_vmio_truncate(struct buf *bp, int npages); static void vfs_vmio_extend(struct buf *bp, int npages, int size); @@ -955,8 +955,6 @@ vfs_buf_test_cache(struct buf *bp, vm_ooffset_t foff, vm_offset_t size, vm_page_t m) { - VM_OBJECT_ASSERT_LOCKED(m->object); - /* * This function and its results are protected by higher level * synchronization requiring vnode and buf locks to page in and @@ -2865,7 +2863,6 @@ vfs_vmio_iodone(struct buf *bp) bogus = false; iosize = bp->b_bcount - bp->b_resid; - VM_OBJECT_WLOCK(obj); for (i = 0; i < bp->b_npages; i++) { resid = ((foff + PAGE_SIZE) & ~(off_t)PAGE_MASK) - foff; if (resid > iosize) @@ -2876,7 +2873,10 @@ vfs_vmio_iodone(struct buf *bp) */ m = bp->b_pages[i]; if (m == bogus_page) { - bogus = true; + if (bogus == false) { + bogus = true; + VM_OBJECT_RLOCK(obj); + } m = vm_page_lookup(obj, OFF_TO_IDX(foff)); if (m == NULL) panic("biodone: page disappeared!"); @@ -2900,8 +2900,9 @@ vfs_vmio_iodone(struct buf *bp) foff = (foff + PAGE_SIZE) & ~(off_t)PAGE_MASK; iosize -= resid; } + if (bogus) + VM_OBJECT_RUNLOCK(obj); vm_object_pip_wakeupn(obj, bp->b_npages); - VM_OBJECT_WUNLOCK(obj); if (bogus && buf_mapped(bp)) { BUF_CHECK_MAPPED(bp); pmap_qenter(trunc_page((vm_offset_t)bp->b_data), @@ -3029,7 +3030,6 @@ vfs_vmio_extend(struct buf *bp, int desiredpages, int * are not valid for the range covered by the buffer. */ obj = bp->b_bufobj->bo_object; - VM_OBJECT_WLOCK(obj); if (bp->b_npages < desiredpages) { /* * We must allocate system pages since blocking @@ -3041,11 +3041,13 @@ vfs_vmio_extend(struct buf *bp, int desiredpages, int * deadlocks once allocbuf() is called after * pages are vfs_busy_pages(). */ + VM_OBJECT_WLOCK(obj); (void)vm_page_grab_pages(obj, OFF_TO_IDX(bp->b_offset) + bp->b_npages, VM_ALLOC_SYSTEM | VM_ALLOC_IGN_SBUSY | VM_ALLOC_NOBUSY | VM_ALLOC_WIRED, &bp->b_pages[bp->b_npages], desiredpages - bp->b_npages); + VM_OBJECT_WUNLOCK(obj); bp->b_npages = desiredpages; } @@ -3076,7 +3078,6 @@ vfs_vmio_extend(struct buf *bp, int desiredpages, int toff += tinc; tinc = PAGE_SIZE; } - VM_OBJECT_WUNLOCK(obj); /* * Step 3, fixup the KVA pmap. @@ -3656,9 +3657,8 @@ vfs_clean_pages_dirty_buf(struct buf *bp) KASSERT(bp->b_offset != NOOFFSET, ("vfs_clean_pages_dirty_buf: no buffer offset")); - VM_OBJECT_WLOCK(bp->b_bufobj->bo_object); vfs_busy_pages_acquire(bp); - vfs_setdirty_locked_object(bp); + vfs_setdirty_range(bp); for (i = 0; i < bp->b_npages; i++) { noff = (foff + PAGE_SIZE) & ~(off_t)PAGE_MASK; eoff = noff; @@ -3670,69 +3670,57 @@ vfs_clean_pages_dirty_buf(struct buf *bp) foff = noff; } vfs_busy_pages_release(bp); - VM_OBJECT_WUNLOCK(bp->b_bufobj->bo_object); } static void -vfs_setdirty_locked_object(struct buf *bp) +vfs_setdirty_range(struct buf *bp) { - vm_object_t object; + vm_offset_t boffset; + vm_offset_t eoffset; int i; - object = bp->b_bufobj->bo_object; - VM_OBJECT_ASSERT_WLOCKED(object); + /* + * test the pages to see if they have been modified directly + * by users through the VM system. + */ + for (i = 0; i < bp->b_npages; i++) + vm_page_test_dirty(bp->b_pages[i]); /* - * We qualify the scan for modified pages on whether the - * object has been flushed yet. + * Calculate the encompassing dirty range, boffset and eoffset, + * (eoffset - boffset) bytes. */ - if ((object->flags & OBJ_MIGHTBEDIRTY) != 0) { - vm_offset_t boffset; - vm_offset_t eoffset; - /* - * test the pages to see if they have been modified directly - * by users through the VM system. - */ - for (i = 0; i < bp->b_npages; i++) - vm_page_test_dirty(bp->b_pages[i]); + for (i = 0; i < bp->b_npages; i++) { + if (bp->b_pages[i]->dirty) + break; + } + boffset = (i << PAGE_SHIFT) - (bp->b_offset & PAGE_MASK); - /* - * Calculate the encompassing dirty range, boffset and eoffset, - * (eoffset - boffset) bytes. - */ - - for (i = 0; i < bp->b_npages; i++) { - if (bp->b_pages[i]->dirty) - break; + for (i = bp->b_npages - 1; i >= 0; --i) { + if (bp->b_pages[i]->dirty) { + break; } - boffset = (i << PAGE_SHIFT) - (bp->b_offset & PAGE_MASK); + } + eoffset = ((i + 1) << PAGE_SHIFT) - (bp->b_offset & PAGE_MASK); - for (i = bp->b_npages - 1; i >= 0; --i) { - if (bp->b_pages[i]->dirty) { - break; - } - } - eoffset = ((i + 1) << PAGE_SHIFT) - (bp->b_offset & PAGE_MASK); + /* + * Fit it to the buffer. + */ - /* - * Fit it to the buffer. - */ + if (eoffset > bp->b_bcount) + eoffset = bp->b_bcount; - if (eoffset > bp->b_bcount) - eoffset = bp->b_bcount; + /* + * If we have a good dirty range, merge with the existing + * dirty range. + */ - /* - * If we have a good dirty range, merge with the existing - * dirty range. - */ - - if (boffset < eoffset) { - if (bp->b_dirtyoff > boffset) - bp->b_dirtyoff = boffset; - if (bp->b_dirtyend < eoffset) - bp->b_dirtyend = eoffset; - } + if (boffset < eoffset) { + if (bp->b_dirtyoff > boffset) + bp->b_dirtyoff = boffset; + if (bp->b_dirtyend < eoffset) + bp->b_dirtyend = eoffset; } } @@ -4472,16 +4460,21 @@ vfs_unbusy_pages(struct buf *bp) int i; vm_object_t obj; vm_page_t m; + bool bogus; runningbufwakeup(bp); if (!(bp->b_flags & B_VMIO)) return; obj = bp->b_bufobj->bo_object; - VM_OBJECT_WLOCK(obj); + bogus = false; for (i = 0; i < bp->b_npages; i++) { m = bp->b_pages[i]; if (m == bogus_page) { + if (bogus == false) { + bogus = true; + VM_OBJECT_RLOCK(obj); + } m = vm_page_lookup(obj, OFF_TO_IDX(bp->b_offset) + i); if (!m) panic("vfs_unbusy_pages: page missing\n"); @@ -4495,8 +4488,9 @@ vfs_unbusy_pages(struct buf *bp) } vm_page_sunbusy(m); } + if (bogus) + VM_OBJECT_RUNLOCK(obj); vm_object_pip_wakeupn(obj, bp->b_npages); - VM_OBJECT_WUNLOCK(obj); } /* @@ -4573,7 +4567,6 @@ vfs_busy_pages_acquire(struct buf *bp) { int i; - VM_OBJECT_ASSERT_WLOCKED(bp->b_bufobj->bo_object); for (i = 0; i < bp->b_npages; i++) vm_page_busy_acquire(bp->b_pages[i], VM_ALLOC_SBUSY); } @@ -4583,7 +4576,6 @@ vfs_busy_pages_release(struct buf *bp) { int i; - VM_OBJECT_ASSERT_WLOCKED(bp->b_bufobj->bo_object); for (i = 0; i < bp->b_npages; i++) vm_page_sunbusy(bp->b_pages[i]); } @@ -4616,13 +4608,12 @@ vfs_busy_pages(struct buf *bp, int clear_modify) foff = bp->b_offset; KASSERT(bp->b_offset != NOOFFSET, ("vfs_busy_pages: no buffer offset")); - VM_OBJECT_WLOCK(obj); if ((bp->b_flags & B_CLUSTER) == 0) { vm_object_pip_add(obj, bp->b_npages); vfs_busy_pages_acquire(bp); } if (bp->b_bufsize != 0) - vfs_setdirty_locked_object(bp); + vfs_setdirty_range(bp); bogus = false; for (i = 0; i < bp->b_npages; i++) { m = bp->b_pages[i]; @@ -4653,7 +4644,6 @@ vfs_busy_pages(struct buf *bp, int clear_modify) } foff = (foff + PAGE_SIZE) & ~(off_t)PAGE_MASK; } - VM_OBJECT_WUNLOCK(obj); if (bogus && buf_mapped(bp)) { BUF_CHECK_MAPPED(bp); pmap_qenter(trunc_page((vm_offset_t)bp->b_data), @@ -4686,8 +4676,6 @@ vfs_bio_set_valid(struct buf *bp, int base, int size) base += (bp->b_offset & PAGE_MASK); n = PAGE_SIZE - (base & PAGE_MASK); - VM_OBJECT_WLOCK(bp->b_bufobj->bo_object); - /* * Busy may not be strictly necessary here because the pages are * unlikely to be fully valid and the vnode lock will synchronize @@ -4705,7 +4693,6 @@ vfs_bio_set_valid(struct buf *bp, int base, int size) n = PAGE_SIZE; } vfs_busy_pages_release(bp); - VM_OBJECT_WUNLOCK(bp->b_bufobj->bo_object); } /* @@ -4731,22 +4718,7 @@ vfs_bio_clrbuf(struct buf *bp) } bp->b_flags &= ~B_INVAL; bp->b_ioflags &= ~BIO_ERROR; - VM_OBJECT_WLOCK(bp->b_bufobj->bo_object); vfs_busy_pages_acquire(bp); - if ((bp->b_npages == 1) && (bp->b_bufsize < PAGE_SIZE) && - (bp->b_offset & PAGE_MASK) == 0) { - if (bp->b_pages[0] == bogus_page) - goto unlock; - mask = (1 << (bp->b_bufsize / DEV_BSIZE)) - 1; - VM_OBJECT_ASSERT_WLOCKED(bp->b_pages[0]->object); - if ((bp->b_pages[0]->valid & mask) == mask) - goto unlock; - if ((bp->b_pages[0]->valid & mask) == 0) { - pmap_zero_page_area(bp->b_pages[0], 0, bp->b_bufsize); - bp->b_pages[0]->valid |= mask; - goto unlock; - } - } sa = bp->b_offset & PAGE_MASK; slide = 0; for (i = 0; i < bp->b_npages; i++, sa = 0) { @@ -4758,7 +4730,6 @@ vfs_bio_clrbuf(struct buf *bp) continue; j = sa / DEV_BSIZE; mask = ((1 << ((ea - sa) / DEV_BSIZE)) - 1) << j; - VM_OBJECT_ASSERT_WLOCKED(bp->b_pages[i]->object); if ((bp->b_pages[i]->valid & mask) == mask) continue; if ((bp->b_pages[i]->valid & mask) == 0) @@ -4771,11 +4742,10 @@ vfs_bio_clrbuf(struct buf *bp) } } } - bp->b_pages[i]->valid |= mask; + vm_page_set_valid_range(bp->b_pages[i], j * DEV_BSIZE, + roundup2(ea - sa, DEV_BSIZE)); } -unlock: vfs_busy_pages_release(bp); - VM_OBJECT_WUNLOCK(bp->b_bufobj->bo_object); bp->b_resid = 0; } @@ -5186,11 +5156,9 @@ vfs_bio_getpages(struct vnode *vp, vm_page_t *ma, int br_flags = (mp != NULL && (mp->mnt_kern_flag & MNTK_UNMAPPED_BUFS) != 0) ? GB_UNMAPPED : 0; - VM_OBJECT_WLOCK(object); again: for (i = 0; i < count; i++) vm_page_busy_downgrade(ma[i]); - VM_OBJECT_WUNLOCK(object); lbnp = -1; for (i = 0; i < count; i++) { @@ -5249,11 +5217,9 @@ again: vm_page_all_valid(m) || i == count - 1, ("buf %d %p invalid", i, m)); if (i == count - 1 && lpart) { - VM_OBJECT_WLOCK(object); if (!vm_page_none_valid(m) && !vm_page_all_valid(m)) vm_page_zero_invalid(m, TRUE); - VM_OBJECT_WUNLOCK(object); } next_page:; } @@ -5281,9 +5247,9 @@ end_pages: if (!vm_page_all_valid(ma[i])) redo = true; } + VM_OBJECT_WUNLOCK(object); if (redo && error == 0) goto again; - VM_OBJECT_WUNLOCK(object); return (error != 0 ? VM_PAGER_ERROR : VM_PAGER_OK); } Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Tue Oct 29 20:28:02 2019 (r354154) +++ head/sys/kern/vfs_cluster.c Tue Oct 29 20:37:59 2019 (r354155) @@ -417,11 +417,9 @@ cluster_rbuild(struct vnode *vp, u_quad_t filesize, da inc = btodb(size); for (bn = blkno, i = 0; i < run; ++i, bn += inc) { if (i == 0) { - VM_OBJECT_WLOCK(tbp->b_bufobj->bo_object); vm_object_pip_add(tbp->b_bufobj->bo_object, tbp->b_npages); vfs_busy_pages_acquire(tbp); - VM_OBJECT_WUNLOCK(tbp->b_bufobj->bo_object); } else { if ((bp->b_npages * PAGE_SIZE) + round_page(size) > vp->v_mount->mnt_iosize_max) { @@ -458,13 +456,11 @@ cluster_rbuild(struct vnode *vp, u_quad_t filesize, da */ off = tbp->b_offset; tsize = size; - VM_OBJECT_WLOCK(tbp->b_bufobj->bo_object); for (j = 0; tsize > 0; j++) { toff = off & PAGE_MASK; tinc = tsize; if (toff + tinc > PAGE_SIZE) tinc = PAGE_SIZE - toff; - VM_OBJECT_ASSERT_WLOCKED(tbp->b_pages[j]->object); if (vm_page_trysbusy(tbp->b_pages[j]) == 0) break; if ((tbp->b_pages[j]->valid & @@ -482,11 +478,9 @@ clean_sbusy: j); for (k = 0; k < j; k++) vm_page_sunbusy(tbp->b_pages[k]); - VM_OBJECT_WUNLOCK(tbp->b_bufobj->bo_object); bqrelse(tbp); break; } - VM_OBJECT_WUNLOCK(tbp->b_bufobj->bo_object); /* * Set a read-ahead mark as appropriate @@ -506,7 +500,6 @@ clean_sbusy: if (tbp->b_blkno == tbp->b_lblkno) { tbp->b_blkno = bn; } else if (tbp->b_blkno != bn) { - VM_OBJECT_WLOCK(tbp->b_bufobj->bo_object); goto clean_sbusy; } } @@ -517,9 +510,9 @@ clean_sbusy: BUF_KERNPROC(tbp); TAILQ_INSERT_TAIL(&bp->b_cluster.cluster_head, tbp, b_cluster.cluster_entry); - VM_OBJECT_WLOCK(tbp->b_bufobj->bo_object); for (j = 0; j < tbp->b_npages; j += 1) { vm_page_t m; + m = tbp->b_pages[j]; if ((bp->b_npages == 0) || (bp->b_pages[bp->b_npages-1] != m)) { @@ -529,7 +522,7 @@ clean_sbusy: if (vm_page_all_valid(m)) tbp->b_pages[j] = bogus_page; } - VM_OBJECT_WUNLOCK(tbp->b_bufobj->bo_object); + /* * Don't inherit tbp->b_bufsize as it may be larger due to * a non-page-aligned size. Instead just aggregate using @@ -547,13 +540,10 @@ clean_sbusy: * Fully valid pages in the cluster are already good and do not need * to be re-read from disk. Replace the page with bogus_page */ - VM_OBJECT_WLOCK(bp->b_bufobj->bo_object); for (j = 0; j < bp->b_npages; j++) { - VM_OBJECT_ASSERT_WLOCKED(bp->b_pages[j]->object); if (vm_page_all_valid(bp->b_pages[j])) bp->b_pages[j] = bogus_page; } - VM_OBJECT_WUNLOCK(bp->b_bufobj->bo_object); if (bp->b_bufsize > bp->b_kvasize) panic("cluster_rbuild: b_bufsize(%ld) > b_kvasize(%d)\n", bp->b_bufsize, bp->b_kvasize); @@ -988,7 +978,6 @@ cluster_wbuild(struct vnode *vp, long size, daddr_t st if (tbp->b_flags & B_VMIO) { vm_page_t m; - VM_OBJECT_WLOCK(tbp->b_bufobj->bo_object); if (i == 0) { vfs_busy_pages_acquire(tbp); } else { /* if not first buffer */ @@ -998,8 +987,6 @@ cluster_wbuild(struct vnode *vp, long size, daddr_t st for (j--; j >= 0; j--) vm_page_sunbusy( tbp->b_pages[j]); - VM_OBJECT_WUNLOCK( - tbp->b_object); bqrelse(tbp); goto finishcluster; } @@ -1015,7 +1002,6 @@ cluster_wbuild(struct vnode *vp, long size, daddr_t st bp->b_npages++; } } - VM_OBJECT_WUNLOCK(tbp->b_bufobj->bo_object); } bp->b_bcount += size; bp->b_bufsize += size; From owner-svn-src-all@freebsd.org Tue Oct 29 20:46:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1EAA164112; Tue, 29 Oct 2019 20:46:26 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472kC63W8Tz438Y; Tue, 29 Oct 2019 20:46:26 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5732727896; Tue, 29 Oct 2019 20:46:26 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9TKkQA5030973; Tue, 29 Oct 2019 20:46:26 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9TKkQZc030972; Tue, 29 Oct 2019 20:46:26 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201910292046.x9TKkQZc030972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 29 Oct 2019 20:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354156 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 354156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2019 20:46:26 -0000 Author: jeff Date: Tue Oct 29 20:46:25 2019 New Revision: 354156 URL: https://svnweb.freebsd.org/changeset/base/354156 Log: Drop the object lock earlier in fault and don't relock it after pmap_enter(). Recent changes in object and page locking have enabled more lock pushdown. Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D22036 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Tue Oct 29 20:37:59 2019 (r354155) +++ head/sys/vm/vm_fault.c Tue Oct 29 20:46:25 2019 (r354156) @@ -184,11 +184,10 @@ unlock_vp(struct faultstate *fs) } static void -unlock_and_deallocate(struct faultstate *fs) +fault_deallocate(struct faultstate *fs) { vm_object_pip_wakeup(fs->object); - VM_OBJECT_WUNLOCK(fs->object); if (fs->object != fs->first_object) { VM_OBJECT_WLOCK(fs->first_object); vm_page_free(fs->first_m); @@ -202,6 +201,14 @@ unlock_and_deallocate(struct faultstate *fs) } static void +unlock_and_deallocate(struct faultstate *fs) +{ + + VM_OBJECT_WUNLOCK(fs->object); + fault_deallocate(fs); +} + +static void vm_fault_dirty(vm_map_entry_t entry, vm_page_t m, vm_prot_t prot, vm_prot_t fault_type, int fault_flags, bool set_wd) { @@ -1261,10 +1268,12 @@ readrest: fs.object, OFF_TO_IDX( fs.first_object->backing_object_offset)); #endif + VM_OBJECT_WUNLOCK(fs.object); fs.first_m = fs.m; fs.m = NULL; VM_CNT_INC(v_cow_optim); } else { + VM_OBJECT_WUNLOCK(fs.object); /* * Oh, well, lets copy it. */ @@ -1285,7 +1294,6 @@ readrest: * conditional */ vm_object_pip_wakeup(fs.object); - VM_OBJECT_WUNLOCK(fs.object); /* * We only try to prefault read-only mappings to the @@ -1405,7 +1413,6 @@ readrest: vm_fault_prefault(&fs, vaddr, faultcount > 0 ? behind : PFBAK, faultcount > 0 ? ahead : PFFOR, false); - VM_OBJECT_WLOCK(fs.object); /* * If the page is not wired down, then put it where the pageout daemon @@ -1427,7 +1434,7 @@ readrest: /* * Unlock everything, and return */ - unlock_and_deallocate(&fs); + fault_deallocate(&fs); if (hardfault) { VM_CNT_INC(v_io_faults); curthread->td_ru.ru_majflt++; From owner-svn-src-all@freebsd.org Tue Oct 29 20:58:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19631164478; Tue, 29 Oct 2019 20:58:48 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472kTM6vzcz43jl; Tue, 29 Oct 2019 20:58:47 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC47927A5C; Tue, 29 Oct 2019 20:58:47 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9TKwlWS036661; Tue, 29 Oct 2019 20:58:47 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9TKwkvE036657; Tue, 29 Oct 2019 20:58:46 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201910292058.x9TKwkvE036657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 29 Oct 2019 20:58:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354157 - in head/sys: sys vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: sys vm X-SVN-Commit-Revision: 354157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2019 20:58:48 -0000 Author: jeff Date: Tue Oct 29 20:58:46 2019 New Revision: 354157 URL: https://svnweb.freebsd.org/changeset/base/354157 Log: Use atomics and a shared object lock to protect the object reference count. Certain consumers still need to guarantee a stable reference so we can not switch entirely to atomics yet. Exclusive lock holders can still modify and examine the refcount without using the ref api. Reviewed by: kib Tested by: pho Sponsored by: Netflix, Intel Differential Revision: https://reviews.freebsd.org/D21598 Modified: head/sys/sys/refcount.h head/sys/vm/vm_object.c head/sys/vm/vm_object.h head/sys/vm/vnode_pager.c Modified: head/sys/sys/refcount.h ============================================================================== --- head/sys/sys/refcount.h Tue Oct 29 20:46:25 2019 (r354156) +++ head/sys/sys/refcount.h Tue Oct 29 20:58:46 2019 (r354157) @@ -175,4 +175,22 @@ refcount_release_if_not_last(volatile u_int *count) } } +static __inline __result_use_check bool +refcount_release_if_gt(volatile u_int *count, u_int n) +{ + u_int old; + + KASSERT(n > 0, + ("refcount_release_if_gt: Use refcount_release for final ref")); + old = *count; + for (;;) { + if (REFCOUNT_COUNT(old) <= n) + return (false); + if (__predict_false(REFCOUNT_SATURATED(old))) + return (true); + if (atomic_fcmpset_int(count, &old, old - 1)) + return (true); + } +} + #endif /* ! __SYS_REFCOUNT_H__ */ Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Tue Oct 29 20:46:25 2019 (r354156) +++ head/sys/vm/vm_object.c Tue Oct 29 20:58:46 2019 (r354157) @@ -224,8 +224,8 @@ vm_object_zinit(void *mem, int size, int flags) /* These are true for any object that has been freed */ object->type = OBJT_DEAD; - object->ref_count = 0; vm_radix_init(&object->rtree); + refcount_init(&object->ref_count, 0); refcount_init(&object->paging_in_progress, 0); refcount_init(&object->busy, 0); object->resident_page_count = 0; @@ -282,7 +282,7 @@ _vm_object_allocate(objtype_t type, vm_pindex_t size, object->size = size; object->domain.dr_policy = NULL; object->generation = 1; - object->ref_count = 1; + refcount_init(&object->ref_count, 1); object->memattr = VM_MEMATTR_DEFAULT; object->cred = NULL; object->charge = 0; @@ -444,9 +444,9 @@ vm_object_reference(vm_object_t object) { if (object == NULL) return; - VM_OBJECT_WLOCK(object); + VM_OBJECT_RLOCK(object); vm_object_reference_locked(object); - VM_OBJECT_WUNLOCK(object); + VM_OBJECT_RUNLOCK(object); } /* @@ -461,8 +461,8 @@ vm_object_reference_locked(vm_object_t object) { struct vnode *vp; - VM_OBJECT_ASSERT_WLOCKED(object); - object->ref_count++; + VM_OBJECT_ASSERT_LOCKED(object); + refcount_acquire(&object->ref_count); if (object->type == OBJT_VNODE) { vp = object->handle; vref(vp); @@ -477,24 +477,16 @@ vm_object_vndeallocate(vm_object_t object) { struct vnode *vp = (struct vnode *) object->handle; - VM_OBJECT_ASSERT_WLOCKED(object); KASSERT(object->type == OBJT_VNODE, ("vm_object_vndeallocate: not a vnode object")); KASSERT(vp != NULL, ("vm_object_vndeallocate: missing vp")); -#ifdef INVARIANTS - if (object->ref_count == 0) { - vn_printf(vp, "vm_object_vndeallocate "); - panic("vm_object_vndeallocate: bad object reference count"); - } -#endif - if (!umtx_shm_vnobj_persistent && object->ref_count == 1) + if (refcount_release(&object->ref_count) && + !umtx_shm_vnobj_persistent) umtx_shm_object_terminated(object); - object->ref_count--; - + VM_OBJECT_RUNLOCK(object); /* vrele may need the vnode lock. */ - VM_OBJECT_WUNLOCK(object); vrele(vp); } @@ -513,24 +505,32 @@ void vm_object_deallocate(vm_object_t object) { vm_object_t temp; + bool released; while (object != NULL) { - VM_OBJECT_WLOCK(object); + VM_OBJECT_RLOCK(object); if (object->type == OBJT_VNODE) { vm_object_vndeallocate(object); return; } - KASSERT(object->ref_count != 0, - ("vm_object_deallocate: object deallocated too many times: %d", object->type)); - /* * If the reference count goes to 0 we start calling - * vm_object_terminate() on the object chain. - * A ref count of 1 may be a special case depending on the - * shadow count being 0 or 1. + * vm_object_terminate() on the object chain. A ref count + * of 1 may be a special case depending on the shadow count + * being 0 or 1. These cases require a write lock on the + * object. */ - object->ref_count--; + released = refcount_release_if_gt(&object->ref_count, 2); + VM_OBJECT_RUNLOCK(object); + if (released) + return; + + VM_OBJECT_WLOCK(object); + KASSERT(object->ref_count != 0, + ("vm_object_deallocate: object deallocated too many times: %d", object->type)); + + refcount_release(&object->ref_count); if (object->ref_count > 1) { VM_OBJECT_WUNLOCK(object); return; @@ -558,7 +558,7 @@ vm_object_deallocate(vm_object_t object) /* * Avoid a potential deadlock. */ - object->ref_count++; + refcount_acquire(&object->ref_count); VM_OBJECT_WUNLOCK(object); /* * More likely than not the thread @@ -580,7 +580,7 @@ vm_object_deallocate(vm_object_t object) (robject->type == OBJT_DEFAULT || robject->type == OBJT_SWAP)) { - robject->ref_count++; + refcount_acquire(&robject->ref_count); retry: if (REFCOUNT_COUNT(robject->paging_in_progress) > 0) { VM_OBJECT_WUNLOCK(object); @@ -1223,15 +1223,15 @@ vm_object_shadow( * Don't create the new object if the old object isn't shared. */ if (source != NULL) { - VM_OBJECT_WLOCK(source); + VM_OBJECT_RLOCK(source); if (source->ref_count == 1 && source->handle == NULL && (source->type == OBJT_DEFAULT || source->type == OBJT_SWAP)) { - VM_OBJECT_WUNLOCK(source); + VM_OBJECT_RUNLOCK(source); return; } - VM_OBJECT_WUNLOCK(source); + VM_OBJECT_RUNLOCK(source); } /* @@ -1822,7 +1822,7 @@ vm_object_collapse(vm_object_t object) * Drop the reference count on backing_object. Since * its ref_count was at least 2, it will not vanish. */ - backing_object->ref_count--; + refcount_release(&backing_object->ref_count); VM_OBJECT_WUNLOCK(backing_object); counter_u64_add(object_bypasses, 1); } Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Tue Oct 29 20:46:25 2019 (r354156) +++ head/sys/vm/vm_object.h Tue Oct 29 20:58:46 2019 (r354157) @@ -106,7 +106,7 @@ struct vm_object { vm_pindex_t size; /* Object size */ struct domainset_ref domain; /* NUMA policy. */ int generation; /* generation ID */ - int ref_count; /* How many refs?? */ + volatile u_int ref_count; /* How many refs?? */ int shadow_count; /* how many objects that this is a shadow for */ vm_memattr_t memattr; /* default memory attribute for pages */ objtype_t type; /* type of pager */ Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Tue Oct 29 20:46:25 2019 (r354156) +++ head/sys/vm/vnode_pager.c Tue Oct 29 20:58:46 2019 (r354157) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -172,9 +173,9 @@ vnode_create_vobject(struct vnode *vp, off_t isize, st * Dereference the reference we just created. This assumes * that the object is associated with the vp. */ - VM_OBJECT_WLOCK(object); - object->ref_count--; - VM_OBJECT_WUNLOCK(object); + VM_OBJECT_RLOCK(object); + refcount_release(&object->ref_count); + VM_OBJECT_RUNLOCK(object); vrele(vp); KASSERT(vp->v_object != NULL, ("vnode_create_vobject: NULL object")); @@ -285,7 +286,7 @@ retry: KASSERT(object->ref_count == 1, ("leaked ref %p %d", object, object->ref_count)); object->type = OBJT_DEAD; - object->ref_count = 0; + refcount_init(&object->ref_count, 0); VM_OBJECT_WUNLOCK(object); vm_object_destroy(object); goto retry; @@ -294,7 +295,7 @@ retry: VI_UNLOCK(vp); } else { VM_OBJECT_WLOCK(object); - object->ref_count++; + refcount_acquire(&object->ref_count); #if VM_NRESERVLEVEL > 0 vm_object_color(object, 0); #endif From owner-svn-src-all@freebsd.org Tue Oct 29 21:06:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D37D71647C3; Tue, 29 Oct 2019 21:06:37 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472kfP5w1Nz44DL; Tue, 29 Oct 2019 21:06:37 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9085627C1E; Tue, 29 Oct 2019 21:06:37 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9TL6bR4042615; Tue, 29 Oct 2019 21:06:37 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9TL6Zk8042602; Tue, 29 Oct 2019 21:06:35 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201910292106.x9TL6Zk8042602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 29 Oct 2019 21:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354158 - in head/sys: fs/nfsclient fs/nfsserver fs/tmpfs kern ufs/ffs vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: fs/nfsclient fs/nfsserver fs/tmpfs kern ufs/ffs vm X-SVN-Commit-Revision: 354158 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2019 21:06:37 -0000 Author: jeff Date: Tue Oct 29 21:06:34 2019 New Revision: 354158 URL: https://svnweb.freebsd.org/changeset/base/354158 Log: Replace OBJ_MIGHTBEDIRTY with a system using atomics. Remove the TMPFS_DIRTY flag and use the same system. This enables further fault locking improvements by allowing more faults to proceed with a shared lock. Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D22116 Modified: head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vfsops.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/kern/vfs_subr.c head/sys/ufs/ffs/ffs_rawread.c head/sys/vm/vm_fault.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h head/sys/vm/vm_page.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Tue Oct 29 20:58:46 2019 (r354157) +++ head/sys/fs/nfsclient/nfs_clvnops.c Tue Oct 29 21:06:34 2019 (r354158) @@ -715,7 +715,7 @@ nfs_open(struct vop_open_args *ap) */ if (vp->v_writecount <= -1) { if ((obj = vp->v_object) != NULL && - (obj->flags & OBJ_MIGHTBEDIRTY) != 0) { + vm_object_mightbedirty(obj)) { VM_OBJECT_WLOCK(obj); vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); VM_OBJECT_WUNLOCK(obj); Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Tue Oct 29 20:58:46 2019 (r354157) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Tue Oct 29 21:06:34 2019 (r354158) @@ -1498,8 +1498,7 @@ nfsvno_fsync(struct vnode *vp, u_int64_t off, int cnt, /* * Give up and do the whole thing */ - if (vp->v_object && - (vp->v_object->flags & OBJ_MIGHTBEDIRTY)) { + if (vp->v_object && vm_object_mightbedirty(vp->v_object)) { VM_OBJECT_WLOCK(vp->v_object); vm_object_page_clean(vp->v_object, 0, 0, OBJPC_SYNC); VM_OBJECT_WUNLOCK(vp->v_object); @@ -1529,8 +1528,7 @@ nfsvno_fsync(struct vnode *vp, u_int64_t off, int cnt, } lblkno = off / iosize; - if (vp->v_object && - (vp->v_object->flags & OBJ_MIGHTBEDIRTY)) { + if (vp->v_object && vm_object_mightbedirty(vp->v_object)) { VM_OBJECT_WLOCK(vp->v_object); vm_object_page_clean(vp->v_object, off, off + cnt, OBJPC_SYNC); Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Tue Oct 29 20:58:46 2019 (r354157) +++ head/sys/fs/tmpfs/tmpfs_subr.c Tue Oct 29 21:06:34 2019 (r354158) @@ -1477,10 +1477,10 @@ tmpfs_check_mtime(struct vnode *vp) KASSERT((obj->flags & (OBJ_TMPFS_NODE | OBJ_TMPFS)) == (OBJ_TMPFS_NODE | OBJ_TMPFS), ("non-tmpfs obj")); /* unlocked read */ - if ((obj->flags & OBJ_TMPFS_DIRTY) != 0) { + if (obj->generation != obj->cleangeneration) { VM_OBJECT_WLOCK(obj); - if ((obj->flags & OBJ_TMPFS_DIRTY) != 0) { - obj->flags &= ~OBJ_TMPFS_DIRTY; + if (obj->generation != obj->cleangeneration) { + obj->cleangeneration = obj->generation; node = VP_TO_TMPFS_NODE(vp); node->tn_status |= TMPFS_NODE_MODIFIED | TMPFS_NODE_CHANGED; Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Tue Oct 29 20:58:46 2019 (r354157) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Tue Oct 29 21:06:34 2019 (r354158) @@ -172,7 +172,7 @@ tmpfs_update_mtime(struct mount *mp, bool lazy) * For non-lazy case, we must flush all pending * metadata changes now. */ - if (!lazy || (obj->flags & OBJ_TMPFS_DIRTY) != 0) { + if (!lazy || obj->generation != obj->cleangeneration) { if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, curthread) != 0) continue; Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Tue Oct 29 20:58:46 2019 (r354157) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Tue Oct 29 21:06:34 2019 (r354158) @@ -1323,7 +1323,7 @@ tmpfs_need_inactive(struct vop_need_inactive_args *ap) goto need; if (vp->v_type == VREG) { obj = vp->v_object; - if ((obj->flags & OBJ_TMPFS_DIRTY) != 0) + if (obj->generation != obj->cleangeneration) goto need; } return (0); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Oct 29 20:58:46 2019 (r354157) +++ head/sys/kern/vfs_subr.c Tue Oct 29 21:06:34 2019 (r354158) @@ -3346,7 +3346,7 @@ vinactive(struct vnode *vp, struct thread *td) * pending I/O and dirty pages in the object. */ if ((obj = vp->v_object) != NULL && (vp->v_vflag & VV_NOSYNC) == 0 && - (obj->flags & OBJ_MIGHTBEDIRTY) != 0) { + vm_object_mightbedirty(obj)) { VM_OBJECT_WLOCK(obj); vm_object_page_clean(obj, 0, 0, 0); VM_OBJECT_WUNLOCK(obj); @@ -4406,7 +4406,7 @@ vfs_msync(struct mount *mp, int flags) MNT_VNODE_FOREACH_ACTIVE(vp, mp, mvp) { obj = vp->v_object; - if (obj != NULL && (obj->flags & OBJ_MIGHTBEDIRTY) != 0 && + if (obj != NULL && vm_object_mightbedirty(obj) && (flags == MNT_WAIT || VOP_ISLOCKED(vp) == 0)) { if (!vget(vp, LK_EXCLUSIVE | LK_RETRY | LK_INTERLOCK, @@ -4696,7 +4696,7 @@ vn_need_pageq_flush(struct vnode *vp) MPASS(mtx_owned(VI_MTX(vp))); need = 0; if ((obj = vp->v_object) != NULL && (vp->v_vflag & VV_NOSYNC) == 0 && - (obj->flags & OBJ_MIGHTBEDIRTY) != 0) + vm_object_mightbedirty(obj)) need = 1; return (need); } Modified: head/sys/ufs/ffs/ffs_rawread.c ============================================================================== --- head/sys/ufs/ffs/ffs_rawread.c Tue Oct 29 20:58:46 2019 (r354157) +++ head/sys/ufs/ffs/ffs_rawread.c Tue Oct 29 21:06:34 2019 (r354158) @@ -109,7 +109,7 @@ ffs_rawread_sync(struct vnode *vp) if (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0 || ((obj = vp->v_object) != NULL && - (obj->flags & OBJ_MIGHTBEDIRTY) != 0)) { + vm_object_mightbedirty(obj))) { VI_UNLOCK(vp); BO_UNLOCK(bo); @@ -140,7 +140,7 @@ ffs_rawread_sync(struct vnode *vp) } /* Attempt to msync mmap() regions to clean dirty mmap */ if ((obj = vp->v_object) != NULL && - (obj->flags & OBJ_MIGHTBEDIRTY) != 0) { + vm_object_mightbedirty(obj)) { VI_UNLOCK(vp); VM_OBJECT_WLOCK(obj); vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Tue Oct 29 20:58:46 2019 (r354157) +++ head/sys/vm/vm_fault.c Tue Oct 29 21:06:34 2019 (r354158) @@ -210,7 +210,7 @@ unlock_and_deallocate(struct faultstate *fs) static void vm_fault_dirty(vm_map_entry_t entry, vm_page_t m, vm_prot_t prot, - vm_prot_t fault_type, int fault_flags, bool set_wd) + vm_prot_t fault_type, int fault_flags, bool excl) { bool need_dirty; @@ -226,11 +226,11 @@ vm_fault_dirty(vm_map_entry_t entry, vm_page_t m, vm_p (fault_flags & VM_FAULT_WIRE) == 0) || (fault_flags & VM_FAULT_DIRTY) != 0; - if (set_wd) - vm_object_set_writeable_dirty(m->object); - else + vm_object_set_writeable_dirty(m->object); + + if (!excl) /* - * If two callers of vm_fault_dirty() with set_wd == + * If two callers of vm_fault_dirty() with excl == * FALSE, one for the map entry with MAP_ENTRY_NOSYNC * flag set, other with flag clear, race, it is * possible for the no-NOSYNC thread to see m->dirty @@ -267,7 +267,7 @@ vm_fault_dirty(vm_map_entry_t entry, vm_page_t m, vm_p */ if (need_dirty) vm_page_dirty(m); - if (!set_wd) + if (!excl) vm_page_unlock(m); else if (need_dirty) vm_pager_page_unswapped(m); @@ -758,29 +758,17 @@ RetryFault_oom: /* * Try to avoid lock contention on the top-level object through * special-case handling of some types of page faults, specifically, - * those that are both (1) mapping an existing page from the top- - * level object and (2) not having to mark that object as containing - * dirty pages. Under these conditions, a read lock on the top-level - * object suffices, allowing multiple page faults of a similar type to - * run in parallel on the same top-level object. + * those that are mapping an existing page from the top-level object. + * Under this condition, a read lock on the object suffices, allowing + * multiple page faults of a similar type to run in parallel. */ if (fs.vp == NULL /* avoid locked vnode leak */ && - (fault_flags & (VM_FAULT_WIRE | VM_FAULT_DIRTY)) == 0 && - /* avoid calling vm_object_set_writeable_dirty() */ - ((prot & VM_PROT_WRITE) == 0 || - (fs.first_object->type != OBJT_VNODE && - (fs.first_object->flags & OBJ_TMPFS_NODE) == 0) || - (fs.first_object->flags & OBJ_MIGHTBEDIRTY) != 0)) { + (fault_flags & (VM_FAULT_WIRE | VM_FAULT_DIRTY)) == 0) { VM_OBJECT_RLOCK(fs.first_object); - if ((prot & VM_PROT_WRITE) == 0 || - (fs.first_object->type != OBJT_VNODE && - (fs.first_object->flags & OBJ_TMPFS_NODE) == 0) || - (fs.first_object->flags & OBJ_MIGHTBEDIRTY) != 0) { - rv = vm_fault_soft_fast(&fs, vaddr, prot, fault_type, - fault_flags, wired, m_hold); - if (rv == KERN_SUCCESS) - return (rv); - } + rv = vm_fault_soft_fast(&fs, vaddr, prot, fault_type, + fault_flags, wired, m_hold); + if (rv == KERN_SUCCESS) + return (rv); if (!VM_OBJECT_TRYUPGRADE(fs.first_object)) { VM_OBJECT_RUNLOCK(fs.first_object); VM_OBJECT_WLOCK(fs.first_object); Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Tue Oct 29 20:58:46 2019 (r354157) +++ head/sys/vm/vm_object.c Tue Oct 29 21:06:34 2019 (r354158) @@ -112,10 +112,10 @@ SYSCTL_INT(_vm, OID_AUTO, old_msync, CTLFLAG_RW, &old_ "Use old (insecure) msync behavior"); static int vm_object_page_collect_flush(vm_object_t object, vm_page_t p, - int pagerflags, int flags, boolean_t *clearobjflags, + int pagerflags, int flags, boolean_t *allclean, boolean_t *eio); static boolean_t vm_object_page_remove_write(vm_page_t p, int flags, - boolean_t *clearobjflags); + boolean_t *allclean); static void vm_object_qcollapse(vm_object_t object); static void vm_object_vndeallocate(vm_object_t object); @@ -282,6 +282,7 @@ _vm_object_allocate(objtype_t type, vm_pindex_t size, object->size = size; object->domain.dr_policy = NULL; object->generation = 1; + object->cleangeneration = 1; refcount_init(&object->ref_count, 1); object->memattr = VM_MEMATTR_DEFAULT; object->cred = NULL; @@ -769,7 +770,7 @@ vm_object_terminate(vm_object_t object) * page should be flushed, and FALSE otherwise. */ static boolean_t -vm_object_page_remove_write(vm_page_t p, int flags, boolean_t *clearobjflags) +vm_object_page_remove_write(vm_page_t p, int flags, boolean_t *allclean) { vm_page_assert_busied(p); @@ -780,7 +781,7 @@ vm_object_page_remove_write(vm_page_t p, int flags, bo * cleared in this case so we do not have to set them. */ if ((flags & OBJPC_NOSYNC) != 0 && (p->aflags & PGA_NOSYNC) != 0) { - *clearobjflags = FALSE; + *allclean = FALSE; return (FALSE); } else { pmap_remove_write(p); @@ -813,16 +814,11 @@ vm_object_page_clean(vm_object_t object, vm_ooffset_t vm_page_t np, p; vm_pindex_t pi, tend, tstart; int curgeneration, n, pagerflags; - boolean_t clearobjflags, eio, res; + boolean_t eio, res, allclean; VM_OBJECT_ASSERT_WLOCKED(object); - /* - * The OBJ_MIGHTBEDIRTY flag is only set for OBJT_VNODE - * objects. The check below prevents the function from - * operating on non-vnode objects. - */ - if ((object->flags & OBJ_MIGHTBEDIRTY) == 0 || + if (object->type != OBJT_VNODE || !vm_object_mightbedirty(object) || object->resident_page_count == 0) return (TRUE); @@ -832,7 +828,7 @@ vm_object_page_clean(vm_object_t object, vm_ooffset_t tstart = OFF_TO_IDX(start); tend = (end == 0) ? object->size : OFF_TO_IDX(end + PAGE_MASK); - clearobjflags = tstart == 0 && tend >= object->size; + allclean = tstart == 0 && tend >= object->size; res = TRUE; rescan: @@ -846,32 +842,26 @@ rescan: if (vm_page_none_valid(p)) continue; if (vm_page_busy_acquire(p, VM_ALLOC_WAITFAIL) == 0) { - if (object->generation != curgeneration) { - if ((flags & OBJPC_SYNC) != 0) - goto rescan; - else - clearobjflags = FALSE; - } + if (object->generation != curgeneration && + (flags & OBJPC_SYNC) != 0) + goto rescan; np = vm_page_find_least(object, pi); continue; } - if (!vm_object_page_remove_write(p, flags, &clearobjflags)) { + if (!vm_object_page_remove_write(p, flags, &allclean)) { vm_page_xunbusy(p); continue; } n = vm_object_page_collect_flush(object, p, pagerflags, - flags, &clearobjflags, &eio); + flags, &allclean, &eio); if (eio) { res = FALSE; - clearobjflags = FALSE; + allclean = FALSE; } - if (object->generation != curgeneration) { - if ((flags & OBJPC_SYNC) != 0) - goto rescan; - else - clearobjflags = FALSE; - } + if (object->generation != curgeneration && + (flags & OBJPC_SYNC) != 0) + goto rescan; /* * If the VOP_PUTPAGES() did a truncated write, so @@ -887,7 +877,7 @@ rescan: */ if (n == 0) { n = 1; - clearobjflags = FALSE; + allclean = FALSE; } np = vm_page_find_least(object, pi + n); } @@ -895,14 +885,14 @@ rescan: VOP_FSYNC(vp, (pagerflags & VM_PAGER_PUT_SYNC) ? MNT_WAIT : 0); #endif - if (clearobjflags) - vm_object_clear_flag(object, OBJ_MIGHTBEDIRTY); + if (allclean) + object->cleangeneration = curgeneration; return (res); } static int vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int pagerflags, - int flags, boolean_t *clearobjflags, boolean_t *eio) + int flags, boolean_t *allclean, boolean_t *eio) { vm_page_t ma[vm_pageout_page_count], p_first, tp; int count, i, mreq, runlen; @@ -918,7 +908,7 @@ vm_object_page_collect_flush(vm_object_t object, vm_pa tp = vm_page_next(tp); if (tp == NULL || vm_page_tryxbusy(tp) == 0) break; - if (!vm_object_page_remove_write(tp, flags, clearobjflags)) { + if (!vm_object_page_remove_write(tp, flags, allclean)) { vm_page_xunbusy(tp); break; } @@ -928,7 +918,7 @@ vm_object_page_collect_flush(vm_object_t object, vm_pa tp = vm_page_prev(p_first); if (tp == NULL || vm_page_tryxbusy(tp) == 0) break; - if (!vm_object_page_remove_write(tp, flags, clearobjflags)) { + if (!vm_object_page_remove_write(tp, flags, allclean)) { vm_page_xunbusy(tp); break; } @@ -993,7 +983,7 @@ vm_object_sync(vm_object_t object, vm_ooffset_t offset * I/O. */ if (object->type == OBJT_VNODE && - (object->flags & OBJ_MIGHTBEDIRTY) != 0 && + vm_object_mightbedirty(object) != 0 && ((vp = object->handle)->v_vflag & VV_NOSYNC) == 0) { VM_OBJECT_WUNLOCK(object); (void) vn_start_write(vp, &mp, V_WAIT); @@ -2130,18 +2120,13 @@ void vm_object_set_writeable_dirty(vm_object_t object) { - VM_OBJECT_ASSERT_WLOCKED(object); - if (object->type != OBJT_VNODE) { - if ((object->flags & OBJ_TMPFS_NODE) != 0) { - KASSERT(object->type == OBJT_SWAP, ("non-swap tmpfs")); - vm_object_set_flag(object, OBJ_TMPFS_DIRTY); - } + VM_OBJECT_ASSERT_LOCKED(object); + + /* Only set for vnodes & tmpfs */ + if (object->type != OBJT_VNODE && + (object->flags & OBJ_TMPFS_NODE) == 0) return; - } - object->generation++; - if ((object->flags & OBJ_MIGHTBEDIRTY) != 0) - return; - vm_object_set_flag(object, OBJ_MIGHTBEDIRTY); + atomic_add_int(&object->generation, 1); } /* Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Tue Oct 29 20:58:46 2019 (r354157) +++ head/sys/vm/vm_object.h Tue Oct 29 21:06:34 2019 (r354158) @@ -105,7 +105,8 @@ struct vm_object { struct vm_radix rtree; /* root of the resident page radix trie*/ vm_pindex_t size; /* Object size */ struct domainset_ref domain; /* NUMA policy. */ - int generation; /* generation ID */ + volatile int generation; /* generation ID */ + int cleangeneration; /* Generation at clean time */ volatile u_int ref_count; /* How many refs?? */ int shadow_count; /* how many objects that this is a shadow for */ vm_memattr_t memattr; /* default memory attribute for pages */ @@ -188,9 +189,7 @@ struct vm_object { #define OBJ_UMTXDEAD 0x0020 /* umtx pshared was terminated */ #define OBJ_SIZEVNLOCK 0x0040 /* lock vnode to check obj size */ #define OBJ_PG_DTOR 0x0080 /* dont reset object, leave that for dtor */ -#define OBJ_MIGHTBEDIRTY 0x0100 /* object might be dirty, only for vnode */ #define OBJ_TMPFS_NODE 0x0200 /* object belongs to tmpfs VREG node */ -#define OBJ_TMPFS_DIRTY 0x0400 /* dirty tmpfs obj */ #define OBJ_COLORED 0x1000 /* pg_color is defined */ #define OBJ_ONEMAPPING 0x2000 /* One USE (a single, non-forked) mapping flag */ #define OBJ_TMPFS 0x8000 /* has tmpfs vnode allocated */ @@ -307,6 +306,14 @@ vm_object_reserv(vm_object_t object) return (true); } return (false); +} + +static __inline bool +vm_object_mightbedirty(vm_object_t object) +{ + + return (object->type == OBJT_VNODE && + object->generation != object->cleangeneration); } void vm_object_clear_flag(vm_object_t object, u_short bits); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Oct 29 20:58:46 2019 (r354157) +++ head/sys/vm/vm_page.c Tue Oct 29 21:06:34 2019 (r354158) @@ -1521,7 +1521,7 @@ vm_page_insert_radixdone(vm_page_t m, vm_object_t obje /* * Since we are inserting a new and possibly dirty page, - * update the object's OBJ_MIGHTBEDIRTY flag. + * update the object's generation count. */ if (pmap_page_is_write_mapped(m)) vm_object_set_writeable_dirty(object); @@ -1691,7 +1691,8 @@ vm_page_replace(vm_page_t mnew, vm_object_t object, vm /* * The object's resident_page_count does not change because we have - * swapped one page for another, but OBJ_MIGHTBEDIRTY. + * swapped one page for another, but the generation count should + * change if the page is dirty. */ if (pmap_page_is_write_mapped(mnew)) vm_object_set_writeable_dirty(object); From owner-svn-src-all@freebsd.org Tue Oct 29 21:25:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2D90164F28; Tue, 29 Oct 2019 21:25:19 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472l3z4HMCz4595; Tue, 29 Oct 2019 21:25:19 +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 775A527FCF; Tue, 29 Oct 2019 21:25:19 +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 x9TLPJ8i054806; Tue, 29 Oct 2019 21:25:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9TLPJ1g054805; Tue, 29 Oct 2019 21:25:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201910292125.x9TLPJ1g054805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 29 Oct 2019 21:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354159 - head/sys/cddl/contrib/opensolaris/uts/common/zmod X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/zmod X-SVN-Commit-Revision: 354159 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2019 21:25:19 -0000 Author: mav Date: Tue Oct 29 21:25:19 2019 New Revision: 354159 URL: https://svnweb.freebsd.org/changeset/base/354159 Log: FreeBSD'fy ZFS zlib zalloc/zfree callbacks. The previous code came from OpenSolaris, which in my understanding require allocation size to be known to free memory. To store that size previous code allocated additional 8 byte header. But I have noticed that zlib with present settings allocates 64KB context buffers for each call, that could be efficiently cached by UMA, but addition of those 8 bytes makes them fall back to physical RAM allocations, that cause huge overhead and lock congestion on small blocks. Since FreeBSD's free() does not have the size argument, switching to it solves the problem, increasing write speed to ZVOLs with 4KB block size and GZIP compression on my 40-threads test system from ~60MB/s to ~600MB/s. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod.c Tue Oct 29 21:06:34 2019 (r354158) +++ head/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod.c Tue Oct 29 21:25:19 2019 (r354159) @@ -27,45 +27,28 @@ #include #include #include -#include +#include #include #include #include -struct zchdr { - uint_t zch_magic; - uint_t zch_size; -}; - -#define ZCH_MAGIC 0x3cc13cc1 - /*ARGSUSED*/ static void * zfs_zcalloc(void *opaque, uint_t items, uint_t size) { - size_t nbytes = sizeof (struct zchdr) + items * size; - struct zchdr *z = kobj_zalloc(nbytes, KM_NOWAIT|KM_TMP); + void *ptr; - if (z == NULL) - return (NULL); - - z->zch_magic = ZCH_MAGIC; - z->zch_size = nbytes; - - return (z + 1); + ptr = malloc((size_t)items * size, M_SOLARIS, M_NOWAIT); + return ptr; } /*ARGSUSED*/ static void zfs_zcfree(void *opaque, void *ptr) { - struct zchdr *z = ((struct zchdr *)ptr) - 1; - if (z->zch_magic != ZCH_MAGIC) - panic("zcfree region corrupt: hdr=%p ptr=%p", (void *)z, ptr); - - kobj_free(z, z->zch_size); + free(ptr, M_SOLARIS); } /* From owner-svn-src-all@freebsd.org Wed Oct 30 01:24:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F04AA172E11; Wed, 30 Oct 2019 01:24:28 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472rMw62K0z4GWD; Wed, 30 Oct 2019 01:24:28 +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 B35D22B31; Wed, 30 Oct 2019 01:24:28 +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 x9U1OSbq095097; Wed, 30 Oct 2019 01:24:28 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9U1OS6w095095; Wed, 30 Oct 2019 01:24:28 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910300124.x9U1OS6w095095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 30 Oct 2019 01:24:28 +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: r354160 - stable/12/libexec/rc X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/12/libexec/rc X-SVN-Commit-Revision: 354160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 01:24:29 -0000 Author: cy Date: Wed Oct 30 01:24:28 2019 New Revision: 354160 URL: https://svnweb.freebsd.org/changeset/base/354160 Log: MFC r354129: Remove trailing tab. Modified: stable/12/libexec/rc/rc.subr Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.subr ============================================================================== --- stable/12/libexec/rc/rc.subr Tue Oct 29 21:25:19 2019 (r354159) +++ stable/12/libexec/rc/rc.subr Wed Oct 30 01:24:28 2019 (r354160) @@ -1266,7 +1266,7 @@ $command $rc_flags $command_args" ${PROTECT} -p ${pid} ;; esac - fi + fi ;; esac From owner-svn-src-all@freebsd.org Wed Oct 30 01:35:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 093E21734DB; Wed, 30 Oct 2019 01:35:03 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472rc66Zgtz4H1X; Wed, 30 Oct 2019 01:35:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C531D2D08; Wed, 30 Oct 2019 01:35:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9U1Z2Cr001113; Wed, 30 Oct 2019 01:35:02 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9U1Z1lr001102; Wed, 30 Oct 2019 01:35:01 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201910300135.x9U1Z1lr001102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 30 Oct 2019 01:35:01 +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: r354161 - in stable/12: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/12: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Commit-Revision: 354161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 01:35:03 -0000 Author: asomers Date: Wed Oct 30 01:35:00 2019 New Revision: 354161 URL: https://svnweb.freebsd.org/changeset/base/354161 Log: MFC r352404, r352413-r352414 r352404: fusefs: fix some minor issues with fuse_vnode_setparent * When unparenting a vnode, actually clear the flag. AFAIK this is basically a no-op because we only unparent a vnode when reclaiming it or when unlinking. * There's no need to call fuse_vnode_setparent during reclaim, because we're about to free the vnode data anyway. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21630 r352413: fusefs: fix some minor Coverity CIDs in the tests Where open(2) is expected to fail, the tests should assert or expect that its return value is -1. These tests all accepted too much but happened to pass anyway. Reported by: Coverity Coverity CID: 1404512, 1404378, 1404504, 1404483 Sponsored by: The FreeBSD Foundation r352414: fusefs: initialize C++ classes the Coverity way Coverity complained that I wasn't initializing some class members until the SetUp method. Do it in the constructor instead. Reported by: Coverity Coverity CIDs: 1404352, 1404378 Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/fs/fuse/fuse_node.h stable/12/sys/fs/fuse/fuse_vnops.c stable/12/tests/sys/fs/fusefs/create.cc stable/12/tests/sys/fs/fusefs/default_permissions.cc stable/12/tests/sys/fs/fusefs/io.cc stable/12/tests/sys/fs/fusefs/mknod.cc stable/12/tests/sys/fs/fusefs/opendir.cc Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/fuse/fuse_node.h ============================================================================== --- stable/12/sys/fs/fuse/fuse_node.h Wed Oct 30 01:24:28 2019 (r354160) +++ stable/12/sys/fs/fuse/fuse_node.h Wed Oct 30 01:35:00 2019 (r354161) @@ -174,6 +174,8 @@ fuse_vnode_setparent(struct vnode *vp, struct vnode *d MPASS(dvp->v_type == VDIR); VTOFUD(vp)->parent_nid = VTOI(dvp); VTOFUD(vp)->flag |= FN_PARENT_NID; + } else { + VTOFUD(vp)->flag &= ~FN_PARENT_NID; } } Modified: stable/12/sys/fs/fuse/fuse_vnops.c ============================================================================== --- stable/12/sys/fs/fuse/fuse_vnops.c Wed Oct 30 01:24:28 2019 (r354160) +++ stable/12/sys/fs/fuse/fuse_vnops.c Wed Oct 30 01:35:00 2019 (r354161) @@ -1526,11 +1526,10 @@ fuse_vnop_reclaim(struct vop_reclaim_args *ap) fuse_filehandle_close(vp, fufh, td, NULL); } - if ((!fuse_isdeadfs(vp)) && (fvdat->nlookup)) { + if (!fuse_isdeadfs(vp) && fvdat->nlookup > 0) { fuse_internal_forget_send(vnode_mount(vp), td, NULL, VTOI(vp), fvdat->nlookup); } - fuse_vnode_setparent(vp, NULL); cache_purge(vp); vfs_hash_remove(vp); vnode_destroy_vobject(vp); Modified: stable/12/tests/sys/fs/fusefs/create.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/create.cc Wed Oct 30 01:24:28 2019 (r354160) +++ stable/12/tests/sys/fs/fusefs/create.cc Wed Oct 30 01:35:00 2019 (r354161) @@ -204,7 +204,7 @@ TEST_F(Create, eexist) EXPECT_LOOKUP(FUSE_ROOT_ID, RELPATH) .WillOnce(Invoke(ReturnErrno(ENOENT))); expect_create(RELPATH, mode, ReturnErrno(EEXIST)); - EXPECT_NE(0, open(FULLPATH, O_CREAT | O_EXCL, mode)); + EXPECT_EQ(-1, open(FULLPATH, O_CREAT | O_EXCL, mode)); EXPECT_EQ(EEXIST, errno); } @@ -342,7 +342,7 @@ TEST_F(Create, eperm) .WillOnce(Invoke(ReturnErrno(ENOENT))); expect_create(RELPATH, mode, ReturnErrno(EPERM)); - EXPECT_NE(0, open(FULLPATH, O_CREAT | O_EXCL, mode)); + EXPECT_EQ(-1, open(FULLPATH, O_CREAT | O_EXCL, mode)); EXPECT_EQ(EPERM, errno); } Modified: stable/12/tests/sys/fs/fusefs/default_permissions.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/default_permissions.cc Wed Oct 30 01:24:28 2019 (r354160) +++ stable/12/tests/sys/fs/fusefs/default_permissions.cc Wed Oct 30 01:35:00 2019 (r354161) @@ -749,7 +749,7 @@ TEST_F(Open, eacces) expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755, UINT64_MAX, 1); expect_lookup(RELPATH, ino, S_IFREG | 0644, UINT64_MAX); - EXPECT_NE(0, open(FULLPATH, O_RDWR)); + EXPECT_EQ(-1, open(FULLPATH, O_RDWR)); EXPECT_EQ(EACCES, errno); } Modified: stable/12/tests/sys/fs/fusefs/io.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/io.cc Wed Oct 30 01:24:28 2019 (r354160) +++ stable/12/tests/sys/fs/fusefs/io.cc Wed Oct 30 01:35:00 2019 (r354161) @@ -108,11 +108,11 @@ int m_backing_fd, m_control_fd, m_test_fd; off_t m_filesize; bool m_direct_io; -Io(): m_backing_fd(-1), m_control_fd(-1), m_test_fd(-1), m_direct_io(false) {}; +Io(): m_backing_fd(-1), m_control_fd(-1), m_test_fd(-1), m_filesize(0), + m_direct_io(false) {}; void SetUp() { - m_filesize = 0; m_backing_fd = open("backing_file", O_RDWR | O_CREAT | O_TRUNC, 0644); if (m_backing_fd < 0) FAIL() << strerror(errno); Modified: stable/12/tests/sys/fs/fusefs/mknod.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/mknod.cc Wed Oct 30 01:24:28 2019 (r354160) +++ stable/12/tests/sys/fs/fusefs/mknod.cc Wed Oct 30 01:35:00 2019 (r354161) @@ -55,8 +55,11 @@ const static mode_t c_umask = 022; public: -virtual void SetUp() { +Mknod() { m_oldmask = umask(c_umask); +} + +virtual void SetUp() { if (geteuid() != 0) { GTEST_SKIP() << "Only root may use most mknod(2) variations"; } Modified: stable/12/tests/sys/fs/fusefs/opendir.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/opendir.cc Wed Oct 30 01:24:28 2019 (r354160) +++ stable/12/tests/sys/fs/fusefs/opendir.cc Wed Oct 30 01:35:00 2019 (r354161) @@ -103,7 +103,7 @@ TEST_F(Opendir, eperm) expect_lookup(RELPATH, ino); expect_opendir(ino, O_RDONLY, ReturnErrno(EPERM)); - EXPECT_NE(0, open(FULLPATH, O_DIRECTORY)); + EXPECT_EQ(-1, open(FULLPATH, O_DIRECTORY)); EXPECT_EQ(EPERM, errno); } From owner-svn-src-all@freebsd.org Wed Oct 30 01:41:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E87D173740; Wed, 30 Oct 2019 01:41:15 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472rlH37xXz4HGj; Wed, 30 Oct 2019 01:41:15 +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 4F55E2D58; Wed, 30 Oct 2019 01:41:15 +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 x9U1fF7D005429; Wed, 30 Oct 2019 01:41:15 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9U1fEPA005427; Wed, 30 Oct 2019 01:41:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201910300141.x9U1fEPA005427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 30 Oct 2019 01:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354162 - in head/sys/x86: include x86 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/x86: include x86 X-SVN-Commit-Revision: 354162 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 01:41:15 -0000 Author: cem Date: Wed Oct 30 01:41:14 2019 New Revision: 354162 URL: https://svnweb.freebsd.org/changeset/base/354162 Log: amd64: Define and decode new AMD64 feature bits These are documented in revisions 3.32 of the public AMD64 Vol. 2 and revision 3.28 of Vol. 3, published October and September 2019, respectively. Modified: head/sys/x86/include/specialreg.h head/sys/x86/x86/identcpu.c Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Wed Oct 30 01:35:00 2019 (r354161) +++ head/sys/x86/include/specialreg.h Wed Oct 30 01:41:14 2019 (r354162) @@ -71,6 +71,7 @@ #define CR4_PCE 0x00000100 /* Performance monitoring counter enable */ #define CR4_FXSR 0x00000200 /* Fast FPU save/restore used by OS */ #define CR4_XMM 0x00000400 /* enable SIMD/MMX2 to use except 16 */ +#define CR4_UMIP 0x00000800 /* User Mode Instruction Prevention */ #define CR4_VMXE 0x00002000 /* enable VMX operation (Intel-specific) */ #define CR4_FSGSBASE 0x00010000 /* Enable FS/GS BASE accessing instructions */ #define CR4_PCIDE 0x00020000 /* Enable Context ID */ @@ -90,6 +91,7 @@ #define EFER_LMSLE 0x000002000 /* Long Mode Segment Limit Enable */ #define EFER_FFXSR 0x000004000 /* Fast FXSAVE/FSRSTOR */ #define EFER_TCE 0x000008000 /* Translation Cache Extension */ +#define EFER_MCOMMIT 0x00020000 /* Enable MCOMMIT (AMD) */ /* * Intel Extended Features registers @@ -384,6 +386,9 @@ #define AMDFEID_CLZERO 0x00000001 #define AMDFEID_IRPERF 0x00000002 #define AMDFEID_XSAVEERPTR 0x00000004 +#define AMDFEID_RDPRU 0x00000004 +#define AMDFEID_MCOMMIT 0x00000100 +#define AMDFEID_WBNOINVD 0x00000200 #define AMDFEID_IBPB 0x00001000 #define AMDFEID_IBRS 0x00004000 #define AMDFEID_STIBP 0x00008000 Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Wed Oct 30 01:35:00 2019 (r354161) +++ head/sys/x86/x86/identcpu.c Wed Oct 30 01:41:14 2019 (r354162) @@ -1067,6 +1067,9 @@ printcpuinfo(void) "\001CLZERO" "\002IRPerf" "\003XSaveErPtr" + "\005RDPRU" + "\011MCOMMIT" + "\012WBNOINVD" "\015IBPB" "\017IBRS" "\020STIBP" @@ -2355,7 +2358,7 @@ print_svm_info(void) "\017" "\020V_VMSAVE_VMLOAD" "\021vGIF" - "\022" + "\022GMET" /* Guest Mode Execute Trap */ "\023" "\024" "\025" From owner-svn-src-all@freebsd.org Wed Oct 30 01:41:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 548331738B2; Wed, 30 Oct 2019 01:41:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472rly1fKRz4HbJ; Wed, 30 Oct 2019 01:41:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D6C12E94; Wed, 30 Oct 2019 01:41:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9U1fnL0005494; Wed, 30 Oct 2019 01:41:50 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9U1fn2j005493; Wed, 30 Oct 2019 01:41:49 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201910300141.x9U1fn2j005493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 30 Oct 2019 01:41:49 +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: r354163 - stable/12/usr.bin/tftp X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/usr.bin/tftp X-SVN-Commit-Revision: 354163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 01:41:50 -0000 Author: asomers Date: Wed Oct 30 01:41:49 2019 New Revision: 354163 URL: https://svnweb.freebsd.org/changeset/base/354163 Log: MFC r353068: tftp: fix two minor Coverity CIDs Reported by: Coverity CID 1394842: file descriptor leak in an error path CID 1007603: single byte array overflow Differential Revision: https://reviews.freebsd.org/D21695 Modified: stable/12/usr.bin/tftp/main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/tftp/main.c ============================================================================== --- stable/12/usr.bin/tftp/main.c Wed Oct 30 01:41:14 2019 (r354162) +++ stable/12/usr.bin/tftp/main.c Wed Oct 30 01:41:49 2019 (r354163) @@ -491,6 +491,7 @@ put(int argc, char *argv[]) if (fstat(fd, &sb) < 0) { warn("%s", cp); + close(fd); return; } asprintf(&options[OPT_TSIZE].o_request, "%ju", sb.st_size); @@ -746,7 +747,7 @@ command(bool interactive, EditLine *el, History *hist, exit(0); len = MIN(MAXLINE, num); memcpy(line, bp, len); - line[len] = '\0'; + line[len - 1] = '\0'; history(hist, hep, H_ENTER, bp); } else { line[0] = 0; From owner-svn-src-all@freebsd.org Wed Oct 30 01:57:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E260E1744BC; Wed, 30 Oct 2019 01:57:41 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472s6F5k9Pz4JLw; Wed, 30 Oct 2019 01:57:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7A8E30A7; Wed, 30 Oct 2019 01:57:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9U1vfMX013157; Wed, 30 Oct 2019 01:57:41 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9U1vf4u013155; Wed, 30 Oct 2019 01:57:41 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201910300157.x9U1vf4u013155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 30 Oct 2019 01:57: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: r354164 - in stable/12/sys/fs: nfs nfsclient X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/12/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 354164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 01:57:41 -0000 Author: rmacklem Date: Wed Oct 30 01:57:40 2019 New Revision: 354164 URL: https://svnweb.freebsd.org/changeset/base/354164 Log: MFC: r352736 Replace all mtx_assert() calls for n_mtx and ncl_iod_mutex with macros. To be consistent with replacing the mtx_lock()/mtx_unlock() calls on the NFS node mutex (n_mtx) and ncl_iod_mutex, this patch replaces all mtx_assert() calls on these mutexes with macros as well. This will simplify changing these locks to sx locks in a future commit. However, this change may be delayed indefinitely, since it appears there is a deadlock when vnode_pager_setsize() is called to shrink the size and the NFS node lock is held. There is no semantic change as a result of this commit. Modified: stable/12/sys/fs/nfs/nfsport.h stable/12/sys/fs/nfsclient/nfs_clnfsiod.c stable/12/sys/fs/nfsclient/nfs_clnode.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfs/nfsport.h ============================================================================== --- stable/12/sys/fs/nfs/nfsport.h Wed Oct 30 01:41:49 2019 (r354163) +++ stable/12/sys/fs/nfs/nfsport.h Wed Oct 30 01:57:40 2019 (r354164) @@ -688,10 +688,12 @@ void nfsrvd_rcv(struct socket *, void *, int); #define NFSUNLOCKV4ROOTMUTEX() mtx_unlock(&nfs_v4root_mutex) #define NFSLOCKNODE(n) mtx_lock(&((n)->n_mtx)) #define NFSUNLOCKNODE(n) mtx_unlock(&((n)->n_mtx)) +#define NFSASSERTNODE(n) mtx_assert(&((n)->n_mtx), MA_OWNED) #define NFSLOCKMNT(m) mtx_lock(&((m)->nm_mtx)) #define NFSUNLOCKMNT(m) mtx_unlock(&((m)->nm_mtx)) #define NFSLOCKIOD() mtx_lock(&ncl_iod_mutex) #define NFSUNLOCKIOD() mtx_unlock(&ncl_iod_mutex) +#define NFSASSERTIOD() mtx_assert(&ncl_iod_mutex, MA_OWNED) #define NFSLOCKREQUEST(r) mtx_lock(&((r)->r_mtx)) #define NFSUNLOCKREQUEST(r) mtx_unlock(&((r)->r_mtx)) #define NFSPROCLISTLOCK() sx_slock(&allproc_lock) Modified: stable/12/sys/fs/nfsclient/nfs_clnfsiod.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clnfsiod.c Wed Oct 30 01:41:49 2019 (r354163) +++ stable/12/sys/fs/nfsclient/nfs_clnfsiod.c Wed Oct 30 01:57:40 2019 (r354164) @@ -169,7 +169,7 @@ nfs_nfsiodnew_sync(void) { int error, i; - mtx_assert(&ncl_iod_mutex, MA_OWNED); + NFSASSERTIOD(); for (i = 0; i < ncl_iodmax; i++) { if (nfs_asyncdaemon[i] == 0) { nfs_asyncdaemon[i] = 1; @@ -206,7 +206,7 @@ void ncl_nfsiodnew(void) { - mtx_assert(&ncl_iod_mutex, MA_OWNED); + NFSASSERTIOD(); taskqueue_enqueue(taskqueue_thread, &ncl_nfsiodnew_task); } Modified: stable/12/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clnode.c Wed Oct 30 01:41:49 2019 (r354163) +++ stable/12/sys/fs/nfsclient/nfs_clnode.c Wed Oct 30 01:57:40 2019 (r354164) @@ -212,7 +212,7 @@ ncl_releasesillyrename(struct vnode *vp, struct thread ASSERT_VOP_ELOCKED(vp, "releasesillyrename"); np = VTONFS(vp); - mtx_assert(&np->n_mtx, MA_OWNED); + NFSASSERTNODE(np); if (vp->v_type != VDIR) { sp = np->n_sillyrename; np->n_sillyrename = NULL; From owner-svn-src-all@freebsd.org Wed Oct 30 02:03:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D3B11747D6; Wed, 30 Oct 2019 02:03:43 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472sFB6XdRz4JlK; Wed, 30 Oct 2019 02:03:42 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4AA6327B; Wed, 30 Oct 2019 02:03:42 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9U23gI7018621; Wed, 30 Oct 2019 02:03:42 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9U23b7U018593; Wed, 30 Oct 2019 02:03:37 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201910300203.x9U23b7U018593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 30 Oct 2019 02:03: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: r354165 - in stable/12: . tests/sys/cddl/zfs/include tests/sys/cddl/zfs/tests/cli_root/zdb tests/sys/cddl/zfs/tests/cli_root/zpool_add tests/sys/cddl/zfs/tests/cli_root/zpool_create tes... X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/12: . tests/sys/cddl/zfs/include tests/sys/cddl/zfs/tests/cli_root/zdb tests/sys/cddl/zfs/tests/cli_root/zpool_add tests/sys/cddl/zfs/tests/cli_root/zpool_create tests/sys/cddl/zfs/tests/cli... X-SVN-Commit-Revision: 354165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 02:03:43 -0000 Author: asomers Date: Wed Oct 30 02:03:37 2019 New Revision: 354165 URL: https://svnweb.freebsd.org/changeset/base/354165 Log: MFC r353117-r353118, r353281-r353282, r353284-r353289, r353309-r353310, r353360-r353361, r353366, r353379 r353117: ZFS: the hotspare_add_004_neg test needs at least two disks Sponsored by: Axcient r353118: ZFS: fix several of the "zpool create" tests * Remove zpool_create_013_neg. FreeBSD doesn't have an equivalent of Solaris's metadevices. GEOM would be the equivalent, but since all geoms are the same from ZFS's perspective, this test would be redundant with zpool_create_012_neg * Remove zpool_create_014_neg. FreeBSD does not support swapping to regular files. * Remove zpool_create_016_pos. This test is redundant with literally every other test that creates a disk-backed pool. * s:/etc/vfstab:/etc/fstab in zpool_create_011_neg * Delete the VTOC-related portion of zpool_create_008_pos. FreeBSD doesn't use VTOC. * Replace dumpadm with dumpon and swap with swapon in multiple tests. * In zpool_create_015_neg, don't require "zpool create -n" to fail. It's reasonable for that variant to succeed, because it doesn't actually open the zvol. * Greatly simplify zpool_create_012_neg. Make it safer, too, but not interfering with the system's regular swap devices. * Expect zpool_create_011_neg to fail (PR 241070) * Delete some redundant cleanup steps in various tests * Remove some unneeeded ATF timeout specifications. The default is fine. PR: 241070 Sponsored by: Axcient r353281: ZFS: fix several zvol_misc tests * Adapt zvol_misc_001_neg to use dumpon instead of Solaris's dumpadm * Disable zvol_misc_003_neg, zvol_misc_005_neg, and zvol_misc_006_pos, because they involve using a zvol as a dump device, which FreeBSD does not yet support. Sponsored by: Axcient r353282: zfs: fix the slog_012_neg test This test attempts to corrupt a file-backed vdev by deleting it and then recreating it with truncate. But that doesn't work, because the pool already has the vdev open, and it happily hangs on to the open-but-deleted file. Fix by truncating the file without deleting it. Sponsored by: Axcient r353284: ZFS: fix the zpool_get_002_pos test ZFS has grown some additional properties that hadn't been added to the config file yet. While I'm here, improve the error message, and remove a superfluous command. Sponsored by: Axcient r353285: zfs: fix the zdb_001_neg test The test needed to be updated for r331701 (MFV illumos 8671400), which added a "-k" option. Sponsored by: Axcient r353286: zfs: skip the zfsd tests if zfsd is not running Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D21878 r353287: ZFS: fix the delegate tests These tests have never worked correctly * Replace runwattr with sudo * Fix a scoping bug with the "dtst" variable * Cleanup user properties created during tests * Eliminate the checks for refreservation and send support. They will always be supported. * Fix verify_fs_snapshot. It seemed to assume that permissions would not yet be delegated, but that's not how it's actually used. * Combine verify_fs_promote with verify_vol_promote * Remove some useless sleeps * Fix backwards condition in verify_vol_volsize * Remove some redundant cleanup steps in the tests. cleanup.ksh will handle everything. * Disable some parts of the tests that FreeBSD doesn't support: * Creating snapshots with mkdir * devices * shareisci * sharenfs * xattr * zoned The sharenfs parts could probably be reenabled with more work to remove the Solarisms. Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D21898 r353288: ZFS: mark hotspare_scrub_002_pos as an expected failure "zpool scrub" doesn't detect all errors on active spares in raidz arrays PR: 241069 Sponsored by: Axcient r353289: ZFS: fix the redundancy tests * Fix force_sync_path, which ensures that a file is fully flushed to disk. Apparently "zpool history"'s performance has improved, but exporting and importing the pool still works. * Fix file_dva by using undocumented zdb syntax to clarify that we're interested in the pool's root file system, not the pool itself. This should also fix the zpool_clear_001_pos test. * Remove a redundant cleanup step Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D21901 r353309: zfs: fix the zfsd_autoreplace_003_pos test The test declared that it only needed 5 disks, but actually tried to use 6. Fix it to use just 5, which is all it really needs. Sponsored by: Axcient r353310: zfs: fix the zfsd_hotspare_007_pos test It was trying to destroy the pool while zfsd was detaching the spare, and "zpool destroy" failed. Fix by waiting until the spare has fully detached. Sponsored by: Axcient r353360: ZFS: multiple fixes to the zpool_import tests * Don't create a UFS mountpoint just to store some temporary files. The tests should always be executed with a sufficiently large TMPDIR. Creating the UFS mountpoint is not only unneccessary, but it slowed zpool_import_missing_002_pos greatly, because that test moves large files between TMPDIR and the UFS mountpoint. This change also allows many of the tests to be executed with just a single test disk, instead of two. * Move zpool_import_missing_002_pos's backup device dir from / to $PWD to prevent cross-device moves. On my system, these two changes improved that test's speed by 39x. It should also prevent ENOSPC errors seen in CI. * If insufficient disks are available, don't try to partition one of them. Just rely on Kyua to skip the test. Users who care will configure Kyua with sufficient disks. Sponsored by: Axcient r353361: ZFS: in the tests, don't override PWD The ZFS test suite was overriding the common $PWD variable with the path to the pwd command, even though no test wanted to use it that way. Most tests didn't notice, because ksh93 eventually restored it to its proper meaning. Sponsored by: Axcient r353366: ZFS: fix the zpool_add_010_pos test The test is necessarily racy, because it depends on being able to complete a "zpool add" before a previous resilver finishes. But it was racier than it needed to be. Move the first "zpool add" to before the resilver starts. Sponsored by: Axcient r353379: zfs: multiple improvements to the zpool_add tests * Don't partition a disk if too few are available. Just rely on Kyua to ensure that the tests aren't run with insufficient disks. * Remove redundant cleanup steps * In zpool_add_003_pos, store the temporary file in $PWD so Kyua will automatically clean it up. * Update zpool_add_005_pos to use dumpon instead of dumpadm. This test had never been ported to FreeBSD. * In zpool_add_005_pos, don't format the dump disk with UFS. That was pointless. Sponsored by: Axcient > Description of fields to fill in above: 76 columns --| > PR: If and which Problem Report is related. > Submitted by: If someone else sent in the change. > Reported by: If someone else reported the issue. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > MFH: Ports tree branch name. Request approval for merge. > Relnotes: Set to 'yes' for mention in release notes. > Security: Vulnerability reference (one per line) or description. > Sponsored by: If the change was sponsored by an organization (each collaborator). > Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed). > Empty fields above will be automatically removed. _M 12 M 12/ObsoleteFiles.inc M 12/tests/sys/cddl/zfs/include/commands.txt M 12/tests/sys/cddl/zfs/include/libtest.kshlib M 12/tests/sys/cddl/zfs/tests/cli_root/zdb/zdb_001_neg.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/cleanup.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/setup.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_001_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_002_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_003_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_004_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_005_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_006_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_007_neg.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_008_neg.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_009_neg.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_010_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_test.sh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/Makefile M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create.kshlib M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_008_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_011_neg.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_012_neg.ksh D 12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_013_neg.ksh D 12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_014_neg.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_015_neg.ksh D 12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_016_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_test.sh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get_002_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_import/cleanup.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_import/setup.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import.cfg M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import_all_001_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import_test.sh M 12/tests/sys/cddl/zfs/tests/delegate/delegate_common.kshlib M 12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_001_pos.ksh M 12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_002_pos.ksh M 12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_003_pos.ksh M 12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_007_pos.ksh M 12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_010_pos.ksh M 12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_012_neg.ksh M 12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_test.sh M 12/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_007_neg.ksh M 12/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_test.sh M 12/tests/sys/cddl/zfs/tests/hotspare/hotspare_test.sh M 12/tests/sys/cddl/zfs/tests/redundancy/redundancy.kshlib M 12/tests/sys/cddl/zfs/tests/redundancy/redundancy_001_pos.ksh M 12/tests/sys/cddl/zfs/tests/slog/slog_012_neg.ksh M 12/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_003_pos.ksh M 12/tests/sys/cddl/zfs/tests/zfsd/zfsd_hotspare_007_pos.ksh M 12/tests/sys/cddl/zfs/tests/zfsd/zfsd_test.sh M 12/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_001_neg.ksh M 12/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_test.sh Deleted: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_013_neg.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_014_neg.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_016_pos.ksh Modified: stable/12/ObsoleteFiles.inc stable/12/tests/sys/cddl/zfs/include/commands.txt stable/12/tests/sys/cddl/zfs/include/libtest.kshlib stable/12/tests/sys/cddl/zfs/tests/cli_root/zdb/zdb_001_neg.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/cleanup.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/setup.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_001_pos.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_002_pos.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_003_pos.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_004_pos.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_005_pos.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_006_pos.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_007_neg.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_008_neg.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_009_neg.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_010_pos.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_test.sh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/Makefile stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create.kshlib stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_008_pos.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_011_neg.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_012_neg.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_015_neg.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_test.sh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get_002_pos.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_import/cleanup.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_import/setup.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import.cfg stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import_all_001_pos.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import_test.sh stable/12/tests/sys/cddl/zfs/tests/delegate/delegate_common.kshlib stable/12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_001_pos.ksh stable/12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_002_pos.ksh stable/12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_003_pos.ksh stable/12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_007_pos.ksh stable/12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_010_pos.ksh stable/12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_012_neg.ksh stable/12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_test.sh stable/12/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_007_neg.ksh stable/12/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_test.sh stable/12/tests/sys/cddl/zfs/tests/hotspare/hotspare_test.sh stable/12/tests/sys/cddl/zfs/tests/redundancy/redundancy.kshlib stable/12/tests/sys/cddl/zfs/tests/redundancy/redundancy_001_pos.ksh stable/12/tests/sys/cddl/zfs/tests/slog/slog_012_neg.ksh stable/12/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_003_pos.ksh stable/12/tests/sys/cddl/zfs/tests/zfsd/zfsd_hotspare_007_pos.ksh stable/12/tests/sys/cddl/zfs/tests/zfsd/zfsd_test.sh stable/12/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_001_neg.ksh stable/12/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_test.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/ObsoleteFiles.inc Wed Oct 30 02:03:37 2019 (r354165) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20191003: Remove useless ZFS tests +OLD_FILES+=usr/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_013_neg.ksh +OLD_FILES+=usr/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_014_neg.ksh +OLD_FILES+=usr/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_016_pos.ksh # 20190811: sys/pwm.h renamed to dev/pwmc.h and pwm(9) removed OLD_FILES+=usr/include/sys/pwm.h usr/share/man/man9/pwm.9 # 20190723: new clang import which bumps version from 8.0.0 to 8.0.1. Modified: stable/12/tests/sys/cddl/zfs/include/commands.txt ============================================================================== --- stable/12/tests/sys/cddl/zfs/include/commands.txt Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/include/commands.txt Wed Oct 30 02:03:37 2019 (r354165) @@ -65,6 +65,7 @@ /usr/bin/dirname /usr/bin/du #%%STFSUITEDIR%%/bin/dumpadm +/sbin/dumpon /bin/echo /usr/bin/egrep /usr/bin/env @@ -131,7 +132,6 @@ /bin/pkill /bin/ps #/usr/sbin/psrinfo -/bin/pwd /usr/sbin/quotaon /bin/rcp /sbin/reboot Modified: stable/12/tests/sys/cddl/zfs/include/libtest.kshlib ============================================================================== --- stable/12/tests/sys/cddl/zfs/include/libtest.kshlib Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/include/libtest.kshlib Wed Oct 30 02:03:37 2019 (r354165) @@ -2676,8 +2676,7 @@ function gen_dataset_name # # Ensure that a given path has been synced, not just ZIL committed. # -# XXX The implementation currently requires calling 'zpool history'. On -# FreeBSD, the sync(8) command (via $SYNC) calls zfs_sync() which just +# XXX On FreeBSD, the sync(8) command (via $SYNC) calls zfs_sync() which just # does a zil_commit(), as opposed to a txg_wait_synced(). For things that # require writing to their final destination (e.g. for intentional # corruption purposes), zil_commit() is not good enough. @@ -2686,10 +2685,8 @@ function force_sync_path # path { typeset path="$1" - zfspath=$($DF $path 2>/dev/null | tail -1 | cut -d" " -f1 | cut -d/ -f1) - [ -z "$zfspath" ] && return false - log_note "Force syncing ${zfspath} for ${path} ..." - $ZPOOL history $zfspath >/dev/null 2>&1 + log_must $ZPOOL export $TESTPOOL + log_must $ZPOOL import -d $path $TESTPOOL } # @@ -3326,7 +3323,7 @@ function file_dva # dataset filepath [level] [offset] # The inner match is for 'DVA[0]=<0:1b412600:200>', in which the # text surrounding the actual DVA is a fixed size with 8 characters # before it and 1 after. - $ZDB -P -vvvvv $dataset $inode | \ + $ZDB -P -vvvvv "$dataset/" $inode | \ $AWK -v level=${level} -v dva_num=${dva_num} ' BEGIN { stage = 0; } (stage == 0) && ($1=="Object") { stage = 1; next; } Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zdb/zdb_001_neg.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zdb/zdb_001_neg.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zdb/zdb_001_neg.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -69,7 +69,7 @@ set -A args "create" "add" "destroy" "import fakepool" "add mirror fakepool" "add raidz fakepool" \ "add raidz1 fakepool" "add raidz2 fakepool" \ "setvprop" "blah blah" "-%" "--?" "-*" "-=" \ - "-a" "-f" "-g" "-h" "-j" "-k" "-m" "-n" "-p" "-p /tmp" \ + "-a" "-f" "-g" "-h" "-j" "-m" "-n" "-p" "-p /tmp" \ "-r" "-t" "-w" "-x" "-y" "-z" \ "-D" "-E" "-G" "-H" "-I" "-J" "-K" "-M" \ "-N" "-Q" "-T" "-W" Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/cleanup.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/cleanup.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/cleanup.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -32,6 +32,8 @@ . $STF_SUITE/include/libtest.kshlib . $STF_SUITE/tests/cli_root/zpool_add/zpool_add.kshlib +poolexists $TESTPOOL && \ + destroy_pool $TESTPOOL cleanup_devices $DISKS log_pass Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/setup.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/setup.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/setup.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -34,19 +34,4 @@ verify_runnable "global" -if [[ -n $DISK ]]; then - # - # Use 'zpool create' to clean up the infomation in - # in the given disk to avoid slice overlapping. - # - cleanup_devices $DISK - - partition_disk $SIZE $DISK 7 -else - for disk in `$ECHO $DISKSARRAY`; do - cleanup_devices $disk - partition_disk $SIZE $disk 7 - done -fi - log_pass Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_001_pos.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_001_pos.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_001_pos.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -58,45 +58,24 @@ verify_runnable "global" -function cleanup -{ - poolexists $TESTPOOL && \ - destroy_pool $TESTPOOL - - partition_cleanup -} - log_assert "'zpool add ...' can add devices to the pool." -log_onexit cleanup - set -A keywords "" "mirror" "raidz" "raidz1" "spare" -typeset diskname=${disk#/dev/} +set_disks + typeset diskname0=${DISK0#/dev/} typeset diskname1=${DISK1#/dev/} +typeset diskname2=${DISK2#/dev/} +typeset diskname3=${DISK3#/dev/} +typeset diskname4=${DISK4#/dev/} -case $DISK_ARRAY_NUM in -0|1) - pooldevs="${diskname}p1 \ - /dev/${diskname}p1 \ - \"${diskname}p1 ${diskname}p2\"" - mirrordevs="\"/dev/${diskname}p1 ${diskname}p2\"" - raidzdevs="\"/dev/${diskname}p1 ${diskname}p2\"" +pooldevs="${diskname0}\ + \"/dev/${diskname0} ${diskname1}\" \ + \"${diskname0} ${diskname1} ${diskname2}\"" +mirrordevs="\"/dev/${diskname0} ${diskname1}\"" +raidzdevs="\"/dev/${diskname0} ${diskname1}\"" - ;; -2|*) - pooldevs="${diskname0}p1\ - \"/dev/${diskname0}p1 ${diskname1}p1\" \ - \"${diskname0}p1 ${diskname0}p2 ${diskname1}p2\"\ - \"${diskname0}p1 ${diskname1}p1 ${diskname0}p2\ - ${diskname1}p2\"" - mirrordevs="\"/dev/${diskname0}p1 ${diskname1}p1\"" - raidzdevs="\"/dev/${diskname0}p1 ${diskname1}p1\"" - - ;; -esac - typeset -i i=0 typeset vdev eval set -A poolarray $pooldevs @@ -107,7 +86,7 @@ while (( $i < ${#keywords[*]} )); do case ${keywords[i]} in ""|spare) for vdev in "${poolarray[@]}"; do - create_pool "$TESTPOOL" "${diskname}p6" + create_pool "$TESTPOOL" "${diskname3}" log_must poolexists "$TESTPOOL" log_must $ZPOOL add -f "$TESTPOOL" ${keywords[i]} \ $vdev @@ -119,7 +98,7 @@ while (( $i < ${#keywords[*]} )); do mirror) for vdev in "${mirrorarray[@]}"; do create_pool "$TESTPOOL" "${keywords[i]}" \ - "${diskname}p4" "${diskname}p5" + "${diskname3}" "${diskname4}" log_must poolexists "$TESTPOOL" log_must $ZPOOL add "$TESTPOOL" ${keywords[i]} \ $vdev @@ -131,7 +110,7 @@ while (( $i < ${#keywords[*]} )); do raidz|raidz1) for vdev in "${raidzarray[@]}"; do create_pool "$TESTPOOL" "${keywords[i]}" \ - "${diskname}p4" "${diskname}p5" + "${diskname3}" "${diskname4}" log_must poolexists "$TESTPOOL" log_must $ZPOOL add "$TESTPOOL" ${keywords[i]} \ $vdev Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_002_pos.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_002_pos.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_002_pos.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -60,26 +60,18 @@ verify_runnable "global" -function cleanup -{ - poolexists $TESTPOOL && \ - destroy_pool $TESTPOOL +set_disks - partition_cleanup -} - log_assert "'zpool add -f ...' can successfully add" \ "devices to the pool in some cases." -log_onexit cleanup - -create_pool "$TESTPOOL" mirror "${disk}p1" "${disk}p2" +create_pool "$TESTPOOL" mirror "${DISK0}" "${DISK1}" log_must poolexists "$TESTPOOL" -log_mustnot $ZPOOL add "$TESTPOOL" ${disk}p3 -log_mustnot iscontained "$TESTPOOL" "${disk}p3" +log_mustnot $ZPOOL add "$TESTPOOL" ${DISK2} +log_mustnot iscontained "$TESTPOOL" "${DISK2}" -log_must $ZPOOL add -f "$TESTPOOL" ${disk}p3 -log_must iscontained "$TESTPOOL" "${disk}p3" +log_must $ZPOOL add -f "$TESTPOOL" ${DISK2} +log_must iscontained "$TESTPOOL" "${DISK2}" log_pass "'zpool add -f ...' executes successfully." Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_003_pos.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_003_pos.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_003_pos.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -58,30 +58,19 @@ verify_runnable "global" -function cleanup -{ - poolexists $TESTPOOL && \ - destroy_pool $TESTPOOL +set_disks - partition_cleanup - - [[ -e $tmpfile ]] && \ - log_must $RM -f $tmpfile -} - log_assert "'zpool add -n ...' can display the configuration" \ "without actually adding devices to the pool." -log_onexit cleanup +tmpfile="zpool_add_003.tmp${TESTCASE_ID}" -tmpfile="$TMPDIR/zpool_add_003.tmp${TESTCASE_ID}" - -create_pool "$TESTPOOL" "${disk}p1" +create_pool "$TESTPOOL" "${DISK0}" log_must poolexists "$TESTPOOL" -$ZPOOL add -n "$TESTPOOL" ${disk}p2 > $tmpfile +$ZPOOL add -n "$TESTPOOL" ${DISK1} > $tmpfile -log_mustnot iscontained "$TESTPOOL" "${disk}p2" +log_mustnot iscontained "$TESTPOOL" "${DISK1}" str="would update '$TESTPOOL' to the following configuration:" $CAT $tmpfile | $GREP "$str" >/dev/null 2>&1 Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_004_pos.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_004_pos.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_004_pos.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -58,6 +58,8 @@ verify_runnable "global" +set_disks + function cleanup { poolexists $TESTPOOL && \ @@ -67,19 +69,16 @@ function cleanup log_must $ZFS destroy -f $TESTPOOL1/$TESTVOL poolexists $TESTPOOL1 && \ destroy_pool "$TESTPOOL1" - - partition_cleanup - } log_assert "'zpool add ...' can add zfs volume to the pool." log_onexit cleanup -create_pool "$TESTPOOL" "${disk}p1" +create_pool "$TESTPOOL" "${DISK0}" log_must poolexists "$TESTPOOL" -create_pool "$TESTPOOL1" "${disk}p2" +create_pool "$TESTPOOL1" "${DISK1}" log_must poolexists "$TESTPOOL1" log_must $ZFS create -V $VOLSIZE $TESTPOOL1/$TESTVOL Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_005_pos.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_005_pos.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_005_pos.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -61,6 +61,8 @@ verify_runnable "global" +set_disks + function cleanup { poolexists "$TESTPOOL" && \ @@ -68,11 +70,7 @@ function cleanup poolexists "$TESTPOOL1" && \ destroy_pool "$TESTPOOL1" - if [[ -n $saved_dump_dev ]]; then - log_must eval "$DUMPADM -u -d $saved_dump_dev > /dev/null" - fi - - partition_cleanup + $DUMPON -r $dump_dev } log_assert "'zpool add' should fail with inapplicable scenarios." @@ -81,22 +79,20 @@ log_onexit cleanup mnttab_dev=$(find_mnttab_dev) vfstab_dev=$(find_vfstab_dev) -saved_dump_dev=$(save_dump_dev) -dump_dev=${disk}p3 +dump_dev=${DISK2} -create_pool "$TESTPOOL" "${disk}p1" +create_pool "$TESTPOOL" "${DISK0}" log_must poolexists "$TESTPOOL" -create_pool "$TESTPOOL1" "${disk}p2" +create_pool "$TESTPOOL1" "${DISK1}" log_must poolexists "$TESTPOOL1" -log_mustnot $ZPOOL add -f "$TESTPOOL" ${disk}p2 +log_mustnot $ZPOOL add -f "$TESTPOOL" ${DISK1} log_mustnot $ZPOOL add -f "$TESTPOOL" $mnttab_dev log_mustnot $ZPOOL add -f "$TESTPOOL" $vfstab_dev -log_must $ECHO "y" | $NEWFS /dev/$dump_dev > /dev/null 2>&1 -log_must $DUMPADM -u -d /dev/$dump_dev > /dev/null +log_must $DUMPON $dump_dev log_mustnot $ZPOOL add -f "$TESTPOOL" $dump_dev log_pass "'zpool add' should fail with inapplicable scenarios." Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_006_pos.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_006_pos.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_006_pos.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -66,16 +66,12 @@ function cleanup poolexists $TESTPOOL1 && \ destroy_pool $TESTPOOL1 - datasetexists $TESTPOOL/$TESTFS && \ - log_must $ZFS destroy -f $TESTPOOL/$TESTFS poolexists $TESTPOOL && \ destroy_pool $TESTPOOL if [[ -d $TESTDIR ]]; then log_must $RM -rf $TESTDIR fi - - partition_cleanup } @@ -101,7 +97,6 @@ function setup_vdevs # # Minus $largest_num/20 to leave 5% space for metadata. (( vdevs_num=largest_num - largest_num/20 )) file_size=64 - vdev=$disk else vdevs_num=$VDEVS_NUM (( file_size = fs_size / (1024 * 1024 * (vdevs_num + vdevs_num/20)) )) @@ -112,8 +107,8 @@ function setup_vdevs # (( slice_size = file_size * (vdevs_num + vdevs_num/20) )) wipe_partition_table $disk set_partition 0 "" ${slice_size}m $disk - vdev=${disk}p1 fi + vdev=${disk} create_pool $TESTPOOL $vdev [[ -d $TESTDIR ]] && \ @@ -143,17 +138,11 @@ log_assert " 'zpool add [-f]' can add large numbers of " pool without any errors." log_onexit cleanup -if [[ $DISK_ARRAY_NUM == 0 ]]; then - disk=$DISK -else - disk=$DISK0 -fi - vdevs_list="" vdevs_num=$VDEVS_NUM file_size=$FILE_SIZE -setup_vdevs $disk +setup_vdevs $DISK0 log_must $ZPOOL add -f "$TESTPOOL1" $vdevs_list log_must iscontained "$TESTPOOL1" "$vdevs_list" Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_007_neg.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_007_neg.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_007_neg.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -57,22 +57,14 @@ verify_runnable "global" -function cleanup -{ - poolexists "$TESTPOOL" && \ - destroy_pool "$TESTPOOL" - - partition_cleanup -} +set_disks log_assert "'zpool add' should return an error with badly-formed parameters." -log_onexit cleanup - set -A args "" "-f" "-n" "-?" "-nf" "-fn" "-f -n" "--f" "-blah" \ - "-? $TESTPOOL ${disk}p2" + "-? $TESTPOOL ${DISK1}" -create_pool "$TESTPOOL" "${disk}p1" +create_pool "$TESTPOOL" "${DISK0}" log_must poolexists "$TESTPOOL" typeset -i i=0 Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_008_neg.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_008_neg.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_008_neg.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -57,23 +57,12 @@ verify_runnable "global" -function cleanup -{ - - poolexists "$TESTPOOL" && \ - destroy_pool "$TESTPOOL" - - partition_cleanup -} - log_assert "'zpool add' should return an error with nonexistent pools and vdevs" -log_onexit cleanup - -set -A args "" "-f nonexistent_pool ${disk}p2" \ +set -A args "" "-f nonexistent_pool ${DISK1}" \ "-f $TESTPOOL nonexistent_vdev" -create_pool "$TESTPOOL" "${disk}p1" +create_pool "$TESTPOOL" "${DISK0}" log_must poolexists "$TESTPOOL" typeset -i i=0 Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_009_neg.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_009_neg.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_009_neg.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -58,26 +58,14 @@ verify_runnable "global" -function cleanup -{ - - poolexists "$TESTPOOL" && \ - destroy_pool "$TESTPOOL" - - partition_cleanup - -} - log_assert "'zpool add' should fail if vdevs are the same or vdev is " \ "contained in the given pool." -log_onexit cleanup - -create_pool "$TESTPOOL" "${disk}p1" +create_pool "$TESTPOOL" "${DISK1}" log_must poolexists "$TESTPOOL" -log_mustnot $ZPOOL add -f "$TESTPOOL" ${disk}p2 ${disk}p2 -log_mustnot $ZPOOL add -f "$TESTPOOL" ${disk}p1 +log_mustnot $ZPOOL add -f "$TESTPOOL" ${DISK0} ${DISK0} +log_mustnot $ZPOOL add -f "$TESTPOOL" ${DISK1} log_pass "'zpool add' get fail as expected if vdevs are the same or vdev is " \ "contained in the given pool." Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_010_pos.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_010_pos.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_010_pos.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -31,25 +31,15 @@ verify_runnable "global" -function cleanup -{ - poolexists $TESTPOOL && \ - destroy_pool $TESTPOOL - - partition_cleanup -} - log_assert "'zpool add' can add devices, even if a replacing vdev with a spare child is present" -log_onexit cleanup - create_pool $TESTPOOL mirror ${DISK0} ${DISK1} # A replacing vdev will automatically detach the older member when resilvering # is complete. We don't want that to happen during this test, so write some # data just to slow down resilvering. $TIMEOUT 60s $DD if=/dev/zero of=/$TESTPOOL/zerofile bs=128k -log_must $ZPOOL replace $TESTPOOL ${DISK0} ${DISK2} log_must $ZPOOL add $TESTPOOL spare ${DISK3} +log_must $ZPOOL replace $TESTPOOL ${DISK0} ${DISK2} log_must $ZPOOL replace $TESTPOOL ${DISK0} ${DISK3} log_must $ZPOOL add $TESTPOOL spare ${DISK4} Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_test.sh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_test.sh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_test.sh Wed Oct 30 02:03:37 2019 (r354165) @@ -39,7 +39,7 @@ zpool_add_001_pos_body() . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 2 + verify_disk_count "$DISKS" 5 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_001_pos.ksh || atf_fail "Testcase failed" } @@ -66,7 +66,7 @@ zpool_add_002_pos_body() . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 1 + verify_disk_count "$DISKS" 3 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_002_pos.ksh || atf_fail "Testcase failed" } @@ -93,7 +93,7 @@ zpool_add_003_pos_body() . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 1 + verify_disk_count "$DISKS" 2 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_003_pos.ksh || atf_fail "Testcase failed" } @@ -120,6 +120,7 @@ zpool_add_004_pos_body() . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg + verify_disk_count "$DISKS" 2 verify_zvol_recursive ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_004_pos.ksh || atf_fail "Testcase failed" @@ -138,7 +139,7 @@ atf_test_case zpool_add_005_pos cleanup zpool_add_005_pos_head() { atf_set "descr" "'zpool add' should fail with inapplicable scenarios." - atf_set "require.progs" dumpadm zpool + atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_add_005_pos_body() @@ -147,8 +148,8 @@ zpool_add_005_pos_body() . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 1 - verify_disk_count "$DISKS" 1 + verify_disk_count "$DISKS" 3 + atf_expect_fail "PR 241070 dumpon opens geom devices non-exclusively" ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_005_pos.ksh || atf_fail "Testcase failed" } @@ -175,7 +176,7 @@ zpool_add_006_pos_body() . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 2 + verify_disk_count "$DISKS" 1 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_006_pos.ksh || atf_fail "Testcase failed" } @@ -202,7 +203,7 @@ zpool_add_007_neg_body() . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 1 + verify_disk_count "$DISKS" 2 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_007_neg.ksh || atf_fail "Testcase failed" } @@ -229,7 +230,7 @@ zpool_add_008_neg_body() . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 1 + verify_disk_count "$DISKS" 2 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_008_neg.ksh || atf_fail "Testcase failed" } @@ -256,7 +257,7 @@ zpool_add_009_neg_body() . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 1 + verify_disk_count "$DISKS" 2 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_009_neg.ksh || atf_fail "Testcase failed" } Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/Makefile ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/Makefile Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/Makefile Wed Oct 30 02:03:37 2019 (r354165) @@ -13,8 +13,6 @@ TEST_METADATA+= is_exclusive=true ${PACKAGE}FILES+= zpool_create_003_pos.ksh ${PACKAGE}FILES+= zpool_create_020_pos.ksh ${PACKAGE}FILES+= zpool_create_017_neg.ksh -${PACKAGE}FILES+= zpool_create_013_neg.ksh -${PACKAGE}FILES+= zpool_create_016_pos.ksh ${PACKAGE}FILES+= zpool_create_012_neg.ksh ${PACKAGE}FILES+= zpool_create_006_pos.ksh ${PACKAGE}FILES+= zpool_create_002_pos.ksh @@ -22,7 +20,6 @@ ${PACKAGE}FILES+= zpool_create_021_pos.ksh ${PACKAGE}FILES+= zpool_create_007_neg.ksh ${PACKAGE}FILES+= setup.ksh ${PACKAGE}FILES+= cleanup.ksh -${PACKAGE}FILES+= zpool_create_014_neg.ksh ${PACKAGE}FILES+= zpool_create_010_neg.ksh ${PACKAGE}FILES+= zpool_create_019_pos.ksh ${PACKAGE}FILES+= zpool_create_008_pos.ksh Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create.kshlib ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create.kshlib Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create.kshlib Wed Oct 30 02:03:37 2019 (r354165) @@ -96,36 +96,22 @@ function clean_blockfile # # Find the storage device in /etc/vfstab # -function find_vfstab_dev +function find_fstab_dev { - typeset vfstab="/etc/vfstab" - typeset tmpfile="$TMPDIR/vfstab.tmp" - typeset vfstabdev - typeset vfstabdevs="" + typeset fstab="/etc/fstab" + typeset tmpfile="$TMPDIR/fstab.tmp" + typeset fstabdev + typeset fstabdevs="" typeset line - $CAT $vfstab | $GREP "^/dev" >$tmpfile + $CAT $fstab | $GREP "^/dev" >$tmpfile while read -r line do - vfstabdev=`$ECHO "$line" | $AWK '{print $1}'` - vfstabdev=${vfstabdev%%:} - vfstabdevs="$vfstabdev $vfstabdevs" + fstabdev=`$ECHO "$line" | $AWK '{print $1}'` + fstabdev=${fstabdev%%:} + fstabdevs="$fstabdev $fstabdevs" done <$tmpfile $RM -f $tmpfile - $ECHO $vfstabdevs + $ECHO $fstabdevs } - -# -# Save the systme current dump device configuration -# -function save_dump_dev -{ - - typeset dumpdev - typeset fnd="Dump device" - - dumpdev=`$DUMPADM | $GREP "$fnd" | $CUT -f2 -d : | \ - $AWK '{print $1}'` - $ECHO $dumpdev -} Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_008_pos.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_008_pos.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_008_pos.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -57,102 +57,24 @@ verify_runnable "global" -function cleanup -{ - if [[ $exported_pool == true ]]; then - if [[ $force_pool == true ]]; then - log_must $ZPOOL create -f $TESTPOOL ${disk}p1 - else - log_must $ZPOOL import $TESTPOOL - fi - fi - - if poolexists $TESTPOOL ; then - destroy_pool $TESTPOOL - fi - - if poolexists $TESTPOOL1 ; then - destroy_pool $TESTPOOL1 - fi - - # - # recover it back to EFI label - # - wipe_partition_table $disk -} - -# -# create overlap slice 0 and 1 on $disk -# -function create_overlap_slice -{ - typeset format_file=$TMPDIR/format_overlap.${TESTCASE_ID} - typeset disk=$1 - - $ECHO "partition" >$format_file - $ECHO "0" >> $format_file - $ECHO "" >> $format_file - $ECHO "" >> $format_file - $ECHO "0" >> $format_file - $ECHO "200m" >> $format_file - $ECHO "1" >> $format_file - $ECHO "" >> $format_file - $ECHO "" >> $format_file - $ECHO "0" >> $format_file - $ECHO "400m" >> $format_file - $ECHO "label" >> $format_file - $ECHO "" >> $format_file - $ECHO "q" >> $format_file - $ECHO "q" >> $format_file - - $FORMAT -e -s -d $disk -f $format_file - typeset -i ret=$? - $RM -fr $format_file - - if (( ret != 0 )); then - log_fail "unable to create overlap slice." - fi - - return 0 -} - log_assert "'zpool create' have to use '-f' scenarios" -log_onexit cleanup -typeset exported_pool=false -typeset force_pool=false - if [[ -n $DISK ]]; then disk=$DISK else disk=$DISK0 fi -# overlapped slices as vdev need -f to create pool - # Make the disk is EFI labeled first via pool creation create_pool $TESTPOOL $disk destroy_pool $TESTPOOL -# Make the disk is VTOC labeled since only VTOC label supports overlap -log_must labelvtoc $disk -log_must create_overlap_slice $disk - -log_mustnot $ZPOOL create $TESTPOOL ${disk}p1 -log_must $ZPOOL create -f $TESTPOOL ${disk}p1 -destroy_pool $TESTPOOL - # exported device to be as spare vdev need -f to create pool - -log_must $ZPOOL create -f $TESTPOOL $disk -destroy_pool $TESTPOOL log_must partition_disk $SIZE $disk 6 create_pool $TESTPOOL ${disk}p1 ${disk}p2 log_must $ZPOOL export $TESTPOOL -exported_pool=true log_mustnot $ZPOOL create $TESTPOOL1 ${disk}p3 spare ${disk}p2 create_pool $TESTPOOL1 ${disk}p3 spare ${disk}p2 -force_pool=true destroy_pool $TESTPOOL1 log_pass "'zpool create' have to use '-f' scenarios" Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_011_neg.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_011_neg.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_011_neg.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -41,7 +41,7 @@ # 'zpool create' will fail in the following cases: # existent pool; device is part of an active pool; nested virtual devices; # differently sized devices without -f option; device being currently -# mounted; devices in /etc/vfstab; specified as the dedicated dump device. +# mounted; devices in /etc/fstab; specified as the dedicated dump device. # # STRATEGY: # 1. Create case scenarios @@ -67,8 +67,8 @@ function cleanup destroy_pool $pool done - if [[ -n $saved_dump_dev ]]; then - log_must $DUMPADM -u -d $saved_dump_dev + if [[ -n $specified_dump_dev ]]; then + $DUMPON -r $specified_dump_dev fi } @@ -87,11 +87,11 @@ mirror2="${disk}p4 ${disk}p5" raidz1=$mirror1 raidz2=$mirror2 diff_size_dev="${disk}p6 ${disk}p7" -vfstab_dev=$(find_vfstab_dev) -specified_dump_dev=${disk}p1 -saved_dump_dev=$(save_dump_dev) +fstab_dev=$(find_fstab_dev) +specified_dump_dev=${disk} lba=$(get_partition_end $disk 6) +$GPART delete -i 7 $disk set_partition 7 "$lba" $SIZE1 $disk create_pool "$TESTPOOL" "$pooldev1" @@ -112,7 +112,7 @@ set -A arg "$TESTPOOL $pooldev2" \ "$TESTPOOL1 raidz $diff_size_dev" \ "$TESTPOOL1 raidz1 $diff_size_dev" \ "$TESTPOOL1 mirror $mirror1 spare $mirror2 spare $diff_size_dev" \ - "$TESTPOOL1 $vfstab_dev" \ + "$TESTPOOL1 $fstab_dev" \ "$TESTPOOL1 ${disk}s10" \ "$TESTPOOL1 spare $pooldev2" @@ -130,7 +130,7 @@ log_must $ZPOOL destroy -f $TESTPOOL log_must $ZPOOL create -f $TESTPOOL3 $disk log_must $ZPOOL destroy -f $TESTPOOL3 -log_must $DUMPADM -d /dev/$specified_dump_dev +log_must dumpon $specified_dump_dev log_mustnot $ZPOOL create -f $TESTPOOL1 "$specified_dump_dev" # Also check to see that in-use checking prevents us from creating Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_012_neg.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_012_neg.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_012_neg.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -38,13 +38,12 @@ # # # DESCRIPTION: -# 'zpool create' will fail with formal disk slice in swap +# 'zpool create' will fail with disk in swap # # # STRATEGY: -# 1. Get all the disk devices in swap -# 2. For each device, try to create a new pool with this device -# 3. Verify the creation is failed. +# 1. Add a disk to swap +# 2. Try to create a pool on that disk. It should fail. # # TESTABILITY: explicit # @@ -60,21 +59,14 @@ verify_runnable "global" function cleanup { - if poolexists $TESTPOOL; then - destroy_pool $TESTPOOL - fi + $SWAPOFF $DISK0 } -typeset swap_disks=`$SWAP -l | $GREP "c[0-9].*d[0-9].*s[0-9]" | \ - $AWK '{print $1}'` -log_assert "'zpool create' should fail with disk slice in swap." +log_assert "'zpool create' should fail with disk in swap." log_onexit cleanup -for sdisk in $swap_disks; do - for opt in "-n" "" "-f"; do - log_mustnot $ZPOOL create $opt $TESTPOOL $sdisk - done -done +log_must $SWAPON $DISK0 +log_mustnot $ZPOOL create $TESTPOOL $DISK0 -log_pass "'zpool create' passed as expected with inapplicable scenario." +log_pass "'zpool create' cannot use a swap disk" Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_015_neg.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_015_neg.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_015_neg.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -62,16 +62,7 @@ verify_runnable "global" function cleanup { - # cleanup zfs pool and dataset - if datasetexists $vol_name; then - $SWAP -l | $GREP /dev/zvol/$vol_name > /dev/null 2>&1 - if [[ $? -eq 0 ]]; then - $SWAP -d /dev/zvol/${vol_name} - fi - fi - - destroy_pool $TESTPOOL1 - destroy_pool $TESTPOOL + $SWAPOFF /dev/zvol/${vol_name} } if [[ -n $DISK ]]; then @@ -80,7 +71,7 @@ else disk=$DISK0 fi -typeset pool_dev=${disk}p1 +typeset pool_dev=${disk} typeset vol_name=$TESTPOOL/$TESTVOL log_assert "'zpool create' should fail with zfs vol device in swap." @@ -91,13 +82,9 @@ log_onexit cleanup # create_pool $TESTPOOL $pool_dev log_must $ZFS create -V 100m $vol_name -log_must $SWAP -a /dev/zvol/$vol_name -for opt in "-n" "" "-f"; do +log_must $SWAPON /dev/zvol/$vol_name +for opt in "" "-f"; do log_mustnot $ZPOOL create $opt $TESTPOOL1 /dev/zvol/${vol_name} done - -# cleanup -log_must $SWAP -d /dev/zvol/${vol_name} -log_must $ZFS destroy $vol_name log_pass "'zpool create' passed as expected with inapplicable scenario." Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_test.sh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_test.sh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_test.sh Wed Oct 30 02:03:37 2019 (r354165) @@ -219,7 +219,7 @@ atf_test_case zpool_create_008_pos cleanup zpool_create_008_pos_head() { atf_set "descr" "'zpool create' have to use '-f' scenarios" - atf_set "require.progs" zpool format + atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_create_008_pos_body() @@ -300,7 +300,7 @@ atf_test_case zpool_create_011_neg cleanup zpool_create_011_neg_head() { atf_set "descr" "'zpool create' should be failed with inapplicable scenarios." - atf_set "require.progs" dumpadm zpool + atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_create_011_neg_body() @@ -310,6 +310,7 @@ zpool_create_011_neg_body() . $(atf_get_srcdir)/zpool_create.cfg verify_disk_count "$DISKS" 1 + atf_expect_fail "PR 241070 dumpon opens geom devices non-exclusively" ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_011_neg.ksh || atf_fail "Testcase failed" } @@ -323,12 +324,11 @@ zpool_create_011_neg_cleanup() } -atf_test_case zpool_create_012_neg cleanup +atf_test_case zpool_create_012_neg zpool_create_012_neg_head() { atf_set "descr" "'zpool create' should fail with disk slice in swap." - atf_set "require.progs" zpool swap - atf_set "timeout" 2400 + atf_set "require.progs" zpool } zpool_create_012_neg_body() { @@ -336,78 +336,16 @@ zpool_create_012_neg_body() . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg - ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + verify_disk_count "$DISKS" 1 ksh93 $(atf_get_srcdir)/zpool_create_012_neg.ksh || atf_fail "Testcase failed" } -zpool_create_012_neg_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/zpool_create.kshlib - . $(atf_get_srcdir)/zpool_create.cfg - ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" -} - -atf_test_case zpool_create_013_neg cleanup -zpool_create_013_neg_head() *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Oct 30 02:33:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 995B717596D; Wed, 30 Oct 2019 02:33:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472svr3MLZz4LQ8; Wed, 30 Oct 2019 02:33:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5668A399C; Wed, 30 Oct 2019 02:33:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9U2Xi1i036343; Wed, 30 Oct 2019 02:33:44 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9U2XiS8036342; Wed, 30 Oct 2019 02:33:44 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201910300233.x9U2XiS8036342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 30 Oct 2019 02:33:44 +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: r354166 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 354166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 02:33:44 -0000 Author: asomers Date: Wed Oct 30 02:33:43 2019 New Revision: 354166 URL: https://svnweb.freebsd.org/changeset/base/354166 Log: MFC r353439: MFZol: Fix performance of "zfs recv" with many deletions This patch fixes 2 issues with the DMU free throttle implemented in dmu_free_long_range(). The first issue is that get_next_chunk() was calculating the number of L1 blocks the free would dirty incorrectly. In some cases involving extremely large files, this code would greatly overestimate the number of affected L1 blocks, causing excessive calls to txg_wait_open(). This patch corrects the calculation. The second issue is that the free throttle uses the total number of free'd blocks in all (open, quiescing, and syncing) txgs to determine whether to throttle. This causes large frees (such as those created by the first issue) to cause 4 txg syncs before any further frees were allowed to proceed. This patch ensures that the accounting is done entirely in a per-txg fashion, so that frees from a given txg don't affect those that immediately follow it. Reviewed-by: Brian Behlendorf Reviewed-by: Matthew Ahrens Signed-off-by: Tom Caputi zfsonlinux/zfs@f4c594da94d856c422512a54e48070f890b2685b Freeing throttle should account for holes Deletion throttle currently does not account for holes in a file. This means that it can activate when it shouldn't. To fix it we switch the throttle to be based on the number of L1 blocks we will have to dirty when freeing Reviewed-by: Tom Caputi Reviewed-by: Matt Ahrens Reviewed-by: Brian Behlendorf Signed-off-by: Alek Pinchuk zfsonlinux/zfs@65282ee9e06b130f1f0169baf5d9bf0dd8fc1ef9 Submitted by: Alek Pinchuk Reviewed by: allanjude Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D21895 Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Wed Oct 30 02:03:37 2019 (r354165) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Wed Oct 30 02:33:43 2019 (r354166) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2017 by Delphix. All rights reserved. + * Copyright (c) 2019 Datto Inc. */ /* Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ /* Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -62,14 +63,15 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, nopwrite_enabled, CTLFL &zfs_nopwrite_enabled, 0, "Enable nopwrite feature"); /* - * Tunable to control percentage of dirtied blocks from frees in one TXG. - * After this threshold is crossed, additional dirty blocks from frees - * wait until the next TXG. + * Tunable to control percentage of dirtied L1 blocks from frees allowed into + * one TXG. After this threshold is crossed, additional dirty blocks from frees + * will wait until the next TXG. * A value of zero will disable this throttle. */ -uint32_t zfs_per_txg_dirty_frees_percent = 30; +uint32_t zfs_per_txg_dirty_frees_percent = 5; SYSCTL_INT(_vfs_zfs, OID_AUTO, per_txg_dirty_frees_percent, CTLFLAG_RWTUN, - &zfs_per_txg_dirty_frees_percent, 0, "Percentage of dirtied blocks from frees in one txg"); + &zfs_per_txg_dirty_frees_percent, 0, + "Percentage of dirtied indirect blocks from frees allowed in one txg"); /* * This can be used for testing, to ensure that certain actions happen @@ -683,11 +685,13 @@ dmu_prefetch(objset_t *os, uint64_t object, int64_t le * * On input, *start should be the first offset that does not need to be * freed (e.g. "offset + length"). On return, *start will be the first - * offset that should be freed. + * offset that should be freed and l1blks is set to the number of level 1 + * indirect blocks found within the chunk. */ static int -get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t minimum) +get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t minimum, uint64_t *l1blks) { + uint64_t blks; uint64_t maxblks = DMU_MAX_ACCESS >> (dn->dn_indblkshift + 1); /* bytes of data covered by a level-1 indirect block */ uint64_t iblkrange = @@ -695,13 +699,23 @@ get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t ASSERT3U(minimum, <=, *start); - if (*start - minimum <= iblkrange * maxblks) { + /* + * Check if we can free the entire range assuming that all of the + * L1 blocks in this range have data. If we can, we use this + * worst case value as an estimate so we can avoid having to look + * at the object's actual data. + */ + uint64_t total_l1blks = + (roundup(*start, iblkrange) - (minimum / iblkrange * iblkrange)) / + iblkrange; + if (total_l1blks <= maxblks) { + *l1blks = total_l1blks; *start = minimum; return (0); } ASSERT(ISP2(iblkrange)); - for (uint64_t blks = 0; *start > minimum && blks < maxblks; blks++) { + for (blks = 0; *start > minimum && blks < maxblks; blks++) { int err; /* @@ -711,6 +725,7 @@ get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t * to search. */ (*start)--; + err = dnode_next_offset(dn, DNODE_FIND_BACKWARDS, start, 2, 1, 0); @@ -719,6 +734,7 @@ get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t *start = minimum; break; } else if (err != 0) { + *l1blks = blks; return (err); } @@ -727,6 +743,8 @@ get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t } if (*start < minimum) *start = minimum; + *l1blks = blks; + return (0); } @@ -762,14 +780,14 @@ dmu_free_long_range_impl(objset_t *os, dnode_t *dn, ui dirty_frees_threshold = zfs_per_txg_dirty_frees_percent * zfs_dirty_data_max / 100; else - dirty_frees_threshold = zfs_dirty_data_max / 4; + dirty_frees_threshold = zfs_dirty_data_max / 20; if (length == DMU_OBJECT_END || offset + length > object_size) length = object_size - offset; while (length != 0) { uint64_t chunk_end, chunk_begin, chunk_len; - uint64_t long_free_dirty_all_txgs = 0; + uint64_t l1blks; dmu_tx_t *tx; if (dmu_objset_zfs_unmounting(dn->dn_objset)) @@ -778,7 +796,7 @@ dmu_free_long_range_impl(objset_t *os, dnode_t *dn, ui chunk_end = chunk_begin = offset + length; /* move chunk_begin backwards to the beginning of this chunk */ - err = get_next_chunk(dn, &chunk_begin, offset); + err = get_next_chunk(dn, &chunk_begin, offset, &l1blks); if (err) return (err); ASSERT3U(chunk_begin, >=, offset); @@ -786,24 +804,6 @@ dmu_free_long_range_impl(objset_t *os, dnode_t *dn, ui chunk_len = chunk_end - chunk_begin; - mutex_enter(&dp->dp_lock); - for (int t = 0; t < TXG_SIZE; t++) { - long_free_dirty_all_txgs += - dp->dp_long_free_dirty_pertxg[t]; - } - mutex_exit(&dp->dp_lock); - - /* - * To avoid filling up a TXG with just frees wait for - * the next TXG to open before freeing more chunks if - * we have reached the threshold of frees - */ - if (dirty_frees_threshold != 0 && - long_free_dirty_all_txgs >= dirty_frees_threshold) { - txg_wait_open(dp, 0); - continue; - } - tx = dmu_tx_create(os); dmu_tx_hold_free(tx, dn->dn_object, chunk_begin, chunk_len); @@ -818,13 +818,42 @@ dmu_free_long_range_impl(objset_t *os, dnode_t *dn, ui return (err); } + uint64_t txg = dmu_tx_get_txg(tx); + mutex_enter(&dp->dp_lock); - dp->dp_long_free_dirty_pertxg[dmu_tx_get_txg(tx) & TXG_MASK] += - chunk_len; + uint64_t long_free_dirty = + dp->dp_long_free_dirty_pertxg[txg & TXG_MASK]; mutex_exit(&dp->dp_lock); + + /* + * To avoid filling up a TXG with just frees, wait for + * the next TXG to open before freeing more chunks if + * we have reached the threshold of frees. + */ + if (dirty_frees_threshold != 0 && + long_free_dirty >= dirty_frees_threshold) { + dmu_tx_commit(tx); + txg_wait_open(dp, 0); + continue; + } + + /* + * In order to prevent unnecessary write throttling, for each + * TXG, we track the cumulative size of L1 blocks being dirtied + * in dnode_free_range() below. We compare this number to a + * tunable threshold, past which we prevent new L1 dirty freeing + * blocks from being added into the open TXG. See + * dmu_free_long_range_impl() for details. The threshold + * prevents write throttle activation due to dirty freeing L1 + * blocks taking up a large percentage of zfs_dirty_data_max. + */ + mutex_enter(&dp->dp_lock); + dp->dp_long_free_dirty_pertxg[txg & TXG_MASK] += + l1blks << dn->dn_indblkshift; + mutex_exit(&dp->dp_lock); DTRACE_PROBE3(free__long__range, - uint64_t, long_free_dirty_all_txgs, uint64_t, chunk_len, - uint64_t, dmu_tx_get_txg(tx)); + uint64_t, long_free_dirty, uint64_t, chunk_len, + uint64_t, txg); dnode_free_range(dn, chunk_begin, chunk_len, tx); dmu_tx_commit(tx); From owner-svn-src-all@freebsd.org Wed Oct 30 04:00:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 601EE177F7C; Wed, 30 Oct 2019 04:00:45 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472vrF1h7xz4Pj3; Wed, 30 Oct 2019 04:00:45 +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 1AA234980; Wed, 30 Oct 2019 04:00:45 +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 x9U40itO086225; Wed, 30 Oct 2019 04:00:44 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9U40iSD086188; Wed, 30 Oct 2019 04:00:44 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201910300400.x9U40iSD086188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 30 Oct 2019 04:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354167 - head/sys/x86/include X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/x86/include X-SVN-Commit-Revision: 354167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 04:00:45 -0000 Author: cem Date: Wed Oct 30 04:00:44 2019 New Revision: 354167 URL: https://svnweb.freebsd.org/changeset/base/354167 Log: amd64: Fix typo: RDPRU bit is 0x10, not 0x04 Bit 4 != 4, of course. X-MFC-With: r354162 Modified: head/sys/x86/include/specialreg.h Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Wed Oct 30 02:33:43 2019 (r354166) +++ head/sys/x86/include/specialreg.h Wed Oct 30 04:00:44 2019 (r354167) @@ -386,7 +386,7 @@ #define AMDFEID_CLZERO 0x00000001 #define AMDFEID_IRPERF 0x00000002 #define AMDFEID_XSAVEERPTR 0x00000004 -#define AMDFEID_RDPRU 0x00000004 +#define AMDFEID_RDPRU 0x00000010 #define AMDFEID_MCOMMIT 0x00000100 #define AMDFEID_WBNOINVD 0x00000200 #define AMDFEID_IBPB 0x00001000 From owner-svn-src-all@freebsd.org Wed Oct 30 07:54:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82BA917CC78; Wed, 30 Oct 2019 07:54:35 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4731232gPpz4Yqf; Wed, 30 Oct 2019 07:54:35 +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 3EF2F73F0; Wed, 30 Oct 2019 07:54:35 +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 x9U7sZrZ024149; Wed, 30 Oct 2019 07:54:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9U7sZ9t024148; Wed, 30 Oct 2019 07:54:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201910300754.x9U7sZ9t024148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 30 Oct 2019 07:54:35 +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: r354168 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 354168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 07:54:35 -0000 Author: kib Date: Wed Oct 30 07:54:34 2019 New Revision: 354168 URL: https://svnweb.freebsd.org/changeset/base/354168 Log: MFC r353930: Fix undefined behavior. Modified: stable/12/sys/kern/vfs_subr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/vfs_subr.c ============================================================================== --- stable/12/sys/kern/vfs_subr.c Wed Oct 30 04:00:44 2019 (r354167) +++ stable/12/sys/kern/vfs_subr.c Wed Oct 30 07:54:34 2019 (r354168) @@ -1244,7 +1244,7 @@ vnlru_proc(void) { struct mount *mp, *nmp; unsigned long onumvnodes; - int done, force, trigger, usevnodes; + int done, force, trigger, usevnodes, vsp; bool reclaim_nc_src; EVENTHANDLER_REGISTER(shutdown_pre_sync, kproc_shutdown, vnlruproc, @@ -1272,7 +1272,8 @@ vnlru_proc(void) force = 1; vstir = 0; } - if (vspace() >= vlowat && force == 0) { + vsp = vspace(); + if (vsp >= vlowat && force == 0) { vnlruproc_sig = 0; wakeup(&vnlruproc_sig); msleep(vnlruproc, &vnode_free_list_mtx, @@ -1339,7 +1340,8 @@ vnlru_proc(void) * After becoming active to expand above low water, keep * active until above high water. */ - force = vspace() < vhiwat; + vsp = vspace(); + force = vsp < vhiwat; } } @@ -1416,8 +1418,10 @@ vtryrecycle(struct vnode *vp) static void vcheckspace(void) { + int vsp; - if (vspace() < vlowat && vnlruproc_sig == 0) { + vsp = vspace(); + if (vsp < vlowat && vnlruproc_sig == 0) { vnlruproc_sig = 1; wakeup(vnlruproc); } From owner-svn-src-all@freebsd.org Wed Oct 30 08:06:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 399CB17D488; Wed, 30 Oct 2019 08:06:23 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4731Hg0Xvpz4ZJ1; Wed, 30 Oct 2019 08:06:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5F7D75AD; Wed, 30 Oct 2019 08:06:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9U86Mnb029888; Wed, 30 Oct 2019 08:06:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9U86M1n029887; Wed, 30 Oct 2019 08:06:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201910300806.x9U86M1n029887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 30 Oct 2019 08:06:22 +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: r354169 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 354169 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 08:06:23 -0000 Author: kib Date: Wed Oct 30 08:06:22 2019 New Revision: 354169 URL: https://svnweb.freebsd.org/changeset/base/354169 Log: MFC r353930: Fix undefined behavior. Modified: stable/11/sys/kern/vfs_subr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_subr.c ============================================================================== --- stable/11/sys/kern/vfs_subr.c Wed Oct 30 07:54:34 2019 (r354168) +++ stable/11/sys/kern/vfs_subr.c Wed Oct 30 08:06:22 2019 (r354169) @@ -1168,7 +1168,7 @@ vnlru_proc(void) { struct mount *mp, *nmp; unsigned long ofreevnodes, onumvnodes; - int done, force, reclaim_nc_src, trigger, usevnodes; + int done, force, reclaim_nc_src, trigger, usevnodes, vsp; EVENTHANDLER_REGISTER(shutdown_pre_sync, kproc_shutdown, vnlruproc, SHUTDOWN_PRI_FIRST); @@ -1196,7 +1196,8 @@ vnlru_proc(void) force = 1; vstir = 0; } - if (vspace() >= vlowat && force == 0) { + vsp = vspace(); + if (vsp >= vlowat && force == 0) { vnlruproc_sig = 0; wakeup(&vnlruproc_sig); msleep(vnlruproc, &vnode_free_list_mtx, @@ -1264,7 +1265,8 @@ vnlru_proc(void) * After becoming active to expand above low water, keep * active until above high water. */ - force = vspace() < vhiwat; + vsp = vspace(); + force = vsp < vhiwat; } } @@ -1341,8 +1343,10 @@ vtryrecycle(struct vnode *vp) static void vcheckspace(void) { + int vsp; - if (vspace() < vlowat && vnlruproc_sig == 0) { + vsp = vspace(); + if (vsp < vlowat && vnlruproc_sig == 0) { vnlruproc_sig = 1; wakeup(vnlruproc); } From owner-svn-src-all@freebsd.org Wed Oct 30 10:06:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11AD717FEDE; Wed, 30 Oct 2019 10:06:59 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4733yq0MBPz3Bs5; Wed, 30 Oct 2019 10:06:59 +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 C76F08ABD; Wed, 30 Oct 2019 10:06:58 +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 x9UA6wUU000491; Wed, 30 Oct 2019 10:06:58 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UA6wH6000488; Wed, 30 Oct 2019 10:06:58 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201910301006.x9UA6wH6000488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 Oct 2019 10:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354170 - in head/sys: arm64/arm64 arm64/include libkern X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm64/arm64 arm64/include libkern X-SVN-Commit-Revision: 354170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 10:06:59 -0000 Author: andrew Date: Wed Oct 30 10:06:57 2019 New Revision: 354170 URL: https://svnweb.freebsd.org/changeset/base/354170 Log: Rename the macros to extract a single arm64 ID field. Because of the previous naming scheme the old ID_AA64PFR0_EL1 macro collided with a potential macro for the register of the same name. To fix this collision rename these macros. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/elf32_machdep.c head/sys/arm64/include/armreg.h head/sys/libkern/gsb_crc32.c Modified: head/sys/arm64/arm64/elf32_machdep.c ============================================================================== --- head/sys/arm64/arm64/elf32_machdep.c Wed Oct 30 08:06:22 2019 (r354169) +++ head/sys/arm64/arm64/elf32_machdep.c Wed Oct 30 10:06:57 2019 (r354170) @@ -130,7 +130,7 @@ elf32_arm_abi_supported(struct image_params *imgp) const Elf32_Ehdr *hdr; /* Check if we support AArch32 */ - if (ID_AA64PFR0_EL0(READ_SPECIALREG(id_aa64pfr0_el1)) != + if (ID_AA64PFR0_EL0_VAL(READ_SPECIALREG(id_aa64pfr0_el1)) != ID_AA64PFR0_EL0_64_32) return (FALSE); Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Wed Oct 30 08:06:22 2019 (r354169) +++ head/sys/arm64/include/armreg.h Wed Oct 30 10:06:57 2019 (r354170) @@ -178,140 +178,140 @@ /* ID_AA64DFR0_EL1 */ #define ID_AA64DFR0_DebugVer_SHIFT 0 #define ID_AA64DFR0_DebugVer_MASK (UL(0xf) << ID_AA64DFR0_DebugVer_SHIFT) -#define ID_AA64DFR0_DebugVer(x) ((x) & ID_AA64DFR0_DebugVer_MASK) +#define ID_AA64DFR0_DebugVer_VAL(x) ((x) & ID_AA64DFR0_DebugVer_MASK) #define ID_AA64DFR0_DebugVer_8 (UL(0x6) << ID_AA64DFR0_DebugVer_SHIFT) #define ID_AA64DFR0_DebugVer_8_VHE (UL(0x7) << ID_AA64DFR0_DebugVer_SHIFT) #define ID_AA64DFR0_DebugVer_8_2 (UL(0x8) << ID_AA64DFR0_DebugVer_SHIFT) #define ID_AA64DFR0_TraceVer_SHIFT 4 #define ID_AA64DFR0_TraceVer_MASK (UL(0xf) << ID_AA64DFR0_TraceVer_SHIFT) -#define ID_AA64DFR0_TraceVer(x) ((x) & ID_AA64DFR0_TraceVer_MASK) +#define ID_AA64DFR0_TraceVer_VAL(x) ((x) & ID_AA64DFR0_TraceVer_MASK) #define ID_AA64DFR0_TraceVer_NONE (UL(0x0) << ID_AA64DFR0_TraceVer_SHIFT) #define ID_AA64DFR0_TraceVer_IMPL (UL(0x1) << ID_AA64DFR0_TraceVer_SHIFT) #define ID_AA64DFR0_PMUVer_SHIFT 8 #define ID_AA64DFR0_PMUVer_MASK (UL(0xf) << ID_AA64DFR0_PMUVer_SHIFT) -#define ID_AA64DFR0_PMUVer(x) ((x) & ID_AA64DFR0_PMUVer_MASK) +#define ID_AA64DFR0_PMUVer_VAL(x) ((x) & ID_AA64DFR0_PMUVer_MASK) #define ID_AA64DFR0_PMUVer_NONE (UL(0x0) << ID_AA64DFR0_PMUVer_SHIFT) #define ID_AA64DFR0_PMUVer_3 (UL(0x1) << ID_AA64DFR0_PMUVer_SHIFT) #define ID_AA64DFR0_PMUVer_3_1 (UL(0x4) << ID_AA64DFR0_PMUVer_SHIFT) #define ID_AA64DFR0_PMUVer_IMPL (UL(0xf) << ID_AA64DFR0_PMUVer_SHIFT) #define ID_AA64DFR0_BRPs_SHIFT 12 #define ID_AA64DFR0_BRPs_MASK (UL(0xf) << ID_AA64DFR0_BRPs_SHIFT) -#define ID_AA64DFR0_BRPs(x) \ +#define ID_AA64DFR0_BRPs_VAL(x) \ ((((x) >> ID_AA64DFR0_BRPs_SHIFT) & 0xf) + 1) #define ID_AA64DFR0_WRPs_SHIFT 20 #define ID_AA64DFR0_WRPs_MASK (UL(0xf) << ID_AA64DFR0_WRPs_SHIFT) -#define ID_AA64DFR0_WRPs(x) \ +#define ID_AA64DFR0_WRPs_VAL(x) \ ((((x) >> ID_AA64DFR0_WRPs_SHIFT) & 0xf) + 1) #define ID_AA64DFR0_CTX_CMPs_SHIFT 28 #define ID_AA64DFR0_CTX_CMPs_MASK (UL(0xf) << ID_AA64DFR0_CTX_CMPs_SHIFT) -#define ID_AA64DFR0_CTX_CMPs(x) \ +#define ID_AA64DFR0_CTX_CMPs_VAL(x) \ ((((x) >> ID_AA64DFR0_CTX_CMPs_SHIFT) & 0xf) + 1) #define ID_AA64DFR0_PMSVer_SHIFT 32 #define ID_AA64DFR0_PMSVer_MASK (UL(0xf) << ID_AA64DFR0_PMSVer_SHIFT) -#define ID_AA64DFR0_PMSVer(x) ((x) & ID_AA64DFR0_PMSVer_MASK) +#define ID_AA64DFR0_PMSVer_VAL(x) ((x) & ID_AA64DFR0_PMSVer_MASK) #define ID_AA64DFR0_PMSVer_NONE (UL(0x0) << ID_AA64DFR0_PMSVer_SHIFT) #define ID_AA64DFR0_PMSVer_V1 (UL(0x1) << ID_AA64DFR0_PMSVer_SHIFT) /* ID_AA64ISAR0_EL1 */ #define ID_AA64ISAR0_AES_SHIFT 4 #define ID_AA64ISAR0_AES_MASK (UL(0xf) << ID_AA64ISAR0_AES_SHIFT) -#define ID_AA64ISAR0_AES(x) ((x) & ID_AA64ISAR0_AES_MASK) +#define ID_AA64ISAR0_AES_VAL(x) ((x) & ID_AA64ISAR0_AES_MASK) #define ID_AA64ISAR0_AES_NONE (UL(0x0) << ID_AA64ISAR0_AES_SHIFT) #define ID_AA64ISAR0_AES_BASE (UL(0x1) << ID_AA64ISAR0_AES_SHIFT) #define ID_AA64ISAR0_AES_PMULL (UL(0x2) << ID_AA64ISAR0_AES_SHIFT) #define ID_AA64ISAR0_SHA1_SHIFT 8 #define ID_AA64ISAR0_SHA1_MASK (UL(0xf) << ID_AA64ISAR0_SHA1_SHIFT) -#define ID_AA64ISAR0_SHA1(x) ((x) & ID_AA64ISAR0_SHA1_MASK) +#define ID_AA64ISAR0_SHA1_VAL(x) ((x) & ID_AA64ISAR0_SHA1_MASK) #define ID_AA64ISAR0_SHA1_NONE (UL(0x0) << ID_AA64ISAR0_SHA1_SHIFT) #define ID_AA64ISAR0_SHA1_BASE (UL(0x1) << ID_AA64ISAR0_SHA1_SHIFT) #define ID_AA64ISAR0_SHA2_SHIFT 12 #define ID_AA64ISAR0_SHA2_MASK (UL(0xf) << ID_AA64ISAR0_SHA2_SHIFT) -#define ID_AA64ISAR0_SHA2(x) ((x) & ID_AA64ISAR0_SHA2_MASK) +#define ID_AA64ISAR0_SHA2_VAL(x) ((x) & ID_AA64ISAR0_SHA2_MASK) #define ID_AA64ISAR0_SHA2_NONE (UL(0x0) << ID_AA64ISAR0_SHA2_SHIFT) #define ID_AA64ISAR0_SHA2_BASE (UL(0x1) << ID_AA64ISAR0_SHA2_SHIFT) #define ID_AA64ISAR0_SHA2_512 (UL(0x2) << ID_AA64ISAR0_SHA2_SHIFT) #define ID_AA64ISAR0_CRC32_SHIFT 16 #define ID_AA64ISAR0_CRC32_MASK (UL(0xf) << ID_AA64ISAR0_CRC32_SHIFT) -#define ID_AA64ISAR0_CRC32(x) ((x) & ID_AA64ISAR0_CRC32_MASK) +#define ID_AA64ISAR0_CRC32_VAL(x) ((x) & ID_AA64ISAR0_CRC32_MASK) #define ID_AA64ISAR0_CRC32_NONE (UL(0x0) << ID_AA64ISAR0_CRC32_SHIFT) #define ID_AA64ISAR0_CRC32_BASE (UL(0x1) << ID_AA64ISAR0_CRC32_SHIFT) #define ID_AA64ISAR0_Atomic_SHIFT 20 #define ID_AA64ISAR0_Atomic_MASK (UL(0xf) << ID_AA64ISAR0_Atomic_SHIFT) -#define ID_AA64ISAR0_Atomic(x) ((x) & ID_AA64ISAR0_Atomic_MASK) +#define ID_AA64ISAR0_Atomic_VAL(x) ((x) & ID_AA64ISAR0_Atomic_MASK) #define ID_AA64ISAR0_Atomic_NONE (UL(0x0) << ID_AA64ISAR0_Atomic_SHIFT) #define ID_AA64ISAR0_Atomic_IMPL (UL(0x2) << ID_AA64ISAR0_Atomic_SHIFT) #define ID_AA64ISAR0_RDM_SHIFT 28 #define ID_AA64ISAR0_RDM_MASK (UL(0xf) << ID_AA64ISAR0_RDM_SHIFT) -#define ID_AA64ISAR0_RDM(x) ((x) & ID_AA64ISAR0_RDM_MASK) +#define ID_AA64ISAR0_RDM_VAL(x) ((x) & ID_AA64ISAR0_RDM_MASK) #define ID_AA64ISAR0_RDM_NONE (UL(0x0) << ID_AA64ISAR0_RDM_SHIFT) #define ID_AA64ISAR0_RDM_IMPL (UL(0x1) << ID_AA64ISAR0_RDM_SHIFT) #define ID_AA64ISAR0_SHA3_SHIFT 32 #define ID_AA64ISAR0_SHA3_MASK (UL(0xf) << ID_AA64ISAR0_SHA3_SHIFT) -#define ID_AA64ISAR0_SHA3(x) ((x) & ID_AA64ISAR0_SHA3_MASK) +#define ID_AA64ISAR0_SHA3_VAL(x) ((x) & ID_AA64ISAR0_SHA3_MASK) #define ID_AA64ISAR0_SHA3_NONE (UL(0x0) << ID_AA64ISAR0_SHA3_SHIFT) #define ID_AA64ISAR0_SHA3_IMPL (UL(0x1) << ID_AA64ISAR0_SHA3_SHIFT) #define ID_AA64ISAR0_SM3_SHIFT 36 #define ID_AA64ISAR0_SM3_MASK (UL(0xf) << ID_AA64ISAR0_SM3_SHIFT) -#define ID_AA64ISAR0_SM3(x) ((x) & ID_AA64ISAR0_SM3_MASK) +#define ID_AA64ISAR0_SM3_VAL(x) ((x) & ID_AA64ISAR0_SM3_MASK) #define ID_AA64ISAR0_SM3_NONE (UL(0x0) << ID_AA64ISAR0_SM3_SHIFT) #define ID_AA64ISAR0_SM3_IMPL (UL(0x1) << ID_AA64ISAR0_SM3_SHIFT) #define ID_AA64ISAR0_SM4_SHIFT 40 #define ID_AA64ISAR0_SM4_MASK (UL(0xf) << ID_AA64ISAR0_SM4_SHIFT) -#define ID_AA64ISAR0_SM4(x) ((x) & ID_AA64ISAR0_SM4_MASK) +#define ID_AA64ISAR0_SM4_VAL(x) ((x) & ID_AA64ISAR0_SM4_MASK) #define ID_AA64ISAR0_SM4_NONE (UL(0x0) << ID_AA64ISAR0_SM4_SHIFT) #define ID_AA64ISAR0_SM4_IMPL (UL(0x1) << ID_AA64ISAR0_SM4_SHIFT) #define ID_AA64ISAR0_DP_SHIFT 44 #define ID_AA64ISAR0_DP_MASK (UL(0xf) << ID_AA64ISAR0_DP_SHIFT) -#define ID_AA64ISAR0_DP(x) ((x) & ID_AA64ISAR0_DP_MASK) +#define ID_AA64ISAR0_DP_VAL(x) ((x) & ID_AA64ISAR0_DP_MASK) #define ID_AA64ISAR0_DP_NONE (UL(0x0) << ID_AA64ISAR0_DP_SHIFT) #define ID_AA64ISAR0_DP_IMPL (UL(0x1) << ID_AA64ISAR0_DP_SHIFT) /* ID_AA64ISAR1_EL1 */ #define ID_AA64ISAR1_DPB_SHIFT 0 #define ID_AA64ISAR1_DPB_MASK (UL(0xf) << ID_AA64ISAR1_DPB_SHIFT) -#define ID_AA64ISAR1_DPB(x) ((x) & ID_AA64ISAR1_DPB_MASK) +#define ID_AA64ISAR1_DPB_VAL(x) ((x) & ID_AA64ISAR1_DPB_MASK) #define ID_AA64ISAR1_DPB_NONE (UL(0x0) << ID_AA64ISAR1_DPB_SHIFT) #define ID_AA64ISAR1_DPB_IMPL (UL(0x1) << ID_AA64ISAR1_DPB_SHIFT) #define ID_AA64ISAR1_APA_SHIFT 4 #define ID_AA64ISAR1_APA_MASK (UL(0xf) << ID_AA64ISAR1_APA_SHIFT) -#define ID_AA64ISAR1_APA(x) ((x) & ID_AA64ISAR1_APA_MASK) +#define ID_AA64ISAR1_APA_VAL(x) ((x) & ID_AA64ISAR1_APA_MASK) #define ID_AA64ISAR1_APA_NONE (UL(0x0) << ID_AA64ISAR1_APA_SHIFT) #define ID_AA64ISAR1_APA_IMPL (UL(0x1) << ID_AA64ISAR1_APA_SHIFT) #define ID_AA64ISAR1_API_SHIFT 8 #define ID_AA64ISAR1_API_MASK (UL(0xf) << ID_AA64ISAR1_API_SHIFT) -#define ID_AA64ISAR1_API(x) ((x) & ID_AA64ISAR1_API_MASK) +#define ID_AA64ISAR1_API_VAL(x) ((x) & ID_AA64ISAR1_API_MASK) #define ID_AA64ISAR1_API_NONE (UL(0x0) << ID_AA64ISAR1_API_SHIFT) #define ID_AA64ISAR1_API_IMPL (UL(0x1) << ID_AA64ISAR1_API_SHIFT) #define ID_AA64ISAR1_JSCVT_SHIFT 12 #define ID_AA64ISAR1_JSCVT_MASK (UL(0xf) << ID_AA64ISAR1_JSCVT_SHIFT) -#define ID_AA64ISAR1_JSCVT(x) ((x) & ID_AA64ISAR1_JSCVT_MASK) +#define ID_AA64ISAR1_JSCVT_VAL(x) ((x) & ID_AA64ISAR1_JSCVT_MASK) #define ID_AA64ISAR1_JSCVT_NONE (UL(0x0) << ID_AA64ISAR1_JSCVT_SHIFT) #define ID_AA64ISAR1_JSCVT_IMPL (UL(0x1) << ID_AA64ISAR1_JSCVT_SHIFT) #define ID_AA64ISAR1_FCMA_SHIFT 16 #define ID_AA64ISAR1_FCMA_MASK (UL(0xf) << ID_AA64ISAR1_FCMA_SHIFT) -#define ID_AA64ISAR1_FCMA(x) ((x) & ID_AA64ISAR1_FCMA_MASK) +#define ID_AA64ISAR1_FCMA_VAL(x) ((x) & ID_AA64ISAR1_FCMA_MASK) #define ID_AA64ISAR1_FCMA_NONE (UL(0x0) << ID_AA64ISAR1_FCMA_SHIFT) #define ID_AA64ISAR1_FCMA_IMPL (UL(0x1) << ID_AA64ISAR1_FCMA_SHIFT) #define ID_AA64ISAR1_LRCPC_SHIFT 20 #define ID_AA64ISAR1_LRCPC_MASK (UL(0xf) << ID_AA64ISAR1_LRCPC_SHIFT) -#define ID_AA64ISAR1_LRCPC(x) ((x) & ID_AA64ISAR1_LRCPC_MASK) +#define ID_AA64ISAR1_LRCPC_VAL(x) ((x) & ID_AA64ISAR1_LRCPC_MASK) #define ID_AA64ISAR1_LRCPC_NONE (UL(0x0) << ID_AA64ISAR1_LRCPC_SHIFT) #define ID_AA64ISAR1_LRCPC_IMPL (UL(0x1) << ID_AA64ISAR1_LRCPC_SHIFT) #define ID_AA64ISAR1_GPA_SHIFT 24 #define ID_AA64ISAR1_GPA_MASK (UL(0xf) << ID_AA64ISAR1_GPA_SHIFT) -#define ID_AA64ISAR1_GPA(x) ((x) & ID_AA64ISAR1_GPA_MASK) +#define ID_AA64ISAR1_GPA_VAL(x) ((x) & ID_AA64ISAR1_GPA_MASK) #define ID_AA64ISAR1_GPA_NONE (UL(0x0) << ID_AA64ISAR1_GPA_SHIFT) #define ID_AA64ISAR1_GPA_IMPL (UL(0x1) << ID_AA64ISAR1_GPA_SHIFT) #define ID_AA64ISAR1_GPI_SHIFT 28 #define ID_AA64ISAR1_GPI_MASK (UL(0xf) << ID_AA64ISAR1_GPI_SHIFT) -#define ID_AA64ISAR1_GPI(x) ((x) & ID_AA64ISAR1_GPI_MASK) +#define ID_AA64ISAR1_GPI_VAL(x) ((x) & ID_AA64ISAR1_GPI_MASK) #define ID_AA64ISAR1_GPI_NONE (UL(0x0) << ID_AA64ISAR1_GPI_SHIFT) #define ID_AA64ISAR1_GPI_IMPL (UL(0x1) << ID_AA64ISAR1_GPI_SHIFT) /* ID_AA64MMFR0_EL1 */ #define ID_AA64MMFR0_PARange_SHIFT 0 #define ID_AA64MMFR0_PARange_MASK (UL(0xf) << ID_AA64MMFR0_PARange_SHIFT) -#define ID_AA64MMFR0_PARange(x) ((x) & ID_AA64MMFR0_PARange_MASK) +#define ID_AA64MMFR0_PARange_VAL(x) ((x) & ID_AA64MMFR0_PARange_MASK) #define ID_AA64MMFR0_PARange_4G (UL(0x0) << ID_AA64MMFR0_PARange_SHIFT) #define ID_AA64MMFR0_PARange_64G (UL(0x1) << ID_AA64MMFR0_PARange_SHIFT) #define ID_AA64MMFR0_PARange_1T (UL(0x2) << ID_AA64MMFR0_PARange_SHIFT) @@ -321,82 +321,82 @@ #define ID_AA64MMFR0_PARange_4P (UL(0x6) << ID_AA64MMFR0_PARange_SHIFT) #define ID_AA64MMFR0_ASIDBits_SHIFT 4 #define ID_AA64MMFR0_ASIDBits_MASK (UL(0xf) << ID_AA64MMFR0_ASIDBits_SHIFT) -#define ID_AA64MMFR0_ASIDBits(x) ((x) & ID_AA64MMFR0_ASIDBits_MASK) +#define ID_AA64MMFR0_ASIDBits_VAL(x) ((x) & ID_AA64MMFR0_ASIDBits_MASK) #define ID_AA64MMFR0_ASIDBits_8 (UL(0x0) << ID_AA64MMFR0_ASIDBits_SHIFT) #define ID_AA64MMFR0_ASIDBits_16 (UL(0x2) << ID_AA64MMFR0_ASIDBits_SHIFT) #define ID_AA64MMFR0_BigEnd_SHIFT 8 #define ID_AA64MMFR0_BigEnd_MASK (UL(0xf) << ID_AA64MMFR0_BigEnd_SHIFT) -#define ID_AA64MMFR0_BigEnd(x) ((x) & ID_AA64MMFR0_BigEnd_MASK) +#define ID_AA64MMFR0_BigEnd_VAL(x) ((x) & ID_AA64MMFR0_BigEnd_MASK) #define ID_AA64MMFR0_BigEnd_FIXED (UL(0x0) << ID_AA64MMFR0_BigEnd_SHIFT) #define ID_AA64MMFR0_BigEnd_MIXED (UL(0x1) << ID_AA64MMFR0_BigEnd_SHIFT) #define ID_AA64MMFR0_SNSMem_SHIFT 12 #define ID_AA64MMFR0_SNSMem_MASK (UL(0xf) << ID_AA64MMFR0_SNSMem_SHIFT) -#define ID_AA64MMFR0_SNSMem(x) ((x) & ID_AA64MMFR0_SNSMem_MASK) +#define ID_AA64MMFR0_SNSMem_VAL(x) ((x) & ID_AA64MMFR0_SNSMem_MASK) #define ID_AA64MMFR0_SNSMem_NONE (UL(0x0) << ID_AA64MMFR0_SNSMem_SHIFT) #define ID_AA64MMFR0_SNSMem_DISTINCT (UL(0x1) << ID_AA64MMFR0_SNSMem_SHIFT) #define ID_AA64MMFR0_BigEndEL0_SHIFT 16 #define ID_AA64MMFR0_BigEndEL0_MASK (UL(0xf) << ID_AA64MMFR0_BigEndEL0_SHIFT) -#define ID_AA64MMFR0_BigEndEL0(x) ((x) & ID_AA64MMFR0_BigEndEL0_MASK) +#define ID_AA64MMFR0_BigEndEL0_VAL(x) ((x) & ID_AA64MMFR0_BigEndEL0_MASK) #define ID_AA64MMFR0_BigEndEL0_FIXED (UL(0x0) << ID_AA64MMFR0_BigEndEL0_SHIFT) #define ID_AA64MMFR0_BigEndEL0_MIXED (UL(0x1) << ID_AA64MMFR0_BigEndEL0_SHIFT) #define ID_AA64MMFR0_TGran16_SHIFT 20 #define ID_AA64MMFR0_TGran16_MASK (UL(0xf) << ID_AA64MMFR0_TGran16_SHIFT) -#define ID_AA64MMFR0_TGran16(x) ((x) & ID_AA64MMFR0_TGran16_MASK) +#define ID_AA64MMFR0_TGran16_VAL(x) ((x) & ID_AA64MMFR0_TGran16_MASK) #define ID_AA64MMFR0_TGran16_NONE (UL(0x0) << ID_AA64MMFR0_TGran16_SHIFT) #define ID_AA64MMFR0_TGran16_IMPL (UL(0x1) << ID_AA64MMFR0_TGran16_SHIFT) #define ID_AA64MMFR0_TGran64_SHIFT 24 #define ID_AA64MMFR0_TGran64_MASK (UL(0xf) << ID_AA64MMFR0_TGran64_SHIFT) -#define ID_AA64MMFR0_TGran64(x) ((x) & ID_AA64MMFR0_TGran64_MASK) +#define ID_AA64MMFR0_TGran64_VAL(x) ((x) & ID_AA64MMFR0_TGran64_MASK) #define ID_AA64MMFR0_TGran64_IMPL (UL(0x0) << ID_AA64MMFR0_TGran64_SHIFT) #define ID_AA64MMFR0_TGran64_NONE (UL(0xf) << ID_AA64MMFR0_TGran64_SHIFT) #define ID_AA64MMFR0_TGran4_SHIFT 28 #define ID_AA64MMFR0_TGran4_MASK (UL(0xf) << ID_AA64MMFR0_TGran4_SHIFT) -#define ID_AA64MMFR0_TGran4(x) ((x) & ID_AA64MMFR0_TGran4_MASK) +#define ID_AA64MMFR0_TGran4_VAL(x) ((x) & ID_AA64MMFR0_TGran4_MASK) #define ID_AA64MMFR0_TGran4_IMPL (UL(0x0) << ID_AA64MMFR0_TGran4_SHIFT) #define ID_AA64MMFR0_TGran4_NONE (UL(0xf) << ID_AA64MMFR0_TGran4_SHIFT) /* ID_AA64MMFR1_EL1 */ #define ID_AA64MMFR1_HAFDBS_SHIFT 0 #define ID_AA64MMFR1_HAFDBS_MASK (UL(0xf) << ID_AA64MMFR1_HAFDBS_SHIFT) -#define ID_AA64MMFR1_HAFDBS(x) ((x) & ID_AA64MMFR1_HAFDBS_MASK) +#define ID_AA64MMFR1_HAFDBS_VAL(x) ((x) & ID_AA64MMFR1_HAFDBS_MASK) #define ID_AA64MMFR1_HAFDBS_NONE (UL(0x0) << ID_AA64MMFR1_HAFDBS_SHIFT) #define ID_AA64MMFR1_HAFDBS_AF (UL(0x1) << ID_AA64MMFR1_HAFDBS_SHIFT) #define ID_AA64MMFR1_HAFDBS_AF_DBS (UL(0x2) << ID_AA64MMFR1_HAFDBS_SHIFT) #define ID_AA64MMFR1_VMIDBits_SHIFT 4 #define ID_AA64MMFR1_VMIDBits_MASK (UL(0xf) << ID_AA64MMFR1_VMIDBits_SHIFT) -#define ID_AA64MMFR1_VMIDBits(x) ((x) & ID_AA64MMFR1_VMIDBits_MASK) +#define ID_AA64MMFR1_VMIDBits_VAL(x) ((x) & ID_AA64MMFR1_VMIDBits_MASK) #define ID_AA64MMFR1_VMIDBits_8 (UL(0x0) << ID_AA64MMFR1_VMIDBits_SHIFT) #define ID_AA64MMFR1_VMIDBits_16 (UL(0x2) << ID_AA64MMFR1_VMIDBits_SHIFT) #define ID_AA64MMFR1_VH_SHIFT 8 #define ID_AA64MMFR1_VH_MASK (UL(0xf) << ID_AA64MMFR1_VH_SHIFT) -#define ID_AA64MMFR1_VH(x) ((x) & ID_AA64MMFR1_VH_MASK) +#define ID_AA64MMFR1_VH_VAL(x) ((x) & ID_AA64MMFR1_VH_MASK) #define ID_AA64MMFR1_VH_NONE (UL(0x0) << ID_AA64MMFR1_VH_SHIFT) #define ID_AA64MMFR1_VH_IMPL (UL(0x1) << ID_AA64MMFR1_VH_SHIFT) #define ID_AA64MMFR1_HPDS_SHIFT 12 #define ID_AA64MMFR1_HPDS_MASK (UL(0xf) << ID_AA64MMFR1_HPDS_SHIFT) -#define ID_AA64MMFR1_HPDS(x) ((x) & ID_AA64MMFR1_HPDS_MASK) +#define ID_AA64MMFR1_HPDS_VAL(x) ((x) & ID_AA64MMFR1_HPDS_MASK) #define ID_AA64MMFR1_HPDS_NONE (UL(0x0) << ID_AA64MMFR1_HPDS_SHIFT) #define ID_AA64MMFR1_HPDS_HPD (UL(0x1) << ID_AA64MMFR1_HPDS_SHIFT) #define ID_AA64MMFR1_HPDS_TTPBHA (UL(0x2) << ID_AA64MMFR1_HPDS_SHIFT) #define ID_AA64MMFR1_LO_SHIFT 16 #define ID_AA64MMFR1_LO_MASK (UL(0xf) << ID_AA64MMFR1_LO_SHIFT) -#define ID_AA64MMFR1_LO(x) ((x) & ID_AA64MMFR1_LO_MASK) +#define ID_AA64MMFR1_LO_VAL(x) ((x) & ID_AA64MMFR1_LO_MASK) #define ID_AA64MMFR1_LO_NONE (UL(0x0) << ID_AA64MMFR1_LO_SHIFT) #define ID_AA64MMFR1_LO_IMPL (UL(0x1) << ID_AA64MMFR1_LO_SHIFT) #define ID_AA64MMFR1_PAN_SHIFT 20 #define ID_AA64MMFR1_PAN_MASK (UL(0xf) << ID_AA64MMFR1_PAN_SHIFT) -#define ID_AA64MMFR1_PAN(x) ((x) & ID_AA64MMFR1_PAN_MASK) +#define ID_AA64MMFR1_PAN_VAL(x) ((x) & ID_AA64MMFR1_PAN_MASK) #define ID_AA64MMFR1_PAN_NONE (UL(0x0) << ID_AA64MMFR1_PAN_SHIFT) #define ID_AA64MMFR1_PAN_IMPL (UL(0x1) << ID_AA64MMFR1_PAN_SHIFT) #define ID_AA64MMFR1_PAN_ATS1E1 (UL(0x2) << ID_AA64MMFR1_PAN_SHIFT) #define ID_AA64MMFR1_SpecSEI_SHIFT 24 #define ID_AA64MMFR1_SpecSEI_MASK (UL(0xf) << ID_AA64MMFR1_SpecSEI_SHIFT) -#define ID_AA64MMFR1_SpecSEI(x) ((x) & ID_AA64MMFR1_SpecSEI_MASK) +#define ID_AA64MMFR1_SpecSEI_VAL(x) ((x) & ID_AA64MMFR1_SpecSEI_MASK) #define ID_AA64MMFR1_SpecSEI_NONE (UL(0x0) << ID_AA64MMFR1_SpecSEI_SHIFT) #define ID_AA64MMFR1_SpecSEI_IMPL (UL(0x1) << ID_AA64MMFR1_SpecSEI_SHIFT) #define ID_AA64MMFR1_XNX_SHIFT 28 #define ID_AA64MMFR1_XNX_MASK (UL(0xf) << ID_AA64MMFR1_XNX_SHIFT) -#define ID_AA64MMFR1_XNX(x) ((x) & ID_AA64MMFR1_XNX_MASK) +#define ID_AA64MMFR1_XNX_VAL(x) ((x) & ID_AA64MMFR1_XNX_MASK) #define ID_AA64MMFR1_XNX_NONE (UL(0x0) << ID_AA64MMFR1_XNX_SHIFT) #define ID_AA64MMFR1_XNX_IMPL (UL(0x1) << ID_AA64MMFR1_XNX_SHIFT) @@ -404,89 +404,89 @@ #define ID_AA64MMFR2_EL1 S3_0_C0_C7_2 #define ID_AA64MMFR2_CnP_SHIFT 0 #define ID_AA64MMFR2_CnP_MASK (UL(0xf) << ID_AA64MMFR2_CnP_SHIFT) -#define ID_AA64MMFR2_CnP(x) ((x) & ID_AA64MMFR2_CnP_MASK) +#define ID_AA64MMFR2_CnP_VAL(x) ((x) & ID_AA64MMFR2_CnP_MASK) #define ID_AA64MMFR2_CnP_NONE (UL(0x0) << ID_AA64MMFR2_CnP_SHIFT) #define ID_AA64MMFR2_CnP_IMPL (UL(0x1) << ID_AA64MMFR2_CnP_SHIFT) #define ID_AA64MMFR2_UAO_SHIFT 4 #define ID_AA64MMFR2_UAO_MASK (UL(0xf) << ID_AA64MMFR2_UAO_SHIFT) -#define ID_AA64MMFR2_UAO(x) ((x) & ID_AA64MMFR2_UAO_MASK) +#define ID_AA64MMFR2_UAO_VAL(x) ((x) & ID_AA64MMFR2_UAO_MASK) #define ID_AA64MMFR2_UAO_NONE (UL(0x0) << ID_AA64MMFR2_UAO_SHIFT) #define ID_AA64MMFR2_UAO_IMPL (UL(0x1) << ID_AA64MMFR2_UAO_SHIFT) #define ID_AA64MMFR2_LSM_SHIFT 8 #define ID_AA64MMFR2_LSM_MASK (UL(0xf) << ID_AA64MMFR2_LSM_SHIFT) -#define ID_AA64MMFR2_LSM(x) ((x) & ID_AA64MMFR2_LSM_MASK) +#define ID_AA64MMFR2_LSM_VAL(x) ((x) & ID_AA64MMFR2_LSM_MASK) #define ID_AA64MMFR2_LSM_NONE (UL(0x0) << ID_AA64MMFR2_LSM_SHIFT) #define ID_AA64MMFR2_LSM_IMPL (UL(0x1) << ID_AA64MMFR2_LSM_SHIFT) #define ID_AA64MMFR2_IESB_SHIFT 12 #define ID_AA64MMFR2_IESB_MASK (UL(0xf) << ID_AA64MMFR2_IESB_SHIFT) -#define ID_AA64MMFR2_IESB(x) ((x) & ID_AA64MMFR2_IESB_MASK) +#define ID_AA64MMFR2_IESB_VAL(x) ((x) & ID_AA64MMFR2_IESB_MASK) #define ID_AA64MMFR2_IESB_NONE (UL(0x0) << ID_AA64MMFR2_IESB_SHIFT) #define ID_AA64MMFR2_IESB_IMPL (UL(0x1) << ID_AA64MMFR2_IESB_SHIFT) #define ID_AA64MMFR2_VARange_SHIFT 16 #define ID_AA64MMFR2_VARange_MASK (UL(0xf) << ID_AA64MMFR2_VARange_SHIFT) -#define ID_AA64MMFR2_VARange(x) ((x) & ID_AA64MMFR2_VARange_MASK) +#define ID_AA64MMFR2_VARange_VAL(x) ((x) & ID_AA64MMFR2_VARange_MASK) #define ID_AA64MMFR2_VARange_48 (UL(0x0) << ID_AA64MMFR2_VARange_SHIFT) #define ID_AA64MMFR2_VARange_52 (UL(0x1) << ID_AA64MMFR2_VARange_SHIFT) #define ID_AA64MMFR2_CCIDX_SHIFT 20 #define ID_AA64MMFR2_CCIDX_MASK (UL(0xf) << ID_AA64MMFR2_CCIDX_SHIFT) -#define ID_AA64MMFR2_CCIDX(x) ((x) & ID_AA64MMFR2_CCIDX_MASK) +#define ID_AA64MMFR2_CCIDX_VAL(x) ((x) & ID_AA64MMFR2_CCIDX_MASK) #define ID_AA64MMFR2_CCIDX_32 (UL(0x0) << ID_AA64MMFR2_CCIDX_SHIFT) #define ID_AA64MMFR2_CCIDX_64 (UL(0x1) << ID_AA64MMFR2_CCIDX_SHIFT) #define ID_AA64MMFR2_NV_SHIFT 24 #define ID_AA64MMFR2_NV_MASK (UL(0xf) << ID_AA64MMFR2_NV_SHIFT) -#define ID_AA64MMFR2_NV(x) ((x) & ID_AA64MMFR2_NV_MASK) +#define ID_AA64MMFR2_NV_VAL(x) ((x) & ID_AA64MMFR2_NV_MASK) #define ID_AA64MMFR2_NV_NONE (UL(0x0) << ID_AA64MMFR2_NV_SHIFT) #define ID_AA64MMFR2_NV_IMPL (UL(0x1) << ID_AA64MMFR2_NV_SHIFT) /* ID_AA64PFR0_EL1 */ #define ID_AA64PFR0_EL0_SHIFT 0 #define ID_AA64PFR0_EL0_MASK (UL(0xf) << ID_AA64PFR0_EL0_SHIFT) -#define ID_AA64PFR0_EL0(x) ((x) & ID_AA64PFR0_EL0_MASK) +#define ID_AA64PFR0_EL0_VAL(x) ((x) & ID_AA64PFR0_EL0_MASK) #define ID_AA64PFR0_EL0_64 (UL(0x1) << ID_AA64PFR0_EL0_SHIFT) #define ID_AA64PFR0_EL0_64_32 (UL(0x2) << ID_AA64PFR0_EL0_SHIFT) #define ID_AA64PFR0_EL1_SHIFT 4 #define ID_AA64PFR0_EL1_MASK (UL(0xf) << ID_AA64PFR0_EL1_SHIFT) -#define ID_AA64PFR0_EL1(x) ((x) & ID_AA64PFR0_EL1_MASK) +#define ID_AA64PFR0_EL1_VAL(x) ((x) & ID_AA64PFR0_EL1_MASK) #define ID_AA64PFR0_EL1_64 (UL(0x1) << ID_AA64PFR0_EL1_SHIFT) #define ID_AA64PFR0_EL1_64_32 (UL(0x2) << ID_AA64PFR0_EL1_SHIFT) #define ID_AA64PFR0_EL2_SHIFT 8 #define ID_AA64PFR0_EL2_MASK (UL(0xf) << ID_AA64PFR0_EL2_SHIFT) -#define ID_AA64PFR0_EL2(x) ((x) & ID_AA64PFR0_EL2_MASK) +#define ID_AA64PFR0_EL2_VAL(x) ((x) & ID_AA64PFR0_EL2_MASK) #define ID_AA64PFR0_EL2_NONE (UL(0x0) << ID_AA64PFR0_EL2_SHIFT) #define ID_AA64PFR0_EL2_64 (UL(0x1) << ID_AA64PFR0_EL2_SHIFT) #define ID_AA64PFR0_EL2_64_32 (UL(0x2) << ID_AA64PFR0_EL2_SHIFT) #define ID_AA64PFR0_EL3_SHIFT 12 #define ID_AA64PFR0_EL3_MASK (UL(0xf) << ID_AA64PFR0_EL3_SHIFT) -#define ID_AA64PFR0_EL3(x) ((x) & ID_AA64PFR0_EL3_MASK) +#define ID_AA64PFR0_EL3_VAL(x) ((x) & ID_AA64PFR0_EL3_MASK) #define ID_AA64PFR0_EL3_NONE (UL(0x0) << ID_AA64PFR0_EL3_SHIFT) #define ID_AA64PFR0_EL3_64 (UL(0x1) << ID_AA64PFR0_EL3_SHIFT) #define ID_AA64PFR0_EL3_64_32 (UL(0x2) << ID_AA64PFR0_EL3_SHIFT) #define ID_AA64PFR0_FP_SHIFT 16 #define ID_AA64PFR0_FP_MASK (UL(0xf) << ID_AA64PFR0_FP_SHIFT) -#define ID_AA64PFR0_FP(x) ((x) & ID_AA64PFR0_FP_MASK) +#define ID_AA64PFR0_FP_VAL(x) ((x) & ID_AA64PFR0_FP_MASK) #define ID_AA64PFR0_FP_IMPL (UL(0x0) << ID_AA64PFR0_FP_SHIFT) #define ID_AA64PFR0_FP_HP (UL(0x1) << ID_AA64PFR0_FP_SHIFT) #define ID_AA64PFR0_FP_NONE (UL(0xf) << ID_AA64PFR0_FP_SHIFT) #define ID_AA64PFR0_AdvSIMD_SHIFT 20 #define ID_AA64PFR0_AdvSIMD_MASK (UL(0xf) << ID_AA64PFR0_AdvSIMD_SHIFT) -#define ID_AA64PFR0_AdvSIMD(x) ((x) & ID_AA64PFR0_AdvSIMD_MASK) +#define ID_AA64PFR0_AdvSIMD_VAL(x) ((x) & ID_AA64PFR0_AdvSIMD_MASK) #define ID_AA64PFR0_AdvSIMD_IMPL (UL(0x0) << ID_AA64PFR0_AdvSIMD_SHIFT) #define ID_AA64PFR0_AdvSIMD_HP (UL(0x1) << ID_AA64PFR0_AdvSIMD_SHIFT) #define ID_AA64PFR0_AdvSIMD_NONE (UL(0xf) << ID_AA64PFR0_AdvSIMD_SHIFT) #define ID_AA64PFR0_GIC_BITS 0x4 /* Number of bits in GIC field */ #define ID_AA64PFR0_GIC_SHIFT 24 #define ID_AA64PFR0_GIC_MASK (UL(0xf) << ID_AA64PFR0_GIC_SHIFT) -#define ID_AA64PFR0_GIC(x) ((x) & ID_AA64PFR0_GIC_MASK) +#define ID_AA64PFR0_GIC_VAL(x) ((x) & ID_AA64PFR0_GIC_MASK) #define ID_AA64PFR0_GIC_CPUIF_NONE (UL(0x0) << ID_AA64PFR0_GIC_SHIFT) #define ID_AA64PFR0_GIC_CPUIF_EN (UL(0x1) << ID_AA64PFR0_GIC_SHIFT) #define ID_AA64PFR0_RAS_SHIFT 28 #define ID_AA64PFR0_RAS_MASK (UL(0xf) << ID_AA64PFR0_RAS_SHIFT) -#define ID_AA64PFR0_RAS(x) ((x) & ID_AA64PFR0_RAS_MASK) +#define ID_AA64PFR0_RAS_VAL(x) ((x) & ID_AA64PFR0_RAS_MASK) #define ID_AA64PFR0_RAS_NONE (UL(0x0) << ID_AA64PFR0_RAS_SHIFT) #define ID_AA64PFR0_RAS_V1 (UL(0x1) << ID_AA64PFR0_RAS_SHIFT) #define ID_AA64PFR0_SVE_SHIFT 32 #define ID_AA64PFR0_SVE_MASK (UL(0xf) << ID_AA64PFR0_SVE_SHIFT) -#define ID_AA64PFR0_SVE(x) ((x) & ID_AA64PFR0_SVE_MASK) +#define ID_AA64PFR0_SVE_VAL(x) ((x) & ID_AA64PFR0_SVE_MASK) #define ID_AA64PFR0_SVE_NONE (UL(0x0) << ID_AA64PFR0_SVE_SHIFT) #define ID_AA64PFR0_SVE_IMPL (UL(0x1) << ID_AA64PFR0_SVE_SHIFT) Modified: head/sys/libkern/gsb_crc32.c ============================================================================== --- head/sys/libkern/gsb_crc32.c Wed Oct 30 08:06:22 2019 (r354169) +++ head/sys/libkern/gsb_crc32.c Wed Oct 30 10:06:57 2019 (r354170) @@ -777,7 +777,7 @@ calculate_crc32c(uint32_t crc32c, * this applies to all CPUs. */ reg = READ_SPECIALREG(id_aa64isar0_el1); - if (ID_AA64ISAR0_CRC32(reg) != ID_AA64ISAR0_CRC32_NONE) { + if (ID_AA64ISAR0_CRC32_VAL(reg) != ID_AA64ISAR0_CRC32_NONE) { return (armv8_crc32c(crc32c, buffer, length)); } else #endif From owner-svn-src-all@freebsd.org Wed Oct 30 10:13:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C98041A11E6; Wed, 30 Oct 2019 10:13:15 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47346350nYz3CMM; Wed, 30 Oct 2019 10:13:15 +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 8EFD08CA6; Wed, 30 Oct 2019 10:13:15 +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 x9UADF7W005970; Wed, 30 Oct 2019 10:13:15 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UADF97005969; Wed, 30 Oct 2019 10:13:15 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201910301013.x9UADF97005969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 Oct 2019 10:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354171 - 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: 354171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 10:13:15 -0000 Author: andrew Date: Wed Oct 30 10:13:14 2019 New Revision: 354171 URL: https://svnweb.freebsd.org/changeset/base/354171 Log: Add two files missed in r354170 Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/identcpu.c head/sys/arm64/arm64/machdep.c Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Wed Oct 30 10:06:57 2019 (r354170) +++ head/sys/arm64/arm64/identcpu.c Wed Oct 30 10:13:14 2019 (r354171) @@ -897,25 +897,25 @@ parse_cpu_features_hwcap(u_int cpu) { u_long hwcap = 0; - if (ID_AA64ISAR0_DP(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_DP_IMPL) + if (ID_AA64ISAR0_DP_VAL(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_DP_IMPL) hwcap |= HWCAP_ASIMDDP; - if (ID_AA64ISAR0_SM4(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_SM4_IMPL) + if (ID_AA64ISAR0_SM4_VAL(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_SM4_IMPL) hwcap |= HWCAP_SM4; - if (ID_AA64ISAR0_SM3(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_SM3_IMPL) + if (ID_AA64ISAR0_SM3_VAL(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_SM3_IMPL) hwcap |= HWCAP_SM3; - if (ID_AA64ISAR0_RDM(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_RDM_IMPL) + if (ID_AA64ISAR0_RDM_VAL(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_RDM_IMPL) hwcap |= HWCAP_ASIMDRDM; - if (ID_AA64ISAR0_Atomic(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_Atomic_IMPL) + if (ID_AA64ISAR0_Atomic_VAL(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_Atomic_IMPL) hwcap |= HWCAP_ATOMICS; - if (ID_AA64ISAR0_CRC32(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE) + if (ID_AA64ISAR0_CRC32_VAL(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE) hwcap |= HWCAP_CRC32; - switch (ID_AA64ISAR0_SHA2(cpu_desc[cpu].id_aa64isar0)) { + switch (ID_AA64ISAR0_SHA2_VAL(cpu_desc[cpu].id_aa64isar0)) { case ID_AA64ISAR0_SHA2_BASE: hwcap |= HWCAP_SHA2; break; @@ -926,10 +926,10 @@ parse_cpu_features_hwcap(u_int cpu) break; } - if (ID_AA64ISAR0_SHA1(cpu_desc[cpu].id_aa64isar0)) + if (ID_AA64ISAR0_SHA1_VAL(cpu_desc[cpu].id_aa64isar0)) hwcap |= HWCAP_SHA1; - switch (ID_AA64ISAR0_AES(cpu_desc[cpu].id_aa64isar0)) { + switch (ID_AA64ISAR0_AES_VAL(cpu_desc[cpu].id_aa64isar0)) { case ID_AA64ISAR0_AES_BASE: hwcap |= HWCAP_AES; break; @@ -940,22 +940,22 @@ parse_cpu_features_hwcap(u_int cpu) break; } - if (ID_AA64ISAR1_LRCPC(cpu_desc[cpu].id_aa64isar1) == ID_AA64ISAR1_LRCPC_IMPL) + if (ID_AA64ISAR1_LRCPC_VAL(cpu_desc[cpu].id_aa64isar1) == ID_AA64ISAR1_LRCPC_IMPL) hwcap |= HWCAP_LRCPC; - if (ID_AA64ISAR1_FCMA(cpu_desc[cpu].id_aa64isar1) == ID_AA64ISAR1_FCMA_IMPL) + if (ID_AA64ISAR1_FCMA_VAL(cpu_desc[cpu].id_aa64isar1) == ID_AA64ISAR1_FCMA_IMPL) hwcap |= HWCAP_FCMA; - if (ID_AA64ISAR1_JSCVT(cpu_desc[cpu].id_aa64isar1) == ID_AA64ISAR1_JSCVT_IMPL) + if (ID_AA64ISAR1_JSCVT_VAL(cpu_desc[cpu].id_aa64isar1) == ID_AA64ISAR1_JSCVT_IMPL) hwcap |= HWCAP_JSCVT; - if (ID_AA64ISAR1_DPB(cpu_desc[cpu].id_aa64isar1) == ID_AA64ISAR1_DPB_IMPL) + if (ID_AA64ISAR1_DPB_VAL(cpu_desc[cpu].id_aa64isar1) == ID_AA64ISAR1_DPB_IMPL) hwcap |= HWCAP_DCPOP; - if (ID_AA64PFR0_SVE(cpu_desc[cpu].id_aa64pfr0) == ID_AA64PFR0_SVE_IMPL) + if (ID_AA64PFR0_SVE_VAL(cpu_desc[cpu].id_aa64pfr0) == ID_AA64PFR0_SVE_IMPL) hwcap |= HWCAP_SVE; - switch (ID_AA64PFR0_AdvSIMD(cpu_desc[cpu].id_aa64pfr0)) { + switch (ID_AA64PFR0_AdvSIMD_VAL(cpu_desc[cpu].id_aa64pfr0)) { case ID_AA64PFR0_AdvSIMD_IMPL: hwcap |= HWCAP_ASIMD; break; @@ -966,7 +966,7 @@ parse_cpu_features_hwcap(u_int cpu) break; } - switch (ID_AA64PFR0_FP(cpu_desc[cpu].id_aa64pfr0)) { + switch (ID_AA64PFR0_FP_VAL(cpu_desc[cpu].id_aa64pfr0)) { case ID_AA64PFR0_FP_IMPL: hwcap |= HWCAP_FP; break; Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Wed Oct 30 10:06:57 2019 (r354170) +++ head/sys/arm64/arm64/machdep.c Wed Oct 30 10:13:14 2019 (r354171) @@ -134,7 +134,7 @@ pan_setup(void) uint64_t id_aa64mfr1; id_aa64mfr1 = READ_SPECIALREG(id_aa64mmfr1_el1); - if (ID_AA64MMFR1_PAN(id_aa64mfr1) != ID_AA64MMFR1_PAN_NONE) + if (ID_AA64MMFR1_PAN_VAL(id_aa64mfr1) != ID_AA64MMFR1_PAN_NONE) has_pan = 1; } From owner-svn-src-all@freebsd.org Wed Oct 30 10:16:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8408D1A12D6; Wed, 30 Oct 2019 10:16:29 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47349n2tgqz3CWb; Wed, 30 Oct 2019 10:16:29 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 41E848CA9; Wed, 30 Oct 2019 10:16:29 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9UAGTot006310; Wed, 30 Oct 2019 10:16:29 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UAGSjI006308; Wed, 30 Oct 2019 10:16:28 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201910301016.x9UAGSjI006308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 30 Oct 2019 10:16:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354172 - in head/sys: amd64/conf conf X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: amd64/conf conf X-SVN-Commit-Revision: 354172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 10:16:29 -0000 Author: trasz Date: Wed Oct 30 10:16:28 2019 New Revision: 354172 URL: https://svnweb.freebsd.org/changeset/base/354172 Log: There's nothing architecture specific in "options STATS"; move it from sys/amd64/conf/NOTES to sys/conf/NOTES. Suggested by: jhb@ Sponsored by: Klara Inc, Netflix Modified: head/sys/amd64/conf/NOTES head/sys/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Wed Oct 30 10:13:14 2019 (r354171) +++ head/sys/amd64/conf/NOTES Wed Oct 30 10:16:28 2019 (r354172) @@ -678,5 +678,3 @@ device ndis options LINDEBUGFS options GCOV - -options STATS Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Oct 30 10:13:14 2019 (r354171) +++ head/sys/conf/NOTES Wed Oct 30 10:16:28 2019 (r354172) @@ -2896,3 +2896,6 @@ options SPIGEN_LEGACY_CDEVNAME # legacy device names # Compression supports. device zlib # gzip/zlib compression/decompression library device xz # xz_embedded LZMA de-compression library + +# Kernel support for stats(3). +options STATS From owner-svn-src-all@freebsd.org Wed Oct 30 10:41:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BF891A18A1; Wed, 30 Oct 2019 10:41: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4734kH0s4Nz3Dbf; Wed, 30 Oct 2019 10:41:11 +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 009DB904D; Wed, 30 Oct 2019 10:41:11 +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 x9UAfAHk021079; Wed, 30 Oct 2019 10:41:10 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UAfAuT021078; Wed, 30 Oct 2019 10:41:10 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201910301041.x9UAfAuT021078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 Oct 2019 10:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354173 - head/sys/crypto/armv8 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/crypto/armv8 X-SVN-Commit-Revision: 354173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 10:41:11 -0000 Author: andrew Date: Wed Oct 30 10:41:10 2019 New Revision: 354173 URL: https://svnweb.freebsd.org/changeset/base/354173 Log: Fix the armv8 crypto driver after r354170. Sponsored by: DARPA, AFRL Modified: head/sys/crypto/armv8/armv8_crypto.c Modified: head/sys/crypto/armv8/armv8_crypto.c ============================================================================== --- head/sys/crypto/armv8/armv8_crypto.c Wed Oct 30 10:16:28 2019 (r354172) +++ head/sys/crypto/armv8/armv8_crypto.c Wed Oct 30 10:41:10 2019 (r354173) @@ -107,7 +107,7 @@ armv8_crypto_probe(device_t dev) reg = READ_SPECIALREG(id_aa64isar0_el1); - switch (ID_AA64ISAR0_AES(reg)) { + switch (ID_AA64ISAR0_AES_VAL(reg)) { case ID_AA64ISAR0_AES_BASE: case ID_AA64ISAR0_AES_PMULL: ret = 0; From owner-svn-src-all@freebsd.org Wed Oct 30 10:42:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6C7101A1A94; Wed, 30 Oct 2019 10:42:53 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4734mF2GXVz3Dqt; Wed, 30 Oct 2019 10:42: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 3115791CF; Wed, 30 Oct 2019 10:42: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 x9UAgqYo025128; Wed, 30 Oct 2019 10:42:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UAgq8w025127; Wed, 30 Oct 2019 10:42:52 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201910301042.x9UAgq8w025127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 Oct 2019 10:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354174 - 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: 354174 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 10:42:53 -0000 Author: andrew Date: Wed Oct 30 10:42:52 2019 New Revision: 354174 URL: https://svnweb.freebsd.org/changeset/base/354174 Log: Use an array of handlers in the data and instruction aborts Previously we would call data_abort on all data and instruction aborts however this is incorrect for most abort types. Move to use an array of function pointers to allow for more handlers to be easily added. Reviewed by: jhibbits Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22170 Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Wed Oct 30 10:41:10 2019 (r354173) +++ head/sys/arm64/arm64/trap.c Wed Oct 30 10:42:52 2019 (r354174) @@ -84,6 +84,24 @@ static void print_registers(struct trapframe *frame); int (*dtrace_invop_jump_addr)(struct trapframe *); +typedef void (abort_handler)(struct thread *, struct trapframe *, uint64_t, + uint64_t, int); + +static abort_handler data_abort; + +static abort_handler *abort_handlers[] = { + [ISS_DATA_DFSC_TF_L0] = data_abort, + [ISS_DATA_DFSC_TF_L1] = data_abort, + [ISS_DATA_DFSC_TF_L2] = data_abort, + [ISS_DATA_DFSC_TF_L3] = data_abort, + [ISS_DATA_DFSC_AFF_L1] = data_abort, + [ISS_DATA_DFSC_AFF_L2] = data_abort, + [ISS_DATA_DFSC_AFF_L3] = data_abort, + [ISS_DATA_DFSC_PF_L1] = data_abort, + [ISS_DATA_DFSC_PF_L2] = data_abort, + [ISS_DATA_DFSC_PF_L3] = data_abort, +}; + static __inline void call_trapsignal(struct thread *td, int sig, int code, void *addr) { @@ -149,7 +167,7 @@ svc_handler(struct thread *td, struct trapframe *frame static void data_abort(struct thread *td, struct trapframe *frame, uint64_t esr, - uint64_t far, int lower, int exec) + uint64_t far, int lower) { struct vm_map *map; struct proc *p; @@ -212,11 +230,16 @@ data_abort(struct thread *td, struct trapframe *frame, panic("data abort in critical section or under mutex"); } - if (exec) + switch (ESR_ELx_EXCEPTION(esr)) { + case EXCP_INSN_ABORT: + case EXCP_INSN_ABORT_L: ftype = VM_PROT_EXECUTE; - else + break; + default: ftype = (esr & ISS_DATA_WnR) == 0 ? VM_PROT_READ : VM_PROT_READ | VM_PROT_WRITE; + break; + } /* Fault in the page. */ error = vm_fault_trap(map, far, ftype, VM_FAULT_NORMAL, &sig, &ucode); @@ -275,6 +298,7 @@ do_el1h_sync(struct thread *td, struct trapframe *fram struct trapframe *oframe; uint32_t exception; uint64_t esr, far; + int dfsc; /* Read the esr register to get the exception details */ esr = frame->tf_esr; @@ -318,8 +342,14 @@ do_el1h_sync(struct thread *td, struct trapframe *fram case EXCP_INSN_ABORT: case EXCP_DATA_ABORT: far = READ_SPECIALREG(far_el1); - data_abort(td, frame, esr, far, 0, - exception == EXCP_INSN_ABORT); + dfsc = esr & ISS_DATA_DFSC_MASK; + if (dfsc < nitems(abort_handlers) && + abort_handlers[dfsc] != NULL) + abort_handlers[dfsc](td, frame, esr, far, 0); + else + panic("Unhandled EL1 %s abort: %x", + exception == EXCP_INSN_ABORT ? "instruction" : + "data", dfsc); break; case EXCP_BRK: #ifdef KDTRACE_HOOKS @@ -365,6 +395,7 @@ do_el0_sync(struct thread *td, struct trapframe *frame pcpu_bp_harden bp_harden; uint32_t exception; uint64_t esr, far; + int dfsc; /* Check we have a sane environment when entering from userland */ KASSERT((uintptr_t)get_pcpu() >= VM_MIN_KERNEL_ADDRESS, @@ -416,8 +447,14 @@ do_el0_sync(struct thread *td, struct trapframe *frame case EXCP_INSN_ABORT_L: case EXCP_DATA_ABORT_L: case EXCP_DATA_ABORT: - data_abort(td, frame, esr, far, 1, - exception == EXCP_INSN_ABORT_L); + dfsc = esr & ISS_DATA_DFSC_MASK; + if (dfsc < nitems(abort_handlers) && + abort_handlers[dfsc] != NULL) + abort_handlers[dfsc](td, frame, esr, far, 1); + else + panic("Unhandled EL0 %s abort: %x", + exception == EXCP_INSN_ABORT_L ? "instruction" : + "data", dfsc); break; case EXCP_UNKNOWN: if (!undef_insn(0, frame)) From owner-svn-src-all@freebsd.org Wed Oct 30 10:51:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F84E1A1D7A; Wed, 30 Oct 2019 10:51:26 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4734y63YNMz3FHg; Wed, 30 Oct 2019 10:51:26 +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 441EF9245; Wed, 30 Oct 2019 10:51:26 +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 x9UApQ5m030389; Wed, 30 Oct 2019 10:51:26 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UApOWj030378; Wed, 30 Oct 2019 10:51:24 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201910301051.x9UApOWj030378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 Oct 2019 10:51:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354175 - in head/sys: arm64/arm64 arm64/include conf X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm64/arm64 arm64/include conf X-SVN-Commit-Revision: 354175 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 10:51:26 -0000 Author: andrew Date: Wed Oct 30 10:51:24 2019 New Revision: 354175 URL: https://svnweb.freebsd.org/changeset/base/354175 Log: Update the debug monitor handling to work after userspace has started The debug monitor register state is now stored in a struct and updated when required. Currently there is only a kernel state, however a per-process state will be added in a future change. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22128 Modified: head/sys/arm64/arm64/db_trace.c head/sys/arm64/arm64/debug_monitor.c head/sys/arm64/arm64/exception.S head/sys/arm64/arm64/mp_machdep.c head/sys/arm64/include/debug_monitor.h head/sys/arm64/include/pcpu.h head/sys/conf/files.arm64 Modified: head/sys/arm64/arm64/db_trace.c ============================================================================== --- head/sys/arm64/arm64/db_trace.c Wed Oct 30 10:42:52 2019 (r354174) +++ head/sys/arm64/arm64/db_trace.c Wed Oct 30 10:51:24 2019 (r354175) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include + #include #include #include @@ -53,15 +54,14 @@ int db_md_clr_watchpoint(db_expr_t addr, db_expr_t size) { - return (dbg_remove_watchpoint(addr, size, DBG_FROM_EL1)); + return (dbg_remove_watchpoint(NULL, addr, size)); } int db_md_set_watchpoint(db_expr_t addr, db_expr_t size) { - return (dbg_setup_watchpoint(addr, size, DBG_FROM_EL1, - HW_BREAKPOINT_RW)); + return (dbg_setup_watchpoint(NULL, addr, size, HW_BREAKPOINT_RW)); } static void Modified: head/sys/arm64/arm64/debug_monitor.c ============================================================================== --- head/sys/arm64/arm64/debug_monitor.c Wed Oct 30 10:42:52 2019 (r354174) +++ head/sys/arm64/arm64/debug_monitor.c Wed Oct 30 10:51:24 2019 (r354175) @@ -43,8 +43,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef DDB #include #include +#endif enum dbg_t { DBG_TYPE_BREAKPOINT = 0, @@ -53,8 +55,9 @@ enum dbg_t { static int dbg_watchpoint_num; static int dbg_breakpoint_num; -static int dbg_ref_count_mde[MAXCPU]; -static int dbg_ref_count_kde[MAXCPU]; +static struct debug_monitor_state kernel_monitor = { + .dbg_flags = DBGMON_KERNEL +}; /* Watchpoints/breakpoints control register bitfields */ #define DBG_WATCH_CTRL_LEN_1 (0x1 << 5) @@ -138,6 +141,7 @@ static int dbg_ref_count_kde[MAXCPU]; WRITE_WB_REG_CASE(reg, 14, offset, val); \ WRITE_WB_REG_CASE(reg, 15, offset, val) +#ifdef DDB static uint64_t dbg_wb_read_reg(int reg, int n) { @@ -149,11 +153,12 @@ dbg_wb_read_reg(int reg, int n) SWITCH_CASES_READ_WB_REG(DBG_WB_BVR, DBG_REG_BASE_BVR, val); SWITCH_CASES_READ_WB_REG(DBG_WB_BCR, DBG_REG_BASE_BCR, val); default: - db_printf("trying to read from wrong debug register %d\n", n); + printf("trying to read from wrong debug register %d\n", n); } return val; } +#endif /* DDB */ static void dbg_wb_write_reg(int reg, int n, uint64_t val) @@ -164,17 +169,19 @@ dbg_wb_write_reg(int reg, int n, uint64_t val) SWITCH_CASES_WRITE_WB_REG(DBG_WB_BVR, DBG_REG_BASE_BVR, val); SWITCH_CASES_WRITE_WB_REG(DBG_WB_BCR, DBG_REG_BASE_BCR, val); default: - db_printf("trying to write to wrong debug register %d\n", n); + printf("trying to write to wrong debug register %d\n", n); + return; } isb(); } +#ifdef DDB void kdb_cpu_set_singlestep(void) { kdb_frame->tf_spsr |= DBG_SPSR_SS; - WRITE_SPECIALREG(MDSCR_EL1, READ_SPECIALREG(MDSCR_EL1) | + WRITE_SPECIALREG(mdscr_el1, READ_SPECIALREG(mdscr_el1) | DBG_MDSCR_SS | DBG_MDSCR_KDE); /* @@ -182,9 +189,9 @@ kdb_cpu_set_singlestep(void) * over watched instruction will trigger break exception instead of * single-step exception and locks CPU on that instruction for ever. */ - if (dbg_ref_count_mde[PCPU_GET(cpuid)] > 0) { - WRITE_SPECIALREG(MDSCR_EL1, - READ_SPECIALREG(MDSCR_EL1) & ~DBG_MDSCR_MDE); + if ((kernel_monitor.dbg_flags & DBGMON_ENABLED) != 0) { + WRITE_SPECIALREG(mdscr_el1, + READ_SPECIALREG(mdscr_el1) & ~DBG_MDSCR_MDE); } } @@ -192,18 +199,18 @@ void kdb_cpu_clear_singlestep(void) { - WRITE_SPECIALREG(MDSCR_EL1, READ_SPECIALREG(MDSCR_EL1) & + WRITE_SPECIALREG(mdscr_el1, READ_SPECIALREG(mdscr_el1) & ~(DBG_MDSCR_SS | DBG_MDSCR_KDE)); /* Restore breakpoints and watchpoints */ - if (dbg_ref_count_mde[PCPU_GET(cpuid)] > 0) { - WRITE_SPECIALREG(MDSCR_EL1, - READ_SPECIALREG(MDSCR_EL1) | DBG_MDSCR_MDE); - } + if ((kernel_monitor.dbg_flags & DBGMON_ENABLED) != 0) { + WRITE_SPECIALREG(mdscr_el1, + READ_SPECIALREG(mdscr_el1) | DBG_MDSCR_MDE); - if (dbg_ref_count_kde[PCPU_GET(cpuid)] > 0) { - WRITE_SPECIALREG(MDSCR_EL1, - READ_SPECIALREG(MDSCR_EL1) | DBG_MDSCR_KDE); + if ((kernel_monitor.dbg_flags & DBGMON_KERNEL) != 0) { + WRITE_SPECIALREG(mdscr_el1, + READ_SPECIALREG(mdscr_el1) | DBG_MDSCR_KDE); + } } } @@ -267,30 +274,30 @@ dbg_show_watchpoint(void) } } } +#endif /* DDB */ - static int -dbg_find_free_slot(enum dbg_t type) +dbg_find_free_slot(struct debug_monitor_state *monitor, enum dbg_t type) { - u_int max, reg, i; + uint64_t *reg; + u_int max, i; switch(type) { case DBG_TYPE_BREAKPOINT: max = dbg_breakpoint_num; - reg = DBG_REG_BASE_BCR; - + reg = monitor->dbg_bcr; break; case DBG_TYPE_WATCHPOINT: max = dbg_watchpoint_num; - reg = DBG_REG_BASE_WCR; + reg = monitor->dbg_wcr; break; default: - db_printf("Unsupported debug type\n"); + printf("Unsupported debug type\n"); return (i); } for (i = 0; i < max; i++) { - if ((dbg_wb_read_reg(reg, i) & DBG_WB_CTRL_E) == 0) + if ((reg[i] & DBG_WB_CTRL_E) == 0) return (i); } @@ -298,81 +305,50 @@ dbg_find_free_slot(enum dbg_t type) } static int -dbg_find_slot(enum dbg_t type, db_expr_t addr) +dbg_find_slot(struct debug_monitor_state *monitor, enum dbg_t type, + vm_offset_t addr) { - u_int max, reg_addr, reg_ctrl, i; + uint64_t *reg_addr, *reg_ctrl; + u_int max, i; switch(type) { case DBG_TYPE_BREAKPOINT: max = dbg_breakpoint_num; - reg_addr = DBG_REG_BASE_BVR; - reg_ctrl = DBG_REG_BASE_BCR; + reg_addr = monitor->dbg_bvr; + reg_ctrl = monitor->dbg_bcr; break; case DBG_TYPE_WATCHPOINT: max = dbg_watchpoint_num; - reg_addr = DBG_REG_BASE_WVR; - reg_ctrl = DBG_REG_BASE_WCR; + reg_addr = monitor->dbg_wvr; + reg_ctrl = monitor->dbg_wcr; break; default: - db_printf("Unsupported debug type\n"); + printf("Unsupported debug type\n"); return (i); } for (i = 0; i < max; i++) { - if ((dbg_wb_read_reg(reg_addr, i) == addr) && - ((dbg_wb_read_reg(reg_ctrl, i) & DBG_WB_CTRL_E) != 0)) + if (reg_addr[i] == addr && + (reg_ctrl[i] & DBG_WB_CTRL_E) != 0) return (i); } return (-1); } -static void -dbg_enable_monitor(enum dbg_el_t el) -{ - uint64_t reg_mdcr = 0; - - /* - * There is no need to have debug monitor on permanently, thus we are - * refcounting and turn it on only if any of CPU is going to use that. - */ - if (atomic_fetchadd_int(&dbg_ref_count_mde[PCPU_GET(cpuid)], 1) == 0) - reg_mdcr = DBG_MDSCR_MDE; - - if ((el == DBG_FROM_EL1) && - atomic_fetchadd_int(&dbg_ref_count_kde[PCPU_GET(cpuid)], 1) == 0) - reg_mdcr |= DBG_MDSCR_KDE; - - if (reg_mdcr) - WRITE_SPECIALREG(MDSCR_EL1, READ_SPECIALREG(MDSCR_EL1) | reg_mdcr); -} - -static void -dbg_disable_monitor(enum dbg_el_t el) -{ - uint64_t reg_mdcr = 0; - - if (atomic_fetchadd_int(&dbg_ref_count_mde[PCPU_GET(cpuid)], -1) == 1) - reg_mdcr = DBG_MDSCR_MDE; - - if ((el == DBG_FROM_EL1) && - atomic_fetchadd_int(&dbg_ref_count_kde[PCPU_GET(cpuid)], -1) == 1) - reg_mdcr |= DBG_MDSCR_KDE; - - if (reg_mdcr) - WRITE_SPECIALREG(MDSCR_EL1, READ_SPECIALREG(MDSCR_EL1) & ~reg_mdcr); -} - int -dbg_setup_watchpoint(db_expr_t addr, db_expr_t size, enum dbg_el_t el, - enum dbg_access_t access) +dbg_setup_watchpoint(struct debug_monitor_state *monitor, vm_offset_t addr, + vm_size_t size, enum dbg_access_t access) { uint64_t wcr_size, wcr_priv, wcr_access; u_int i; - i = dbg_find_free_slot(DBG_TYPE_WATCHPOINT); + if (monitor == NULL) + monitor = &kernel_monitor; + + i = dbg_find_free_slot(monitor, DBG_TYPE_WATCHPOINT); if (i == -1) { - db_printf("Can not find slot for watchpoint, max %d" + printf("Can not find slot for watchpoint, max %d" " watchpoints supported\n", dbg_watchpoint_num); return (i); } @@ -391,21 +367,14 @@ dbg_setup_watchpoint(db_expr_t addr, db_expr_t size, e wcr_size = DBG_WATCH_CTRL_LEN_8; break; default: - db_printf("Unsupported address size for watchpoint\n"); + printf("Unsupported address size for watchpoint\n"); return (-1); } - switch(el) { - case DBG_FROM_EL0: + if ((monitor->dbg_flags & DBGMON_KERNEL) == 0) wcr_priv = DBG_WB_CTRL_EL0; - break; - case DBG_FROM_EL1: + else wcr_priv = DBG_WB_CTRL_EL1; - break; - default: - db_printf("Unsupported exception level for watchpoint\n"); - return (-1); - } switch(access) { case HW_BREAKPOINT_X: @@ -421,34 +390,79 @@ dbg_setup_watchpoint(db_expr_t addr, db_expr_t size, e wcr_access = DBG_WATCH_CTRL_LOAD | DBG_WATCH_CTRL_STORE; break; default: - db_printf("Unsupported exception level for watchpoint\n"); + printf("Unsupported exception level for watchpoint\n"); return (-1); } - dbg_wb_write_reg(DBG_REG_BASE_WVR, i, addr); - dbg_wb_write_reg(DBG_REG_BASE_WCR, i, wcr_size | wcr_access | wcr_priv | - DBG_WB_CTRL_E); - dbg_enable_monitor(el); + monitor->dbg_wvr[i] = addr; + monitor->dbg_wcr[i] = wcr_size | wcr_access | wcr_priv | DBG_WB_CTRL_E; + monitor->dbg_enable_count++; + monitor->dbg_flags |= DBGMON_ENABLED; + + dbg_register_sync(monitor); return (0); } int -dbg_remove_watchpoint(db_expr_t addr, db_expr_t size, enum dbg_el_t el) +dbg_remove_watchpoint(struct debug_monitor_state *monitor, vm_offset_t addr, + vm_size_t size) { u_int i; - i = dbg_find_slot(DBG_TYPE_WATCHPOINT, addr); + if (monitor == NULL) + monitor = &kernel_monitor; + + i = dbg_find_slot(monitor, DBG_TYPE_WATCHPOINT, addr); if (i == -1) { - db_printf("Can not find watchpoint for address 0%lx\n", addr); + printf("Can not find watchpoint for address 0%lx\n", addr); return (i); } - dbg_wb_write_reg(DBG_REG_BASE_WCR, i, 0); - dbg_disable_monitor(el); + monitor->dbg_wvr[i] = 0; + monitor->dbg_wcr[i] = 0; + monitor->dbg_enable_count--; + if (monitor->dbg_enable_count == 0) + monitor->dbg_flags &= ~DBGMON_ENABLED; + + dbg_register_sync(monitor); return (0); } void +dbg_register_sync(struct debug_monitor_state *monitor) +{ + uint64_t mdscr; + int i; + + if (monitor == NULL) + monitor = &kernel_monitor; + + mdscr = READ_SPECIALREG(mdscr_el1); + if ((monitor->dbg_flags & DBGMON_ENABLED) == 0) { + mdscr &= ~(DBG_MDSCR_MDE | DBG_MDSCR_KDE); + } else { + for (i = 0; i < dbg_breakpoint_num; i++) { + dbg_wb_write_reg(DBG_REG_BASE_BCR, i, + monitor->dbg_bcr[i]); + dbg_wb_write_reg(DBG_REG_BASE_BVR, i, + monitor->dbg_bvr[i]); + } + + for (i = 0; i < dbg_watchpoint_num; i++) { + dbg_wb_write_reg(DBG_REG_BASE_WCR, i, + monitor->dbg_wcr[i]); + dbg_wb_write_reg(DBG_REG_BASE_WVR, i, + monitor->dbg_wvr[i]); + } + mdscr |= DBG_MDSCR_MDE; + if ((monitor->dbg_flags & DBGMON_KERNEL) == DBGMON_KERNEL) + mdscr |= DBG_MDSCR_KDE; + } + WRITE_SPECIALREG(mdscr_el1, mdscr); + isb(); +} + +void dbg_monitor_init(void) { u_int i; @@ -471,12 +485,12 @@ dbg_monitor_init(void) * * Reset all breakpoints and watchpoints. */ - for (i = 0; i < dbg_watchpoint_num; ++i) { + for (i = 0; i < dbg_watchpoint_num; i++) { dbg_wb_write_reg(DBG_REG_BASE_WCR, i, 0); dbg_wb_write_reg(DBG_REG_BASE_WVR, i, 0); } - for (i = 0; i < dbg_breakpoint_num; ++i) { + for (i = 0; i < dbg_breakpoint_num; i++) { dbg_wb_write_reg(DBG_REG_BASE_BCR, i, 0); dbg_wb_write_reg(DBG_REG_BASE_BVR, i, 0); } Modified: head/sys/arm64/arm64/exception.S ============================================================================== --- head/sys/arm64/arm64/exception.S Wed Oct 30 10:42:52 2019 (r354174) +++ head/sys/arm64/arm64/exception.S Wed Oct 30 10:51:24 2019 (r354175) @@ -74,15 +74,17 @@ __FBSDID("$FreeBSD$"); blr x1 1: .endif + msr daifclr, #8 /* Enable the debug exception */ .endm .macro restore_registers el .if \el == 1 - msr daifset, #2 /* - * Disable interrupts, x18 may change in the interrupt exception - * handler. For EL0 exceptions, do_ast already did this. + * Disable interrupts and debug exceptions, x18 may change in the + * interrupt exception handler. For EL0 exceptions, do_ast already + * did this. */ + msr daifset, #10 .endif .if \el == 0 /* Remove the SSBD (CVE-2018-3639) workaround if needed */ @@ -136,7 +138,7 @@ __FBSDID("$FreeBSD$"); bic x19, x19, #PSR_I 1: /* Disable interrupts */ - msr daifset, #2 + msr daifset, #10 /* Read the current thread flags */ ldr x1, [x18, #PC_CURTHREAD] /* Load curthread */ Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Wed Oct 30 10:42:52 2019 (r354174) +++ head/sys/arm64/arm64/mp_machdep.c Wed Oct 30 10:51:24 2019 (r354175) @@ -29,6 +29,7 @@ */ #include "opt_acpi.h" +#include "opt_ddb.h" #include "opt_kstack_pages.h" #include "opt_platform.h" @@ -55,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #ifdef VFP @@ -352,6 +354,10 @@ ipi_stop(void *dummy __unused) /* Wait for restart */ while (!CPU_ISSET(cpu, &started_cpus)) cpu_spinwait(); + +#ifdef DDB + dbg_register_sync(NULL); +#endif CPU_CLR_ATOMIC(cpu, &started_cpus); CPU_CLR_ATOMIC(cpu, &stopped_cpus); Modified: head/sys/arm64/include/debug_monitor.h ============================================================================== --- head/sys/arm64/include/debug_monitor.h Wed Oct 30 10:42:52 2019 (r354174) +++ head/sys/arm64/include/debug_monitor.h Wed Oct 30 10:51:24 2019 (r354175) @@ -32,13 +32,20 @@ #ifndef _MACHINE_DEBUG_MONITOR_H_ #define _MACHINE_DEBUG_MONITOR_H_ -#ifdef DDB +#ifdef _KERNEL -#include +#define DBG_BRP_MAX 16 +#define DBG_WRP_MAX 16 -enum dbg_el_t { - DBG_FROM_EL0 = 0, - DBG_FROM_EL1 = 1, +struct debug_monitor_state { + uint32_t dbg_enable_count; + uint32_t dbg_flags; +#define DBGMON_ENABLED (1 << 0) +#define DBGMON_KERNEL (1 << 1) + uint64_t dbg_bcr[DBG_BRP_MAX]; + uint64_t dbg_bvr[DBG_BRP_MAX]; + uint64_t dbg_wcr[DBG_WRP_MAX]; + uint64_t dbg_wvr[DBG_WRP_MAX]; }; enum dbg_access_t { @@ -49,15 +56,15 @@ enum dbg_access_t { }; void dbg_monitor_init(void); +void dbg_register_sync(struct debug_monitor_state *); +int dbg_setup_watchpoint(struct debug_monitor_state *, vm_offset_t, vm_size_t, + enum dbg_access_t); +int dbg_remove_watchpoint(struct debug_monitor_state *, vm_offset_t, vm_size_t); + +#ifdef DDB void dbg_show_watchpoint(void); -int dbg_setup_watchpoint(db_expr_t addr, db_expr_t size, enum dbg_el_t el, - enum dbg_access_t access); -int dbg_remove_watchpoint(db_expr_t addr, db_expr_t size, enum dbg_el_t el); -#else -static __inline void -dbg_monitor_init(void) -{ -} #endif + +#endif /* _KERNEL */ #endif /* _MACHINE_DEBUG_MONITOR_H_ */ Modified: head/sys/arm64/include/pcpu.h ============================================================================== --- head/sys/arm64/include/pcpu.h Wed Oct 30 10:42:52 2019 (r354174) +++ head/sys/arm64/include/pcpu.h Wed Oct 30 10:51:24 2019 (r354175) @@ -37,6 +37,7 @@ typedef int (*pcpu_bp_harden)(void); typedef int (*pcpu_ssbd)(int); +struct debug_monitor_state; #define PCPU_MD_FIELDS \ u_int pc_acpi_id; /* ACPI CPU id */ \ Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Wed Oct 30 10:42:52 2019 (r354174) +++ head/sys/conf/files.arm64 Wed Oct 30 10:51:24 2019 (r354175) @@ -136,7 +136,7 @@ arm64/arm64/cpufunc_asm.S standard arm64/arm64/db_disasm.c optional ddb arm64/arm64/db_interface.c optional ddb arm64/arm64/db_trace.c optional ddb -arm64/arm64/debug_monitor.c optional ddb +arm64/arm64/debug_monitor.c standard arm64/arm64/disassem.c optional ddb arm64/arm64/dump_machdep.c standard arm64/arm64/efirt_machdep.c optional efirt From owner-svn-src-all@freebsd.org Wed Oct 30 12:33:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DDCB11A48C8; Wed, 30 Oct 2019 12:33:37 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4737D15c4qz3MJQ; Wed, 30 Oct 2019 12:33:37 +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 A39F2A594; Wed, 30 Oct 2019 12:33:37 +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 x9UCXbKC090523; Wed, 30 Oct 2019 12:33:37 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UCXbsx090521; Wed, 30 Oct 2019 12:33:37 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201910301233.x9UCXbsx090521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 Oct 2019 12:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354176 - 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: 354176 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 12:33:37 -0000 Author: andrew Date: Wed Oct 30 12:33:36 2019 New Revision: 354176 URL: https://svnweb.freebsd.org/changeset/base/354176 Log: Move the MRS instruction decode macros to armreg.h These instructions are used to access the registers described in armreg.h, and will be used in a future change to create a per-register identification macro. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/include/armreg.h head/sys/arm64/include/undefined.h Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Wed Oct 30 10:51:24 2019 (r354175) +++ head/sys/arm64/include/armreg.h Wed Oct 30 12:33:36 2019 (r354176) @@ -35,6 +35,23 @@ #define INSN_SIZE 4 +#define MRS_MASK 0xfff00000 +#define MRS_VALUE 0xd5300000 +#define MRS_SPECIAL(insn) ((insn) & 0x000fffe0) +#define MRS_REGISTER(insn) ((insn) & 0x0000001f) +#define MRS_Op0_SHIFT 19 +#define MRS_Op0_MASK 0x00080000 +#define MRS_Op1_SHIFT 16 +#define MRS_Op1_MASK 0x00070000 +#define MRS_CRn_SHIFT 12 +#define MRS_CRn_MASK 0x0000f000 +#define MRS_CRm_SHIFT 8 +#define MRS_CRm_MASK 0x00000f00 +#define MRS_Op2_SHIFT 5 +#define MRS_Op2_MASK 0x000000e0 +#define MRS_Rt_SHIFT 0 +#define MRS_Rt_MASK 0x0000001f + #define READ_SPECIALREG(reg) \ ({ uint64_t _val; \ __asm __volatile("mrs %0, " __STRING(reg) : "=&r" (_val)); \ Modified: head/sys/arm64/include/undefined.h ============================================================================== --- head/sys/arm64/include/undefined.h Wed Oct 30 10:51:24 2019 (r354175) +++ head/sys/arm64/include/undefined.h Wed Oct 30 12:33:36 2019 (r354176) @@ -36,23 +36,6 @@ typedef int (*undef_handler_t)(vm_offset_t, uint32_t, struct trapframe *, uint32_t); -#define MRS_MASK 0xfff00000 -#define MRS_VALUE 0xd5300000 -#define MRS_SPECIAL(insn) ((insn) & 0x000fffe0) -#define MRS_REGISTER(insn) ((insn) & 0x0000001f) -#define MRS_Op0_SHIFT 19 -#define MRS_Op0_MASK 0x00080000 -#define MRS_Op1_SHIFT 16 -#define MRS_Op1_MASK 0x00070000 -#define MRS_CRn_SHIFT 12 -#define MRS_CRn_MASK 0x0000f000 -#define MRS_CRm_SHIFT 8 -#define MRS_CRm_MASK 0x00000f00 -#define MRS_Op2_SHIFT 5 -#define MRS_Op2_MASK 0x000000e0 -#define MRS_Rt_SHIFT 0 -#define MRS_Rt_MASK 0x0000001f - static inline int mrs_Op0(uint32_t insn) { From owner-svn-src-all@freebsd.org Wed Oct 30 12:47:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8ACA1A4BDF; Wed, 30 Oct 2019 12:47:01 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4737WT4xkfz3NG8; Wed, 30 Oct 2019 12:47:01 +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 8964CA772; Wed, 30 Oct 2019 12:47:01 +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 x9UCl1so096604; Wed, 30 Oct 2019 12:47:01 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UCl01w096599; Wed, 30 Oct 2019 12:47:00 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201910301247.x9UCl01w096599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 Oct 2019 12:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354177 - in head/sys: arm64/arm64 dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm64/arm64 dev/hwpmc X-SVN-Commit-Revision: 354177 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 12:47:01 -0000 Author: andrew Date: Wed Oct 30 12:47:00 2019 New Revision: 354177 URL: https://svnweb.freebsd.org/changeset/base/354177 Log: Use a lowercase name for arm64 special registers so they don't conflict with macros of the same name. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/debug_monitor.c head/sys/arm64/arm64/freebsd32_machdep.c head/sys/arm64/arm64/gic_v3_reg.h head/sys/arm64/arm64/machdep.c head/sys/arm64/arm64/trap.c head/sys/dev/hwpmc/hwpmc_arm64.c Modified: head/sys/arm64/arm64/debug_monitor.c ============================================================================== --- head/sys/arm64/arm64/debug_monitor.c Wed Oct 30 12:33:36 2019 (r354176) +++ head/sys/arm64/arm64/debug_monitor.c Wed Oct 30 12:47:00 2019 (r354177) @@ -468,8 +468,8 @@ dbg_monitor_init(void) u_int i; /* Find out many breakpoints and watchpoints we can use */ - dbg_watchpoint_num = ((READ_SPECIALREG(ID_AA64DFR0_EL1) >> 20) & 0xf) + 1; - dbg_breakpoint_num = ((READ_SPECIALREG(ID_AA64DFR0_EL1) >> 12) & 0xf) + 1; + dbg_watchpoint_num = ((READ_SPECIALREG(id_aa64dfr0_el1) >> 20) & 0xf) + 1; + dbg_breakpoint_num = ((READ_SPECIALREG(id_aa64dfr0_el1) >> 12) & 0xf) + 1; if (bootverbose && PCPU_GET(cpuid) == 0) { printf("%d watchpoints and %d breakpoints supported\n", Modified: head/sys/arm64/arm64/freebsd32_machdep.c ============================================================================== --- head/sys/arm64/arm64/freebsd32_machdep.c Wed Oct 30 12:33:36 2019 (r354176) +++ head/sys/arm64/arm64/freebsd32_machdep.c Wed Oct 30 12:47:00 2019 (r354177) @@ -72,8 +72,8 @@ freebsd32_sysarch(struct thread *td, struct freebsd32_ switch(uap->op) { case ARM_SET_TP: - WRITE_SPECIALREG(TPIDR_EL0, uap->parms); - WRITE_SPECIALREG(TPIDRRO_EL0, uap->parms); + WRITE_SPECIALREG(tpidr_el0, uap->parms); + WRITE_SPECIALREG(tpidrro_el0, uap->parms); return 0; case ARM_SYNC_ICACHE: { Modified: head/sys/arm64/arm64/gic_v3_reg.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_reg.h Wed Oct 30 12:33:36 2019 (r354176) +++ head/sys/arm64/arm64/gic_v3_reg.h Wed Oct 30 12:47:00 2019 (r354177) @@ -389,7 +389,7 @@ #define gic_icc_write(reg, val) \ do { \ - WRITE_SPECIALREG(ICC_ ##reg ##_EL1, val); \ + WRITE_SPECIALREG(icc_ ##reg ##_el1, val); \ isb(); \ } while (0) @@ -397,7 +397,7 @@ do { \ ({ \ uint64_t val; \ \ - val = READ_SPECIALREG(ICC_ ##reg ##_EL1); \ + val = READ_SPECIALREG(icc_ ##reg ##_el1); \ (val); \ }) Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Wed Oct 30 12:33:36 2019 (r354176) +++ head/sys/arm64/arm64/machdep.c Wed Oct 30 12:47:00 2019 (r354177) @@ -1150,7 +1150,7 @@ dbg_init(void) { /* Clear OS lock */ - WRITE_SPECIALREG(OSLAR_EL1, 0); + WRITE_SPECIALREG(oslar_el1, 0); /* This permits DDB to use debug registers for watchpoints. */ dbg_monitor_init(); Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Wed Oct 30 12:33:36 2019 (r354176) +++ head/sys/arm64/arm64/trap.c Wed Oct 30 12:47:00 2019 (r354177) @@ -480,8 +480,8 @@ do_el0_sync(struct thread *td, struct trapframe *frame case EXCP_SOFTSTP_EL0: td->td_frame->tf_spsr &= ~PSR_SS; td->td_pcb->pcb_flags &= ~PCB_SINGLE_STEP; - WRITE_SPECIALREG(MDSCR_EL1, - READ_SPECIALREG(MDSCR_EL1) & ~DBG_MDSCR_SS); + WRITE_SPECIALREG(mdscr_el1, + READ_SPECIALREG(mdscr_el1) & ~DBG_MDSCR_SS); call_trapsignal(td, SIGTRAP, TRAP_TRACE, (void *)frame->tf_elr); userret(td, frame); Modified: head/sys/dev/hwpmc/hwpmc_arm64.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_arm64.c Wed Oct 30 12:33:36 2019 (r354176) +++ head/sys/dev/hwpmc/hwpmc_arm64.c Wed Oct 30 12:47:00 2019 (r354177) @@ -63,7 +63,7 @@ arm64_interrupt_enable(uint32_t pmc) uint32_t reg; reg = (1 << pmc); - WRITE_SPECIALREG(PMINTENSET_EL1, reg); + WRITE_SPECIALREG(pmintenset_el1, reg); isb(); } @@ -77,7 +77,7 @@ arm64_interrupt_disable(uint32_t pmc) uint32_t reg; reg = (1 << pmc); - WRITE_SPECIALREG(PMINTENCLR_EL1, reg); + WRITE_SPECIALREG(pmintenclr_el1, reg); isb(); } @@ -91,7 +91,7 @@ arm64_counter_enable(unsigned int pmc) uint32_t reg; reg = (1 << pmc); - WRITE_SPECIALREG(PMCNTENSET_EL0, reg); + WRITE_SPECIALREG(pmcntenset_el0, reg); isb(); } @@ -105,7 +105,7 @@ arm64_counter_disable(unsigned int pmc) uint32_t reg; reg = (1 << pmc); - WRITE_SPECIALREG(PMCNTENCLR_EL0, reg); + WRITE_SPECIALREG(pmcntenclr_el0, reg); isb(); } @@ -118,7 +118,7 @@ arm64_pmcr_read(void) { uint32_t reg; - reg = READ_SPECIALREG(PMCR_EL0); + reg = READ_SPECIALREG(pmcr_el0); return (reg); } @@ -127,7 +127,7 @@ static void arm64_pmcr_write(uint32_t reg) { - WRITE_SPECIALREG(PMCR_EL0, reg); + WRITE_SPECIALREG(pmcr_el0, reg); isb(); } @@ -141,11 +141,11 @@ arm64_pmcn_read(unsigned int pmc) KASSERT(pmc < arm64_npmcs, ("%s: illegal PMC number %d", __func__, pmc)); - WRITE_SPECIALREG(PMSELR_EL0, pmc); + WRITE_SPECIALREG(pmselr_el0, pmc); isb(); - return (READ_SPECIALREG(PMXEVCNTR_EL0)); + return (READ_SPECIALREG(pmxevcntr_el0)); } static void @@ -154,8 +154,8 @@ arm64_pmcn_write(unsigned int pmc, uint32_t reg) KASSERT(pmc < arm64_npmcs, ("%s: illegal PMC number %d", __func__, pmc)); - WRITE_SPECIALREG(PMSELR_EL0, pmc); - WRITE_SPECIALREG(PMXEVCNTR_EL0, reg); + WRITE_SPECIALREG(pmselr_el0, pmc); + WRITE_SPECIALREG(pmxevcntr_el0, reg); isb(); } @@ -273,8 +273,8 @@ arm64_start_pmc(int cpu, int ri) /* * Configure the event selection. */ - WRITE_SPECIALREG(PMSELR_EL0, ri); - WRITE_SPECIALREG(PMXEVTYPER_EL0, config); + WRITE_SPECIALREG(pmselr_el0, ri); + WRITE_SPECIALREG(pmxevtyper_el0, config); isb(); @@ -347,10 +347,10 @@ arm64_intr(struct trapframe *tf) /* Check if counter is overflowed */ reg = (1 << ri); - if ((READ_SPECIALREG(PMOVSCLR_EL0) & reg) == 0) + if ((READ_SPECIALREG(pmovsclr_el0) & reg) == 0) continue; /* Clear Overflow Flag */ - WRITE_SPECIALREG(PMOVSCLR_EL0, reg); + WRITE_SPECIALREG(pmovsclr_el0, reg); isb(); From owner-svn-src-all@freebsd.org Wed Oct 30 13:45:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 938C91A5F80; Wed, 30 Oct 2019 13:45:41 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4738q93McHz3xSs; Wed, 30 Oct 2019 13:45:41 +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 54707B216; Wed, 30 Oct 2019 13:45:41 +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 x9UDjfgl032527; Wed, 30 Oct 2019 13:45:41 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UDjei2032524; Wed, 30 Oct 2019 13:45:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201910301345.x9UDjei2032524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 Oct 2019 13:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354178 - 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: 354178 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 13:45:41 -0000 Author: andrew Date: Wed Oct 30 13:45:40 2019 New Revision: 354178 URL: https://svnweb.freebsd.org/changeset/base/354178 Log: Allow the userspace ID register fields to be read from the kernel To allow consistent values to be used in both the kernel and userspace create a function for these to be read from the kernel. They use a newly created macro with the name of the ID register to read. For now there is redundant information in the user_regs array as it still holds the CRm and Op2 values, however this will be fixed in a later change. This will be used by ptrace to allow hardware breakpoints in userspace. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/identcpu.c head/sys/arm64/include/armreg.h head/sys/arm64/include/undefined.h Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Wed Oct 30 12:47:00 2019 (r354177) +++ head/sys/arm64/arm64/identcpu.c Wed Oct 30 13:45:40 2019 (r354178) @@ -710,6 +710,7 @@ static struct mrs_field id_aa64pfr1_fields[] = { }; struct mrs_user_reg { + u_int reg; u_int CRm; u_int Op2; size_t offset; @@ -718,24 +719,28 @@ struct mrs_user_reg { static struct mrs_user_reg user_regs[] = { { /* id_aa64isar0_el1 */ + .reg = ID_AA64ISAR0_EL1, .CRm = 6, .Op2 = 0, .offset = __offsetof(struct cpu_desc, id_aa64isar0), .fields = id_aa64isar0_fields, }, { /* id_aa64isar1_el1 */ + .reg = ID_AA64ISAR1_EL1, .CRm = 6, .Op2 = 1, .offset = __offsetof(struct cpu_desc, id_aa64isar1), .fields = id_aa64isar1_fields, }, { /* id_aa64pfr0_el1 */ + .reg = ID_AA64PFR0_EL1, .CRm = 4, .Op2 = 0, .offset = __offsetof(struct cpu_desc, id_aa64pfr0), .fields = id_aa64pfr0_fields, }, { /* id_aa64dfr0_el1 */ + .reg = ID_AA64DFR0_EL1, .CRm = 5, .Op2 = 0, .offset = __offsetof(struct cpu_desc, id_aa64dfr0), @@ -816,6 +821,23 @@ user_mrs_handler(vm_offset_t va, uint32_t insn, struct frame->tf_lr = value; return (1); +} + +bool +extract_user_id_field(u_int reg, u_int field_shift, uint8_t *val) +{ + uint64_t value; + int i; + + for (i = 0; i < nitems(user_regs); i++) { + if (user_regs[i].reg == reg) { + value = CPU_DESC_FIELD(user_cpu_desc, i); + *val = value >> field_shift; + return (true); + } + } + + return (false); } static void Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Wed Oct 30 12:47:00 2019 (r354177) +++ head/sys/arm64/include/armreg.h Wed Oct 30 13:45:40 2019 (r354178) @@ -51,6 +51,10 @@ #define MRS_Op2_MASK 0x000000e0 #define MRS_Rt_SHIFT 0 #define MRS_Rt_MASK 0x0000001f +#define MRS_REG(op0, op1, crn, crm, op2) \ + (((op0) << MRS_Op0_SHIFT) | ((op1) << MRS_Op1_SHIFT) | \ + ((crn) << MRS_CRn_SHIFT) | ((crm) << MRS_CRm_SHIFT) | \ + ((op2) << MRS_Op2_SHIFT)) #define READ_SPECIALREG(reg) \ ({ uint64_t _val; \ @@ -193,6 +197,7 @@ #define ICC_SRE_EL2_EN (1U << 3) /* ID_AA64DFR0_EL1 */ +#define ID_AA64DFR0_EL1 MRS_REG(3, 0, 0, 5, 0) #define ID_AA64DFR0_DebugVer_SHIFT 0 #define ID_AA64DFR0_DebugVer_MASK (UL(0xf) << ID_AA64DFR0_DebugVer_SHIFT) #define ID_AA64DFR0_DebugVer_VAL(x) ((x) & ID_AA64DFR0_DebugVer_MASK) @@ -230,6 +235,7 @@ #define ID_AA64DFR0_PMSVer_V1 (UL(0x1) << ID_AA64DFR0_PMSVer_SHIFT) /* ID_AA64ISAR0_EL1 */ +#define ID_AA64ISAR0_EL1 MRS_REG(3, 0, 0, 6, 0) #define ID_AA64ISAR0_AES_SHIFT 4 #define ID_AA64ISAR0_AES_MASK (UL(0xf) << ID_AA64ISAR0_AES_SHIFT) #define ID_AA64ISAR0_AES_VAL(x) ((x) & ID_AA64ISAR0_AES_MASK) @@ -284,6 +290,7 @@ #define ID_AA64ISAR0_DP_IMPL (UL(0x1) << ID_AA64ISAR0_DP_SHIFT) /* ID_AA64ISAR1_EL1 */ +#define ID_AA64ISAR1_EL1 MRS_REG(3, 0, 0, 6, 1) #define ID_AA64ISAR1_DPB_SHIFT 0 #define ID_AA64ISAR1_DPB_MASK (UL(0xf) << ID_AA64ISAR1_DPB_SHIFT) #define ID_AA64ISAR1_DPB_VAL(x) ((x) & ID_AA64ISAR1_DPB_MASK) @@ -326,6 +333,7 @@ #define ID_AA64ISAR1_GPI_IMPL (UL(0x1) << ID_AA64ISAR1_GPI_SHIFT) /* ID_AA64MMFR0_EL1 */ +#define ID_AA64MMFR0_EL1 MRS_REG(3, 0, 0, 7, 0) #define ID_AA64MMFR0_PARange_SHIFT 0 #define ID_AA64MMFR0_PARange_MASK (UL(0xf) << ID_AA64MMFR0_PARange_SHIFT) #define ID_AA64MMFR0_PARange_VAL(x) ((x) & ID_AA64MMFR0_PARange_MASK) @@ -373,6 +381,7 @@ #define ID_AA64MMFR0_TGran4_NONE (UL(0xf) << ID_AA64MMFR0_TGran4_SHIFT) /* ID_AA64MMFR1_EL1 */ +#define ID_AA64MMFR1_EL1 MRS_REG(3, 0, 0, 7, 1) #define ID_AA64MMFR1_HAFDBS_SHIFT 0 #define ID_AA64MMFR1_HAFDBS_MASK (UL(0xf) << ID_AA64MMFR1_HAFDBS_SHIFT) #define ID_AA64MMFR1_HAFDBS_VAL(x) ((x) & ID_AA64MMFR1_HAFDBS_MASK) @@ -418,7 +427,7 @@ #define ID_AA64MMFR1_XNX_IMPL (UL(0x1) << ID_AA64MMFR1_XNX_SHIFT) /* ID_AA64MMFR2_EL1 */ -#define ID_AA64MMFR2_EL1 S3_0_C0_C7_2 +#define ID_AA64MMFR2_EL1 MRS_REG(3, 0, 0, 7, 2) #define ID_AA64MMFR2_CnP_SHIFT 0 #define ID_AA64MMFR2_CnP_MASK (UL(0xf) << ID_AA64MMFR2_CnP_SHIFT) #define ID_AA64MMFR2_CnP_VAL(x) ((x) & ID_AA64MMFR2_CnP_MASK) @@ -456,6 +465,7 @@ #define ID_AA64MMFR2_NV_IMPL (UL(0x1) << ID_AA64MMFR2_NV_SHIFT) /* ID_AA64PFR0_EL1 */ +#define ID_AA64PFR0_EL1 MRS_REG(3, 0, 0, 4, 0) #define ID_AA64PFR0_EL0_SHIFT 0 #define ID_AA64PFR0_EL0_MASK (UL(0xf) << ID_AA64PFR0_EL0_SHIFT) #define ID_AA64PFR0_EL0_VAL(x) ((x) & ID_AA64PFR0_EL0_MASK) Modified: head/sys/arm64/include/undefined.h ============================================================================== --- head/sys/arm64/include/undefined.h Wed Oct 30 12:47:00 2019 (r354177) +++ head/sys/arm64/include/undefined.h Wed Oct 30 13:45:40 2019 (r354178) @@ -33,6 +33,8 @@ #ifndef _MACHINE__UNDEFINED_H_ #define _MACHINE__UNDEFINED_H_ +#ifdef _KERNEL + typedef int (*undef_handler_t)(vm_offset_t, uint32_t, struct trapframe *, uint32_t); @@ -60,5 +62,8 @@ void undef_init(void); void *install_undef_handler(bool, undef_handler_t); void remove_undef_handler(void *); int undef_insn(u_int, struct trapframe *); +bool extract_user_id_field(u_int, u_int, uint8_t *); + +#endif /* _KERNEL */ #endif From owner-svn-src-all@freebsd.org Wed Oct 30 14:05:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 915DE1A63BD; Wed, 30 Oct 2019 14:05:51 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4739GR37zyz3yhQ; Wed, 30 Oct 2019 14:05:51 +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 4BE73B5C6; Wed, 30 Oct 2019 14:05:51 +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 x9UE5pA3043913; Wed, 30 Oct 2019 14:05:51 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UE5oe5043911; Wed, 30 Oct 2019 14:05:50 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201910301405.x9UE5oe5043911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 Oct 2019 14:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354179 - 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: 354179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 14:05:51 -0000 Author: andrew Date: Wed Oct 30 14:05:50 2019 New Revision: 354179 URL: https://svnweb.freebsd.org/changeset/base/354179 Log: Allow exceptions to be masked when in userspace We may want to mask exceptions when in userspace. This was previously impossible as threads are created with all exceptions unmasked and signals expected userspace to mask any. Fix these by copying the mask state on thread creation and allow exceptions to be masked on signal return, as long as they don't change. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/machdep.c head/sys/arm64/arm64/vm_machdep.c head/sys/arm64/include/armreg.h Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Wed Oct 30 13:45:40 2019 (r354178) +++ head/sys/arm64/arm64/machdep.c Wed Oct 30 14:05:50 2019 (r354179) @@ -441,7 +441,8 @@ set_mcontext(struct thread *td, mcontext_t *mcp) spsr = mcp->mc_gpregs.gp_spsr; if ((spsr & PSR_M_MASK) != PSR_M_EL0t || - (spsr & (PSR_AARCH32 | PSR_F | PSR_I | PSR_A | PSR_D)) != 0) + (spsr & PSR_AARCH32) != 0 || + (spsr & PSR_DAIF) != (td->td_frame->tf_spsr & PSR_DAIF)) return (EINVAL); memcpy(tf->tf_x, mcp->mc_gpregs.gp_x, sizeof(tf->tf_x)); Modified: head/sys/arm64/arm64/vm_machdep.c ============================================================================== --- head/sys/arm64/arm64/vm_machdep.c Wed Oct 30 13:45:40 2019 (r354178) +++ head/sys/arm64/arm64/vm_machdep.c Wed Oct 30 14:05:50 2019 (r354179) @@ -98,7 +98,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct t bcopy(td1->td_frame, tf, sizeof(*tf)); tf->tf_x[0] = 0; tf->tf_x[1] = 0; - tf->tf_spsr = td1->td_frame->tf_spsr & PSR_M_32; + tf->tf_spsr = td1->td_frame->tf_spsr & (PSR_M_32 | PSR_DAIF); td2->td_frame = tf; Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Wed Oct 30 13:45:40 2019 (r354178) +++ head/sys/arm64/include/armreg.h Wed Oct 30 14:05:50 2019 (r354179) @@ -608,6 +608,7 @@ #define PSR_I 0x00000080 #define PSR_A 0x00000100 #define PSR_D 0x00000200 +#define PSR_DAIF (PSR_D | PSR_A | PSR_I | PSR_F) #define PSR_IL 0x00100000 #define PSR_SS 0x00200000 #define PSR_V 0x10000000 From owner-svn-src-all@freebsd.org Wed Oct 30 15:15:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E5681A79E9; Wed, 30 Oct 2019 15:15:54 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473BqG1M1wz43l8; Wed, 30 Oct 2019 15:15:54 +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 115EDC3CC; Wed, 30 Oct 2019 15:15:54 +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 x9UFFrXc084906; Wed, 30 Oct 2019 15:15:53 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UFFrI4084905; Wed, 30 Oct 2019 15:15:53 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910301515.x9UFFrI4084905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 30 Oct 2019 15:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354180 - head/sys/dev/ow X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/ow X-SVN-Commit-Revision: 354180 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 15:15:54 -0000 Author: avg Date: Wed Oct 30 15:15:53 2019 New Revision: 354180 URL: https://svnweb.freebsd.org/changeset/base/354180 Log: ow(4): increase regular mode recovery time, t_rec, to 15 us Previously we used the minimal value of 1 us and it was really tight. Application Note 3829 has a table describing recommended t_rec values for various bus voltages, temperature conditions and numbers of slave devices. The new value decreases the maximum possible data rate from 16.3 Kbit/s to 13.3 Kbit/s, but it allows for up to four slaves on a 3.3V bus (under room temperature). References: - Maxim Integrated Application Note 3829 Determining the Recovery Time for Multiple-Slave 1-Wire(R) Networks - Maxim Integrated Application Note 937 Book of iButton Standards Discussed with: imp (D22108) MFC after: 3 weeks Modified: head/sys/dev/ow/ow.c Modified: head/sys/dev/ow/ow.c ============================================================================== --- head/sys/dev/ow/ow.c Wed Oct 30 14:05:50 2019 (r354179) +++ head/sys/dev/ow/ow.c Wed Oct 30 15:15:53 2019 (r354180) @@ -80,7 +80,7 @@ static struct ow_timing timing_regular = { .t_low0 = 60, /* really 60 to 120 */ .t_low1 = 1, /* really 1 to 15 */ .t_release = 45, /* <= 45us */ - .t_rec = 1, /* at least 1us */ + .t_rec = 15, /* at least 1us */ .t_rdv = 15, /* 15us */ .t_rstl = 480, /* 480us or more */ .t_rsth = 480, /* 480us or more */ From owner-svn-src-all@freebsd.org Wed Oct 30 15:26:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C131C1A7D4D; Wed, 30 Oct 2019 15:26:41 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473C3j4m7nz44RL; Wed, 30 Oct 2019 15:26:41 +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 826A2C58B; Wed, 30 Oct 2019 15:26:41 +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 x9UFQfOu091116; Wed, 30 Oct 2019 15:26:41 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UFQfkm091115; Wed, 30 Oct 2019 15:26:41 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910301526.x9UFQfkm091115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 30 Oct 2019 15:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354181 - head/sys/dev/ow X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/ow X-SVN-Commit-Revision: 354181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 15:26:41 -0000 Author: avg Date: Wed Oct 30 15:26:41 2019 New Revision: 354181 URL: https://svnweb.freebsd.org/changeset/base/354181 Log: ow(4): protocol timings can now be changed as sysctl-s / tunables I limited potentially infinite timings by 960 us based on a footnote on page 38 of Maxim Integrated Application Note 937, Book of iButton Standards: "In order not to mask interrupt signalling by other devices on the 1–Wire bus, tRSTL + tR should always be less than 960 us." MFC after: 3 weeks Modified: head/sys/dev/ow/ow.c Modified: head/sys/dev/ow/ow.c ============================================================================== --- head/sys/dev/ow/ow.c Wed Oct 30 15:15:53 2019 (r354180) +++ head/sys/dev/ow/ow.c Wed Oct 30 15:26:41 2019 (r354181) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -75,34 +76,137 @@ static void ow_release_bus(device_t ndev, device_t pde static MALLOC_DEFINE(M_OW, "ow", "House keeping data for 1wire bus"); +static const struct ow_timing timing_regular_min = { + .t_slot = 60, + .t_low0 = 60, + .t_low1 = 1, + .t_release = 0, + .t_rec = 1, + .t_rdv = 15, /* fixed */ + .t_rstl = 480, + .t_rsth = 480, + .t_pdl = 60, + .t_pdh = 15, + .t_lowr = 1, +}; + +static const struct ow_timing timing_regular_max = { + .t_slot = 120, + .t_low0 = 120, + .t_low1 = 15, + .t_release = 45, + .t_rec = 960, /* infinity */ + .t_rdv = 15, /* fixed */ + .t_rstl = 960, /* infinity */ + .t_rsth = 960, /* infinity */ + .t_pdl = 240, /* 60us to 240us */ + .t_pdh = 60, /* 15us to 60us */ + .t_lowr = 15, /* 1us */ +}; + static struct ow_timing timing_regular = { - .t_slot = 60, /* 60 to 120 */ - .t_low0 = 60, /* really 60 to 120 */ - .t_low1 = 1, /* really 1 to 15 */ - .t_release = 45, /* <= 45us */ - .t_rec = 15, /* at least 1us */ - .t_rdv = 15, /* 15us */ - .t_rstl = 480, /* 480us or more */ - .t_rsth = 480, /* 480us or more */ - .t_pdl = 60, /* 60us to 240us */ - .t_pdh = 60, /* 15us to 60us */ - .t_lowr = 1, /* 1us */ + .t_slot = 60, /* 60 <= t < 120 */ + .t_low0 = 60, /* 60 <= t < t_slot < 120 */ + .t_low1 = 1, /* 1 <= t < 15 */ + .t_release = 45, /* 0 <= t < 45 */ + .t_rec = 15, /* 1 <= t < inf */ + .t_rdv = 15, /* t == 15 */ + .t_rstl = 480, /* 480 <= t < inf */ + .t_rsth = 480, /* 480 <= t < inf */ + .t_pdl = 60, /* 60 <= t < 240 */ + .t_pdh = 60, /* 15 <= t < 60 */ + .t_lowr = 1, /* 1 <= t < 15 */ }; /* NB: Untested */ +static const struct ow_timing timing_overdrive_min = { + .t_slot = 6, + .t_low0 = 6, + .t_low1 = 1, + .t_release = 0, + .t_rec = 1, + .t_rdv = 2, /* fixed */ + .t_rstl = 48, + .t_rsth = 48, + .t_pdl = 8, + .t_pdh = 2, + .t_lowr = 1, +}; + +static const struct ow_timing timing_overdrive_max = { + .t_slot = 16, + .t_low0 = 16, + .t_low1 = 2, + .t_release = 4, + .t_rec = 960, /* infinity */ + .t_rdv = 2, /* fixed */ + .t_rstl = 80, + .t_rsth = 960, /* infinity */ + .t_pdl = 24, + .t_pdh = 6, + .t_lowr = 2, +}; + static struct ow_timing timing_overdrive = { - .t_slot = 11, /* 6us to 16us */ - .t_low0 = 6, /* really 6 to 16 */ - .t_low1 = 1, /* really 1 to 2 */ - .t_release = 4, /* <= 4us */ - .t_rec = 1, /* at least 1us */ - .t_rdv = 2, /* 2us */ - .t_rstl = 48, /* 48us to 80us */ - .t_rsth = 48, /* 48us or more */ - .t_pdl = 8, /* 8us to 24us */ - .t_pdh = 2, /* 2us to 6us */ - .t_lowr = 1, /* 1us */ + .t_slot = 11, /* 6 <= t < 16 */ + .t_low0 = 6, /* 6 <= t < t_slot < 16 */ + .t_low1 = 1, /* 1 <= t < 2 */ + .t_release = 4, /* 0 <= t < 4 */ + .t_rec = 1, /* 1 <= t < inf */ + .t_rdv = 2, /* t == 2 */ + .t_rstl = 48, /* 48 <= t < 80 */ + .t_rsth = 48, /* 48 <= t < inf */ + .t_pdl = 8, /* 8 <= t < 24 */ + .t_pdh = 2, /* 2 <= t < 6 */ + .t_lowr = 1, /* 1 <= t < 2 */ }; + +SYSCTL_DECL(_hw); +SYSCTL_NODE(_hw, OID_AUTO, ow, CTLFLAG_RD, 0, "1-Wire protocol"); +SYSCTL_NODE(_hw_ow, OID_AUTO, regular, CTLFLAG_RD, 0, + "Regular mode timings"); +SYSCTL_NODE(_hw_ow, OID_AUTO, overdrive, CTLFLAG_RD, 0, + "Overdrive mode timings"); + +#define _OW_TIMING_SYSCTL(mode, param) \ + static int \ + sysctl_ow_timing_ ## mode ## _ ## param(SYSCTL_HANDLER_ARGS) \ + { \ + int val = timing_ ## mode.param; \ + int err; \ + err = sysctl_handle_int(oidp, &val, 0, req); \ + if (err != 0 || req->newptr == NULL) \ + return (err); \ + if (val < timing_ ## mode ## _min.param) \ + return (EINVAL); \ + else if (val >= timing_ ## mode ## _max.param) \ + return (EINVAL); \ + timing_ ## mode.param = val; \ + return (0); \ + } \ +SYSCTL_PROC(_hw_ow_ ## mode, OID_AUTO, param, \ + CTLTYPE_INT | CTLFLAG_RWTUN, 0, sizeof(int), \ + sysctl_ow_timing_ ## mode ## _ ## param, "I", \ + "1-Wire timing parameter in microseconds (-1 resets to default)") + +#define OW_TIMING_SYSCTL(param) \ + _OW_TIMING_SYSCTL(regular, param); \ + _OW_TIMING_SYSCTL(overdrive, param) + +OW_TIMING_SYSCTL(t_slot); +OW_TIMING_SYSCTL(t_low0); +OW_TIMING_SYSCTL(t_low1); +OW_TIMING_SYSCTL(t_release); +OW_TIMING_SYSCTL(t_rec); +OW_TIMING_SYSCTL(t_rdv); +OW_TIMING_SYSCTL(t_rstl); +OW_TIMING_SYSCTL(t_rsth); +OW_TIMING_SYSCTL(t_pdl); +OW_TIMING_SYSCTL(t_pdh); +OW_TIMING_SYSCTL(t_lowr); + +#undef _OW_TIMING_SYSCTL +#undef OW_TIMING_SYSCTL static void ow_send_byte(device_t lldev, struct ow_timing *t, uint8_t byte) From owner-svn-src-all@freebsd.org Wed Oct 30 15:30:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2098158053; Wed, 30 Oct 2019 15:30:40 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473C8J5DdWz44wC; Wed, 30 Oct 2019 15:30:40 +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 97DCFC5A1; Wed, 30 Oct 2019 15:30:40 +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 x9UFUeY4091386; Wed, 30 Oct 2019 15:30:40 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UFUe8X091385; Wed, 30 Oct 2019 15:30:40 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201910301530.x9UFUe8X091385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 30 Oct 2019 15:30:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354182 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 354182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 15:30:40 -0000 Author: jhibbits Date: Wed Oct 30 15:30:40 2019 New Revision: 354182 URL: https://svnweb.freebsd.org/changeset/base/354182 Log: ARM64: Treat alignment faults as bus errors Summary: ARM64 currently treats all data abort exceptions as page faults. This can cause infinite loops on non-page fault faults, such as alignment faults. Since kernel-side alignment faults should be avoided, this adds support directly to the el0 fault handler, instead of the data_abort() handler. Test Plan: Tested on rpi3, with a misaligned ldm test. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D22133 Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Wed Oct 30 15:26:41 2019 (r354181) +++ head/sys/arm64/arm64/trap.c Wed Oct 30 15:30:40 2019 (r354182) @@ -87,6 +87,7 @@ int (*dtrace_invop_jump_addr)(struct trapframe *); typedef void (abort_handler)(struct thread *, struct trapframe *, uint64_t, uint64_t, int); +static abort_handler align_abort; static abort_handler data_abort; static abort_handler *abort_handlers[] = { @@ -100,6 +101,7 @@ static abort_handler *abort_handlers[] = { [ISS_DATA_DFSC_PF_L1] = data_abort, [ISS_DATA_DFSC_PF_L2] = data_abort, [ISS_DATA_DFSC_PF_L3] = data_abort, + [ISS_DATA_DFSC_ALIGN] = align_abort, }; static __inline void @@ -163,6 +165,17 @@ svc_handler(struct thread *td, struct trapframe *frame call_trapsignal(td, SIGILL, ILL_ILLOPN, (void *)frame->tf_elr); userret(td, frame); } +} + +static void +align_abort(struct thread *td, struct trapframe *frame, uint64_t esr, + uint64_t far, int lower) +{ + if (!lower) + panic("Misaligned access from kernel space!"); + + call_trapsignal(td, SIGBUS, BUS_ADRALN, (void *)frame->tf_elr); + userret(td, frame); } static void From owner-svn-src-all@freebsd.org Wed Oct 30 15:36:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 908E51583E5; Wed, 30 Oct 2019 15:36:42 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473CHG3Jtxz45KW; Wed, 30 Oct 2019 15:36:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 511C2C76A; Wed, 30 Oct 2019 15:36:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9UFagx3096916; Wed, 30 Oct 2019 15:36:42 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UFagtb096915; Wed, 30 Oct 2019 15:36:42 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910301536.x9UFagtb096915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 30 Oct 2019 15:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354183 - head/sys/dev/ow X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/ow X-SVN-Commit-Revision: 354183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 15:36:42 -0000 Author: avg Date: Wed Oct 30 15:36:41 2019 New Revision: 354183 URL: https://svnweb.freebsd.org/changeset/base/354183 Log: ow(4): clean up stray white space MFC after: 2 weeks Modified: head/sys/dev/ow/ow.c Modified: head/sys/dev/ow/ow.c ============================================================================== --- head/sys/dev/ow/ow.c Wed Oct 30 15:30:40 2019 (r354182) +++ head/sys/dev/ow/ow.c Wed Oct 30 15:36:41 2019 (r354183) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); typedef int ow_enum_fn(device_t, device_t); typedef int ow_found_fn(device_t, romid_t); -struct ow_softc +struct ow_softc { device_t dev; /* Newbus driver back pointer */ struct mtx mtx; /* bus mutex */ @@ -212,7 +212,7 @@ static void ow_send_byte(device_t lldev, struct ow_timing *t, uint8_t byte) { int i; - + for (i = 0; i < 8; i++) if (byte & (1 << i)) OWLL_WRITE_ONE(lldev, t); @@ -226,7 +226,7 @@ ow_read_byte(device_t lldev, struct ow_timing *t, uint int i; uint8_t byte = 0; int bit; - + for (i = 0; i < 8; i++) { OWLL_READ_DATA(lldev, t, &bit); byte |= bit << i; From owner-svn-src-all@freebsd.org Wed Oct 30 16:41:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB22915A429; Wed, 30 Oct 2019 16:41:57 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473DkY4X92z4CWw; Wed, 30 Oct 2019 16:41:57 +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 7EBBED3B2; Wed, 30 Oct 2019 16:41:57 +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 x9UGfvGp037629; Wed, 30 Oct 2019 16:41:57 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UGfvY8037628; Wed, 30 Oct 2019 16:41:57 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910301641.x9UGfvY8037628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 30 Oct 2019 16:41:57 +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: r354184 - stable/12/sys/arm/include X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/arm/include X-SVN-Commit-Revision: 354184 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 16:41:57 -0000 Author: avg Date: Wed Oct 30 16:41:57 2019 New Revision: 354184 URL: https://svnweb.freebsd.org/changeset/base/354184 Log: MFC r353165: align use of cp15_pmccntr_get with its availability Modified: stable/12/sys/arm/include/cpu.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/include/cpu.h ============================================================================== --- stable/12/sys/arm/include/cpu.h Wed Oct 30 15:36:41 2019 (r354183) +++ stable/12/sys/arm/include/cpu.h Wed Oct 30 16:41:57 2019 (r354184) @@ -20,7 +20,7 @@ void swi_vm(void *); static __inline uint64_t get_cyclecount(void) { -#if __ARM_ARCH >= 6 +#if __ARM_ARCH > 6 || (__ARM_ARCH == 6 && defined(CPU_ARM1176)) #if (__ARM_ARCH > 6) && defined(DEV_PMU) if (pmu_attched) { u_int cpu; From owner-svn-src-all@freebsd.org Wed Oct 30 16:45:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2FBC15A670; Wed, 30 Oct 2019 16:45:26 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473DpZ4JPWz4Cs6; Wed, 30 Oct 2019 16:45:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D7E1D3EE; Wed, 30 Oct 2019 16:45:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9UGjQEY040894; Wed, 30 Oct 2019 16:45:26 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UGjPbe040889; Wed, 30 Oct 2019 16:45:25 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910301645.x9UGjPbe040889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 30 Oct 2019 16:45:25 +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: r354185 - in stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 354185 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 16:45:26 -0000 Author: avg Date: Wed Oct 30 16:45:24 2019 New Revision: 354185 URL: https://svnweb.freebsd.org/changeset/base/354185 Log: MFC r353621: MFV r353619: 9691 fat zap should prefetch when iterating Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c Wed Oct 30 16:41:57 2019 (r354184) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c Wed Oct 30 16:45:24 2019 (r354185) @@ -21,6 +21,7 @@ /* * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018 by Delphix. All rights reserved. */ #include @@ -113,7 +114,18 @@ ddt_zap_walk(objset_t *os, uint64_t object, ddt_entry_ zap_attribute_t za; int error; - zap_cursor_init_serialized(&zc, os, object, *walk); + if (*walk == 0) { + /* + * We don't want to prefetch the entire ZAP object, because + * it can be enormous. Also the primary use of DDT iteration + * is for scrubbing, in which case we will be issuing many + * scrub i/os for each ZAP block that we read in, so + * reading the ZAP is unlikely to be the bottleneck. + */ + zap_cursor_init_noprefetch(&zc, os, object); + } else { + zap_cursor_init_serialized(&zc, os, object, *walk); + } if ((error = zap_cursor_retrieve(&zc, &za)) == 0) { uchar_t cbuf[sizeof (dde->dde_phys) + 1]; uint64_t csize = za.za_num_integers; Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Wed Oct 30 16:41:57 2019 (r354184) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Wed Oct 30 16:45:24 2019 (r354185) @@ -80,6 +80,13 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, per_txg_dirty_frees_per */ int zfs_object_remap_one_indirect_delay_ticks = 0; +/* + * Limit the amount we can prefetch with one call to this amount. This + * helps to limit the amount of memory that can be used by prefetching. + * Larger objects should be prefetched a bit at a time. + */ +uint64_t dmu_prefetch_max = 8 * SPA_MAXBLOCKSIZE; + const dmu_object_type_info_t dmu_ot[DMU_OT_NUMTYPES] = { { DMU_BSWAP_UINT8, TRUE, FALSE, "unallocated" }, { DMU_BSWAP_ZAP, TRUE, TRUE, "object directory" }, @@ -641,6 +648,11 @@ dmu_prefetch(objset_t *os, uint64_t object, int64_t le rw_exit(&dn->dn_struct_rwlock); return; } + + /* + * See comment before the definition of dmu_prefetch_max. + */ + len = MIN(len, dmu_prefetch_max); /* * XXX - Note, if the dnode for the requested object is not Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Wed Oct 30 16:41:57 2019 (r354184) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Wed Oct 30 16:45:24 2019 (r354185) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2018 by Delphix. All rights reserved. * Copyright 2017 Nexenta Systems, Inc. */ @@ -347,6 +347,7 @@ typedef struct zap_cursor { uint64_t zc_serialized; uint64_t zc_hash; uint32_t zc_cd; + boolean_t zc_prefetch; } zap_cursor_t; typedef struct { @@ -373,6 +374,8 @@ typedef struct { * zapobj. You must _fini the cursor when you are done with it. */ void zap_cursor_init(zap_cursor_t *zc, objset_t *ds, uint64_t zapobj); +void zap_cursor_init_noprefetch(zap_cursor_t *zc, objset_t *os, + uint64_t zapobj); void zap_cursor_fini(zap_cursor_t *zc); /* Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Wed Oct 30 16:41:57 2019 (r354184) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Wed Oct 30 16:45:24 2019 (r354185) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2018 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. */ @@ -49,6 +49,36 @@ #include #include +/* + * If zap_iterate_prefetch is set, we will prefetch the entire ZAP object + * (all leaf blocks) when we start iterating over it. + * + * For zap_cursor_init(), the callers all intend to iterate through all the + * entries. There are a few cases where an error (typically i/o error) could + * cause it to bail out early. + * + * For zap_cursor_init_serialized(), there are callers that do the iteration + * outside of ZFS. Typically they would iterate over everything, but we + * don't have control of that. E.g. zfs_ioc_snapshot_list_next(), + * zcp_snapshots_iter(), and other iterators over things in the MOS - these + * are called by /sbin/zfs and channel programs. The other example is + * zfs_readdir() which iterates over directory entries for the getdents() + * syscall. /sbin/ls iterates to the end (unless it receives a signal), but + * userland doesn't have to. + * + * Given that the ZAP entries aren't returned in a specific order, the only + * legitimate use cases for partial iteration would be: + * + * 1. Pagination: e.g. you only want to display 100 entries at a time, so you + * get the first 100 and then wait for the user to hit "next page", which + * they may never do). + * + * 2. You want to know if there are more than X entries, without relying on + * the zfs-specific implementation of the directory's st_size (which is + * the number of entries). + */ +boolean_t zap_iterate_prefetch = B_TRUE; + int fzap_default_block_shift = 14; /* 16k blocksize */ extern inline zap_phys_t *zap_f_phys(zap_t *zap); @@ -1168,6 +1198,20 @@ fzap_cursor_retrieve(zap_t *zap, zap_cursor_t *zc, zap /* retrieve the next entry at or after zc_hash/zc_cd */ /* if no entry, return ENOENT */ + + /* + * If we are reading from the beginning, we're almost + * certain to iterate over the entire ZAP object. If there are + * multiple leaf blocks (freeblk > 2), prefetch the whole + * object, so that we read the leaf blocks concurrently. + * (Unless noprefetch was requested via zap_cursor_init_noprefetch()). + */ + if (zc->zc_hash == 0 && zap_iterate_prefetch && + zc->zc_prefetch && zap_f_phys(zap)->zap_freeblk > 2) { + dmu_prefetch(zc->zc_objset, zc->zc_zapobj, 0, 0, + zap_f_phys(zap)->zap_freeblk << FZAP_BLOCK_SHIFT(zap), + ZIO_PRIORITY_ASYNC_READ); + } if (zc->zc_leaf && (ZAP_HASH_IDX(zc->zc_hash, Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Wed Oct 30 16:41:57 2019 (r354184) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Wed Oct 30 16:45:24 2019 (r354185) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2017 by Delphix. All rights reserved. + * Copyright (c) 2011, 2018 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2017 Nexenta Systems, Inc. @@ -1394,9 +1394,9 @@ zap_remove_uint64(objset_t *os, uint64_t zapobj, const * Routines for iterating over the attributes. */ -void -zap_cursor_init_serialized(zap_cursor_t *zc, objset_t *os, uint64_t zapobj, - uint64_t serialized) +static void +zap_cursor_init_impl(zap_cursor_t *zc, objset_t *os, uint64_t zapobj, + uint64_t serialized, boolean_t prefetch) { zc->zc_objset = os; zc->zc_zap = NULL; @@ -1405,12 +1405,33 @@ zap_cursor_init_serialized(zap_cursor_t *zc, objset_t zc->zc_serialized = serialized; zc->zc_hash = 0; zc->zc_cd = 0; + zc->zc_prefetch = prefetch; } +void +zap_cursor_init_serialized(zap_cursor_t *zc, objset_t *os, uint64_t zapobj, + uint64_t serialized) +{ + zap_cursor_init_impl(zc, os, zapobj, serialized, B_TRUE); +} +/* + * Initialize a cursor at the beginning of the ZAP object. The entire + * ZAP object will be prefetched. + */ void zap_cursor_init(zap_cursor_t *zc, objset_t *os, uint64_t zapobj) { - zap_cursor_init_serialized(zc, os, zapobj, 0); + zap_cursor_init_impl(zc, os, zapobj, 0, B_TRUE); +} + +/* + * Initialize a cursor at the beginning, but request that we not prefetch + * the entire ZAP object. + */ +void +zap_cursor_init_noprefetch(zap_cursor_t *zc, objset_t *os, uint64_t zapobj) +{ + zap_cursor_init_impl(zc, os, zapobj, 0, B_FALSE); } void From owner-svn-src-all@freebsd.org Wed Oct 30 16:47:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 962FC15A857; Wed, 30 Oct 2019 16:47:06 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473DrV3TCRz4D3s; Wed, 30 Oct 2019 16:47:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AC96D3F4; Wed, 30 Oct 2019 16:47:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9UGl6C8041044; Wed, 30 Oct 2019 16:47:06 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UGl6qW041043; Wed, 30 Oct 2019 16:47:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910301647.x9UGl6qW041043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 30 Oct 2019 16:47:06 +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: r354186 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 354186 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 16:47:06 -0000 Author: avg Date: Wed Oct 30 16:47:05 2019 New Revision: 354186 URL: https://svnweb.freebsd.org/changeset/base/354186 Log: MFC r353609: MFV r353608: 10165 libzpool: passing argument 1 to restrict-qualified parameter Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Oct 30 16:45:24 2019 (r354185) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Oct 30 16:47:05 2019 (r354186) @@ -2196,7 +2196,10 @@ dsl_get_mountpoint(dsl_dataset_t *ds, const char *dsna return (error); } - /* Process the dsname and source to find the full mountpoint string */ + /* + * Process the dsname and source to find the full mountpoint string. + * Can be skipped for 'legacy' or 'none'. + */ if (value[0] == '/') { char *buf = kmem_alloc(ZAP_MAXVALUELEN, KM_SLEEP); char *root = buf; @@ -2247,10 +2250,8 @@ dsl_get_mountpoint(dsl_dataset_t *ds, const char *dsna relpath); } kmem_free(buf, ZAP_MAXVALUELEN); - } else { - /* 'legacy' or 'none' */ - (void) snprintf(value, ZAP_MAXVALUELEN, "%s", value); } + return (0); } From owner-svn-src-all@freebsd.org Wed Oct 30 16:49:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B88A215A952; Wed, 30 Oct 2019 16:49:45 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473DvY5BTyz4DCJ; Wed, 30 Oct 2019 16:49:45 +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 96B4DD3F6; Wed, 30 Oct 2019 16:49:45 +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 x9UGnjXt041220; Wed, 30 Oct 2019 16:49:45 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UGni55041212; Wed, 30 Oct 2019 16:49:44 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910301649.x9UGni55041212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 30 Oct 2019 16:49:44 +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: r354187 - in stable/12: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/12: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 354187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 16:49:45 -0000 Author: avg Date: Wed Oct 30 16:49:44 2019 New Revision: 354187 URL: https://svnweb.freebsd.org/changeset/base/354187 Log: MFC r353612: MFV r353611: 10330 merge recent ZoL vdev and metaslab changes Modified: stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_initialize.c Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Oct 30 16:47:05 2019 (r354186) +++ stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Oct 30 16:49:44 2019 (r354187) @@ -901,11 +901,8 @@ dump_metaslab(metaslab_t *msp) if (dump_opt['m'] > 2 && !dump_opt['L']) { mutex_enter(&msp->ms_lock); - metaslab_load_wait(msp); - if (!msp->ms_loaded) { - VERIFY0(metaslab_load(msp)); - range_tree_stat_verify(msp->ms_allocatable); - } + VERIFY0(metaslab_load(msp)); + range_tree_stat_verify(msp->ms_allocatable); dump_metaslab_stats(msp); metaslab_unload(msp); mutex_exit(&msp->ms_lock); Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Wed Oct 30 16:47:05 2019 (r354186) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Wed Oct 30 16:49:44 2019 (r354187) @@ -1467,7 +1467,7 @@ metaslab_ops_t *zfs_metaslab_ops = &metaslab_df_ops; /* * Wait for any in-progress metaslab loads to complete. */ -void +static void metaslab_load_wait(metaslab_t *msp) { ASSERT(MUTEX_HELD(&msp->ms_lock)); @@ -1478,20 +1478,17 @@ metaslab_load_wait(metaslab_t *msp) } } -int -metaslab_load(metaslab_t *msp) +static int +metaslab_load_impl(metaslab_t *msp) { int error = 0; - boolean_t success = B_FALSE; ASSERT(MUTEX_HELD(&msp->ms_lock)); - ASSERT(!msp->ms_loaded); - ASSERT(!msp->ms_loading); + ASSERT(msp->ms_loading); - msp->ms_loading = B_TRUE; /* * Nobody else can manipulate a loading metaslab, so it's now safe - * to drop the lock. This way we don't have to hold the lock while + * to drop the lock. This way we don't have to hold the lock while * reading the spacemap from disk. */ mutex_exit(&msp->ms_lock); @@ -1508,29 +1505,49 @@ metaslab_load(metaslab_t *msp) msp->ms_start, msp->ms_size); } - success = (error == 0); - mutex_enter(&msp->ms_lock); - msp->ms_loading = B_FALSE; - if (success) { - ASSERT3P(msp->ms_group, !=, NULL); - msp->ms_loaded = B_TRUE; + if (error != 0) + return (error); - /* - * If the metaslab already has a spacemap, then we need to - * remove all segments from the defer tree; otherwise, the - * metaslab is completely empty and we can skip this. - */ - if (msp->ms_sm != NULL) { - for (int t = 0; t < TXG_DEFER_SIZE; t++) { - range_tree_walk(msp->ms_defer[t], - range_tree_remove, msp->ms_allocatable); - } + ASSERT3P(msp->ms_group, !=, NULL); + msp->ms_loaded = B_TRUE; + + /* + * If the metaslab already has a spacemap, then we need to + * remove all segments from the defer tree; otherwise, the + * metaslab is completely empty and we can skip this. + */ + if (msp->ms_sm != NULL) { + for (int t = 0; t < TXG_DEFER_SIZE; t++) { + range_tree_walk(msp->ms_defer[t], + range_tree_remove, msp->ms_allocatable); } - msp->ms_max_size = metaslab_block_maxsize(msp); } + msp->ms_max_size = metaslab_block_maxsize(msp); + + return (0); +} + +int +metaslab_load(metaslab_t *msp) +{ + ASSERT(MUTEX_HELD(&msp->ms_lock)); + + /* + * There may be another thread loading the same metaslab, if that's + * the case just wait until the other thread is done and return. + */ + metaslab_load_wait(msp); + if (msp->ms_loaded) + return (0); + VERIFY(!msp->ms_loading); + + msp->ms_loading = B_TRUE; + int error = metaslab_load_impl(msp); + msp->ms_loading = B_FALSE; cv_broadcast(&msp->ms_load_cv); + return (error); } @@ -2090,13 +2107,10 @@ metaslab_activate(metaslab_t *msp, int allocator, uint ASSERT(MUTEX_HELD(&msp->ms_lock)); if ((msp->ms_weight & METASLAB_ACTIVE_MASK) == 0) { - int error = 0; - metaslab_load_wait(msp); - if (!msp->ms_loaded) { - if ((error = metaslab_load(msp)) != 0) { - metaslab_group_sort(msp->ms_group, msp, 0); - return (error); - } + int error = metaslab_load(msp); + if (error != 0) { + metaslab_group_sort(msp->ms_group, msp, 0); + return (error); } if ((msp->ms_weight & METASLAB_ACTIVE_MASK) != 0) { /* @@ -2208,9 +2222,7 @@ metaslab_preload(void *arg) ASSERT(!MUTEX_HELD(&msp->ms_group->mg_lock)); mutex_enter(&msp->ms_lock); - metaslab_load_wait(msp); - if (!msp->ms_loaded) - (void) metaslab_load(msp); + (void) metaslab_load(msp); msp->ms_selected_txg = spa_syncing_txg(spa); mutex_exit(&msp->ms_lock); } Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h Wed Oct 30 16:47:05 2019 (r354186) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h Wed Oct 30 16:49:44 2019 (r354187) @@ -48,7 +48,6 @@ int metaslab_init(metaslab_group_t *, uint64_t, uint64 metaslab_t **); void metaslab_fini(metaslab_t *); -void metaslab_load_wait(metaslab_t *); int metaslab_load(metaslab_t *); void metaslab_unload(metaslab_t *); Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Wed Oct 30 16:47:05 2019 (r354186) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Wed Oct 30 16:49:44 2019 (r354187) @@ -370,8 +370,8 @@ struct metaslab { uint64_t ms_initializing; /* leaves initializing this ms */ /* - * We must hold both ms_lock and ms_group->mg_lock in order to - * modify ms_loaded. + * We must always hold the ms_lock when modifying ms_loaded + * and ms_loading. */ boolean_t ms_loaded; boolean_t ms_loading; Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Wed Oct 30 16:47:05 2019 (r354186) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Wed Oct 30 16:49:44 2019 (r354187) @@ -163,34 +163,34 @@ static vdev_ops_t *vdev_ops_table[] = { }; -/* target number of metaslabs per top-level vdev */ -int vdev_max_ms_count = 200; -SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, max_ms_count, CTLFLAG_RWTUN, - &vdev_max_ms_count, 0, +/* default target for number of metaslabs per top-level vdev */ +int zfs_vdev_default_ms_count = 200; +SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, default_ms_count, CTLFLAG_RWTUN, + &zfs_vdev_default_ms_count, 0, "Target number of metaslabs per top-level vdev"); /* minimum number of metaslabs per top-level vdev */ -int vdev_min_ms_count = 16; +int zfs_vdev_min_ms_count = 16; SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, min_ms_count, CTLFLAG_RWTUN, - &vdev_min_ms_count, 0, + &zfs_vdev_min_ms_count, 0, "Minimum number of metaslabs per top-level vdev"); /* practical upper limit of total metaslabs per top-level vdev */ -int vdev_ms_count_limit = 1ULL << 17; +int zfs_vdev_ms_count_limit = 1ULL << 17; SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, max_ms_count_limit, CTLFLAG_RWTUN, - &vdev_ms_count_limit, 0, + &zfs_vdev_ms_count_limit, 0, "Maximum number of metaslabs per top-level vdev"); /* lower limit for metaslab size (512M) */ -int vdev_default_ms_shift = 29; +int zfs_vdev_default_ms_shift = 29; SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, default_ms_shift, CTLFLAG_RWTUN, - &vdev_default_ms_shift, 0, + &zfs_vdev_default_ms_shift, 0, "Default shift between vdev size and number of metaslabs"); -/* upper limit for metaslab size (256G) */ -int vdev_max_ms_shift = 38; +/* upper limit for metaslab size (16G) */ +int zfs_vdev_max_ms_shift = 34; SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, max_ms_shift, CTLFLAG_RWTUN, - &vdev_max_ms_shift, 0, + &zfs_vdev_max_ms_shift, 0, "Maximum shift between vdev size and number of metaslabs"); boolean_t vdev_validate_skip = B_FALSE; @@ -2205,16 +2205,24 @@ void vdev_metaslab_set_size(vdev_t *vd) { uint64_t asize = vd->vdev_asize; - uint64_t ms_count = asize >> vdev_default_ms_shift; + uint64_t ms_count = asize >> zfs_vdev_default_ms_shift; uint64_t ms_shift; /* * There are two dimensions to the metaslab sizing calculation: * the size of the metaslab and the count of metaslabs per vdev. - * In general, we aim for vdev_max_ms_count (200) metaslabs. The - * range of the dimensions are as follows: * - * 2^29 <= ms_size <= 2^38 + * The default values used below are a good balance between memory + * usage (larger metaslab size means more memory needed for loaded + * metaslabs; more metaslabs means more memory needed for the + * metaslab_t structs), metaslab load time (larger metaslabs take + * longer to load), and metaslab sync time (more metaslabs means + * more time spent syncing all of them). + * + * In general, we aim for zfs_vdev_default_ms_count (200) metaslabs. + * The range of the dimensions are as follows: + * + * 2^29 <= ms_size <= 2^34 * 16 <= ms_count <= 131,072 * * On the lower end of vdev sizes, we aim for metaslabs sizes of @@ -2223,35 +2231,41 @@ vdev_metaslab_set_size(vdev_t *vd) * of at least 16 metaslabs will override this minimum size goal. * * On the upper end of vdev sizes, we aim for a maximum metaslab - * size of 256GB. However, we will cap the total count to 2^17 - * metaslabs to keep our memory footprint in check. + * size of 16GB. However, we will cap the total count to 2^17 + * metaslabs to keep our memory footprint in check and let the + * metaslab size grow from there if that limit is hit. * * The net effect of applying above constrains is summarized below. * - * vdev size metaslab count - * -------------|----------------- - * < 8GB ~16 - * 8GB - 100GB one per 512MB - * 100GB - 50TB ~200 - * 50TB - 32PB one per 256GB - * > 32PB ~131,072 - * ------------------------------- + * vdev size metaslab count + * --------------|----------------- + * < 8GB ~16 + * 8GB - 100GB one per 512MB + * 100GB - 3TB ~200 + * 3TB - 2PB one per 16GB + * > 2PB ~131,072 + * -------------------------------- + * + * Finally, note that all of the above calculate the initial + * number of metaslabs. Expanding a top-level vdev will result + * in additional metaslabs being allocated making it possible + * to exceed the zfs_vdev_ms_count_limit. */ - if (ms_count < vdev_min_ms_count) - ms_shift = highbit64(asize / vdev_min_ms_count); - else if (ms_count > vdev_max_ms_count) - ms_shift = highbit64(asize / vdev_max_ms_count); + if (ms_count < zfs_vdev_min_ms_count) + ms_shift = highbit64(asize / zfs_vdev_min_ms_count); + else if (ms_count > zfs_vdev_default_ms_count) + ms_shift = highbit64(asize / zfs_vdev_default_ms_count); else - ms_shift = vdev_default_ms_shift; + ms_shift = zfs_vdev_default_ms_shift; if (ms_shift < SPA_MAXBLOCKSHIFT) { ms_shift = SPA_MAXBLOCKSHIFT; - } else if (ms_shift > vdev_max_ms_shift) { - ms_shift = vdev_max_ms_shift; + } else if (ms_shift > zfs_vdev_max_ms_shift) { + ms_shift = zfs_vdev_max_ms_shift; /* cap the total count to constrain memory footprint */ - if ((asize >> ms_shift) > vdev_ms_count_limit) - ms_shift = highbit64(asize / vdev_ms_count_limit); + if ((asize >> ms_shift) > zfs_vdev_ms_count_limit) + ms_shift = highbit64(asize / zfs_vdev_ms_count_limit); } vd->vdev_ms_shift = ms_shift; @@ -3611,13 +3625,17 @@ vdev_accessible(vdev_t *vd, zio_t *zio) boolean_t vdev_is_spacemap_addressable(vdev_t *vd) { + if (spa_feature_is_active(vd->vdev_spa, SPA_FEATURE_SPACEMAP_V2)) + return (B_TRUE); + /* - * Assuming 47 bits of the space map entry dedicated for the entry's - * offset (see description in space_map.h), we calculate the maximum - * address that can be described by a space map entry for the given - * device. + * If double-word space map entries are not enabled we assume + * 47 bits of the space map entry are dedicated to the entry's + * offset (see SM_OFFSET_BITS in space_map.h). We then use that + * to calculate the maximum address that can be described by a + * space map entry for the given device. */ - uint64_t shift = vd->vdev_ashift + 47; + uint64_t shift = vd->vdev_ashift + SM_OFFSET_BITS; if (shift >= 63) /* detect potential overflow */ return (B_TRUE); Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_initialize.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_initialize.c Wed Oct 30 16:47:05 2019 (r354186) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_initialize.c Wed Oct 30 16:49:44 2019 (r354187) @@ -353,16 +353,6 @@ vdev_initialize_ranges(vdev_t *vd, abd_t *data) } static void -vdev_initialize_ms_load(metaslab_t *msp) -{ - ASSERT(MUTEX_HELD(&msp->ms_lock)); - - metaslab_load_wait(msp); - if (!msp->ms_loaded) - VERIFY0(metaslab_load(msp)); -} - -static void vdev_initialize_mg_wait(metaslab_group_t *mg) { ASSERT(MUTEX_HELD(&mg->mg_ms_initialize_lock)); @@ -484,10 +474,10 @@ vdev_initialize_calculate_progress(vdev_t *vd) * metaslab. Load it and walk the free tree for more accurate * progress estimation. */ - vdev_initialize_ms_load(msp); + VERIFY0(metaslab_load(msp)); - for (range_seg_t *rs = avl_first(&msp->ms_allocatable->rt_root); rs; - rs = AVL_NEXT(&msp->ms_allocatable->rt_root, rs)) { + for (range_seg_t *rs = avl_first(&msp->ms_allocatable->rt_root); + rs; rs = AVL_NEXT(&msp->ms_allocatable->rt_root, rs)) { logical_rs.rs_start = rs->rs_start; logical_rs.rs_end = rs->rs_end; vdev_xlate(vd, &logical_rs, &physical_rs); @@ -615,7 +605,7 @@ vdev_initialize_thread(void *arg) vdev_initialize_ms_mark(msp); mutex_enter(&msp->ms_lock); - vdev_initialize_ms_load(msp); + VERIFY0(metaslab_load(msp)); range_tree_walk(msp->ms_allocatable, vdev_initialize_range_add, vd); From owner-svn-src-all@freebsd.org Wed Oct 30 16:54:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E2A215AD60; Wed, 30 Oct 2019 16:54:34 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473F160Mthz4Dxp; Wed, 30 Oct 2019 16:54:34 +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 E42C1D5C4; Wed, 30 Oct 2019 16:54:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9UGsXO5046820; Wed, 30 Oct 2019 16:54:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UGsXp5046819; Wed, 30 Oct 2019 16:54:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910301654.x9UGsXp5046819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 30 Oct 2019 16:54:33 +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: r354188 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 354188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 16:54:34 -0000 Author: avg Date: Wed Oct 30 16:54:33 2019 New Revision: 354188 URL: https://svnweb.freebsd.org/changeset/base/354188 Log: MFC r353796: debug.kassert.warnings is a statistic, not a tunable Modified: stable/12/sys/kern/kern_shutdown.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_shutdown.c ============================================================================== --- stable/12/sys/kern/kern_shutdown.c Wed Oct 30 16:49:44 2019 (r354187) +++ stable/12/sys/kern/kern_shutdown.c Wed Oct 30 16:54:33 2019 (r354188) @@ -685,7 +685,7 @@ SYSCTL_INT(_debug_kassert, OID_AUTO, do_log, KASSERT_R &kassert_do_log, 0, "If warn_only is enabled, log (1) or do not log (0) assertion violations"); -SYSCTL_INT(_debug_kassert, OID_AUTO, warnings, KASSERT_RWTUN, +SYSCTL_INT(_debug_kassert, OID_AUTO, warnings, CTLFLAG_RD | CTLFLAG_STATS, &kassert_warnings, 0, "number of KASSERTs that have been triggered"); SYSCTL_INT(_debug_kassert, OID_AUTO, log_panic_at, KASSERT_RWTUN, From owner-svn-src-all@freebsd.org Wed Oct 30 16:56:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC3DF15AEBC; Wed, 30 Oct 2019 16:56:26 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473F3G4Rhbz4F7T; Wed, 30 Oct 2019 16:56:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CCB8D5C9; Wed, 30 Oct 2019 16:56:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9UGuQ4x047003; Wed, 30 Oct 2019 16:56:26 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UGuQNg047002; Wed, 30 Oct 2019 16:56:26 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910301656.x9UGuQNg047002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 30 Oct 2019 16:56:26 +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: r354189 - stable/12/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/cddl/contrib/opensolaris/cmd/zfs X-SVN-Commit-Revision: 354189 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 16:56:26 -0000 Author: avg Date: Wed Oct 30 16:56:26 2019 New Revision: 354189 URL: https://svnweb.freebsd.org/changeset/base/354189 Log: MFC r354062: zfs.8: fix a typo in the date Modified: stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Oct 30 16:54:33 2019 (r354188) +++ stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Oct 30 16:56:26 2019 (r354189) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Octover 16, 2019 +.Dd October 16, 2019 .Dt ZFS 8 .Os .Sh NAME From owner-svn-src-all@freebsd.org Wed Oct 30 17:02:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE2A115B26F; Wed, 30 Oct 2019 17:02: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473FBH57XSz4FfQ; Wed, 30 Oct 2019 17:02: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 94872D79E; Wed, 30 Oct 2019 17:02: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 x9UH2V3q052657; Wed, 30 Oct 2019 17:02:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UH2VP3052656; Wed, 30 Oct 2019 17:02:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910301702.x9UH2VP3052656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 30 Oct 2019 17:02:31 +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: r354190 - stable/11/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/cddl/contrib/opensolaris/cmd/zfs X-SVN-Commit-Revision: 354190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 17:02:31 -0000 Author: avg Date: Wed Oct 30 17:02:31 2019 New Revision: 354190 URL: https://svnweb.freebsd.org/changeset/base/354190 Log: MFC r354062: zfs.8: fix a typo in the date Modified: stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Oct 30 16:56:26 2019 (r354189) +++ stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Oct 30 17:02:31 2019 (r354190) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Octover 16, 2019 +.Dd October 16, 2019 .Dt ZFS 8 .Os .Sh NAME From owner-svn-src-all@freebsd.org Wed Oct 30 17:06:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51BAF15B3CC; Wed, 30 Oct 2019 17:06:12 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473FGX1xsBz4G88; Wed, 30 Oct 2019 17:06:12 +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 25726D7A3; Wed, 30 Oct 2019 17:06:12 +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 x9UH6CXH052929; Wed, 30 Oct 2019 17:06:12 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UH63KR052885; Wed, 30 Oct 2019 17:06:03 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201910301706.x9UH63KR052885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 30 Oct 2019 17:06:03 +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: r354191 - in stable/12/contrib/tcsh: . nls nls/C nls/et nls/finnish nls/french nls/german nls/greek nls/italian nls/ja nls/russian nls/spanish nls/ukrainian X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/12/contrib/tcsh: . nls nls/C nls/et nls/finnish nls/french nls/german nls/greek nls/italian nls/ja nls/russian nls/spanish nls/ukrainian X-SVN-Commit-Revision: 354191 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 17:06:12 -0000 Author: brooks Date: Wed Oct 30 17:06:02 2019 New Revision: 354191 URL: https://svnweb.freebsd.org/changeset/base/354191 Log: MFC r353325, r353875 r353325: Update tcsh to 6.21.00. This is a bugfix release with no new features. A number of these fixes were previously merged into our tree. Sponsored by: DARPA, AFRL r353875: Update tcsh to git revision 83c5be0 bringing in a number of bug fixes. Reported by: sobomax Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22099 Added: stable/12/contrib/tcsh/README.md - copied, changed from r353325, head/contrib/tcsh/README.md Deleted: stable/12/contrib/tcsh/README stable/12/contrib/tcsh/README.imake Modified: stable/12/contrib/tcsh/Fixes stable/12/contrib/tcsh/Imakefile stable/12/contrib/tcsh/MAKEDIFFS stable/12/contrib/tcsh/MAKESHAR stable/12/contrib/tcsh/Makefile.in stable/12/contrib/tcsh/Makefile.std stable/12/contrib/tcsh/Makefile.vms stable/12/contrib/tcsh/Ported stable/12/contrib/tcsh/complete.tcsh stable/12/contrib/tcsh/config_f.h stable/12/contrib/tcsh/configure stable/12/contrib/tcsh/dotlock.c stable/12/contrib/tcsh/ed.chared.c stable/12/contrib/tcsh/ed.decls.h stable/12/contrib/tcsh/ed.defns.c stable/12/contrib/tcsh/ed.h stable/12/contrib/tcsh/ed.init.c stable/12/contrib/tcsh/ed.inputl.c stable/12/contrib/tcsh/ed.refresh.c stable/12/contrib/tcsh/ed.screen.c stable/12/contrib/tcsh/ed.term.c stable/12/contrib/tcsh/ed.term.h stable/12/contrib/tcsh/ed.xmap.c stable/12/contrib/tcsh/eight-bit.me stable/12/contrib/tcsh/gethost.c stable/12/contrib/tcsh/glob.3 stable/12/contrib/tcsh/glob.c stable/12/contrib/tcsh/glob.h stable/12/contrib/tcsh/host.defs stable/12/contrib/tcsh/imake.config stable/12/contrib/tcsh/ma.setp.c stable/12/contrib/tcsh/mi.termios.c stable/12/contrib/tcsh/mi.varargs.h stable/12/contrib/tcsh/nls/C/set1 stable/12/contrib/tcsh/nls/C/set10 stable/12/contrib/tcsh/nls/C/set11 stable/12/contrib/tcsh/nls/C/set12 stable/12/contrib/tcsh/nls/C/set13 stable/12/contrib/tcsh/nls/C/set14 stable/12/contrib/tcsh/nls/C/set15 stable/12/contrib/tcsh/nls/C/set16 stable/12/contrib/tcsh/nls/C/set17 stable/12/contrib/tcsh/nls/C/set18 stable/12/contrib/tcsh/nls/C/set19 stable/12/contrib/tcsh/nls/C/set2 stable/12/contrib/tcsh/nls/C/set20 stable/12/contrib/tcsh/nls/C/set21 stable/12/contrib/tcsh/nls/C/set22 stable/12/contrib/tcsh/nls/C/set23 stable/12/contrib/tcsh/nls/C/set24 stable/12/contrib/tcsh/nls/C/set25 stable/12/contrib/tcsh/nls/C/set26 stable/12/contrib/tcsh/nls/C/set27 stable/12/contrib/tcsh/nls/C/set29 stable/12/contrib/tcsh/nls/C/set3 stable/12/contrib/tcsh/nls/C/set30 stable/12/contrib/tcsh/nls/C/set31 stable/12/contrib/tcsh/nls/C/set4 stable/12/contrib/tcsh/nls/C/set5 stable/12/contrib/tcsh/nls/C/set6 stable/12/contrib/tcsh/nls/C/set7 stable/12/contrib/tcsh/nls/C/set8 stable/12/contrib/tcsh/nls/C/set9 stable/12/contrib/tcsh/nls/Makefile.in stable/12/contrib/tcsh/nls/catgen stable/12/contrib/tcsh/nls/et/set1 stable/12/contrib/tcsh/nls/et/set10 stable/12/contrib/tcsh/nls/et/set11 stable/12/contrib/tcsh/nls/et/set12 stable/12/contrib/tcsh/nls/et/set13 stable/12/contrib/tcsh/nls/et/set14 stable/12/contrib/tcsh/nls/et/set15 stable/12/contrib/tcsh/nls/et/set16 stable/12/contrib/tcsh/nls/et/set17 stable/12/contrib/tcsh/nls/et/set18 stable/12/contrib/tcsh/nls/et/set19 stable/12/contrib/tcsh/nls/et/set2 stable/12/contrib/tcsh/nls/et/set20 stable/12/contrib/tcsh/nls/et/set21 stable/12/contrib/tcsh/nls/et/set22 stable/12/contrib/tcsh/nls/et/set23 stable/12/contrib/tcsh/nls/et/set24 stable/12/contrib/tcsh/nls/et/set25 stable/12/contrib/tcsh/nls/et/set26 stable/12/contrib/tcsh/nls/et/set27 stable/12/contrib/tcsh/nls/et/set29 stable/12/contrib/tcsh/nls/et/set3 stable/12/contrib/tcsh/nls/et/set30 stable/12/contrib/tcsh/nls/et/set31 stable/12/contrib/tcsh/nls/et/set4 stable/12/contrib/tcsh/nls/et/set5 stable/12/contrib/tcsh/nls/et/set6 stable/12/contrib/tcsh/nls/et/set7 stable/12/contrib/tcsh/nls/et/set8 stable/12/contrib/tcsh/nls/et/set9 stable/12/contrib/tcsh/nls/finnish/set1 stable/12/contrib/tcsh/nls/finnish/set10 stable/12/contrib/tcsh/nls/finnish/set11 stable/12/contrib/tcsh/nls/finnish/set12 stable/12/contrib/tcsh/nls/finnish/set13 stable/12/contrib/tcsh/nls/finnish/set14 stable/12/contrib/tcsh/nls/finnish/set15 stable/12/contrib/tcsh/nls/finnish/set16 stable/12/contrib/tcsh/nls/finnish/set17 stable/12/contrib/tcsh/nls/finnish/set18 stable/12/contrib/tcsh/nls/finnish/set19 stable/12/contrib/tcsh/nls/finnish/set2 stable/12/contrib/tcsh/nls/finnish/set20 stable/12/contrib/tcsh/nls/finnish/set21 stable/12/contrib/tcsh/nls/finnish/set22 stable/12/contrib/tcsh/nls/finnish/set23 stable/12/contrib/tcsh/nls/finnish/set24 stable/12/contrib/tcsh/nls/finnish/set25 stable/12/contrib/tcsh/nls/finnish/set26 stable/12/contrib/tcsh/nls/finnish/set27 stable/12/contrib/tcsh/nls/finnish/set29 stable/12/contrib/tcsh/nls/finnish/set3 stable/12/contrib/tcsh/nls/finnish/set30 stable/12/contrib/tcsh/nls/finnish/set31 stable/12/contrib/tcsh/nls/finnish/set4 stable/12/contrib/tcsh/nls/finnish/set5 stable/12/contrib/tcsh/nls/finnish/set6 stable/12/contrib/tcsh/nls/finnish/set7 stable/12/contrib/tcsh/nls/finnish/set8 stable/12/contrib/tcsh/nls/finnish/set9 stable/12/contrib/tcsh/nls/french/set1 stable/12/contrib/tcsh/nls/french/set10 stable/12/contrib/tcsh/nls/french/set11 stable/12/contrib/tcsh/nls/french/set12 stable/12/contrib/tcsh/nls/french/set13 stable/12/contrib/tcsh/nls/french/set14 stable/12/contrib/tcsh/nls/french/set15 stable/12/contrib/tcsh/nls/french/set16 stable/12/contrib/tcsh/nls/french/set17 stable/12/contrib/tcsh/nls/french/set18 stable/12/contrib/tcsh/nls/french/set19 stable/12/contrib/tcsh/nls/french/set2 stable/12/contrib/tcsh/nls/french/set20 stable/12/contrib/tcsh/nls/french/set21 stable/12/contrib/tcsh/nls/french/set22 stable/12/contrib/tcsh/nls/french/set23 stable/12/contrib/tcsh/nls/french/set24 stable/12/contrib/tcsh/nls/french/set25 stable/12/contrib/tcsh/nls/french/set26 stable/12/contrib/tcsh/nls/french/set27 stable/12/contrib/tcsh/nls/french/set29 stable/12/contrib/tcsh/nls/french/set3 stable/12/contrib/tcsh/nls/french/set30 stable/12/contrib/tcsh/nls/french/set31 stable/12/contrib/tcsh/nls/french/set4 stable/12/contrib/tcsh/nls/french/set5 stable/12/contrib/tcsh/nls/french/set6 stable/12/contrib/tcsh/nls/french/set7 stable/12/contrib/tcsh/nls/french/set8 stable/12/contrib/tcsh/nls/french/set9 stable/12/contrib/tcsh/nls/german/set1 stable/12/contrib/tcsh/nls/german/set10 stable/12/contrib/tcsh/nls/german/set11 stable/12/contrib/tcsh/nls/german/set12 stable/12/contrib/tcsh/nls/german/set13 stable/12/contrib/tcsh/nls/german/set14 stable/12/contrib/tcsh/nls/german/set15 stable/12/contrib/tcsh/nls/german/set16 stable/12/contrib/tcsh/nls/german/set17 stable/12/contrib/tcsh/nls/german/set18 stable/12/contrib/tcsh/nls/german/set19 stable/12/contrib/tcsh/nls/german/set2 stable/12/contrib/tcsh/nls/german/set20 stable/12/contrib/tcsh/nls/german/set21 stable/12/contrib/tcsh/nls/german/set22 stable/12/contrib/tcsh/nls/german/set23 stable/12/contrib/tcsh/nls/german/set24 stable/12/contrib/tcsh/nls/german/set25 stable/12/contrib/tcsh/nls/german/set26 stable/12/contrib/tcsh/nls/german/set27 stable/12/contrib/tcsh/nls/german/set29 stable/12/contrib/tcsh/nls/german/set3 stable/12/contrib/tcsh/nls/german/set30 stable/12/contrib/tcsh/nls/german/set31 stable/12/contrib/tcsh/nls/german/set4 stable/12/contrib/tcsh/nls/german/set5 stable/12/contrib/tcsh/nls/german/set6 stable/12/contrib/tcsh/nls/german/set7 stable/12/contrib/tcsh/nls/german/set8 stable/12/contrib/tcsh/nls/german/set9 stable/12/contrib/tcsh/nls/greek/set1 stable/12/contrib/tcsh/nls/greek/set10 stable/12/contrib/tcsh/nls/greek/set11 stable/12/contrib/tcsh/nls/greek/set12 stable/12/contrib/tcsh/nls/greek/set13 stable/12/contrib/tcsh/nls/greek/set14 stable/12/contrib/tcsh/nls/greek/set15 stable/12/contrib/tcsh/nls/greek/set16 stable/12/contrib/tcsh/nls/greek/set17 stable/12/contrib/tcsh/nls/greek/set18 stable/12/contrib/tcsh/nls/greek/set19 stable/12/contrib/tcsh/nls/greek/set2 stable/12/contrib/tcsh/nls/greek/set20 stable/12/contrib/tcsh/nls/greek/set21 stable/12/contrib/tcsh/nls/greek/set22 stable/12/contrib/tcsh/nls/greek/set23 stable/12/contrib/tcsh/nls/greek/set24 stable/12/contrib/tcsh/nls/greek/set25 stable/12/contrib/tcsh/nls/greek/set26 stable/12/contrib/tcsh/nls/greek/set27 stable/12/contrib/tcsh/nls/greek/set29 stable/12/contrib/tcsh/nls/greek/set3 stable/12/contrib/tcsh/nls/greek/set30 stable/12/contrib/tcsh/nls/greek/set31 stable/12/contrib/tcsh/nls/greek/set4 stable/12/contrib/tcsh/nls/greek/set5 stable/12/contrib/tcsh/nls/greek/set6 stable/12/contrib/tcsh/nls/greek/set7 stable/12/contrib/tcsh/nls/greek/set8 stable/12/contrib/tcsh/nls/greek/set9 stable/12/contrib/tcsh/nls/italian/set1 stable/12/contrib/tcsh/nls/italian/set10 stable/12/contrib/tcsh/nls/italian/set11 stable/12/contrib/tcsh/nls/italian/set12 stable/12/contrib/tcsh/nls/italian/set13 stable/12/contrib/tcsh/nls/italian/set14 stable/12/contrib/tcsh/nls/italian/set15 stable/12/contrib/tcsh/nls/italian/set16 stable/12/contrib/tcsh/nls/italian/set17 stable/12/contrib/tcsh/nls/italian/set18 stable/12/contrib/tcsh/nls/italian/set19 stable/12/contrib/tcsh/nls/italian/set2 stable/12/contrib/tcsh/nls/italian/set20 stable/12/contrib/tcsh/nls/italian/set21 stable/12/contrib/tcsh/nls/italian/set22 stable/12/contrib/tcsh/nls/italian/set23 stable/12/contrib/tcsh/nls/italian/set24 stable/12/contrib/tcsh/nls/italian/set25 stable/12/contrib/tcsh/nls/italian/set26 stable/12/contrib/tcsh/nls/italian/set27 stable/12/contrib/tcsh/nls/italian/set29 stable/12/contrib/tcsh/nls/italian/set3 stable/12/contrib/tcsh/nls/italian/set30 stable/12/contrib/tcsh/nls/italian/set31 stable/12/contrib/tcsh/nls/italian/set4 stable/12/contrib/tcsh/nls/italian/set5 stable/12/contrib/tcsh/nls/italian/set6 stable/12/contrib/tcsh/nls/italian/set7 stable/12/contrib/tcsh/nls/italian/set8 stable/12/contrib/tcsh/nls/italian/set9 stable/12/contrib/tcsh/nls/ja/set1 stable/12/contrib/tcsh/nls/ja/set10 stable/12/contrib/tcsh/nls/ja/set11 stable/12/contrib/tcsh/nls/ja/set12 stable/12/contrib/tcsh/nls/ja/set13 stable/12/contrib/tcsh/nls/ja/set15 stable/12/contrib/tcsh/nls/ja/set16 stable/12/contrib/tcsh/nls/ja/set17 stable/12/contrib/tcsh/nls/ja/set18 stable/12/contrib/tcsh/nls/ja/set2 stable/12/contrib/tcsh/nls/ja/set21 stable/12/contrib/tcsh/nls/ja/set24 stable/12/contrib/tcsh/nls/ja/set29 stable/12/contrib/tcsh/nls/ja/set3 stable/12/contrib/tcsh/nls/ja/set30 stable/12/contrib/tcsh/nls/ja/set4 stable/12/contrib/tcsh/nls/ja/set5 stable/12/contrib/tcsh/nls/ja/set6 stable/12/contrib/tcsh/nls/ja/set7 stable/12/contrib/tcsh/nls/ja/set8 stable/12/contrib/tcsh/nls/russian/set1 stable/12/contrib/tcsh/nls/russian/set10 stable/12/contrib/tcsh/nls/russian/set11 stable/12/contrib/tcsh/nls/russian/set12 stable/12/contrib/tcsh/nls/russian/set13 stable/12/contrib/tcsh/nls/russian/set14 stable/12/contrib/tcsh/nls/russian/set15 stable/12/contrib/tcsh/nls/russian/set16 stable/12/contrib/tcsh/nls/russian/set17 stable/12/contrib/tcsh/nls/russian/set18 stable/12/contrib/tcsh/nls/russian/set19 stable/12/contrib/tcsh/nls/russian/set2 stable/12/contrib/tcsh/nls/russian/set20 stable/12/contrib/tcsh/nls/russian/set21 stable/12/contrib/tcsh/nls/russian/set22 stable/12/contrib/tcsh/nls/russian/set23 stable/12/contrib/tcsh/nls/russian/set24 stable/12/contrib/tcsh/nls/russian/set25 stable/12/contrib/tcsh/nls/russian/set26 stable/12/contrib/tcsh/nls/russian/set27 stable/12/contrib/tcsh/nls/russian/set29 stable/12/contrib/tcsh/nls/russian/set3 stable/12/contrib/tcsh/nls/russian/set30 stable/12/contrib/tcsh/nls/russian/set31 stable/12/contrib/tcsh/nls/russian/set4 stable/12/contrib/tcsh/nls/russian/set5 stable/12/contrib/tcsh/nls/russian/set6 stable/12/contrib/tcsh/nls/russian/set7 stable/12/contrib/tcsh/nls/russian/set8 stable/12/contrib/tcsh/nls/russian/set9 stable/12/contrib/tcsh/nls/spanish/set1 stable/12/contrib/tcsh/nls/spanish/set10 stable/12/contrib/tcsh/nls/spanish/set11 stable/12/contrib/tcsh/nls/spanish/set12 stable/12/contrib/tcsh/nls/spanish/set13 stable/12/contrib/tcsh/nls/spanish/set14 stable/12/contrib/tcsh/nls/spanish/set15 stable/12/contrib/tcsh/nls/spanish/set16 stable/12/contrib/tcsh/nls/spanish/set17 stable/12/contrib/tcsh/nls/spanish/set18 stable/12/contrib/tcsh/nls/spanish/set19 stable/12/contrib/tcsh/nls/spanish/set2 stable/12/contrib/tcsh/nls/spanish/set20 stable/12/contrib/tcsh/nls/spanish/set21 stable/12/contrib/tcsh/nls/spanish/set22 stable/12/contrib/tcsh/nls/spanish/set23 stable/12/contrib/tcsh/nls/spanish/set24 stable/12/contrib/tcsh/nls/spanish/set25 stable/12/contrib/tcsh/nls/spanish/set26 stable/12/contrib/tcsh/nls/spanish/set27 stable/12/contrib/tcsh/nls/spanish/set29 stable/12/contrib/tcsh/nls/spanish/set3 stable/12/contrib/tcsh/nls/spanish/set30 stable/12/contrib/tcsh/nls/spanish/set31 stable/12/contrib/tcsh/nls/spanish/set4 stable/12/contrib/tcsh/nls/spanish/set5 stable/12/contrib/tcsh/nls/spanish/set6 stable/12/contrib/tcsh/nls/spanish/set7 stable/12/contrib/tcsh/nls/spanish/set8 stable/12/contrib/tcsh/nls/spanish/set9 stable/12/contrib/tcsh/nls/ukrainian/set1 stable/12/contrib/tcsh/nls/ukrainian/set10 stable/12/contrib/tcsh/nls/ukrainian/set11 stable/12/contrib/tcsh/nls/ukrainian/set12 stable/12/contrib/tcsh/nls/ukrainian/set13 stable/12/contrib/tcsh/nls/ukrainian/set14 stable/12/contrib/tcsh/nls/ukrainian/set15 stable/12/contrib/tcsh/nls/ukrainian/set16 stable/12/contrib/tcsh/nls/ukrainian/set17 stable/12/contrib/tcsh/nls/ukrainian/set18 stable/12/contrib/tcsh/nls/ukrainian/set19 stable/12/contrib/tcsh/nls/ukrainian/set2 stable/12/contrib/tcsh/nls/ukrainian/set20 stable/12/contrib/tcsh/nls/ukrainian/set21 stable/12/contrib/tcsh/nls/ukrainian/set22 stable/12/contrib/tcsh/nls/ukrainian/set23 stable/12/contrib/tcsh/nls/ukrainian/set24 stable/12/contrib/tcsh/nls/ukrainian/set25 stable/12/contrib/tcsh/nls/ukrainian/set26 stable/12/contrib/tcsh/nls/ukrainian/set27 stable/12/contrib/tcsh/nls/ukrainian/set29 stable/12/contrib/tcsh/nls/ukrainian/set3 stable/12/contrib/tcsh/nls/ukrainian/set30 stable/12/contrib/tcsh/nls/ukrainian/set31 stable/12/contrib/tcsh/nls/ukrainian/set4 stable/12/contrib/tcsh/nls/ukrainian/set5 stable/12/contrib/tcsh/nls/ukrainian/set6 stable/12/contrib/tcsh/nls/ukrainian/set7 stable/12/contrib/tcsh/nls/ukrainian/set8 stable/12/contrib/tcsh/nls/ukrainian/set9 stable/12/contrib/tcsh/patchlevel.h stable/12/contrib/tcsh/pathnames.h stable/12/contrib/tcsh/sh.c stable/12/contrib/tcsh/sh.char.c stable/12/contrib/tcsh/sh.char.h stable/12/contrib/tcsh/sh.decls.h stable/12/contrib/tcsh/sh.dir.c stable/12/contrib/tcsh/sh.dir.h stable/12/contrib/tcsh/sh.dol.c stable/12/contrib/tcsh/sh.err.c stable/12/contrib/tcsh/sh.exec.c stable/12/contrib/tcsh/sh.exp.c stable/12/contrib/tcsh/sh.file.c stable/12/contrib/tcsh/sh.func.c stable/12/contrib/tcsh/sh.glob.c stable/12/contrib/tcsh/sh.h stable/12/contrib/tcsh/sh.hist.c stable/12/contrib/tcsh/sh.init.c stable/12/contrib/tcsh/sh.lex.c stable/12/contrib/tcsh/sh.misc.c stable/12/contrib/tcsh/sh.parse.c stable/12/contrib/tcsh/sh.print.c stable/12/contrib/tcsh/sh.proc.c stable/12/contrib/tcsh/sh.proc.h stable/12/contrib/tcsh/sh.sem.c stable/12/contrib/tcsh/sh.set.c stable/12/contrib/tcsh/sh.time.c stable/12/contrib/tcsh/sh.types.h stable/12/contrib/tcsh/snames.h stable/12/contrib/tcsh/tc.alloc.c stable/12/contrib/tcsh/tc.bind.c stable/12/contrib/tcsh/tc.const.c stable/12/contrib/tcsh/tc.decls.h stable/12/contrib/tcsh/tc.disc.c stable/12/contrib/tcsh/tc.func.c stable/12/contrib/tcsh/tc.h stable/12/contrib/tcsh/tc.nls.c stable/12/contrib/tcsh/tc.nls.h stable/12/contrib/tcsh/tc.os.c stable/12/contrib/tcsh/tc.os.h stable/12/contrib/tcsh/tc.printf.c stable/12/contrib/tcsh/tc.prompt.c stable/12/contrib/tcsh/tc.sched.c stable/12/contrib/tcsh/tc.sig.c stable/12/contrib/tcsh/tc.sig.h stable/12/contrib/tcsh/tc.str.c stable/12/contrib/tcsh/tc.vers.c stable/12/contrib/tcsh/tc.wait.h stable/12/contrib/tcsh/tc.who.c stable/12/contrib/tcsh/tcsh.man stable/12/contrib/tcsh/tcsh.man.new stable/12/contrib/tcsh/tcsh.man2html stable/12/contrib/tcsh/termcap.vms stable/12/contrib/tcsh/tw.color.c stable/12/contrib/tcsh/tw.comp.c stable/12/contrib/tcsh/tw.decls.h stable/12/contrib/tcsh/tw.h stable/12/contrib/tcsh/tw.help.c stable/12/contrib/tcsh/tw.init.c stable/12/contrib/tcsh/tw.parse.c stable/12/contrib/tcsh/tw.spell.c stable/12/contrib/tcsh/vms.termcap.c Modified: stable/12/contrib/tcsh/Fixes ============================================================================== --- stable/12/contrib/tcsh/Fixes Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/Fixes Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,26 @@ - 22. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar) + 5. PR/113: Sobomax: avoid infinite loops for -c commands when stdout is + not a tty. + 4. Avoid infinite loops during history loads when merging, print a better + error for errors during history load. + 3. PR/88: Preserve empty arguments in :q + 2. PR/94: Small apple issues (SAVESIGVEC, HOSTTYPE) + 1. PR/81: Fix range matching issue where we were comparing with the + range character instead of the start of range. [l-z]* would match foo + 12. V6.21.00 - 20190508 + 11. Abort history loading on words and lines too long + https://bugzilla.redhat.com/show_bug.cgi?id=1598502 + 10. PR/37: Introduce GetCmdChar() to avoid open coding array access. + 9. make closem() not close sockets so as not to affect nss_ldap. + tcsh never creates sockets so that's ok (Miloslav Trmac) + 8. PR/597: Make rmstar work with aliased rm + 7. convert match() from recursive to backtracking. + 6. Handle 8 bit characters in bindkey (Werner Fink) + 5. Look for tgetent in libtinfo as well (Werner Fink) + 4. Don't play pointer tricks that are undefined in modern c (Brooks Davis) + 3. Fix out of bounds read (Brooks Davis) + 2. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar) + 1. PR/471: Delay arginp parsing + 20. V6.20.00 - 20161124 19. Don't resize the screen if it did not change size. 18. V6.19.01 - 20161025 Modified: stable/12/contrib/tcsh/Imakefile ============================================================================== --- stable/12/contrib/tcsh/Imakefile Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/Imakefile Wed Oct 30 17:06:02 2019 (r354191) @@ -1,6 +1,4 @@ XCOMM -XCOMM $tcsh: Imakefile,v 1.88 2014/07/07 20:34:58 christos Exp $ -XCOMM XCOMM Imakefile for tcsh 6.12 XCOMM Marc Horowitz, MIT SIPB XCOMM @@ -522,12 +520,11 @@ TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \ tc.vers.${SUF} tc.who.${SUF} -MISCF = Makefile.std Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \ - WishList config_f.h eight-bit.me glob.3 patchlevel.h \ - pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ - README.imake complete.tcsh vmsreadme.txt Makefile.vms termcap.vms \ - snames.h host.defs gethost.c tcsh.man2html Makefile.in configure.ac \ - Makefile.win32 aclocal.m4 +MISCF = Makefile.std BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md \ + FAQ WishList config_f.h eight-bit.me glob.3 patchlevel.h pathnames.h \ + tcsh.man Ported src.desc Imakefile imake.config complete.tcsh \ + Makefile.vms termcap.vms snames.h host.defs gethost.c tcsh.man2html \ + Makefile.in configure.ac Makefile.win32 aclocal.m4 CONFSRCS=config/[a-z]* Modified: stable/12/contrib/tcsh/MAKEDIFFS ============================================================================== --- stable/12/contrib/tcsh/MAKEDIFFS Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/MAKEDIFFS Wed Oct 30 17:06:02 2019 (r354191) @@ -2,7 +2,6 @@ # # MAKEDIFFS.sh: Make context diffs for the csh sources # -# $tcsh: MAKEDIFFS,v 3.1 2006/03/02 18:46:44 christos Exp $ XINUDIR=/usr/share/src/mtXinu/bin/csh BSDDIR=/usr/share/src/mtXinu/BSD/bin/csh TAHOEDIR=/usr/share/src/mtXinu/TAHOE/bin/csh Modified: stable/12/contrib/tcsh/MAKESHAR ============================================================================== --- stable/12/contrib/tcsh/MAKESHAR Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/MAKESHAR Wed Oct 30 17:06:02 2019 (r354191) @@ -2,7 +2,6 @@ # # MAKESHAR.sh: Make a shar file for the sources # -# $tcsh: MAKESHAR,v 3.2 2006/03/02 18:46:44 christos Exp $ AWK=/usr/bin/nawk # Must be nawk or gawk cause of 2D arrays WC=/usr/ucb/wc Modified: stable/12/contrib/tcsh/Makefile.in ============================================================================== --- stable/12/contrib/tcsh/Makefile.in Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/Makefile.in Wed Oct 30 17:06:02 2019 (r354191) @@ -1,5 +1,3 @@ -# $tcsh: Makefile.in,v 3.59 2015/08/24 20:09:04 kim Exp $ -# Makefile.in 4.3 6/11/83 # # C Shell with process control; VM/UNIX VAX Makefile # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria @@ -407,11 +405,11 @@ TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.vers.${SUF} tc.who.${SUF} PVSRCS= Makefile.std Makefile.vms Makefile.in Makefile.win32 -AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \ +AVSRCS= BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md FAQ \ WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ - README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \ - host.defs gethost.c tcsh.man2html configure.ac configure config.h.in \ + complete.tcsh vmsreadme.txt termcap.vms snames.h host.defs \ + gethost.c tcsh.man2html configure.ac configure config.h.in \ tests/testsuite.at aclocal.m4 TESTFILES= tests/aliases.at tests/arguments.at tests/commands.at \ tests/expr.at tests/lexical.at tests/mb-eucjp.at \ @@ -449,7 +447,7 @@ pure:$(P) ${OBJS} gethost: gethost.c sh.err.h tc.const.h sh.h rm -f gethost - ${CC_FOR_GETHOST} -o gethost ${CPPFLAGS} $(srcdir)/gethost.c + ${CC_FOR_GETHOST} -o gethost ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} $(srcdir)/gethost.c tc.defs.c: gethost host.defs @rm -f $@.tmp Modified: stable/12/contrib/tcsh/Makefile.std ============================================================================== --- stable/12/contrib/tcsh/Makefile.std Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/Makefile.std Wed Oct 30 17:06:02 2019 (r354191) @@ -1,5 +1,3 @@ -# $tcsh: Makefile.std,v 1.100 2015/08/24 20:09:04 kim Exp $ -# Makefile.std 4.3 6/11/83 # # C Shell with process control; VM/UNIX VAX Makefile # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria @@ -317,11 +315,11 @@ TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.vers.${SUF} tc.who.${SUF} PVSRCS= Makefile.std Makefile.vms Makefile.in Makefile.win32 -AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \ +AVSRCS= BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md FAQ \ WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ - README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \ - host.defs gethost.c tcsh.man2html configure.ac configure config.h.in \ + complete.tcsh vmsreadme.txt termcap.vms snames.h host.defs \ + gethost.c tcsh.man2html configure.ac configure config.h.in \ aclocal.m4 VHSRCS=${PVSRCS} ${AVSRCS} Modified: stable/12/contrib/tcsh/Makefile.vms ============================================================================== --- stable/12/contrib/tcsh/Makefile.vms Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/Makefile.vms Wed Oct 30 17:06:02 2019 (r354191) @@ -1,5 +1,3 @@ -# $tcsh: Makefile.vms,v 1.40 2014/07/07 20:34:58 christos Exp $ -# Makefile.vms 4.3 6/11/83 # # C Shell with process control; VM/UNIX VAX Makefile # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria @@ -295,11 +293,11 @@ TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.vers.${SUF} tc.who.${SUF} PVSRCS= Makefile.std Makefile.vms Makefile.in Makefile.win32 -AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \ +AVSRCS= BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md FAQ \ WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ - README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \ - host.defs gethost.c tcsh.man2html configure.ac aclocal.m4 + complete.tcsh vmsreadme.txt termcap.vms snames.h host.defs \ + gethost.c tcsh.man2html configure.ac aclocal.m4 VHSRCS=${PVSRCS} ${AVSRCS} Modified: stable/12/contrib/tcsh/Ported ============================================================================== --- stable/12/contrib/tcsh/Ported Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/Ported Wed Oct 30 17:06:02 2019 (r354191) @@ -338,7 +338,7 @@ CFLAGS : normal LIBES : -ltermcap OS : bsd 4.3reno CONFIG : bsdreno -NOTES : ttyname() is buggy. calls closedir() twice. See README +NOTES : ttyname() is buggy. calls closedir() twice. See BUILDING ENVIRON : n/a VERSION : 6.00.04 Copied and modified: stable/12/contrib/tcsh/README.md (from r353325, head/contrib/tcsh/README.md) ============================================================================== --- head/contrib/tcsh/README.md Tue Oct 8 20:59:31 2019 (r353325, copy source) +++ stable/12/contrib/tcsh/README.md Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,4 @@ -# Tcsh +# TCSH *C shell with file name completion and command line editing* @@ -14,10 +14,10 @@ PLEASE file any bug reports, fixes, and code for new f > https://bugs.astron.com/ Comments, questions, etc. (even flames) are welcome via email to -the Tcsh Bugs mailing list: +the tcsh mailing list: -> tcsh-bugs@astron.com -> https://mailman.astron.com/ +> tcsh@astron.com +> https://mailman.astron.com/mailman/listinfo/tcsh [![Build Status][status]][travis] Modified: stable/12/contrib/tcsh/complete.tcsh ============================================================================== --- stable/12/contrib/tcsh/complete.tcsh Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/complete.tcsh Wed Oct 30 17:06:02 2019 (r354191) @@ -1,5 +1,4 @@ # -# $tcsh: complete.tcsh,v 1.56 2015/07/03 16:52:47 christos Exp $ # example file using the new completion code # # Debian GNU/Linux Modified: stable/12/contrib/tcsh/config_f.h ============================================================================== --- stable/12/contrib/tcsh/config_f.h Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/config_f.h Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/config_f.h,v 3.52 2016/04/16 15:44:18 christos Exp $ */ /* * config_f.h -- configure various defines for tcsh * @@ -176,20 +175,6 @@ * FILEC support for old style file completion */ #define FILEC - -/* - * RCSID This defines if we want rcs strings in the binary or not - * - */ -#if !defined(lint) && !defined(SABER) && !defined(__CLCC__) -# ifndef __GNUC__ -# define RCSID(id) static char *rcsid = (id); -# else -# define RCSID(id) static const char rcsid[] __attribute__((__used__)) = (id); -# endif /* !__GNUC__ */ -#else -# define RCSID(id) /* Nothing */ -#endif /* !lint && !SABER */ /* Consistency checks */ #ifdef WIDE_STRINGS Modified: stable/12/contrib/tcsh/configure ============================================================================== --- stable/12/contrib/tcsh/configure Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/configure Wed Oct 30 17:06:02 2019 (r354191) @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for tcsh 6.20.00. +# Generated by GNU Autoconf 2.69 for tcsh 6.21.00. # -# Report bugs to . +# Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -267,10 +267,10 @@ fi $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: http://bugs.gw.com/ about your system, including any -$0: error possibly output before this message. Then install -$0: a modern shell, or manually run the script under such a -$0: shell if you do have one." +$0: https://bugs.astron.com/ about your system, including +$0: any error possibly output before this message. Then +$0: install a modern shell, or manually run the script +$0: under such a shell if you do have one." fi exit 1 fi @@ -580,9 +580,9 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tcsh' PACKAGE_TARNAME='tcsh' -PACKAGE_VERSION='6.20.00' -PACKAGE_STRING='tcsh 6.20.00' -PACKAGE_BUGREPORT='http://bugs.gw.com/' +PACKAGE_VERSION='6.21.00' +PACKAGE_STRING='tcsh 6.21.00' +PACKAGE_BUGREPORT='https://bugs.astron.com/' PACKAGE_URL='' ac_unique_file="tc.vers.c" @@ -1250,7 +1250,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures tcsh 6.20.00 to adapt to many kinds of systems. +\`configure' configures tcsh 6.21.00 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1315,7 +1315,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tcsh 6.20.00:";; + short | recursive ) echo "Configuration of tcsh 6.21.00:";; esac cat <<\_ACEOF @@ -1348,7 +1348,7 @@ Some influential environment variables: Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to . +Report bugs to . _ACEOF ac_status=$? fi @@ -1411,7 +1411,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -tcsh configure 6.20.00 +tcsh configure 6.21.00 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1658,9 +1658,9 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf docume $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ---------------------------------- ## -## Report this to http://bugs.gw.com/ ## -## ---------------------------------- ##" +( $as_echo "## --------------------------------------- ## +## Report this to https://bugs.astron.com/ ## +## --------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac @@ -2174,7 +2174,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by tcsh $as_me 6.20.00, which was +It was created by tcsh $as_me 6.21.00, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -4284,7 +4284,7 @@ return tgetent (); return 0; } _ACEOF -for ac_lib in '' termlib termcap curses ncurses; do +for ac_lib in '' termlib tinfo termcap curses ncurses; do if test -z "$ac_lib"; then ac_res="none required" else @@ -7350,7 +7350,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by tcsh $as_me 6.20.00, which was +This file was extended by tcsh $as_me 6.21.00, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7410,13 +7410,13 @@ $config_headers Configuration commands: $config_commands -Report bugs to ." +Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -tcsh config.status 6.20.00 +tcsh config.status 6.21.00 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/12/contrib/tcsh/dotlock.c ============================================================================== --- stable/12/contrib/tcsh/dotlock.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/dotlock.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,4 @@ -/* $NetBSD: dotlock.c,v 1.11 2009/10/21 01:07:46 snj Exp $ */ +/* NetBSD: dotlock.c,v 1.11 2009/10/21 01:07:46 snj Exp */ /* * Copyright (c) 1996 Christos Zoulas. All rights reserved. @@ -24,7 +24,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "sh.h" -RCSID("$tcsh: dotlock.c,v 3.4 2015/11/03 21:04:13 christos Exp $") #include #ifndef O_SYNC Modified: stable/12/contrib/tcsh/ed.chared.c ============================================================================== --- stable/12/contrib/tcsh/ed.chared.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.chared.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.chared.c,v 3.103 2015/08/19 14:29:55 christos Exp $ */ /* * ed.chared.c: Character editing functions. */ @@ -71,9 +70,6 @@ */ #include "sh.h" - -RCSID("$tcsh: ed.chared.c,v 3.103 2015/08/19 14:29:55 christos Exp $") - #include "ed.h" #include "tw.h" #include "ed.defns.h" @@ -1105,8 +1101,7 @@ e_inc_search(int dir) if (GetNextChar(&ch) != 1) return(e_send_eof(0)); - switch (ch > NT_NUM_KEYS - ? F_INSERT : CurrentKeyMap[(unsigned char) ch]) { + switch (GetCmdChar(ch)) { case F_INSERT: case F_DIGIT: case F_MAGIC_SPACE: Modified: stable/12/contrib/tcsh/ed.decls.h ============================================================================== --- stable/12/contrib/tcsh/ed.decls.h Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.decls.h Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.decls.h,v 3.46 2015/08/19 14:29:55 christos Exp $ */ /* * ed.decls.h: Editor external definitions */ @@ -250,6 +249,7 @@ extern CCRETVAL e_newline_down_hist (Char); * ed.inputl.c */ extern int Inputl (void); +extern int GetCmdChar (Char); extern int GetNextChar (Char *); extern void UngetNextChar (Char); extern void PushMacro (Char *); Modified: stable/12/contrib/tcsh/ed.defns.c ============================================================================== --- stable/12/contrib/tcsh/ed.defns.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.defns.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.defns.c,v 3.51 2016/02/14 15:44:18 christos Exp $ */ /* * ed.defns.c: Editor function definitions and initialization */ @@ -31,9 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.defns.c,v 3.51 2016/02/14 15:44:18 christos Exp $") - #include "ed.h" static void ed_InitMetaBindings (void); @@ -265,26 +261,22 @@ PFCmd CcFuncTbl[] = { /* table of available command #define F_COMMAND_NORM 111 e_dabbrev_expand, #define F_DABBREV_EXPAND 112 - e_copy_to_clipboard, -#define F_COPY_CLIP 113 - e_paste_from_clipboard, -#define F_PASTE_CLIP 114 e_dosify_next, -#define F_DOSIFY_NEXT 115 +#define F_DOSIFY_NEXT 113 e_dosify_prev, -#define F_DOSIFY_PREV 116 +#define F_DOSIFY_PREV 114 e_page_up, -#define F_PAGE_UP 117 +#define F_PAGE_UP 115 e_page_down, -#define F_PAGE_DOWN 118 +#define F_PAGE_DOWN 116 e_yank_pop, -#define F_YANK_POP 119 +#define F_YANK_POP 117 e_newline_hold, -#define F_NEWLINE_HOLD 120 +#define F_NEWLINE_HOLD 118 e_newline_down_hist, -#define F_NEWLINE_DOWN_HIST 121 +#define F_NEWLINE_DOWN_HIST 119 0 /* DUMMY VALUE */ -#define F_NUM_FNS 122 +#define F_NUM_FNS 120 }; @@ -1752,18 +1744,6 @@ editinit(void) f->func = F_YANK_POP; f->desc = CSAVS(3, 115, "Replace just-yanked text with yank from earlier kill"); - - f++; - f->name = "e_copy_to_clipboard"; - f->func = F_COPY_CLIP; - f->desc = CSAVS(3, 116, - "(WIN32 only) Copy cut buffer to system clipboard"); - - f++; - f->name = "e_paste_from_clipboard"; - f->func = F_PASTE_CLIP; - f->desc = CSAVS(3, 117, - "(WIN32 only) Paste clipboard buffer at cursor position"); f++; f->name = "e_dosify_next"; Modified: stable/12/contrib/tcsh/ed.h ============================================================================== --- stable/12/contrib/tcsh/ed.h Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.h Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.h,v 3.50 2007/07/05 14:13:06 christos Exp $ */ /* * ed.h: Editor declarations and globals */ Modified: stable/12/contrib/tcsh/ed.init.c ============================================================================== --- stable/12/contrib/tcsh/ed.init.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.init.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.init.c,v 3.60 2006/08/24 20:56:31 christos Exp $ */ /* * ed.init.c: Editor initializations */ @@ -31,9 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.init.c,v 3.60 2006/08/24 20:56:31 christos Exp $") - #include "ed.h" #include "tc.h" #include "ed.defns.h" Modified: stable/12/contrib/tcsh/ed.inputl.c ============================================================================== --- stable/12/contrib/tcsh/ed.inputl.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.inputl.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.inputl.c,v 3.73 2012/10/19 15:23:32 christos Exp $ */ /* * ed.inputl.c: Input line handling. */ @@ -31,9 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.inputl.c,v 3.73 2012/10/19 15:23:32 christos Exp $") - #include "ed.h" #include "ed.defns.h" /* for the function names */ #include "tw.h" /* for twenex stuff */ @@ -668,6 +664,17 @@ RunCommand(Char *str) Refresh(); } +int +GetCmdChar(Char ch) +{ +#ifndef WINNT_NATIVE // We use more than 256 for various extended keys + wint_t c = ch & CHAR; +#else + wint_t c = ch; +#endif + return c < NT_NUM_KEYS ? CurrentKeyMap[c] : F_INSERT; +} + static int GetNextCommand(KEYCMD *cmdnum, Char *ch) { @@ -696,17 +703,8 @@ GetNextCommand(KEYCMD *cmdnum, Char *ch) MetaNext = 0; *ch |= META; } - /* XXX: This needs to be fixed so that we don't just truncate - * the character, we unquote it. - */ - if (*ch < NT_NUM_KEYS) - cmd = CurrentKeyMap[*ch]; - else -#ifdef WINNT_NATIVE - cmd = CurrentKeyMap[(unsigned char) *ch]; -#else - cmd = F_INSERT; -#endif + + cmd = GetCmdChar(*ch); if (cmd == F_XKEY) { XmapVal val; CStr cstr; @@ -800,13 +798,18 @@ GetNextChar(Char *cp) return -1; } } - cbp++; - if (normal_mbtowc(cp, cbuf, cbp) == -1) { - reset_mbtowc(); - if (cbp < MB_CUR_MAX) - continue; /* Maybe a partial character */ - /* And drop the following bytes, if any */ - *cp = (unsigned char)*cbuf | INVALID_BYTE; + if (cbp == 0 /* && *cbuf < NT_NUM_KEYS */ + && CurrentKeyMap[(unsigned char)*cbuf] == F_XKEY) { + *cp = (unsigned char)*cbuf; + } else { + cbp++; + if (normal_mbtowc(cp, cbuf, cbp) == -1) { + reset_mbtowc(); + if (cbp < MB_CUR_MAX) + continue; /* Maybe a partial character */ + /* And drop the following bytes, if any */ + *cp = (unsigned char)*cbuf | INVALID_BYTE; + } } break; } Modified: stable/12/contrib/tcsh/ed.refresh.c ============================================================================== --- stable/12/contrib/tcsh/ed.refresh.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.refresh.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.refresh.c,v 3.51 2015/06/06 21:19:07 christos Exp $ */ /* * ed.refresh.c: Lower level screen refreshing functions */ @@ -31,9 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.refresh.c,v 3.51 2015/06/06 21:19:07 christos Exp $") - #include "ed.h" /* #define DEBUG_UPDATE */ /* #define DEBUG_REFRESH */ Modified: stable/12/contrib/tcsh/ed.screen.c ============================================================================== --- stable/12/contrib/tcsh/ed.screen.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.screen.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.screen.c,v 3.82 2016/11/24 15:04:14 christos Exp $ */ /* * ed.screen.c: Editor/termcap-curses interface */ @@ -31,9 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.screen.c,v 3.82 2016/11/24 15:04:14 christos Exp $") - #include "ed.h" #include "tc.h" #include "ed.defns.h" Modified: stable/12/contrib/tcsh/ed.term.c ============================================================================== --- stable/12/contrib/tcsh/ed.term.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.term.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.term.c,v 1.38 2011/02/25 23:58:34 christos Exp $ */ /* * ed.term.c: Low level terminal interface */ @@ -32,8 +31,6 @@ */ #include "sh.h" #ifndef WINNT_NATIVE - -RCSID("$tcsh: ed.term.c,v 1.38 2011/02/25 23:58:34 christos Exp $") #include #include "ed.h" Modified: stable/12/contrib/tcsh/ed.term.h ============================================================================== --- stable/12/contrib/tcsh/ed.term.h Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.term.h Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.term.h,v 1.19 2015/03/25 19:53:16 christos Exp $ */ /* * ed.term.h: Local terminal header */ Modified: stable/12/contrib/tcsh/ed.xmap.c ============================================================================== --- stable/12/contrib/tcsh/ed.xmap.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.xmap.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.xmap.c,v 3.38 2015/06/06 21:19:07 christos Exp $ */ /* * ed.xmap.c: This module contains the procedures for maintaining * the extended-key map. @@ -87,9 +86,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.xmap.c,v 3.38 2015/06/06 21:19:07 christos Exp $") - #include "ed.h" #include "ed.defns.h" Modified: stable/12/contrib/tcsh/eight-bit.me ============================================================================== --- stable/12/contrib/tcsh/eight-bit.me Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/eight-bit.me Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -.\" $tcsh: eight-bit.me,v 3.2 2006/03/02 18:46:44 christos Exp $ How to use 8 bit characters by Johan Widen Modified: stable/12/contrib/tcsh/gethost.c ============================================================================== --- stable/12/contrib/tcsh/gethost.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/gethost.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/gethost.c,v 1.19 2014/03/09 00:11:54 christos Exp $ */ /* * gethost.c: Create version file from prototype */ @@ -31,8 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: gethost.c,v 1.19 2014/03/09 00:11:54 christos Exp $") #ifdef SCO # define perror __perror Modified: stable/12/contrib/tcsh/glob.3 ============================================================================== --- stable/12/contrib/tcsh/glob.3 Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/glob.3 Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,4 @@ -.\" $NetBSD: glob.3,v 1.17 2001/03/16 21:09:05 christos Exp $ +.\" NetBSD: glob.3,v 1.17 2001/03/16 21:09:05 christos Exp .\" .\" Copyright (c) 1989, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. Modified: stable/12/contrib/tcsh/glob.c ============================================================================== --- stable/12/contrib/tcsh/glob.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/glob.c Wed Oct 30 17:06:02 2019 (r354191) @@ -100,7 +100,7 @@ static int Lstat (const char *, struct stat *); static int Stat (const char *, struct stat *sb); static Char *Strchr (Char *, int); #ifdef DEBUG -static void qprintf (const Char *); +static void qprintf (const char *, const Char *); #endif #define DOLLAR '$' @@ -256,19 +256,20 @@ Strchr(Char *str, int ch) #ifdef DEBUG static void -qprintf(const Char *s) +qprintf(const char *pre, const Char *s) { const Char *p; - + + xprintf("%s", pre); for (p = s; *p; p++) - printf("%c", *p & 0xff); - printf("\n"); + xprintf("%c", *p & 0xff); + xprintf("\n%s", pre); for (p = s; *p; p++) - printf("%c", *p & M_PROTECT ? '"' : ' '); - printf("\n"); + xprintf("%c", *p & M_PROTECT ? '"' : ' '); + xprintf("\n%s", pre); for (p = s; *p; p++) - printf("%c", *p & M_META ? '_' : ' '); - printf("\n"); + xprintf("%c", *p & M_META ? '_' : ' '); + xprintf("\n"); } #endif /* DEBUG */ @@ -412,7 +413,7 @@ glob(const char *pattern, int flags, int (*errfunc) (c } *bufnext = EOS; #ifdef DEBUG - qprintf(patbuf); + qprintf("patbuf=", patbuf); #endif if ((err = glob1(patbuf, pglob, no_match)) != 0) { @@ -693,72 +694,94 @@ globextend(const char *path, glob_t *pglob) } /* - * pattern matching function for filenames. Each occurrence of the * - * pattern causes a recursion level. + * pattern matching function for filenames. */ static int match(const char *name, const Char *pat, const Char *patend, int m_not) { int ok, negate_range; + const Char *patNext; + const char *nameNext, *nameStart, *nameEnd; Char c; - while (pat < patend) { - size_t lwk; - __Char wc, wk; + patNext = pat; + nameStart = nameNext = name; + nameEnd = NULL; + while (pat < patend || *name) { + size_t lwk, pwk; + __Char wc, wk, wc1; + c = *pat; /* Only for M_MASK bits */ - pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX); + if (*name == EOS) + nameEnd = name; + + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); lwk = one_mbtowc(&wk, name, MB_LEN_MAX); switch (c & M_MASK) { case M_ALL: - while (pat < patend && (*pat & M_MASK) == M_ALL) /* eat consecutive '*' */ - pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX); - if (pat == patend) - return (1); - while (!match(name, pat, patend, m_not)) { - if (*name == EOS) - return (0); - name += lwk; - lwk = one_mbtowc(&wk, name, MB_LEN_MAX); + while ((*(pat + pwk) & M_MASK) == M_ALL) { + pat += pwk; + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); } - return (1); + patNext = pat; + nameNext = name + lwk; + pat += pwk; + continue; case M_ONE: if (*name == EOS) - return (0); + break; name += lwk; - break; + pat += pwk; + continue; case M_SET: ok = 0; if (*name == EOS) - return (0); + break; + pat += pwk; + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); name += lwk; - if ((negate_range = ((*pat & M_MASK) == m_not)) != 0) - ++pat; + if ((negate_range = ((*pat & M_MASK) == m_not)) != 0) { + pat += pwk; + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); + } + wc1 = wc; while ((*pat & M_MASK) != M_END) { - pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX); if ((*pat & M_MASK) == M_RNG) { __Char wc2; - pat++; - pat += One_Char_mbtowc(&wc2, pat, MB_LEN_MAX); - if (globcharcoll(wc, wk, 0) <= 0 && + pat += pwk; + pwk = One_Char_mbtowc(&wc2, pat, MB_LEN_MAX); + if (globcharcoll(wc1, wk, 0) <= 0 && globcharcoll(wk, wc2, 0) <= 0) ok = 1; } else if (wc == wk) ok = 1; + pat += pwk; + wc1 = wc; + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); } - pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX); + pat += pwk; + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); if (ok == negate_range) - return (0); - break; + break; + continue; default: if (*name == EOS || samecase(wk) != samecase(wc)) - return (0); + break; name += lwk; - break; + pat += pwk; + continue; } + if (nameNext != nameStart + && (nameEnd == NULL || nameNext <= nameEnd)) { + pat = patNext; + name = nameNext; + continue; + } + return 0; } - return (*name == EOS); + return 1; } /* free allocated data belonging to a glob_t structure */ Modified: stable/12/contrib/tcsh/glob.h ============================================================================== --- stable/12/contrib/tcsh/glob.h Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/glob.h Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,4 @@ -/* $NetBSD: glob.h,v 1.13 2001/03/16 21:02:42 christos Exp $ */ +/* NetBSD: glob.h,v 1.13 2001/03/16 21:02:42 christos Exp */ /* * Copyright (c) 1989, 1993 Modified: stable/12/contrib/tcsh/host.defs ============================================================================== --- stable/12/contrib/tcsh/host.defs Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/host.defs Wed Oct 30 17:06:02 2019 (r354191) @@ -1,5 +1,4 @@ newcode : -/* $Header: /p/tcsh/cvsroot/tcsh/host.defs,v 1.61 2015/05/26 18:56:19 christos Exp $ */ /* * host.defs: Hosttype/Machtype etc. */ @@ -33,8 +32,6 @@ newcode : */ #include "sh.h" -RCSID("$tcsh: host.defs,v 1.61 2015/05/26 18:56:19 christos Exp $") - endcode : macro : M_mips64el : (defined(mips64) && defined(MIPSEL)) @@ -857,9 +854,9 @@ enddef : newdef : defined(APPLE) && defined(MACH) comment : OS X vendor : : "apple" -hosttype: defined(i386) : "intel-pc" +hosttype: defined(i386) : "intel-mac" hosttype: defined(ppc) : "powermac" -hosttype: defined(M_amd64) : "amd" +hosttype: defined(M_amd64) : "intel-mac" ostype : : "darwin" machtype: defined(i386) : "i386" machtype: defined(M_amd64) : "x86_64" Modified: stable/12/contrib/tcsh/imake.config ============================================================================== --- stable/12/contrib/tcsh/imake.config Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/imake.config Wed Oct 30 17:06:02 2019 (r354191) @@ -1,6 +1,4 @@ /* - * $tcsh: imake.config,v 1.5 2006/03/02 18:46:44 christos Exp $ - * * config.Imakefile for for tcsh 6.00 * Marc Horowitz, MIT SIPB */ Modified: stable/12/contrib/tcsh/ma.setp.c ============================================================================== --- stable/12/contrib/tcsh/ma.setp.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ma.setp.c Wed Oct 30 17:06:02 2019 (r354191) @@ -82,7 +82,6 @@ ********************************************************************** */ #include "sh.h" -RCSID("$tcsh: ma.setp.c,v 1.19 2007/11/20 20:03:51 christos Exp $") #ifdef MACH Modified: stable/12/contrib/tcsh/mi.termios.c ============================================================================== --- stable/12/contrib/tcsh/mi.termios.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/mi.termios.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,10 +1,8 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/mi.termios.c,v 1.5 2006/03/02 18:46:44 christos Exp $ */ /* termios.c - fake termios interface using sgtty interface * by Magnus Doell and Bruce Evans. * */ #include "sh.h" -RCSID("$tcsh: mi.termios.c,v 1.5 2006/03/02 18:46:44 christos Exp $") #if defined(_MINIX) && !defined(_MINIX_VMD) Modified: stable/12/contrib/tcsh/mi.varargs.h ============================================================================== --- stable/12/contrib/tcsh/mi.varargs.h Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/mi.varargs.h Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/mi.varargs.h,v 1.2 1996/04/26 19:18:39 christos Exp $ */ /* * mi.varargs.h: Correct varargs for minix */ Modified: stable/12/contrib/tcsh/nls/C/set1 ============================================================================== --- stable/12/contrib/tcsh/nls/C/set1 Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/nls/C/set1 Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -$ $tcsh: set1,v 1.7 2015/05/26 17:38:25 christos Exp $ $ Error messages $set 1 1 Syntax Error Modified: stable/12/contrib/tcsh/nls/C/set10 ============================================================================== --- stable/12/contrib/tcsh/nls/C/set10 Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/nls/C/set10 Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -$ $tcsh: set10,v 1.3 2006/03/02 18:46:45 christos Exp $ $ ma.setp.c $set 10 1 setpath: invalid command '%s'.\n Modified: stable/12/contrib/tcsh/nls/C/set11 ============================================================================== --- stable/12/contrib/tcsh/nls/C/set11 Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/nls/C/set11 Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -$ $tcsh: set11,v 1.4 2006/03/02 18:46:45 christos Exp $ $ sh.c $set 11 1 Warning: no access to tty (%s).\n Modified: stable/12/contrib/tcsh/nls/C/set12 ============================================================================== --- stable/12/contrib/tcsh/nls/C/set12 Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/nls/C/set12 Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -$ $tcsh: set12,v 1.4 2006/03/02 18:46:45 christos Exp $ $ sh.dir.c $set 12 1 %s: Trying to start from "%s"\n Modified: stable/12/contrib/tcsh/nls/C/set13 ============================================================================== --- stable/12/contrib/tcsh/nls/C/set13 Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/nls/C/set13 Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -$ $tcsh: set13,v 1.3 2006/03/02 18:46:45 christos Exp $ $ sh.exec.c $set 13 1 hash=%-4d dir=%-2d prog=%s\n Modified: stable/12/contrib/tcsh/nls/C/set14 ============================================================================== --- stable/12/contrib/tcsh/nls/C/set14 Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/nls/C/set14 Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -$ $tcsh: set14,v 1.4 2006/03/02 18:46:45 christos Exp $ $ sh.file.c $set 14 1 \nYikes!! Too many %s!!\n Modified: stable/12/contrib/tcsh/nls/C/set15 ============================================================================== --- stable/12/contrib/tcsh/nls/C/set15 Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/nls/C/set15 Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -$ $tcsh: set15,v 1.4 2006/03/02 18:46:45 christos Exp $ $ sh.func.c $set 15 1 %s: %s: Can't %s%s limit\n Modified: stable/12/contrib/tcsh/nls/C/set16 ============================================================================== --- stable/12/contrib/tcsh/nls/C/set16 Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/nls/C/set16 Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -$ $tcsh: set16,v 1.4 2006/03/02 18:46:45 christos Exp $ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Oct 30 17:18:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B91C015B8EA; Wed, 30 Oct 2019 17:18: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473FXM4Rd4z4H5p; Wed, 30 Oct 2019 17:18:11 +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 784C0D96D; Wed, 30 Oct 2019 17:18:11 +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 x9UHIBHl059165; Wed, 30 Oct 2019 17:18:11 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UHIBKT059164; Wed, 30 Oct 2019 17:18:11 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201910301718.x9UHIBKT059164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 30 Oct 2019 17:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354192 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 354192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 17:18:11 -0000 Author: imp Date: Wed Oct 30 17:18:11 2019 New Revision: 354192 URL: https://svnweb.freebsd.org/changeset/base/354192 Log: Make hyperv keyboard work again. r351049 bogusly deleted these lines from files.amd64 but failed to add them to files.x86. Since this works on i386, add them to files.x86 rather than just adding them back to files.amd64. PR: 240734 Reported by: Michael Pro Modified: head/sys/conf/files.x86 Modified: head/sys/conf/files.x86 ============================================================================== --- head/sys/conf/files.x86 Wed Oct 30 17:06:02 2019 (r354191) +++ head/sys/conf/files.x86 Wed Oct 30 17:18:11 2019 (r354192) @@ -113,6 +113,8 @@ dev/hwpmc/hwpmc_core.c optional hwpmc dev/hwpmc/hwpmc_uncore.c optional hwpmc dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc +dev/hyperv/input/hv_kbd.c optional hyperv +dev/hyperv/input/hv_kbdc.c optional hyperv dev/hyperv/pcib/vmbus_pcib.c optional hyperv pci dev/hyperv/netvsc/hn_nvs.c optional hyperv dev/hyperv/netvsc/hn_rndis.c optional hyperv From owner-svn-src-all@freebsd.org Wed Oct 30 17:32:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB2F015C0F8; Wed, 30 Oct 2019 17:32: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473Fs05SWsz4J22; Wed, 30 Oct 2019 17:32: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 84EE0DCFB; Wed, 30 Oct 2019 17:32:36 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9UHWagJ070699; Wed, 30 Oct 2019 17:32:36 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UHWaJs070697; Wed, 30 Oct 2019 17:32:36 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201910301732.x9UHWaJs070697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 Oct 2019 17:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354193 - 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: 354193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 17:32:36 -0000 Author: andrew Date: Wed Oct 30 17:32:35 2019 New Revision: 354193 URL: https://svnweb.freebsd.org/changeset/base/354193 Log: Set the userspace execute never bit on kernel mappings. Arm64 allows us to create execute only mappings. To make sure userspace is unable to accidentally execute kernel code set the user execute never bit in the kernel page tables. MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/locore.S head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/locore.S ============================================================================== --- head/sys/arm64/arm64/locore.S Wed Oct 30 17:18:11 2019 (r354192) +++ head/sys/arm64/arm64/locore.S Wed Oct 30 17:32:35 2019 (r354193) @@ -556,6 +556,7 @@ build_l2_block_pagetable: lsl x12, x7, #2 orr x12, x12, #L2_BLOCK orr x12, x12, #(ATTR_AF) + orr x12, x12, #(ATTR_UXN) #ifdef SMP orr x12, x12, ATTR_SH(ATTR_SH_IS) #endif Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed Oct 30 17:18:11 2019 (r354192) +++ head/sys/arm64/arm64/pmap.c Wed Oct 30 17:32:35 2019 (r354193) @@ -761,7 +761,7 @@ pmap_bootstrap_l3(vm_offset_t l1pt, vm_offset_t va, vm pa = pmap_early_vtophys(l1pt, l3pt); pmap_store(&l2[l2_slot], - (pa & ~Ln_TABLE_MASK) | L2_TABLE); + (pa & ~Ln_TABLE_MASK) | ATTR_UXN | L2_TABLE); l3pt += PAGE_SIZE; } @@ -1174,6 +1174,8 @@ pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_ attr = ATTR_DEFAULT | ATTR_IDX(mode) | L3_PAGE; if (mode == DEVICE_MEMORY) attr |= ATTR_XN; + else + attr |= ATTR_UXN; va = sva; while (size != 0) { @@ -1289,7 +1291,7 @@ pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) m = ma[i]; pa = VM_PAGE_TO_PHYS(m) | ATTR_DEFAULT | ATTR_AP(ATTR_AP_RW) | - ATTR_IDX(m->md.pv_memattr) | L3_PAGE; + ATTR_UXN | ATTR_IDX(m->md.pv_memattr) | L3_PAGE; if (m->md.pv_memattr == DEVICE_MEMORY) pa |= ATTR_XN; pte = pmap_l2_to_l3(pde, va); @@ -3194,6 +3196,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v new_l3 |= ATTR_SW_WIRED; if (va < VM_MAXUSER_ADDRESS) new_l3 |= ATTR_AP(ATTR_AP_USER) | ATTR_PXN; + else + new_l3 |= ATTR_UXN; if ((m->oflags & VPO_UNMANAGED) == 0) { new_l3 |= ATTR_SW_MANAGED; if ((prot & VM_PROT_WRITE) != 0) { @@ -3456,6 +3460,8 @@ pmap_enter_2mpage(pmap_t pmap, vm_offset_t va, vm_page new_l2 |= ATTR_XN; if (va < VM_MAXUSER_ADDRESS) new_l2 |= ATTR_AP(ATTR_AP_USER) | ATTR_PXN; + else + new_l2 |= ATTR_UXN; return (pmap_enter_l2(pmap, va, new_l2, PMAP_ENTER_NOSLEEP | PMAP_ENTER_NOREPLACE | PMAP_ENTER_NORECLAIM, NULL, lockp) == KERN_SUCCESS); @@ -3754,6 +3760,8 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v l3_val |= ATTR_XN; if (va < VM_MAXUSER_ADDRESS) l3_val |= ATTR_AP(ATTR_AP_USER) | ATTR_PXN; + else + l3_val |= ATTR_UXN; /* * Now validate mapping with RO protection From owner-svn-src-all@freebsd.org Wed Oct 30 17:33:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0112E15C1AC; Wed, 30 Oct 2019 17:33: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473Fsn6DP8z4J99; Wed, 30 Oct 2019 17:33: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 B9EAFDCFD; Wed, 30 Oct 2019 17:33: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 x9UHXHxQ070800; Wed, 30 Oct 2019 17:33:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UHXHN9070799; Wed, 30 Oct 2019 17:33:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201910301733.x9UHXHN9070799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 30 Oct 2019 17:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354194 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 354194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 17:33:18 -0000 Author: kib Date: Wed Oct 30 17:33:17 2019 New Revision: 354194 URL: https://svnweb.freebsd.org/changeset/base/354194 Log: vm_page_wire_mapped: explain why failure does not affect correctness. Reviewed by: markj (previous version) Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D22196 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Oct 30 17:32:35 2019 (r354193) +++ head/sys/vm/vm_page.c Wed Oct 30 17:33:17 2019 (r354194) @@ -3763,6 +3763,9 @@ vm_page_wire(vm_page_t m) /* * Attempt to wire a mapped page following a pmap lookup of that page. * This may fail if a thread is concurrently tearing down mappings of the page. + * The transient failure is acceptable because it translates to the + * failure of the caller pmap_extract_and_hold(), which should be then + * followed by the vm_fault() fallback, see e.g. vm_fault_quick_hold_pages(). */ bool vm_page_wire_mapped(vm_page_t m) From owner-svn-src-all@freebsd.org Wed Oct 30 18:22:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E2F4D15CFC7; Wed, 30 Oct 2019 18:22:07 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473Gy76R4Dz4MJ2; Wed, 30 Oct 2019 18:22:07 +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 BFFBDE5C1; Wed, 30 Oct 2019 18:22:07 +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 x9UIM7Hk099862; Wed, 30 Oct 2019 18:22:07 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UILwXj099790; Wed, 30 Oct 2019 18:21:58 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201910301821.x9UILwXj099790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 30 Oct 2019 18:21: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: r354195 - in stable/11/contrib/tcsh: . nls nls/C nls/et nls/finnish nls/french nls/german nls/greek nls/italian nls/ja nls/russian nls/spanish nls/ukrainian X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/11/contrib/tcsh: . nls nls/C nls/et nls/finnish nls/french nls/german nls/greek nls/italian nls/ja nls/russian nls/spanish nls/ukrainian X-SVN-Commit-Revision: 354195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 18:22:08 -0000 Author: brooks Date: Wed Oct 30 18:21:58 2019 New Revision: 354195 URL: https://svnweb.freebsd.org/changeset/base/354195 Log: MFC r353325, r353875 r353325: Update tcsh to 6.21.00. This is a bugfix release with no new features. A number of these fixes were previously merged into our tree. Sponsored by: DARPA, AFRL r353875: Update tcsh to git revision 83c5be0 bringing in a number of bug fixes. Reported by: sobomax Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22099 Record prior MFC of r315948, r315952 Added: stable/11/contrib/tcsh/README.md Deleted: stable/11/contrib/tcsh/README stable/11/contrib/tcsh/README.imake Modified: stable/11/contrib/tcsh/Fixes stable/11/contrib/tcsh/Imakefile stable/11/contrib/tcsh/MAKEDIFFS stable/11/contrib/tcsh/MAKESHAR stable/11/contrib/tcsh/Makefile.in stable/11/contrib/tcsh/Makefile.std stable/11/contrib/tcsh/Makefile.vms stable/11/contrib/tcsh/Ported stable/11/contrib/tcsh/complete.tcsh stable/11/contrib/tcsh/config_f.h stable/11/contrib/tcsh/configure stable/11/contrib/tcsh/dotlock.c stable/11/contrib/tcsh/ed.chared.c stable/11/contrib/tcsh/ed.decls.h stable/11/contrib/tcsh/ed.defns.c stable/11/contrib/tcsh/ed.h stable/11/contrib/tcsh/ed.init.c stable/11/contrib/tcsh/ed.inputl.c stable/11/contrib/tcsh/ed.refresh.c stable/11/contrib/tcsh/ed.screen.c stable/11/contrib/tcsh/ed.term.c stable/11/contrib/tcsh/ed.term.h stable/11/contrib/tcsh/ed.xmap.c stable/11/contrib/tcsh/eight-bit.me stable/11/contrib/tcsh/gethost.c stable/11/contrib/tcsh/glob.3 stable/11/contrib/tcsh/glob.c stable/11/contrib/tcsh/glob.h stable/11/contrib/tcsh/host.defs stable/11/contrib/tcsh/imake.config stable/11/contrib/tcsh/ma.setp.c stable/11/contrib/tcsh/mi.termios.c stable/11/contrib/tcsh/mi.varargs.h stable/11/contrib/tcsh/nls/C/set1 stable/11/contrib/tcsh/nls/C/set10 stable/11/contrib/tcsh/nls/C/set11 stable/11/contrib/tcsh/nls/C/set12 stable/11/contrib/tcsh/nls/C/set13 stable/11/contrib/tcsh/nls/C/set14 stable/11/contrib/tcsh/nls/C/set15 stable/11/contrib/tcsh/nls/C/set16 stable/11/contrib/tcsh/nls/C/set17 stable/11/contrib/tcsh/nls/C/set18 stable/11/contrib/tcsh/nls/C/set19 stable/11/contrib/tcsh/nls/C/set2 stable/11/contrib/tcsh/nls/C/set20 stable/11/contrib/tcsh/nls/C/set21 stable/11/contrib/tcsh/nls/C/set22 stable/11/contrib/tcsh/nls/C/set23 stable/11/contrib/tcsh/nls/C/set24 stable/11/contrib/tcsh/nls/C/set25 stable/11/contrib/tcsh/nls/C/set26 stable/11/contrib/tcsh/nls/C/set27 stable/11/contrib/tcsh/nls/C/set29 stable/11/contrib/tcsh/nls/C/set3 stable/11/contrib/tcsh/nls/C/set30 stable/11/contrib/tcsh/nls/C/set31 stable/11/contrib/tcsh/nls/C/set4 stable/11/contrib/tcsh/nls/C/set5 stable/11/contrib/tcsh/nls/C/set6 stable/11/contrib/tcsh/nls/C/set7 stable/11/contrib/tcsh/nls/C/set8 stable/11/contrib/tcsh/nls/C/set9 stable/11/contrib/tcsh/nls/Makefile.in stable/11/contrib/tcsh/nls/catgen stable/11/contrib/tcsh/nls/et/set1 stable/11/contrib/tcsh/nls/et/set10 stable/11/contrib/tcsh/nls/et/set11 stable/11/contrib/tcsh/nls/et/set12 stable/11/contrib/tcsh/nls/et/set13 stable/11/contrib/tcsh/nls/et/set14 stable/11/contrib/tcsh/nls/et/set15 stable/11/contrib/tcsh/nls/et/set16 stable/11/contrib/tcsh/nls/et/set17 stable/11/contrib/tcsh/nls/et/set18 stable/11/contrib/tcsh/nls/et/set19 stable/11/contrib/tcsh/nls/et/set2 stable/11/contrib/tcsh/nls/et/set20 stable/11/contrib/tcsh/nls/et/set21 stable/11/contrib/tcsh/nls/et/set22 stable/11/contrib/tcsh/nls/et/set23 stable/11/contrib/tcsh/nls/et/set24 stable/11/contrib/tcsh/nls/et/set25 stable/11/contrib/tcsh/nls/et/set26 stable/11/contrib/tcsh/nls/et/set27 stable/11/contrib/tcsh/nls/et/set29 stable/11/contrib/tcsh/nls/et/set3 stable/11/contrib/tcsh/nls/et/set30 stable/11/contrib/tcsh/nls/et/set31 stable/11/contrib/tcsh/nls/et/set4 stable/11/contrib/tcsh/nls/et/set5 stable/11/contrib/tcsh/nls/et/set6 stable/11/contrib/tcsh/nls/et/set7 stable/11/contrib/tcsh/nls/et/set8 stable/11/contrib/tcsh/nls/et/set9 stable/11/contrib/tcsh/nls/finnish/set1 stable/11/contrib/tcsh/nls/finnish/set10 stable/11/contrib/tcsh/nls/finnish/set11 stable/11/contrib/tcsh/nls/finnish/set12 stable/11/contrib/tcsh/nls/finnish/set13 stable/11/contrib/tcsh/nls/finnish/set14 stable/11/contrib/tcsh/nls/finnish/set15 stable/11/contrib/tcsh/nls/finnish/set16 stable/11/contrib/tcsh/nls/finnish/set17 stable/11/contrib/tcsh/nls/finnish/set18 stable/11/contrib/tcsh/nls/finnish/set19 stable/11/contrib/tcsh/nls/finnish/set2 stable/11/contrib/tcsh/nls/finnish/set20 stable/11/contrib/tcsh/nls/finnish/set21 stable/11/contrib/tcsh/nls/finnish/set22 stable/11/contrib/tcsh/nls/finnish/set23 stable/11/contrib/tcsh/nls/finnish/set24 stable/11/contrib/tcsh/nls/finnish/set25 stable/11/contrib/tcsh/nls/finnish/set26 stable/11/contrib/tcsh/nls/finnish/set27 stable/11/contrib/tcsh/nls/finnish/set29 stable/11/contrib/tcsh/nls/finnish/set3 stable/11/contrib/tcsh/nls/finnish/set30 stable/11/contrib/tcsh/nls/finnish/set31 stable/11/contrib/tcsh/nls/finnish/set4 stable/11/contrib/tcsh/nls/finnish/set5 stable/11/contrib/tcsh/nls/finnish/set6 stable/11/contrib/tcsh/nls/finnish/set7 stable/11/contrib/tcsh/nls/finnish/set8 stable/11/contrib/tcsh/nls/finnish/set9 stable/11/contrib/tcsh/nls/french/set1 stable/11/contrib/tcsh/nls/french/set10 stable/11/contrib/tcsh/nls/french/set11 stable/11/contrib/tcsh/nls/french/set12 stable/11/contrib/tcsh/nls/french/set13 stable/11/contrib/tcsh/nls/french/set14 stable/11/contrib/tcsh/nls/french/set15 stable/11/contrib/tcsh/nls/french/set16 stable/11/contrib/tcsh/nls/french/set17 stable/11/contrib/tcsh/nls/french/set18 stable/11/contrib/tcsh/nls/french/set19 stable/11/contrib/tcsh/nls/french/set2 stable/11/contrib/tcsh/nls/french/set20 stable/11/contrib/tcsh/nls/french/set21 stable/11/contrib/tcsh/nls/french/set22 stable/11/contrib/tcsh/nls/french/set23 stable/11/contrib/tcsh/nls/french/set24 stable/11/contrib/tcsh/nls/french/set25 stable/11/contrib/tcsh/nls/french/set26 stable/11/contrib/tcsh/nls/french/set27 stable/11/contrib/tcsh/nls/french/set29 stable/11/contrib/tcsh/nls/french/set3 stable/11/contrib/tcsh/nls/french/set30 stable/11/contrib/tcsh/nls/french/set31 stable/11/contrib/tcsh/nls/french/set4 stable/11/contrib/tcsh/nls/french/set5 stable/11/contrib/tcsh/nls/french/set6 stable/11/contrib/tcsh/nls/french/set7 stable/11/contrib/tcsh/nls/french/set8 stable/11/contrib/tcsh/nls/french/set9 stable/11/contrib/tcsh/nls/german/set1 stable/11/contrib/tcsh/nls/german/set10 stable/11/contrib/tcsh/nls/german/set11 stable/11/contrib/tcsh/nls/german/set12 stable/11/contrib/tcsh/nls/german/set13 stable/11/contrib/tcsh/nls/german/set14 stable/11/contrib/tcsh/nls/german/set15 stable/11/contrib/tcsh/nls/german/set16 stable/11/contrib/tcsh/nls/german/set17 stable/11/contrib/tcsh/nls/german/set18 stable/11/contrib/tcsh/nls/german/set19 stable/11/contrib/tcsh/nls/german/set2 stable/11/contrib/tcsh/nls/german/set20 stable/11/contrib/tcsh/nls/german/set21 stable/11/contrib/tcsh/nls/german/set22 stable/11/contrib/tcsh/nls/german/set23 stable/11/contrib/tcsh/nls/german/set24 stable/11/contrib/tcsh/nls/german/set25 stable/11/contrib/tcsh/nls/german/set26 stable/11/contrib/tcsh/nls/german/set27 stable/11/contrib/tcsh/nls/german/set29 stable/11/contrib/tcsh/nls/german/set3 stable/11/contrib/tcsh/nls/german/set30 stable/11/contrib/tcsh/nls/german/set31 stable/11/contrib/tcsh/nls/german/set4 stable/11/contrib/tcsh/nls/german/set5 stable/11/contrib/tcsh/nls/german/set6 stable/11/contrib/tcsh/nls/german/set7 stable/11/contrib/tcsh/nls/german/set8 stable/11/contrib/tcsh/nls/german/set9 stable/11/contrib/tcsh/nls/greek/set1 stable/11/contrib/tcsh/nls/greek/set10 stable/11/contrib/tcsh/nls/greek/set11 stable/11/contrib/tcsh/nls/greek/set12 stable/11/contrib/tcsh/nls/greek/set13 stable/11/contrib/tcsh/nls/greek/set14 stable/11/contrib/tcsh/nls/greek/set15 stable/11/contrib/tcsh/nls/greek/set16 stable/11/contrib/tcsh/nls/greek/set17 stable/11/contrib/tcsh/nls/greek/set18 stable/11/contrib/tcsh/nls/greek/set19 stable/11/contrib/tcsh/nls/greek/set2 stable/11/contrib/tcsh/nls/greek/set20 stable/11/contrib/tcsh/nls/greek/set21 stable/11/contrib/tcsh/nls/greek/set22 stable/11/contrib/tcsh/nls/greek/set23 stable/11/contrib/tcsh/nls/greek/set24 stable/11/contrib/tcsh/nls/greek/set25 stable/11/contrib/tcsh/nls/greek/set26 stable/11/contrib/tcsh/nls/greek/set27 stable/11/contrib/tcsh/nls/greek/set29 stable/11/contrib/tcsh/nls/greek/set3 stable/11/contrib/tcsh/nls/greek/set30 stable/11/contrib/tcsh/nls/greek/set31 stable/11/contrib/tcsh/nls/greek/set4 stable/11/contrib/tcsh/nls/greek/set5 stable/11/contrib/tcsh/nls/greek/set6 stable/11/contrib/tcsh/nls/greek/set7 stable/11/contrib/tcsh/nls/greek/set8 stable/11/contrib/tcsh/nls/greek/set9 stable/11/contrib/tcsh/nls/italian/set1 stable/11/contrib/tcsh/nls/italian/set10 stable/11/contrib/tcsh/nls/italian/set11 stable/11/contrib/tcsh/nls/italian/set12 stable/11/contrib/tcsh/nls/italian/set13 stable/11/contrib/tcsh/nls/italian/set14 stable/11/contrib/tcsh/nls/italian/set15 stable/11/contrib/tcsh/nls/italian/set16 stable/11/contrib/tcsh/nls/italian/set17 stable/11/contrib/tcsh/nls/italian/set18 stable/11/contrib/tcsh/nls/italian/set19 stable/11/contrib/tcsh/nls/italian/set2 stable/11/contrib/tcsh/nls/italian/set20 stable/11/contrib/tcsh/nls/italian/set21 stable/11/contrib/tcsh/nls/italian/set22 stable/11/contrib/tcsh/nls/italian/set23 stable/11/contrib/tcsh/nls/italian/set24 stable/11/contrib/tcsh/nls/italian/set25 stable/11/contrib/tcsh/nls/italian/set26 stable/11/contrib/tcsh/nls/italian/set27 stable/11/contrib/tcsh/nls/italian/set29 stable/11/contrib/tcsh/nls/italian/set3 stable/11/contrib/tcsh/nls/italian/set30 stable/11/contrib/tcsh/nls/italian/set31 stable/11/contrib/tcsh/nls/italian/set4 stable/11/contrib/tcsh/nls/italian/set5 stable/11/contrib/tcsh/nls/italian/set6 stable/11/contrib/tcsh/nls/italian/set7 stable/11/contrib/tcsh/nls/italian/set8 stable/11/contrib/tcsh/nls/italian/set9 stable/11/contrib/tcsh/nls/ja/set1 stable/11/contrib/tcsh/nls/ja/set10 stable/11/contrib/tcsh/nls/ja/set11 stable/11/contrib/tcsh/nls/ja/set12 stable/11/contrib/tcsh/nls/ja/set13 stable/11/contrib/tcsh/nls/ja/set15 stable/11/contrib/tcsh/nls/ja/set16 stable/11/contrib/tcsh/nls/ja/set17 stable/11/contrib/tcsh/nls/ja/set18 stable/11/contrib/tcsh/nls/ja/set2 stable/11/contrib/tcsh/nls/ja/set21 stable/11/contrib/tcsh/nls/ja/set24 stable/11/contrib/tcsh/nls/ja/set29 stable/11/contrib/tcsh/nls/ja/set3 stable/11/contrib/tcsh/nls/ja/set30 stable/11/contrib/tcsh/nls/ja/set4 stable/11/contrib/tcsh/nls/ja/set5 stable/11/contrib/tcsh/nls/ja/set6 stable/11/contrib/tcsh/nls/ja/set7 stable/11/contrib/tcsh/nls/ja/set8 stable/11/contrib/tcsh/nls/russian/set1 stable/11/contrib/tcsh/nls/russian/set10 stable/11/contrib/tcsh/nls/russian/set11 stable/11/contrib/tcsh/nls/russian/set12 stable/11/contrib/tcsh/nls/russian/set13 stable/11/contrib/tcsh/nls/russian/set14 stable/11/contrib/tcsh/nls/russian/set15 stable/11/contrib/tcsh/nls/russian/set16 stable/11/contrib/tcsh/nls/russian/set17 stable/11/contrib/tcsh/nls/russian/set18 stable/11/contrib/tcsh/nls/russian/set19 stable/11/contrib/tcsh/nls/russian/set2 stable/11/contrib/tcsh/nls/russian/set20 stable/11/contrib/tcsh/nls/russian/set21 stable/11/contrib/tcsh/nls/russian/set22 stable/11/contrib/tcsh/nls/russian/set23 stable/11/contrib/tcsh/nls/russian/set24 stable/11/contrib/tcsh/nls/russian/set25 stable/11/contrib/tcsh/nls/russian/set26 stable/11/contrib/tcsh/nls/russian/set27 stable/11/contrib/tcsh/nls/russian/set29 stable/11/contrib/tcsh/nls/russian/set3 stable/11/contrib/tcsh/nls/russian/set30 stable/11/contrib/tcsh/nls/russian/set31 stable/11/contrib/tcsh/nls/russian/set4 stable/11/contrib/tcsh/nls/russian/set5 stable/11/contrib/tcsh/nls/russian/set6 stable/11/contrib/tcsh/nls/russian/set7 stable/11/contrib/tcsh/nls/russian/set8 stable/11/contrib/tcsh/nls/russian/set9 stable/11/contrib/tcsh/nls/spanish/set1 stable/11/contrib/tcsh/nls/spanish/set10 stable/11/contrib/tcsh/nls/spanish/set11 stable/11/contrib/tcsh/nls/spanish/set12 stable/11/contrib/tcsh/nls/spanish/set13 stable/11/contrib/tcsh/nls/spanish/set14 stable/11/contrib/tcsh/nls/spanish/set15 stable/11/contrib/tcsh/nls/spanish/set16 stable/11/contrib/tcsh/nls/spanish/set17 stable/11/contrib/tcsh/nls/spanish/set18 stable/11/contrib/tcsh/nls/spanish/set19 stable/11/contrib/tcsh/nls/spanish/set2 stable/11/contrib/tcsh/nls/spanish/set20 stable/11/contrib/tcsh/nls/spanish/set21 stable/11/contrib/tcsh/nls/spanish/set22 stable/11/contrib/tcsh/nls/spanish/set23 stable/11/contrib/tcsh/nls/spanish/set24 stable/11/contrib/tcsh/nls/spanish/set25 stable/11/contrib/tcsh/nls/spanish/set26 stable/11/contrib/tcsh/nls/spanish/set27 stable/11/contrib/tcsh/nls/spanish/set29 stable/11/contrib/tcsh/nls/spanish/set3 stable/11/contrib/tcsh/nls/spanish/set30 stable/11/contrib/tcsh/nls/spanish/set31 stable/11/contrib/tcsh/nls/spanish/set4 stable/11/contrib/tcsh/nls/spanish/set5 stable/11/contrib/tcsh/nls/spanish/set6 stable/11/contrib/tcsh/nls/spanish/set7 stable/11/contrib/tcsh/nls/spanish/set8 stable/11/contrib/tcsh/nls/spanish/set9 stable/11/contrib/tcsh/nls/ukrainian/set1 stable/11/contrib/tcsh/nls/ukrainian/set10 stable/11/contrib/tcsh/nls/ukrainian/set11 stable/11/contrib/tcsh/nls/ukrainian/set12 stable/11/contrib/tcsh/nls/ukrainian/set13 stable/11/contrib/tcsh/nls/ukrainian/set14 stable/11/contrib/tcsh/nls/ukrainian/set15 stable/11/contrib/tcsh/nls/ukrainian/set16 stable/11/contrib/tcsh/nls/ukrainian/set17 stable/11/contrib/tcsh/nls/ukrainian/set18 stable/11/contrib/tcsh/nls/ukrainian/set19 stable/11/contrib/tcsh/nls/ukrainian/set2 stable/11/contrib/tcsh/nls/ukrainian/set20 stable/11/contrib/tcsh/nls/ukrainian/set21 stable/11/contrib/tcsh/nls/ukrainian/set22 stable/11/contrib/tcsh/nls/ukrainian/set23 stable/11/contrib/tcsh/nls/ukrainian/set24 stable/11/contrib/tcsh/nls/ukrainian/set25 stable/11/contrib/tcsh/nls/ukrainian/set26 stable/11/contrib/tcsh/nls/ukrainian/set27 stable/11/contrib/tcsh/nls/ukrainian/set29 stable/11/contrib/tcsh/nls/ukrainian/set3 stable/11/contrib/tcsh/nls/ukrainian/set30 stable/11/contrib/tcsh/nls/ukrainian/set31 stable/11/contrib/tcsh/nls/ukrainian/set4 stable/11/contrib/tcsh/nls/ukrainian/set5 stable/11/contrib/tcsh/nls/ukrainian/set6 stable/11/contrib/tcsh/nls/ukrainian/set7 stable/11/contrib/tcsh/nls/ukrainian/set8 stable/11/contrib/tcsh/nls/ukrainian/set9 stable/11/contrib/tcsh/patchlevel.h stable/11/contrib/tcsh/pathnames.h stable/11/contrib/tcsh/sh.c stable/11/contrib/tcsh/sh.char.c stable/11/contrib/tcsh/sh.char.h stable/11/contrib/tcsh/sh.decls.h stable/11/contrib/tcsh/sh.dir.c stable/11/contrib/tcsh/sh.dir.h stable/11/contrib/tcsh/sh.dol.c stable/11/contrib/tcsh/sh.err.c stable/11/contrib/tcsh/sh.exec.c stable/11/contrib/tcsh/sh.exp.c stable/11/contrib/tcsh/sh.file.c stable/11/contrib/tcsh/sh.func.c stable/11/contrib/tcsh/sh.glob.c stable/11/contrib/tcsh/sh.h stable/11/contrib/tcsh/sh.hist.c stable/11/contrib/tcsh/sh.init.c stable/11/contrib/tcsh/sh.lex.c stable/11/contrib/tcsh/sh.misc.c stable/11/contrib/tcsh/sh.parse.c stable/11/contrib/tcsh/sh.print.c stable/11/contrib/tcsh/sh.proc.c stable/11/contrib/tcsh/sh.proc.h stable/11/contrib/tcsh/sh.sem.c stable/11/contrib/tcsh/sh.set.c stable/11/contrib/tcsh/sh.time.c stable/11/contrib/tcsh/sh.types.h stable/11/contrib/tcsh/snames.h stable/11/contrib/tcsh/tc.alloc.c stable/11/contrib/tcsh/tc.bind.c stable/11/contrib/tcsh/tc.const.c stable/11/contrib/tcsh/tc.decls.h stable/11/contrib/tcsh/tc.disc.c stable/11/contrib/tcsh/tc.func.c stable/11/contrib/tcsh/tc.h stable/11/contrib/tcsh/tc.nls.c stable/11/contrib/tcsh/tc.nls.h stable/11/contrib/tcsh/tc.os.c stable/11/contrib/tcsh/tc.os.h stable/11/contrib/tcsh/tc.printf.c stable/11/contrib/tcsh/tc.prompt.c stable/11/contrib/tcsh/tc.sched.c stable/11/contrib/tcsh/tc.sig.c stable/11/contrib/tcsh/tc.sig.h stable/11/contrib/tcsh/tc.str.c stable/11/contrib/tcsh/tc.vers.c stable/11/contrib/tcsh/tc.wait.h stable/11/contrib/tcsh/tc.who.c stable/11/contrib/tcsh/tcsh.man stable/11/contrib/tcsh/tcsh.man.new stable/11/contrib/tcsh/tcsh.man2html stable/11/contrib/tcsh/termcap.vms stable/11/contrib/tcsh/tw.color.c stable/11/contrib/tcsh/tw.comp.c stable/11/contrib/tcsh/tw.decls.h stable/11/contrib/tcsh/tw.h stable/11/contrib/tcsh/tw.help.c stable/11/contrib/tcsh/tw.init.c stable/11/contrib/tcsh/tw.parse.c stable/11/contrib/tcsh/tw.spell.c stable/11/contrib/tcsh/vms.termcap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tcsh/Fixes ============================================================================== --- stable/11/contrib/tcsh/Fixes Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/Fixes Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,26 @@ - 22. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar) + 5. PR/113: Sobomax: avoid infinite loops for -c commands when stdout is + not a tty. + 4. Avoid infinite loops during history loads when merging, print a better + error for errors during history load. + 3. PR/88: Preserve empty arguments in :q + 2. PR/94: Small apple issues (SAVESIGVEC, HOSTTYPE) + 1. PR/81: Fix range matching issue where we were comparing with the + range character instead of the start of range. [l-z]* would match foo + 12. V6.21.00 - 20190508 + 11. Abort history loading on words and lines too long + https://bugzilla.redhat.com/show_bug.cgi?id=1598502 + 10. PR/37: Introduce GetCmdChar() to avoid open coding array access. + 9. make closem() not close sockets so as not to affect nss_ldap. + tcsh never creates sockets so that's ok (Miloslav Trmac) + 8. PR/597: Make rmstar work with aliased rm + 7. convert match() from recursive to backtracking. + 6. Handle 8 bit characters in bindkey (Werner Fink) + 5. Look for tgetent in libtinfo as well (Werner Fink) + 4. Don't play pointer tricks that are undefined in modern c (Brooks Davis) + 3. Fix out of bounds read (Brooks Davis) + 2. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar) + 1. PR/471: Delay arginp parsing + 20. V6.20.00 - 20161124 19. Don't resize the screen if it did not change size. 18. V6.19.01 - 20161025 Modified: stable/11/contrib/tcsh/Imakefile ============================================================================== --- stable/11/contrib/tcsh/Imakefile Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/Imakefile Wed Oct 30 18:21:58 2019 (r354195) @@ -1,6 +1,4 @@ XCOMM -XCOMM $tcsh: Imakefile,v 1.88 2014/07/07 20:34:58 christos Exp $ -XCOMM XCOMM Imakefile for tcsh 6.12 XCOMM Marc Horowitz, MIT SIPB XCOMM @@ -522,12 +520,11 @@ TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \ tc.vers.${SUF} tc.who.${SUF} -MISCF = Makefile.std Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \ - WishList config_f.h eight-bit.me glob.3 patchlevel.h \ - pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ - README.imake complete.tcsh vmsreadme.txt Makefile.vms termcap.vms \ - snames.h host.defs gethost.c tcsh.man2html Makefile.in configure.ac \ - Makefile.win32 aclocal.m4 +MISCF = Makefile.std BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md \ + FAQ WishList config_f.h eight-bit.me glob.3 patchlevel.h pathnames.h \ + tcsh.man Ported src.desc Imakefile imake.config complete.tcsh \ + Makefile.vms termcap.vms snames.h host.defs gethost.c tcsh.man2html \ + Makefile.in configure.ac Makefile.win32 aclocal.m4 CONFSRCS=config/[a-z]* Modified: stable/11/contrib/tcsh/MAKEDIFFS ============================================================================== --- stable/11/contrib/tcsh/MAKEDIFFS Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/MAKEDIFFS Wed Oct 30 18:21:58 2019 (r354195) @@ -2,7 +2,6 @@ # # MAKEDIFFS.sh: Make context diffs for the csh sources # -# $tcsh: MAKEDIFFS,v 3.1 2006/03/02 18:46:44 christos Exp $ XINUDIR=/usr/share/src/mtXinu/bin/csh BSDDIR=/usr/share/src/mtXinu/BSD/bin/csh TAHOEDIR=/usr/share/src/mtXinu/TAHOE/bin/csh Modified: stable/11/contrib/tcsh/MAKESHAR ============================================================================== --- stable/11/contrib/tcsh/MAKESHAR Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/MAKESHAR Wed Oct 30 18:21:58 2019 (r354195) @@ -2,7 +2,6 @@ # # MAKESHAR.sh: Make a shar file for the sources # -# $tcsh: MAKESHAR,v 3.2 2006/03/02 18:46:44 christos Exp $ AWK=/usr/bin/nawk # Must be nawk or gawk cause of 2D arrays WC=/usr/ucb/wc Modified: stable/11/contrib/tcsh/Makefile.in ============================================================================== --- stable/11/contrib/tcsh/Makefile.in Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/Makefile.in Wed Oct 30 18:21:58 2019 (r354195) @@ -1,5 +1,3 @@ -# $tcsh: Makefile.in,v 3.59 2015/08/24 20:09:04 kim Exp $ -# Makefile.in 4.3 6/11/83 # # C Shell with process control; VM/UNIX VAX Makefile # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria @@ -407,11 +405,11 @@ TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.vers.${SUF} tc.who.${SUF} PVSRCS= Makefile.std Makefile.vms Makefile.in Makefile.win32 -AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \ +AVSRCS= BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md FAQ \ WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ - README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \ - host.defs gethost.c tcsh.man2html configure.ac configure config.h.in \ + complete.tcsh vmsreadme.txt termcap.vms snames.h host.defs \ + gethost.c tcsh.man2html configure.ac configure config.h.in \ tests/testsuite.at aclocal.m4 TESTFILES= tests/aliases.at tests/arguments.at tests/commands.at \ tests/expr.at tests/lexical.at tests/mb-eucjp.at \ @@ -449,7 +447,7 @@ pure:$(P) ${OBJS} gethost: gethost.c sh.err.h tc.const.h sh.h rm -f gethost - ${CC_FOR_GETHOST} -o gethost ${CPPFLAGS} $(srcdir)/gethost.c + ${CC_FOR_GETHOST} -o gethost ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} $(srcdir)/gethost.c tc.defs.c: gethost host.defs @rm -f $@.tmp Modified: stable/11/contrib/tcsh/Makefile.std ============================================================================== --- stable/11/contrib/tcsh/Makefile.std Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/Makefile.std Wed Oct 30 18:21:58 2019 (r354195) @@ -1,5 +1,3 @@ -# $tcsh: Makefile.std,v 1.100 2015/08/24 20:09:04 kim Exp $ -# Makefile.std 4.3 6/11/83 # # C Shell with process control; VM/UNIX VAX Makefile # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria @@ -317,11 +315,11 @@ TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.vers.${SUF} tc.who.${SUF} PVSRCS= Makefile.std Makefile.vms Makefile.in Makefile.win32 -AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \ +AVSRCS= BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md FAQ \ WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ - README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \ - host.defs gethost.c tcsh.man2html configure.ac configure config.h.in \ + complete.tcsh vmsreadme.txt termcap.vms snames.h host.defs \ + gethost.c tcsh.man2html configure.ac configure config.h.in \ aclocal.m4 VHSRCS=${PVSRCS} ${AVSRCS} Modified: stable/11/contrib/tcsh/Makefile.vms ============================================================================== --- stable/11/contrib/tcsh/Makefile.vms Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/Makefile.vms Wed Oct 30 18:21:58 2019 (r354195) @@ -1,5 +1,3 @@ -# $tcsh: Makefile.vms,v 1.40 2014/07/07 20:34:58 christos Exp $ -# Makefile.vms 4.3 6/11/83 # # C Shell with process control; VM/UNIX VAX Makefile # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria @@ -295,11 +293,11 @@ TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.vers.${SUF} tc.who.${SUF} PVSRCS= Makefile.std Makefile.vms Makefile.in Makefile.win32 -AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \ +AVSRCS= BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md FAQ \ WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ - README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \ - host.defs gethost.c tcsh.man2html configure.ac aclocal.m4 + complete.tcsh vmsreadme.txt termcap.vms snames.h host.defs \ + gethost.c tcsh.man2html configure.ac aclocal.m4 VHSRCS=${PVSRCS} ${AVSRCS} Modified: stable/11/contrib/tcsh/Ported ============================================================================== --- stable/11/contrib/tcsh/Ported Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/Ported Wed Oct 30 18:21:58 2019 (r354195) @@ -338,7 +338,7 @@ CFLAGS : normal LIBES : -ltermcap OS : bsd 4.3reno CONFIG : bsdreno -NOTES : ttyname() is buggy. calls closedir() twice. See README +NOTES : ttyname() is buggy. calls closedir() twice. See BUILDING ENVIRON : n/a VERSION : 6.00.04 Added: stable/11/contrib/tcsh/README.md ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/tcsh/README.md Wed Oct 30 18:21:58 2019 (r354195) @@ -0,0 +1,26 @@ +# TCSH + +*C shell with file name completion and command line editing* + +The Tcsh source code is available on GitHub as a read-only repo +mirror at: + +> http://github.com/tcsh-org/tcsh + +Instructions for compiling Tcsh can be found in [BUILDING]. + +PLEASE file any bug reports, fixes, and code for new features at: + +> https://bugs.astron.com/ + +Comments, questions, etc. (even flames) are welcome via email to +the tcsh mailing list: + +> tcsh@astron.com +> https://mailman.astron.com/mailman/listinfo/tcsh + +[![Build Status][status]][travis] + +[BUILDING]: BUILDING +[status]: https://travis-ci.org/tcsh-org/tcsh.svg?branch=master +[travis]: https://travis-ci.org/tcsh-org/tcsh Modified: stable/11/contrib/tcsh/complete.tcsh ============================================================================== --- stable/11/contrib/tcsh/complete.tcsh Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/complete.tcsh Wed Oct 30 18:21:58 2019 (r354195) @@ -1,5 +1,4 @@ # -# $tcsh: complete.tcsh,v 1.56 2015/07/03 16:52:47 christos Exp $ # example file using the new completion code # # Debian GNU/Linux Modified: stable/11/contrib/tcsh/config_f.h ============================================================================== --- stable/11/contrib/tcsh/config_f.h Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/config_f.h Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/config_f.h,v 3.52 2016/04/16 15:44:18 christos Exp $ */ /* * config_f.h -- configure various defines for tcsh * @@ -176,20 +175,6 @@ * FILEC support for old style file completion */ #define FILEC - -/* - * RCSID This defines if we want rcs strings in the binary or not - * - */ -#if !defined(lint) && !defined(SABER) && !defined(__CLCC__) -# ifndef __GNUC__ -# define RCSID(id) static char *rcsid = (id); -# else -# define RCSID(id) static const char rcsid[] __attribute__((__used__)) = (id); -# endif /* !__GNUC__ */ -#else -# define RCSID(id) /* Nothing */ -#endif /* !lint && !SABER */ /* Consistency checks */ #ifdef WIDE_STRINGS Modified: stable/11/contrib/tcsh/configure ============================================================================== --- stable/11/contrib/tcsh/configure Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/configure Wed Oct 30 18:21:58 2019 (r354195) @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for tcsh 6.20.00. +# Generated by GNU Autoconf 2.69 for tcsh 6.21.00. # -# Report bugs to . +# Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -267,10 +267,10 @@ fi $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: http://bugs.gw.com/ about your system, including any -$0: error possibly output before this message. Then install -$0: a modern shell, or manually run the script under such a -$0: shell if you do have one." +$0: https://bugs.astron.com/ about your system, including +$0: any error possibly output before this message. Then +$0: install a modern shell, or manually run the script +$0: under such a shell if you do have one." fi exit 1 fi @@ -580,9 +580,9 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tcsh' PACKAGE_TARNAME='tcsh' -PACKAGE_VERSION='6.20.00' -PACKAGE_STRING='tcsh 6.20.00' -PACKAGE_BUGREPORT='http://bugs.gw.com/' +PACKAGE_VERSION='6.21.00' +PACKAGE_STRING='tcsh 6.21.00' +PACKAGE_BUGREPORT='https://bugs.astron.com/' PACKAGE_URL='' ac_unique_file="tc.vers.c" @@ -1250,7 +1250,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures tcsh 6.20.00 to adapt to many kinds of systems. +\`configure' configures tcsh 6.21.00 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1315,7 +1315,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tcsh 6.20.00:";; + short | recursive ) echo "Configuration of tcsh 6.21.00:";; esac cat <<\_ACEOF @@ -1348,7 +1348,7 @@ Some influential environment variables: Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to . +Report bugs to . _ACEOF ac_status=$? fi @@ -1411,7 +1411,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -tcsh configure 6.20.00 +tcsh configure 6.21.00 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1658,9 +1658,9 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf docume $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ---------------------------------- ## -## Report this to http://bugs.gw.com/ ## -## ---------------------------------- ##" +( $as_echo "## --------------------------------------- ## +## Report this to https://bugs.astron.com/ ## +## --------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac @@ -2174,7 +2174,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by tcsh $as_me 6.20.00, which was +It was created by tcsh $as_me 6.21.00, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -4284,7 +4284,7 @@ return tgetent (); return 0; } _ACEOF -for ac_lib in '' termlib termcap curses ncurses; do +for ac_lib in '' termlib tinfo termcap curses ncurses; do if test -z "$ac_lib"; then ac_res="none required" else @@ -7350,7 +7350,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by tcsh $as_me 6.20.00, which was +This file was extended by tcsh $as_me 6.21.00, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7410,13 +7410,13 @@ $config_headers Configuration commands: $config_commands -Report bugs to ." +Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -tcsh config.status 6.20.00 +tcsh config.status 6.21.00 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/11/contrib/tcsh/dotlock.c ============================================================================== --- stable/11/contrib/tcsh/dotlock.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/dotlock.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,4 @@ -/* $NetBSD: dotlock.c,v 1.11 2009/10/21 01:07:46 snj Exp $ */ +/* NetBSD: dotlock.c,v 1.11 2009/10/21 01:07:46 snj Exp */ /* * Copyright (c) 1996 Christos Zoulas. All rights reserved. @@ -24,7 +24,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "sh.h" -RCSID("$tcsh: dotlock.c,v 3.4 2015/11/03 21:04:13 christos Exp $") #include #ifndef O_SYNC Modified: stable/11/contrib/tcsh/ed.chared.c ============================================================================== --- stable/11/contrib/tcsh/ed.chared.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.chared.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.chared.c,v 3.103 2015/08/19 14:29:55 christos Exp $ */ /* * ed.chared.c: Character editing functions. */ @@ -71,9 +70,6 @@ */ #include "sh.h" - -RCSID("$tcsh: ed.chared.c,v 3.103 2015/08/19 14:29:55 christos Exp $") - #include "ed.h" #include "tw.h" #include "ed.defns.h" @@ -1105,8 +1101,7 @@ e_inc_search(int dir) if (GetNextChar(&ch) != 1) return(e_send_eof(0)); - switch (ch > NT_NUM_KEYS - ? F_INSERT : CurrentKeyMap[(unsigned char) ch]) { + switch (GetCmdChar(ch)) { case F_INSERT: case F_DIGIT: case F_MAGIC_SPACE: Modified: stable/11/contrib/tcsh/ed.decls.h ============================================================================== --- stable/11/contrib/tcsh/ed.decls.h Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.decls.h Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.decls.h,v 3.46 2015/08/19 14:29:55 christos Exp $ */ /* * ed.decls.h: Editor external definitions */ @@ -250,6 +249,7 @@ extern CCRETVAL e_newline_down_hist (Char); * ed.inputl.c */ extern int Inputl (void); +extern int GetCmdChar (Char); extern int GetNextChar (Char *); extern void UngetNextChar (Char); extern void PushMacro (Char *); Modified: stable/11/contrib/tcsh/ed.defns.c ============================================================================== --- stable/11/contrib/tcsh/ed.defns.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.defns.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.defns.c,v 3.51 2016/02/14 15:44:18 christos Exp $ */ /* * ed.defns.c: Editor function definitions and initialization */ @@ -31,9 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.defns.c,v 3.51 2016/02/14 15:44:18 christos Exp $") - #include "ed.h" static void ed_InitMetaBindings (void); @@ -265,26 +261,22 @@ PFCmd CcFuncTbl[] = { /* table of available command #define F_COMMAND_NORM 111 e_dabbrev_expand, #define F_DABBREV_EXPAND 112 - e_copy_to_clipboard, -#define F_COPY_CLIP 113 - e_paste_from_clipboard, -#define F_PASTE_CLIP 114 e_dosify_next, -#define F_DOSIFY_NEXT 115 +#define F_DOSIFY_NEXT 113 e_dosify_prev, -#define F_DOSIFY_PREV 116 +#define F_DOSIFY_PREV 114 e_page_up, -#define F_PAGE_UP 117 +#define F_PAGE_UP 115 e_page_down, -#define F_PAGE_DOWN 118 +#define F_PAGE_DOWN 116 e_yank_pop, -#define F_YANK_POP 119 +#define F_YANK_POP 117 e_newline_hold, -#define F_NEWLINE_HOLD 120 +#define F_NEWLINE_HOLD 118 e_newline_down_hist, -#define F_NEWLINE_DOWN_HIST 121 +#define F_NEWLINE_DOWN_HIST 119 0 /* DUMMY VALUE */ -#define F_NUM_FNS 122 +#define F_NUM_FNS 120 }; @@ -1752,18 +1744,6 @@ editinit(void) f->func = F_YANK_POP; f->desc = CSAVS(3, 115, "Replace just-yanked text with yank from earlier kill"); - - f++; - f->name = "e_copy_to_clipboard"; - f->func = F_COPY_CLIP; - f->desc = CSAVS(3, 116, - "(WIN32 only) Copy cut buffer to system clipboard"); - - f++; - f->name = "e_paste_from_clipboard"; - f->func = F_PASTE_CLIP; - f->desc = CSAVS(3, 117, - "(WIN32 only) Paste clipboard buffer at cursor position"); f++; f->name = "e_dosify_next"; Modified: stable/11/contrib/tcsh/ed.h ============================================================================== --- stable/11/contrib/tcsh/ed.h Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.h Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.h,v 3.50 2007/07/05 14:13:06 christos Exp $ */ /* * ed.h: Editor declarations and globals */ Modified: stable/11/contrib/tcsh/ed.init.c ============================================================================== --- stable/11/contrib/tcsh/ed.init.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.init.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.init.c,v 3.60 2006/08/24 20:56:31 christos Exp $ */ /* * ed.init.c: Editor initializations */ @@ -31,9 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.init.c,v 3.60 2006/08/24 20:56:31 christos Exp $") - #include "ed.h" #include "tc.h" #include "ed.defns.h" Modified: stable/11/contrib/tcsh/ed.inputl.c ============================================================================== --- stable/11/contrib/tcsh/ed.inputl.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.inputl.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.inputl.c,v 3.73 2012/10/19 15:23:32 christos Exp $ */ /* * ed.inputl.c: Input line handling. */ @@ -31,9 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.inputl.c,v 3.73 2012/10/19 15:23:32 christos Exp $") - #include "ed.h" #include "ed.defns.h" /* for the function names */ #include "tw.h" /* for twenex stuff */ @@ -668,6 +664,17 @@ RunCommand(Char *str) Refresh(); } +int +GetCmdChar(Char ch) +{ +#ifndef WINNT_NATIVE // We use more than 256 for various extended keys + wint_t c = ch & CHAR; +#else + wint_t c = ch; +#endif + return c < NT_NUM_KEYS ? CurrentKeyMap[c] : F_INSERT; +} + static int GetNextCommand(KEYCMD *cmdnum, Char *ch) { @@ -696,17 +703,8 @@ GetNextCommand(KEYCMD *cmdnum, Char *ch) MetaNext = 0; *ch |= META; } - /* XXX: This needs to be fixed so that we don't just truncate - * the character, we unquote it. - */ - if (*ch < NT_NUM_KEYS) - cmd = CurrentKeyMap[*ch]; - else -#ifdef WINNT_NATIVE - cmd = CurrentKeyMap[(unsigned char) *ch]; -#else - cmd = F_INSERT; -#endif + + cmd = GetCmdChar(*ch); if (cmd == F_XKEY) { XmapVal val; CStr cstr; @@ -800,13 +798,18 @@ GetNextChar(Char *cp) return -1; } } - cbp++; - if (normal_mbtowc(cp, cbuf, cbp) == -1) { - reset_mbtowc(); - if (cbp < MB_CUR_MAX) - continue; /* Maybe a partial character */ - /* And drop the following bytes, if any */ - *cp = (unsigned char)*cbuf | INVALID_BYTE; + if (cbp == 0 /* && *cbuf < NT_NUM_KEYS */ + && CurrentKeyMap[(unsigned char)*cbuf] == F_XKEY) { + *cp = (unsigned char)*cbuf; + } else { + cbp++; + if (normal_mbtowc(cp, cbuf, cbp) == -1) { + reset_mbtowc(); + if (cbp < MB_CUR_MAX) + continue; /* Maybe a partial character */ + /* And drop the following bytes, if any */ + *cp = (unsigned char)*cbuf | INVALID_BYTE; + } } break; } Modified: stable/11/contrib/tcsh/ed.refresh.c ============================================================================== --- stable/11/contrib/tcsh/ed.refresh.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.refresh.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.refresh.c,v 3.51 2015/06/06 21:19:07 christos Exp $ */ /* * ed.refresh.c: Lower level screen refreshing functions */ @@ -31,9 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.refresh.c,v 3.51 2015/06/06 21:19:07 christos Exp $") - #include "ed.h" /* #define DEBUG_UPDATE */ /* #define DEBUG_REFRESH */ Modified: stable/11/contrib/tcsh/ed.screen.c ============================================================================== --- stable/11/contrib/tcsh/ed.screen.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.screen.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.screen.c,v 3.82 2016/11/24 15:04:14 christos Exp $ */ /* * ed.screen.c: Editor/termcap-curses interface */ @@ -31,9 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.screen.c,v 3.82 2016/11/24 15:04:14 christos Exp $") - #include "ed.h" #include "tc.h" #include "ed.defns.h" Modified: stable/11/contrib/tcsh/ed.term.c ============================================================================== --- stable/11/contrib/tcsh/ed.term.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.term.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.term.c,v 1.38 2011/02/25 23:58:34 christos Exp $ */ /* * ed.term.c: Low level terminal interface */ @@ -32,8 +31,6 @@ */ #include "sh.h" #ifndef WINNT_NATIVE - -RCSID("$tcsh: ed.term.c,v 1.38 2011/02/25 23:58:34 christos Exp $") #include #include "ed.h" Modified: stable/11/contrib/tcsh/ed.term.h ============================================================================== --- stable/11/contrib/tcsh/ed.term.h Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.term.h Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.term.h,v 1.19 2015/03/25 19:53:16 christos Exp $ */ /* * ed.term.h: Local terminal header */ Modified: stable/11/contrib/tcsh/ed.xmap.c ============================================================================== --- stable/11/contrib/tcsh/ed.xmap.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.xmap.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.xmap.c,v 3.38 2015/06/06 21:19:07 christos Exp $ */ /* * ed.xmap.c: This module contains the procedures for maintaining * the extended-key map. @@ -87,9 +86,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.xmap.c,v 3.38 2015/06/06 21:19:07 christos Exp $") - #include "ed.h" #include "ed.defns.h" Modified: stable/11/contrib/tcsh/eight-bit.me ============================================================================== --- stable/11/contrib/tcsh/eight-bit.me Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/eight-bit.me Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -.\" $tcsh: eight-bit.me,v 3.2 2006/03/02 18:46:44 christos Exp $ How to use 8 bit characters by Johan Widen Modified: stable/11/contrib/tcsh/gethost.c ============================================================================== --- stable/11/contrib/tcsh/gethost.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/gethost.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/gethost.c,v 1.19 2014/03/09 00:11:54 christos Exp $ */ /* * gethost.c: Create version file from prototype */ @@ -31,8 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: gethost.c,v 1.19 2014/03/09 00:11:54 christos Exp $") #ifdef SCO # define perror __perror Modified: stable/11/contrib/tcsh/glob.3 ============================================================================== --- stable/11/contrib/tcsh/glob.3 Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/glob.3 Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,4 @@ -.\" $NetBSD: glob.3,v 1.17 2001/03/16 21:09:05 christos Exp $ +.\" NetBSD: glob.3,v 1.17 2001/03/16 21:09:05 christos Exp .\" .\" Copyright (c) 1989, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. Modified: stable/11/contrib/tcsh/glob.c ============================================================================== --- stable/11/contrib/tcsh/glob.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/glob.c Wed Oct 30 18:21:58 2019 (r354195) @@ -100,7 +100,7 @@ static int Lstat (const char *, struct stat *); static int Stat (const char *, struct stat *sb); static Char *Strchr (Char *, int); #ifdef DEBUG -static void qprintf (const Char *); +static void qprintf (const char *, const Char *); #endif #define DOLLAR '$' @@ -256,19 +256,20 @@ Strchr(Char *str, int ch) #ifdef DEBUG static void -qprintf(const Char *s) +qprintf(const char *pre, const Char *s) { const Char *p; - + + xprintf("%s", pre); for (p = s; *p; p++) - printf("%c", *p & 0xff); - printf("\n"); + xprintf("%c", *p & 0xff); + xprintf("\n%s", pre); for (p = s; *p; p++) - printf("%c", *p & M_PROTECT ? '"' : ' '); - printf("\n"); + xprintf("%c", *p & M_PROTECT ? '"' : ' '); + xprintf("\n%s", pre); for (p = s; *p; p++) - printf("%c", *p & M_META ? '_' : ' '); - printf("\n"); + xprintf("%c", *p & M_META ? '_' : ' '); + xprintf("\n"); } #endif /* DEBUG */ @@ -412,7 +413,7 @@ glob(const char *pattern, int flags, int (*errfunc) (c } *bufnext = EOS; #ifdef DEBUG - qprintf(patbuf); + qprintf("patbuf=", patbuf); #endif if ((err = glob1(patbuf, pglob, no_match)) != 0) { @@ -693,72 +694,94 @@ globextend(const char *path, glob_t *pglob) } /* - * pattern matching function for filenames. Each occurrence of the * - * pattern causes a recursion level. + * pattern matching function for filenames. */ static int match(const char *name, const Char *pat, const Char *patend, int m_not) { int ok, negate_range; + const Char *patNext; + const char *nameNext, *nameStart, *nameEnd; Char c; - while (pat < patend) { - size_t lwk; - __Char wc, wk; + patNext = pat; + nameStart = nameNext = name; + nameEnd = NULL; + while (pat < patend || *name) { + size_t lwk, pwk; + __Char wc, wk, wc1; + c = *pat; /* Only for M_MASK bits */ - pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX); + if (*name == EOS) + nameEnd = name; + + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); lwk = one_mbtowc(&wk, name, MB_LEN_MAX); switch (c & M_MASK) { case M_ALL: - while (pat < patend && (*pat & M_MASK) == M_ALL) /* eat consecutive '*' */ - pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX); - if (pat == patend) - return (1); - while (!match(name, pat, patend, m_not)) { - if (*name == EOS) - return (0); - name += lwk; - lwk = one_mbtowc(&wk, name, MB_LEN_MAX); + while ((*(pat + pwk) & M_MASK) == M_ALL) { + pat += pwk; + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); } - return (1); + patNext = pat; + nameNext = name + lwk; + pat += pwk; + continue; case M_ONE: if (*name == EOS) - return (0); + break; name += lwk; - break; + pat += pwk; + continue; case M_SET: ok = 0; if (*name == EOS) - return (0); + break; + pat += pwk; + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); name += lwk; - if ((negate_range = ((*pat & M_MASK) == m_not)) != 0) - ++pat; + if ((negate_range = ((*pat & M_MASK) == m_not)) != 0) { + pat += pwk; + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); + } + wc1 = wc; while ((*pat & M_MASK) != M_END) { - pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX); if ((*pat & M_MASK) == M_RNG) { __Char wc2; - pat++; - pat += One_Char_mbtowc(&wc2, pat, MB_LEN_MAX); - if (globcharcoll(wc, wk, 0) <= 0 && + pat += pwk; + pwk = One_Char_mbtowc(&wc2, pat, MB_LEN_MAX); + if (globcharcoll(wc1, wk, 0) <= 0 && globcharcoll(wk, wc2, 0) <= 0) ok = 1; } else if (wc == wk) ok = 1; + pat += pwk; + wc1 = wc; + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); } - pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX); + pat += pwk; + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); if (ok == negate_range) - return (0); - break; + break; + continue; default: if (*name == EOS || samecase(wk) != samecase(wc)) - return (0); + break; name += lwk; - break; + pat += pwk; + continue; } + if (nameNext != nameStart + && (nameEnd == NULL || nameNext <= nameEnd)) { + pat = patNext; + name = nameNext; + continue; + } + return 0; } - return (*name == EOS); + return 1; } /* free allocated data belonging to a glob_t structure */ Modified: stable/11/contrib/tcsh/glob.h ============================================================================== --- stable/11/contrib/tcsh/glob.h Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/glob.h Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,4 @@ -/* $NetBSD: glob.h,v 1.13 2001/03/16 21:02:42 christos Exp $ */ +/* NetBSD: glob.h,v 1.13 2001/03/16 21:02:42 christos Exp */ /* * Copyright (c) 1989, 1993 Modified: stable/11/contrib/tcsh/host.defs ============================================================================== --- stable/11/contrib/tcsh/host.defs Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/host.defs Wed Oct 30 18:21:58 2019 (r354195) @@ -1,5 +1,4 @@ newcode : -/* $Header: /p/tcsh/cvsroot/tcsh/host.defs,v 1.61 2015/05/26 18:56:19 christos Exp $ */ /* * host.defs: Hosttype/Machtype etc. */ @@ -33,8 +32,6 @@ newcode : */ #include "sh.h" -RCSID("$tcsh: host.defs,v 1.61 2015/05/26 18:56:19 christos Exp $") - endcode : macro : M_mips64el : (defined(mips64) && defined(MIPSEL)) @@ -857,9 +854,9 @@ enddef : newdef : defined(APPLE) && defined(MACH) comment : OS X vendor : : "apple" -hosttype: defined(i386) : "intel-pc" +hosttype: defined(i386) : "intel-mac" hosttype: defined(ppc) : "powermac" -hosttype: defined(M_amd64) : "amd" +hosttype: defined(M_amd64) : "intel-mac" ostype : : "darwin" machtype: defined(i386) : "i386" machtype: defined(M_amd64) : "x86_64" Modified: stable/11/contrib/tcsh/imake.config ============================================================================== --- stable/11/contrib/tcsh/imake.config Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/imake.config Wed Oct 30 18:21:58 2019 (r354195) @@ -1,6 +1,4 @@ /* - * $tcsh: imake.config,v 1.5 2006/03/02 18:46:44 christos Exp $ - * * config.Imakefile for for tcsh 6.00 * Marc Horowitz, MIT SIPB */ Modified: stable/11/contrib/tcsh/ma.setp.c ============================================================================== --- stable/11/contrib/tcsh/ma.setp.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ma.setp.c Wed Oct 30 18:21:58 2019 (r354195) @@ -82,7 +82,6 @@ ********************************************************************** */ #include "sh.h" -RCSID("$tcsh: ma.setp.c,v 1.19 2007/11/20 20:03:51 christos Exp $") #ifdef MACH Modified: stable/11/contrib/tcsh/mi.termios.c ============================================================================== --- stable/11/contrib/tcsh/mi.termios.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/mi.termios.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,10 +1,8 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/mi.termios.c,v 1.5 2006/03/02 18:46:44 christos Exp $ */ /* termios.c - fake termios interface using sgtty interface * by Magnus Doell and Bruce Evans. * */ #include "sh.h" -RCSID("$tcsh: mi.termios.c,v 1.5 2006/03/02 18:46:44 christos Exp $") #if defined(_MINIX) && !defined(_MINIX_VMD) Modified: stable/11/contrib/tcsh/mi.varargs.h ============================================================================== --- stable/11/contrib/tcsh/mi.varargs.h Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/mi.varargs.h Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/mi.varargs.h,v 1.2 1996/04/26 19:18:39 christos Exp $ */ /* * mi.varargs.h: Correct varargs for minix */ Modified: stable/11/contrib/tcsh/nls/C/set1 ============================================================================== --- stable/11/contrib/tcsh/nls/C/set1 Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/nls/C/set1 Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -$ $tcsh: set1,v 1.7 2015/05/26 17:38:25 christos Exp $ $ Error messages $set 1 1 Syntax Error Modified: stable/11/contrib/tcsh/nls/C/set10 ============================================================================== --- stable/11/contrib/tcsh/nls/C/set10 Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/nls/C/set10 Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -$ $tcsh: set10,v 1.3 2006/03/02 18:46:45 christos Exp $ $ ma.setp.c $set 10 1 setpath: invalid command '%s'.\n Modified: stable/11/contrib/tcsh/nls/C/set11 ============================================================================== --- stable/11/contrib/tcsh/nls/C/set11 Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/nls/C/set11 Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -$ $tcsh: set11,v 1.4 2006/03/02 18:46:45 christos Exp $ $ sh.c $set 11 1 Warning: no access to tty (%s).\n Modified: stable/11/contrib/tcsh/nls/C/set12 ============================================================================== --- stable/11/contrib/tcsh/nls/C/set12 Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/nls/C/set12 Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -$ $tcsh: set12,v 1.4 2006/03/02 18:46:45 christos Exp $ $ sh.dir.c $set 12 1 %s: Trying to start from "%s"\n Modified: stable/11/contrib/tcsh/nls/C/set13 ============================================================================== --- stable/11/contrib/tcsh/nls/C/set13 Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/nls/C/set13 Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -$ $tcsh: set13,v 1.3 2006/03/02 18:46:45 christos Exp $ $ sh.exec.c $set 13 1 hash=%-4d dir=%-2d prog=%s\n Modified: stable/11/contrib/tcsh/nls/C/set14 ============================================================================== --- stable/11/contrib/tcsh/nls/C/set14 Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/nls/C/set14 Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -$ $tcsh: set14,v 1.4 2006/03/02 18:46:45 christos Exp $ $ sh.file.c $set 14 1 \nYikes!! Too many %s!!\n Modified: stable/11/contrib/tcsh/nls/C/set15 ============================================================================== --- stable/11/contrib/tcsh/nls/C/set15 Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/nls/C/set15 Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -$ $tcsh: set15,v 1.4 2006/03/02 18:46:45 christos Exp $ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Oct 30 18:36:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B9F715D4EE; Wed, 30 Oct 2019 18:36: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473HH56rbfz4NTp; Wed, 30 Oct 2019 18:36:49 +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 CE9A1E7C8; Wed, 30 Oct 2019 18:36:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9UIans9006684; Wed, 30 Oct 2019 18:36:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UIan0b006682; Wed, 30 Oct 2019 18:36:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910301836.x9UIan0b006682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 30 Oct 2019 18:36:49 +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: r354196 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 354196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 18:36:50 -0000 Author: markj Date: Wed Oct 30 18:36:49 2019 New Revision: 354196 URL: https://svnweb.freebsd.org/changeset/base/354196 Log: MFC r353893: Fix thread0 kernel stack initialization on riscv. Modified: stable/12/sys/riscv/riscv/locore.S stable/12/sys/riscv/riscv/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/locore.S ============================================================================== --- stable/12/sys/riscv/riscv/locore.S Wed Oct 30 18:21:58 2019 (r354195) +++ stable/12/sys/riscv/riscv/locore.S Wed Oct 30 18:36:49 2019 (r354196) @@ -209,7 +209,7 @@ va: sd t0, 0(sp) /* kern_l1pt */ sd s9, 8(sp) /* kern_phys */ - la t0, initstack_end + la t0, initstack sd t0, 16(sp) /* kern_stack */ li t0, (VM_MAX_KERNEL_ADDRESS - 2 * L2_SIZE) Modified: stable/12/sys/riscv/riscv/machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/machdep.c Wed Oct 30 18:21:58 2019 (r354195) +++ stable/12/sys/riscv/riscv/machdep.c Wed Oct 30 18:36:49 2019 (r354196) @@ -123,7 +123,6 @@ uint32_t boot_hart; /* The hart we booted on. */ cpuset_t all_harts; extern int *end; -extern int *initstack_end; static void cpu_startup(void *dummy) @@ -656,7 +655,9 @@ init_proc0(vm_offset_t kstack) proc_linkup0(&proc0, &thread0); thread0.td_kstack = kstack; - thread0.td_pcb = (struct pcb *)(thread0.td_kstack) - 1; + thread0.td_kstack_pages = KSTACK_PAGES; + thread0.td_pcb = (struct pcb *)(thread0.td_kstack + + thread0.td_kstack_pages * PAGE_SIZE) - 1; thread0.td_pcb->pcb_fpflags = 0; thread0.td_frame = &proc0_tf; pcpup->pc_curpcb = thread0.td_pcb; From owner-svn-src-all@freebsd.org Wed Oct 30 18:38:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3693115D5F1; Wed, 30 Oct 2019 18:38:45 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473HKK0jnTz4Nkr; Wed, 30 Oct 2019 18:38: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 EFD4EE7CE; Wed, 30 Oct 2019 18:38:44 +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 x9UIcicN006957; Wed, 30 Oct 2019 18:38:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UIcicf006956; Wed, 30 Oct 2019 18:38:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910301838.x9UIcicf006956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 30 Oct 2019 18:38:44 +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: r354197 - stable/12/sys/arm/arm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/arm/arm X-SVN-Commit-Revision: 354197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 18:38:45 -0000 Author: markj Date: Wed Oct 30 18:38:44 2019 New Revision: 354197 URL: https://svnweb.freebsd.org/changeset/base/354197 Log: MFC r353894: Initialize thread0.td_kstack_pages on arm. Modified: stable/12/sys/arm/arm/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/arm/machdep.c ============================================================================== --- stable/12/sys/arm/arm/machdep.c Wed Oct 30 18:36:49 2019 (r354196) +++ stable/12/sys/arm/arm/machdep.c Wed Oct 30 18:38:44 2019 (r354197) @@ -770,8 +770,9 @@ init_proc0(vm_offset_t kstack) { proc_linkup0(&proc0, &thread0); thread0.td_kstack = kstack; - thread0.td_pcb = (struct pcb *) - (thread0.td_kstack + kstack_pages * PAGE_SIZE) - 1; + thread0.td_kstack_pages = kstack_pages; + thread0.td_pcb = (struct pcb *)(thread0.td_kstack + + thread0.td_kstack_pages * PAGE_SIZE) - 1; thread0.td_pcb->pcb_flags = 0; thread0.td_pcb->pcb_vfpcpu = -1; thread0.td_pcb->pcb_vfpstate.fpscr = VFPSCR_DN; From owner-svn-src-all@freebsd.org Wed Oct 30 18:39:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B508715D680; Wed, 30 Oct 2019 18:39:08 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473HKm4H5Pz4Nry; Wed, 30 Oct 2019 18:39:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76FF0E7CF; Wed, 30 Oct 2019 18:39:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9UId8ha007060; Wed, 30 Oct 2019 18:39:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UId8m7007059; Wed, 30 Oct 2019 18:39:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910301839.x9UId8m7007059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 30 Oct 2019 18:39: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: r354198 - stable/12/sys/arm64/arm64 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/arm64/arm64 X-SVN-Commit-Revision: 354198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 18:39:08 -0000 Author: markj Date: Wed Oct 30 18:39:07 2019 New Revision: 354198 URL: https://svnweb.freebsd.org/changeset/base/354198 Log: MFC r353895: Apply r353893 to arm64. Modified: stable/12/sys/arm64/arm64/locore.S stable/12/sys/arm64/arm64/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/arm64/locore.S ============================================================================== --- stable/12/sys/arm64/arm64/locore.S Wed Oct 30 18:38:44 2019 (r354197) +++ stable/12/sys/arm64/arm64/locore.S Wed Oct 30 18:39:07 2019 (r354198) @@ -132,6 +132,7 @@ virtdone: str x1, [x0] /* modulep */ str x26, [x0, 8] /* kern_l1pt */ str x29, [x0, 16] /* kern_delta */ + adr x25, initstack str x25, [x0, 24] /* kern_stack */ str x24, [x0, 32] /* kern_l0pt */ Modified: stable/12/sys/arm64/arm64/machdep.c ============================================================================== --- stable/12/sys/arm64/arm64/machdep.c Wed Oct 30 18:38:44 2019 (r354197) +++ stable/12/sys/arm64/arm64/machdep.c Wed Oct 30 18:39:07 2019 (r354198) @@ -702,7 +702,9 @@ init_proc0(vm_offset_t kstack) proc_linkup0(&proc0, &thread0); thread0.td_kstack = kstack; - thread0.td_pcb = (struct pcb *)(thread0.td_kstack) - 1; + thread0.td_kstack_pages = KSTACK_PAGES; + thread0.td_pcb = (struct pcb *)(thread0.td_kstack + + thread0.td_kstack_pages * KSTACK_PAGES) - 1; thread0.td_pcb->pcb_fpflags = 0; thread0.td_pcb->pcb_fpusaved = &thread0.td_pcb->pcb_fpustate; thread0.td_pcb->pcb_vfpcpu = UINT_MAX; From owner-svn-src-all@freebsd.org Wed Oct 30 18:39:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11ACD15D717; Wed, 30 Oct 2019 18:39: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473HLK6kbVz4P0L; Wed, 30 Oct 2019 18:39:37 +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 CAB63E7D1; Wed, 30 Oct 2019 18:39:37 +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 x9UIdbZ2007251; Wed, 30 Oct 2019 18:39:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UIdb7D007250; Wed, 30 Oct 2019 18:39:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910301839.x9UIdb7D007250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 30 Oct 2019 18:39: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: r354199 - 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: 354199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 18:39:38 -0000 Author: markj Date: Wed Oct 30 18:39:37 2019 New Revision: 354199 URL: https://svnweb.freebsd.org/changeset/base/354199 Log: MFC r353957: Check for bogus_page in vnode_pager_generic_getpages_done(). Modified: stable/12/sys/vm/vnode_pager.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vnode_pager.c ============================================================================== --- stable/12/sys/vm/vnode_pager.c Wed Oct 30 18:39:07 2019 (r354198) +++ stable/12/sys/vm/vnode_pager.c Wed Oct 30 18:39:37 2019 (r354199) @@ -1130,6 +1130,8 @@ vnode_pager_generic_getpages_done(struct buf *bp) nextoff = tfoff + PAGE_SIZE; mt = bp->b_pages[i]; + if (mt == bogus_page) + continue; if (nextoff <= object->un_pager.vnp.vnp_size) { /* From owner-svn-src-all@freebsd.org Wed Oct 30 19:36:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7745E15EF9E; Wed, 30 Oct 2019 19:36:20 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473Jbm1Rvxz4SPr; Wed, 30 Oct 2019 19:36:20 +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 103EFF2D0; Wed, 30 Oct 2019 19:36: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 x9UJaJhU042879; Wed, 30 Oct 2019 19:36:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UJaJmC042878; Wed, 30 Oct 2019 19:36:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910301936.x9UJaJmC042878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 30 Oct 2019 19:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r354200 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: markj X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 354200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 19:36:20 -0000 Author: markj Date: Wed Oct 30 19:36:19 2019 New Revision: 354200 URL: https://svnweb.freebsd.org/changeset/base/354200 Log: Add myself to sizelimit.conf before importing iwm(4) firmware. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Wed Oct 30 18:39:37 2019 (r354199) +++ svnadmin/conf/sizelimit.conf Wed Oct 30 19:36:19 2019 (r354200) @@ -22,6 +22,7 @@ imp jb jeff jkim +markj mm np obrien From owner-svn-src-all@freebsd.org Wed Oct 30 19:36:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 433FC15F023; Wed, 30 Oct 2019 19:36:51 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473JcM13Qtz4SX9; Wed, 30 Oct 2019 19:36:51 +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 07D3EF2D1; Wed, 30 Oct 2019 19:36:51 +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 x9UJapYI042942; Wed, 30 Oct 2019 19:36:51 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UJaohR042940; Wed, 30 Oct 2019 19:36:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910301936.x9UJaohR042940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 30 Oct 2019 19:36:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354201 - in head/sys: contrib/dev/iwm modules/iwmfw modules/iwmfw/iwm9000fw modules/iwmfw/iwm9260fw X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: contrib/dev/iwm modules/iwmfw modules/iwmfw/iwm9000fw modules/iwmfw/iwm9260fw X-SVN-Commit-Revision: 354201 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 19:36:51 -0000 Author: markj Date: Wed Oct 30 19:36:50 2019 New Revision: 354201 URL: https://svnweb.freebsd.org/changeset/base/354201 Log: Add firmware images for Intel 9000-series wifi chips. This is in preparation for adding the corresponding support to iwm(4). Version 46 is the latest but contains unrecognized TLVs, so use version 43 for now. Obtained from: linux-firmware MFC after: 1 month Sponsored by: The FreeBSD Foundation Added: head/sys/contrib/dev/iwm/iwm-9000-43.fw.uu head/sys/contrib/dev/iwm/iwm-9260-43.fw.uu head/sys/modules/iwmfw/iwm9000fw/ head/sys/modules/iwmfw/iwm9000fw/Makefile (contents, props changed) head/sys/modules/iwmfw/iwm9260fw/ head/sys/modules/iwmfw/iwm9260fw/Makefile (contents, props changed) Modified: head/sys/modules/iwmfw/Makefile Added: head/sys/contrib/dev/iwm/iwm-9000-43.fw.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/iwm/iwm-9000-43.fw.uu Wed Oct 30 19:36:50 2019 (r354201) @@ -0,0 +1,56527 @@ +begin 644 iwm-9000-43.fw +M`````$E73`IR96QE87-E+V-O````"`````````!_$^^='@````@````!```` +M(C(``!X````(`````@```-MND0$>````"`````,`````````'````!`````` +M````````````````````&P````0````"````(`````0`````8`,`,P````P` +M``````````"```"``0`S````#`````$``````(@``(```#,````,`````@`` +M````0```\`@`-P```"````"`W(``)'I&`)CF@``8'8``I'*````````````` +M`````#8````(````Q`"(`+A&1,`#```!W`@```$````!````"@````$````" +M````(````&UA8U]P97)I<&@`````````````````````````````M`$```0` +M````1J``!$:@``A&H``,1J``$$:@`!1&H``81J``($:@`"1&H``X1J``/$:@ +M`$!&H`!$1J``2$:@`%!&H`!41J``6$:@`%Q&H`!@1J``9$:@`'!&H`!T1J`` +M>$:@`'Q&H`"`1J``A$:@`(A&H`",1J``D$:@`)1&H`#`1J``Q$:@`,A&H`#, +M1J``T$:@`-1&H`#81J``W$:@`.!&H`#D1J``Z$:@`.Q&H`#P1J``]$:@`/A& +MH`#\1J```$>@``1'H``,1Z``$$>@`!1'H`!\1Z``@$>@`(1'H`"(1Z``D$>@ +M`)1'H`"81Z``H$>@`*1'H````*``#`"@`!``H``4`*``&`"@`!P`H``@`*`` +M)`"@`"P`H``P`*``-`"@`#P`H``0!*``%`2@`!@$H``@!*``*`2@`#`$H``T +M!*``.`2@`#P$H`!$!*``0`B@`%`(H`!4"*``6`B@``00H``($*``$!"@`!@0 +MH``D$*``+!"@`#`0H``T$*``/!"@`$`0H`!($*``3!"@`%`0H`!8$*``8!"@ +M`&00H`!H$*``;!"@`'`0H`",$*``&!R@`!P"2@`'PDH`"`)*``A"2@`(@DH`",)*``D"2@`)0DH`"8)*``G"2@`*`D +MH`"D)*``J"2@`*PDH`"P)*``R"2@`,PDH```):``!"6@``PEH`!():``3"6@ +M`%`EH`!4):``@"6@`(0EH`"():``C"6@`)`EH`"4):``N"6@`,`EH`#,):`` +MT"6@`/0EH```)J``#":@`$@FH`!,)J``4":@`(`FH`#`)J``Q":@`,@FH`#, +M)J```">@``0GH``()Z``#">@`&`>H`"`(*``B""@`(P@H`"0(*```#"@`!`P +MH``4,*``'#"@`"`PH``D,*``*#"@`"PPH``T,*``.#"@`$`PH`!@,*``9#"@ +M`&@PH`!P,*``@#"@`(0PH`",,*``D#"@`)@PH`"H,*``L#"@`+0PH`"\,*`` +M`#&@``0QH``(,:``##&@`!`QH``4,:``&#&@`!PQH``@,:``)#&@`"@QH``L +M,:```#R@``0\H``(/*``##R@`!`\H``4/*``&#R@`"P\H``T/*``7#R@``!$ +MH``$1*``"$2@``Q$H``01*``%$2@`!A$H``<1*``($2@`"1$H``H1*``+$2@ +M`#!$H``T1*``.$2@`#Q$H`!`1*``1$2@`$A$H`!,1*``4$2@`%1$H`!@1*`` +M9$2@`&A$H`!L1*``<$2@`'1$H`#`1*``Q$2@`,A$H`#,1*``T$2@`-1$H`#8 +M1*``W$2@`.!$H`#D1*``Z$2@`.Q$H```1:``!$6@`!!%H``41:``&$6@`!Q% +MH``@1:``)$6@`"A%H``L1:``,$6@`#1%H``X1:``1$6@`$A%H`!@1:``<$6@ +M`'1%H`!X1:``?$6@`)!%H`"81:``P$6@`,1%H`#(1:``S$6@`-!%H`#41:`` +MV$6@`-Q%H`#@1:``Z$6@`.Q%H`#P1:``E""@`!@LH``<+*``("R@`"0LH``H +M+*``+"R@`#`LH`"(+*``C"R@`)`LH`"4+*``F"R@`)PLH``4+*``#"R@``0L +MH`#$'J``P!Z@`*`>H`"$'J``Y""@`!`@H`!,'*``2!R@`!`LH```+*``""R@ +M`)A&H`"<1J``H$:@`*1&H``(1Z``0$>@`$1'H``$,*``"#"@``PPH`"H1Z`` +M5$>@`%A'H`!<1Z``8$>@`&1'H`!H1Z``;$>@`'!'H`!T1Z``L$>@`+1'H`"X +M1Z``?#"@`*`PH`"L,*``P#"@`,@PH`#,,*``T#"@`-0PH`!01Z``'#R@`"`\ +MH``D/*``*#R@`#`\H``X/*``/#R@`$`\H`!$/*``2#R@`$P\H`!0/*``5#R@ +M`%@\H`!`1:``Y$6@`/1%H`"8):``G"6@`*`EH`"D):``J"6@`*PEH`#$):`` +MR"6@`-0EH`#8):``W"6@`.`EH`#D):``Z"6@`.PEH`#P):```@````,````@ +M````<&AY7W!E&9I9F]S```````````````` +M``````````````````$```````````````@````)````(````')X9FEF;W,` +M`````````````````````````````````0``````````````"0````H````@ +M````=FER='5A;%]M96UO[`$`0````$`````!```` +M``$````````````````````````````````````````````````````````` +M`````````````````````````````````````````````````````````!VW +M:9XK6HS@1UZ7\/'_8U$+D6Y^]83_)\S\S&A<&'%>J.U()@NP@:E3%(C +MF\>"V)P$[>.?B@`#;;ZK;`B[SY%R,_"V86PL/]M18=8F]XI6Z_HIKYT_$6VL2:Z/8A@*9GRQ;R`/MZ=3POUKJ6/N +M>8]>D$V):;N`G^<\WYUZDY8L3T^QLM!:!=PDV4KFW'PU?;3BKVNA/'H$U,." +MG%&@E!^5TT3/QR8@7D$B*QF^JI]SX%PN!\3B(\R`@;OC^NIK0NYO#8]I5 +M(MOG*W;Y[;7'"9>!A?U97N@1[-$W9,F*SF:0.V*C[%D!5P9<])&PO`&]>1"# +M-G=%][D8`F.:``!@=@`"D0=P!$(#N$8'P`(8@`` +M&R4!`!LD```%)0$`!20`"`4Y`0`%8H@@P!$"``4D``@%.0$`!6*,(,`1!``% +M)``(!3D!``5BD"#`$0@`!20`"`4Y`0`%8I0@P!$0``4D``@%.0$`!6*8(,`1 +M(``%)``(!3D!``5BG"#`$4``!20`"`4Y`0`%8J`@P!$```@E```()`@.X1D$ +M#N$9"`W`$@$`&W`#``!AZ!W`$!``&S#H'<`1^`S`$@$`&W`%``!A#QP=(@0` +M'2;H'<`0`0`;,.@=P!&6#P!A```;)(``&R7D'<`1"`!?@#8"!``#`%Y0-P!(`"1LH +MB`V`@0``P!><#8"!``#`%\[N#26#APTD#PTW(FP@P!`/&S0,P!(``,T1#T0`(@H``$``0`!P!0``80(`$R/L',`1#W@3 +M(@0`RA$"``!A#W@3(@``QA$(`%@Q#W<3(N```!A"`!8;@\``&$(``=P"P``80`"7#'8'L`0"@`30``0$VX$``!A`0`( +M)```""4$#N$9!```80"`6#`"``!A`"!8,````&'H'<`0YO\3,O__$S/H'<`1 +M```!)`@``24/`6,B`0!2)`@`!VX"``!A```5)````"$.``!AZ!W`$!#X`23_ +M_P$E``$3.0\3`2+X#,`2``$3..@=P!$!`%(D>$7`$`$`$W`"``!A"`!D,>,/ +M`&'L#,`2`0`3;DP``&'.[@TE`8`-)`\--R(/7#[[ZMWN^^K=[OOJW>```````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````````````_W__?_]__W__ +M?_]__W__?P```````````````.P5```"````!````-1'@``````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````#\`/P``````/P`_```````````````````````````````` +M````````````=!6```$````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````@```````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M@````````````````````````````@```````````````````/\````````` +M`(```````/\```````````(```````````````````#_``````````"````` +M``#_```````````"````````````````````_P``````````@```````_P`` +M`````````@```````````````````/\``````````(```````/\````````` +M``(```````````````````#_``````````"```````#_```````````"```` +M````````````````_P``````````@```````_P```````````@`````````` +M`````````/\``````````(```````/\```````````(````````````````` +M``#_``````````"```````#_```````````"````````````````````_P`` +M````````@```````_P```````````@```````````````````/\````````` +M`(```````/\```````````(```````````````````#_``````````"````` +M``#_```````````"````````````````````_P``````````@```````_P`` +M`````````@```````````````````/\``````````(```````/\````````` +M``(```````````````````#_``````````"```````#_```````````"```` +M````````````````_P``````````@```````_P```````````@`````````` +M`````````/\``````````(```````/\````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````!&0```````````````````````````````````````#07`@`% +M````!````-1'@`````````````````"4"`(`!0````0```#41X`````````` +M````````-`@"``4````$````U$>``````````````````%05`@`%````!``` +M`-1'@```````````````````%P(`!0````0```#41X`````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````-#AR\@$"`P```0(#`0("!``!`P0!````!````!$````W`````0`` +M``(````#````!`````8````'````!P`````````!`````@````,````'```` +M!`````4```````````````$````````````````````````````````````! +M`````````````````````````.3X@```````````````````````````@``` +M`````````````````````````````````````````0```````$```````0`` +M```````````````````````````````!`````0`````````````````"`8@3 +M`P&($Q`!`````````````````````````````````````-#^```````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````"<8X`````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````#OOJW>[[ZMWN^^K=[OOJW>```` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````(!`P""@8. +M`0D%#0,+!P\````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````!L>@``!0```@0```#41X`````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````"````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````!F0````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````*<``-1'@`"`(:``M""@`&P@H```,``` +M`'``````````````^$>``/A'@`"`(:``I""@`#@@H``!````!P`````````` +M````'$B``!Q(@`"`(:``J""@`#P@H``0````.```````````````0$B``$!( +M@`"`(:``K""@`'@AH`!``0``P`$`````````````9$B``&1(@`"`(:``L""@ +M`'PAH```#`````X`````````````_P```/\````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````/__``#__P`````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````!P`,``P`"``%``,``:``0`"``B````````````+`"``(``+ +M``L`"P`&@`$``@`(@``````````#`````@```````````````@$``(`````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````_P`````````````````` +M`````````````````````````````````*"G```)````!````-1'@``\.#0P +M+"@D(!P8%!`,"`0```L'`P`[-S,O*R@$````"`@`"`@(``````````@(````"`@("`@(" +M```"`P,"``#Q\0(`!`0$!`0$````````````""Z-C3,^C8V-C8U]C6-KDUV& +M=46-C8V-C3Y5/AJ-@X.3`.H`>@`^`-0! +M]`!Z`#@`'@`0`'(`.@`>``(#!`4``.`B!`"E11@`RO0G`,KT)P`Z`0(!U0#? +M`#H!H@!U`'\`R@%*`>(`^0#*`>H`@@"9``$##P=\?'Q\9V=G9Q45&AH0$!`0 +M"A0W;FH!&@'9`.@`:@&Z`'D`B`!TT447Z**++A`8H``,&*``"!`0`A`(```0 +M&:``#!F@`!`80`80(```$"`@#8`````P``@`#0T-#0X.#@X.#P\/#P\0$!`0 +M$1$1$1(2$A(3$Q,3%!04%145%186%A<7%Q@8&!D9&AH:&QL;'!P='1T>'A\? +M("`A(2(B(R,D)"4E)B8G)R@H*2HJ*RLL+2TN+R\P,3(R,S0T-38W.#@Y.CL\ +M/3T^/T!!0D-$149'2$E*2TQ-3E!14E-45E=865M<75]@86-D9F=I:FQM;W!R +M='5W>7M\?H""A(:(BHR.D)*4EIB:G9^AHZ:HJZVPLK6WNKW`PL7(R\[1U-?: +MW>#DY^KN\?7X_/\````&``T`0`!J`(``D`"A`/\`F"6@`*@EH`"@):``Q"6@ +M`-0EH`#<):``Y"6@`.PEH`!$!=F&1`79AH(#YEE$!=F&@@/F6?/#(F6"`^99 +MPISH4((#YEG"G.A0@@/F6<*0`,`'D`)@`Y`"8`.0`F`#< +M`MP";@'<`FX!Z`%N`?0`;@'T`&X!]`"R!;(%V0*R!=D"S`/9`N8!V0+F`=D" +MY@%$`40!Y@%$`>8!L`'F`1P"Y@$<`N8!'`*(`H@"S`.(`LP#8`/,`S@$S`,X +M!,P#.`3,`\P#L@7,`[(%$`6R!50&L@54!K(%5`8&!A(&$@P2'A(>$AX``0(! +M`P8````$"`00$```*``H`#``+``L`"@`/``T`"P`+``\`#0`,``L`%0`1`!_ +M_P0GMH+Z$]FA\6*;27T!XXCN,X',=Q'+V$]A*.XS@.',=Q +M'([C.`Y>0GL)QW$8!'`*(`M`"*@.$`W4`Z@!?`=0!O@*H +M`QT$D@1\!1@&VP:>!^H`U`&^`J@#?`50!SH()`GX"C`,M@T\#PD)!04)"0T- +M!08!`@,$``"2C8R*BHJ)B(B(DHJ(AX>&AH:&AHZ)B(>&AH:%A862CHV,C(R, +MC(R,#0\%!PD+`0,H`"@`-``P`"P`+`!$`#P`5555`4MH+P%5554%XSB.`ZJJ +MJ@)Q',5)%08`,"JU(^W7%>EQ/U +MIFBY```LP6!`'^/(>>VVOM1&C=EG2W+>E-28Z+!*A6N[*L7E3Q;MQ8;7FE5F +ME!'/BA#I!@2!_O"@1'BZ)>-+\Z+^7<"`B@6M/[PA2'`$\=]CP7=UKV-","`: +MY0[];;],@108-28OP^&^HC7,B#DN5Y/R58+\1WJLR.>Z*S*5YJ#`F!G1GG^C +M9D1^5*L[@PO*C"G'TVL\*'FGXKP=%G:M.]M69$YT'A3;D@H,;$CDN%V?;KWO +M0Z;$J#FD,3?3B_(RU4.+66ZWVHP!9+'2G.!)M-CZK`?S)<^ORH[TZ4<8$-5O +MB/!O2G)<)#CQ5\=S49%!ZI8\#^%F`"1<:VF4QU\:$N-##@K`I=UH1'LM[_*C6;3HL``$"!`0&!@@( +M`````0```0("`P/_!/______`P0,#`@4%`0$0````(```````0````(````$ +M````0```0````$`````T`U`#>P.Z`Q4$FP3T!/X#'P1(!(,$VP1B!;L%N@;L +M!C@'L0=X")L)6@JA!]\'+@BF"&8)B@I+"ZL"4P.E!48&``$"`P$!`?______ +M__\```$```$"`@,#``````,.$P`7````"0`1&VIJ90#`RLK*RLK*R@,`!LH# +MRLK*R@G*`\K*$0,``@`"`@("```````@&V5`91(290!E$CLE.V5E2D4[3U17 +M.Q```````)`#<`3P!7````&!P<'!`<'!P('!P<'!P<'``<'!P$'!P< +M#!P<'!0````,#P\)``\#!@\%*P`9'R4```0'"@`3'!P0``````5`$``,D!R0') +M`&J``)!J@`"074<`!`T'`P$""`@("`@(9/=&`)CW1@#(]T8`7/=&`%3W1@"X +M]D8``P,`!`(#````"``(``@`!0````````````@!!`(#`@,````(``````$% +M````````````"`(&```"!@```@8`"``(`@8`"`(#`P,````&`P8#!@,&```# +M!@$(``@#!@`(`@,#`P`$``8`````#P`_``$````/`#\``0````\`/P`!```` +M#P`_``$````/`#\``0````(````"````!@````8````%````!0````0````$ +M`````P````,````!````````````````````T!0#`-`4`P`LUT<`9-='`+37 +M1P#0%`,`T!0#`/P4`P``%0,`U!0#`-`4`P#0%`,`T!0#`-`4`P#0%`,`T!0# +M`-`4`P#0%`,`T!0#`!````#0%`,`T!0#`-`4`P#0%`,`T!0#`-`4`P#0%`,` +MT!0#`-`4`P#0%`,`T!0#``#G$.<@YS#G0.=0YV#G<.<`[Q#O(.\P[T#O4.]@ +M[W#O`.(`XP#D`.4`Z@#K`.P`[=`4`P#0%`,`X.Y'`-`4`P#0%`,`Y.Y'`-`4 +M`P#\%`,``!4#`-04`P#0%`,`T!0#`-`4`P#0%`,`T!0#`-`4`P#0%`,`T!0# +M`-`4`P`0````T!0#`-`4`P#0%`,`T!0#`-`4`P#0%`,`T!0#`-`4`P#0%`,` +MT!0#`-`4`P````$``@`````$"``0````(#!`4&!P@``@(B`B0$1`1&!F8&:` +MB("(``````$!`0`"`0``G/\8_```9`!B````;P!C`+`$<`!M`-`'<0!O`*`/ +M<@!Q`$`?GM\?'U]?7Y^?GY_?W]_?W]_?X#_0555 +M554!`````@("(````("(B(B(```1````O%("``,```#@=`(``0```)A.`P`` +M````,+("`!@```!P@@(`#````(1]`@`<````C%P"``0```!\D@(`$P````Q8 +M`@`;````J%,"`!$```#\4@(`&````(R$`@`9````D*$"`!H```!TJP(`!P`` +M`%R)`@`#````%'@"``P```"`@`(`!````$23`@"'R`A(B,D)69G:&EJ:VQ`@````0````&```` +M`P````L````3````&P```",````K````,P```#H```!"`````0`````````$ +M````!0```````````````````````````/\```#^`0```O\```/_``$`_P$` +M`0(!`@+_`@#_`P(`_@0"``/_````````````````8"%'``H````$````U$>` +M`````````````````'0A1P`*````!````-1'@``````````````````````` +M```````````````````````````#```````````````>````'H@>B%H```!6 +M````5HA6B`(!``"J````JHBJB/X!``","@``5(Q4C*0?```````````````` +M``"\[@$`!0````0```#41X````````````#$20(``````````````````!`` +M`/8/``#8#P``I@\``&$/```)#P``G0X``"`.``"1#0``\0P``$$,``"""P`` +MM`H``-D)``#R"`````@```,'``#^!0``\00``-X#``#'`@``K`$``(X````` +M`````````````````0````$```````````````$````!`````0`````````` +M`````0``6-N``"8``7""@``!``*X^`(``0`$&&A(``$`!-Q\@``!``+0^0(` +M`0`$H"\#``$`!*SX`@````1H+(```0`"A/@"````!,3X`@`!``0T^@(``P`$ +M```````````````````````#D\0(`!0`` +M`@0```#41X``````````````````W/("``4```($````U$>````````````` +M``````$``````````@```````````````````````````````````&=%(P$% +M`````@("`@("`@("`O\"`@("`@("`@("`@("`@("`@("`@("`0("`@("`@(" +M`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`0(" +M`@("`@+_`0("`@("`@("`O\"`@("`O\"`@("`@+_`@("_____P0\``````@\ +M`````!@\`````!P\`````"`\`````"0\`````"@\`````"P\`````#`\```` +M`#0\`````#@\`````#P\`````$`\`````$0\`````$@\`````$P\`````%`\ +M`````%0\`````%@\`````%P\`````&`\`````&0\`````&@\`````'P\```` +M`'@\```````````````````````````````````````````````````````` +M```````````!`````````````````````````````````````R@```&`"@`U +M```@`````/"]>0`"````````````````````````````H`#__Q\````````` +M```````````````````````````````````````````````````````````` +M`````````0$!+Y]RB(`$!0``#@@8`C\````````#*````8`*`#4``"`````` +M_____P(```````````````````````````"@`/__'P`````````````````` +M```````````````````````````````````````````````````````````! +M`0$OGW*)@`4%```_#C\(/P````````,H```!@`H`-0``(`````#PO7D``@`` +M`````````````````````````*``__\?```````````````````````````` +M``````````````````````````````````````````````````$!`0`````` +M````"P,($@(_`````````R@``/__________```````````````````````` +M````````````````H`#__Q\`%"R@`/\#```\!*``_P,``#P,H`#_`P``$`"@ +M``\````$"*``_P,``!!%H`#_`P``!"2@`/\#````_@$!+Y]RB````0`"`P`. +M"#\````````#*```__________\````````````````````````````````` +M``````"@`/__'P`````````````````````````````````````````````` +M```````````````````````````````!`0$OGW*(```!``(`"`,2#@`````` +M``,H```!@`H`-0``(`````#PO7D``@```````````````````````````*`` +M__\?```````````````````````````````````````````````````````` +M``````````````````````$!`2^?0`"```````` +M````````````````````H`#__Q\````````````````````````````````` +M`````````````````````````````````````````````0$!O_]_$___!P`` +M/PX_"`P````````````````````````````````````````````````````` +M``!LRP$`!0````0```#41X``````````````````"0`````````````````` +M```````````````````````````````````````````````````````````` +M``````````#_```````````````````````````````````````````````` +M`````````````````````````"3@@-(5T@S2%=$3T1+1$-(1TA31@](0T1'1 +M"1$1$0[2`.`!T!+2$])0T`1#`40/T`""(($IX`;0```````````````````` +M`````````````````/3-`0`%````!````-1'@`#DS0$`[,T!`'3.`0#HS0$` +M\,T!```````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````*"92``%````!````-1'@`````````````````!$R0$`"@`` +M`@0```#41X`````````````4````U'Z``+`,@0`8```````````````!```` +M```````````````````````````!```````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````,#P\`!`$/#0\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/ +M#PX/"0\/!0H/"P\/#P\"#P\/#P\/#P\/#P\/#P\&`P\/#P\/#P\/#P\/#P\/ +M"`\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/ +M#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/ +M#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/#P\/ +M#P\/#P\/#P\/#P`,`3!`#`!S<``!,$`,`:+)(`$P0 +M`P`\H```5'$!`$P0`P!,$`,`'-P```QV`0`,=@$`#'8!``QV`0`,=@$`#'8! +M``QV`0!,$`,`3!`#`$P0`P!,$`,`8#X"`$P0`P!,$`,`'+P``$P0`P!,$`,` +M!+P``.2[``!,$`,`3!`#```````````````````````````````````````! +M`````0````$````!`````0````$````!`````0````$````!`````0`````` +M`````````````````````````0````````#AOJW>````````````````"+-' +M``8````$````U$>``````````````````"BQ1P`%```"!````-1'@`#_``$# +M!`4&!P@"```````````````````LOD<`!0```@0```#41X`````````````` +M````````````````````````````````````````````````````&$8````` +M($8`````)$8`````@$8`````A$8`````B$8`````C$8`````D$8`````E$8` +M````F$8`````G$8`````H$8`````I$8`````P$8`````Q$8`````R$8````` +MS$8`````T$8`````U$8`````V$8`````W$8`````X$8`````Y$8`````Z$8` +M````[$8`````\$8`````]$8`````^$8`````_$8`````%$8``````$<````` +M!$<`````"$<`````#$<`````0$<`````1$<`````?$<`````@$<`````A$<` +M````B$<`````D$<`````E$<`````F$<`````H$<`````I$<`````J$<````` +M!$8`````"$8`````#$8`````$$8``````$8`````9$<`````:$<`````;$<` +M````<$<`````=$<`````4$<`````5$<`````6$<`````7$<`````8$<````` +M/0"H'0````#`'0````#$'0````#('0````#,'0````#0'0````#4'0````#8 +M'0````#<'0````#@'0````#D'0````#H'0````#P'0````#T'0````!D'P`` +M``!$'P````"`'P````"$'P````"('P````",'P````"0'P````"4'P````"8 +M'P````"<'P````"@'P````"D'P````"H'P````"L'P````"P'P````#L'P`` +M``!T'@````!$'P````#P'P````#T'P````#\'P`````C```````````````` +M`````````````````.`<`````.0<`````.@<`````/0<`````!@=``````P= +M`````#`=`````)P=`````*`=`````#`>`````#0>`````#@>`````#P>```` +M`$P>`````%`>`````%0>`````%@>`````%P>`````&0>`````'@>`````'P> +M`````(P>`````)`>`````)0>`````)@>`````)P>`````*`>`````,`>```` +M`,0>`````-`>`````-0>``````0?`````-P>`````.`>`````'0?`````'@? +M`````'P?`````/@?`````"8`````````````````````````$````!\````` +M```````````````````````````````````````````````````````````` +M````````````````````````$``````````````````````````````````` +M```````0```````````````4```````````````E````Y?____G___\O```` +MW?____C___\```````````$````````````````````````````````````` +M`````````````````````````````````````````/\````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````/SP```````````````````,`````````_P`````````````` +M````````````````````````````````__\````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````(```````` +M`````````````````````````````````````````````````/__________ +M````````````````H.@!``H````$````U$>`````````````_.H!`!3L`0!, +MZP$`5.H!`$3L`0#8ZP$`J.H!``3J`0```0````$$`0$!``(!`0$#`0`"!P$! +M!`0!`04%`0(#_P(!`08"``('B!,````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````````````````````0(# +M!`7_________________________!@#_____```````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````@``````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````/____\````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````"````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````_____P`````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````(`````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````#_____```````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````@``````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````/____\````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````"````````````````````````````````````````` +M```````````````````````````````````````````````````````````` *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Oct 30 19:37:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FED315F105; Wed, 30 Oct 2019 19:37:34 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473JdB0SnCz4Sgc; Wed, 30 Oct 2019 19:37:34 +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 E75E2F2D2; Wed, 30 Oct 2019 19:37:33 +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 x9UJbXBM043017; Wed, 30 Oct 2019 19:37:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UJbXLi043016; Wed, 30 Oct 2019 19:37:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910301937.x9UJbXLi043016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 30 Oct 2019 19:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r354202 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: markj X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 354202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 19:37:34 -0000 Author: markj Date: Wed Oct 30 19:37:33 2019 New Revision: 354202 URL: https://svnweb.freebsd.org/changeset/base/354202 Log: Remove myself from sizelimit.conf. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Wed Oct 30 19:36:50 2019 (r354201) +++ svnadmin/conf/sizelimit.conf Wed Oct 30 19:37:33 2019 (r354202) @@ -22,7 +22,6 @@ imp jb jeff jkim -markj mm np obrien From owner-svn-src-all@freebsd.org Wed Oct 30 19:53:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DDC015F91F; Wed, 30 Oct 2019 19:53: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473Jzk0QB5z4V9q; Wed, 30 Oct 2019 19:53: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 E5B08F66A; Wed, 30 Oct 2019 19:53: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 x9UJrbH4054427; Wed, 30 Oct 2019 19:53:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UJrbh2054426; Wed, 30 Oct 2019 19:53:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201910301953.x9UJrbh2054426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 30 Oct 2019 19:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354203 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 354203 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 19:53:38 -0000 Author: imp Date: Wed Oct 30 19:53:37 2019 New Revision: 354203 URL: https://svnweb.freebsd.org/changeset/base/354203 Log: Remove duplicate lines. Modified: head/sys/conf/files.x86 Modified: head/sys/conf/files.x86 ============================================================================== --- head/sys/conf/files.x86 Wed Oct 30 19:37:33 2019 (r354202) +++ head/sys/conf/files.x86 Wed Oct 30 19:53:37 2019 (r354203) @@ -12,11 +12,6 @@ # limitations in config: backslash-newline doesn't work in strings, and # dependency lines other than the first are silently ignored. -# -cddl/dev/fbt/x86/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" -cddl/dev/dtrace/x86/dis_tables.c optional dtrace_fbt | dtraceall compile-with "${DTRACE_C}" -cddl/dev/dtrace/x86/instr_size.c optional dtrace_fbt | dtraceall compile-with "${DTRACE_C}" -# cddl/dev/fbt/x86/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" cddl/dev/dtrace/x86/dis_tables.c optional dtrace_fbt | dtraceall compile-with "${DTRACE_C}" cddl/dev/dtrace/x86/instr_size.c optional dtrace_fbt | dtraceall compile-with "${DTRACE_C}" From owner-svn-src-all@freebsd.org Wed Oct 30 19:53:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B6E815F96D; Wed, 30 Oct 2019 19:53: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473Jzv6Z7nz4VJ4; Wed, 30 Oct 2019 19:53:47 +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 C5EFAF66B; Wed, 30 Oct 2019 19:53:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9UJrlp2054485; Wed, 30 Oct 2019 19:53:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UJrlXU054481; Wed, 30 Oct 2019 19:53:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201910301953.x9UJrlXU054481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 30 Oct 2019 19:53:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354204 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 354204 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 19:53:48 -0000 Author: imp Date: Wed Oct 30 19:53:46 2019 New Revision: 354204 URL: https://svnweb.freebsd.org/changeset/base/354204 Log: Move all the sys/dev/[a-j]* that are common to files.x86 All these device entries are common between the two files. Move them to files.x86. Also sort entries from this range into proper order in files.amd64. Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.x86 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Wed Oct 30 19:53:37 2019 (r354203) +++ head/sys/conf/files.amd64 Wed Oct 30 19:53:46 2019 (r354204) @@ -152,33 +152,8 @@ dev/agp/agp_amd64.c optional agp dev/agp/agp_i810.c optional agp dev/agp/agp_via.c optional agp dev/amdgpio/amdgpio.c optional amdgpio -dev/amdsbwd/amdsbwd.c optional amdsbwd -dev/amdsmn/amdsmn.c optional amdsmn | amdtemp -dev/amdtemp/amdtemp.c optional amdtemp -dev/arcmsr/arcmsr.c optional arcmsr pci -dev/asmc/asmc.c optional asmc isa -dev/atkbdc/atkbd.c optional atkbd atkbdc -dev/atkbdc/atkbd_atkbdc.c optional atkbd atkbdc -dev/atkbdc/atkbdc.c optional atkbdc -dev/atkbdc/atkbdc_isa.c optional atkbdc isa -dev/atkbdc/atkbdc_subr.c optional atkbdc -dev/atkbdc/psm.c optional psm atkbdc -dev/coretemp/coretemp.c optional coretemp -dev/cpuctl/cpuctl.c optional cpuctl -dev/dpms/dpms.c optional dpms -dev/fb/fb.c optional fb | vga -dev/fb/s3_pci.c optional s3pci -dev/fb/vesa.c optional vga vesa -dev/fb/vga.c optional vga -dev/ichwd/ichwd.c optional ichwd -dev/if_ndis/if_ndis.c optional ndis -dev/if_ndis/if_ndis_pccard.c optional ndis pccard -dev/if_ndis/if_ndis_pci.c optional ndis cardbus | ndis pci -dev/if_ndis/if_ndis_usb.c optional ndis usb -dev/imcsmb/imcsmb.c optional imcsmb -dev/imcsmb/imcsmb_pci.c optional imcsmb pci -dev/intel/spi.c optional intelspi -dev/io/iodev.c optional io +dev/hyperv/vmbus/amd64/hyperv_machdep.c optional hyperv +dev/hyperv/vmbus/amd64/vmbus_vector.S optional hyperv dev/ioat/ioat.c optional ioat pci dev/ioat/ioat_test.c optional ioat pci dev/ixl/if_ixl.c optional ixl pci \ @@ -211,10 +186,6 @@ dev/ixl/i40e_adminq.c optional ixl pci | iavf pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/i40e_dcb.c optional ixl pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" -dev/gpio/bytgpio.c optional bytgpio -dev/gpio/chvgpio.c optional chvgpio -dev/hyperv/vmbus/amd64/hyperv_machdep.c optional hyperv -dev/hyperv/vmbus/amd64/vmbus_vector.S optional hyperv dev/nctgpio/nctgpio.c optional nctgpio dev/nfe/if_nfe.c optional nfe pci dev/ntb/if_ntb/if_ntb.c optional if_ntb @@ -225,8 +196,6 @@ dev/ntb/ntb_hw/ntb_hw_amd.c optional ntb_hw_amd | ntb_ dev/ntb/ntb_hw/ntb_hw_intel.c optional ntb_hw_intel | ntb_hw dev/ntb/ntb_hw/ntb_hw_plx.c optional ntb_hw_plx | ntb_hw dev/ntb/test/ntb_tool.c optional ntb_tool -dev/vmd/vmd.c optional vmd -dev/vmd/vmd_bus.c optional vmd_bus dev/nvram/nvram.c optional nvram isa dev/random/ivy.c optional rdrand_rng !random_loadable dev/random/nehemiah.c optional padlock_rng !random_loadable @@ -376,6 +345,8 @@ dev/vmware/vmci/vmci_kernel_if.c optional vmci dev/vmware/vmci/vmci_qpair.c optional vmci dev/vmware/vmci/vmci_queue_pair.c optional vmci dev/vmware/vmci/vmci_resource.c optional vmci +dev/vmd/vmd.c optional vmd +dev/vmd/vmd_bus.c optional vmd_bus dev/wbwd/wbwd.c optional wbwd dev/xen/pci/xen_acpi_pci.c optional xenhvm dev/xen/pci/xen_pci.c optional xenhvm Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Wed Oct 30 19:53:37 2019 (r354203) +++ head/sys/conf/files.i386 Wed Oct 30 19:53:46 2019 (r354204) @@ -100,52 +100,23 @@ dev/agp/agp_intel.c optional agp dev/agp/agp_nvidia.c optional agp dev/agp/agp_sis.c optional agp dev/agp/agp_via.c optional agp -dev/amdsbwd/amdsbwd.c optional amdsbwd -dev/amdsmn/amdsmn.c optional amdsmn | amdtemp -dev/amdtemp/amdtemp.c optional amdtemp -dev/arcmsr/arcmsr.c optional arcmsr pci -dev/asmc/asmc.c optional asmc isa -dev/atkbdc/atkbd.c optional atkbd atkbdc -dev/atkbdc/atkbd_atkbdc.c optional atkbd atkbdc -dev/atkbdc/atkbdc.c optional atkbdc -dev/atkbdc/atkbdc_isa.c optional atkbdc isa -dev/atkbdc/atkbdc_subr.c optional atkbdc -dev/atkbdc/psm.c optional psm atkbdc dev/ce/ceddk.c optional ce dev/ce/if_ce.c optional ce dev/ce/tau32-ddk.c optional ce \ compile-with "${NORMAL_C} ${NO_WCONSTANT_CONVERSION}" -dev/coretemp/coretemp.c optional coretemp dev/cp/cpddk.c optional cp dev/cp/if_cp.c optional cp -dev/cpuctl/cpuctl.c optional cpuctl dev/ctau/ctau.c optional ctau dev/ctau/ctddk.c optional ctau dev/ctau/if_ct.c optional ctau dev/cx/csigma.c optional cx dev/cx/cxddk.c optional cx dev/cx/if_cx.c optional cx -dev/dpms/dpms.c optional dpms -dev/fb/fb.c optional fb | vga -dev/fb/s3_pci.c optional s3pci -dev/fb/vesa.c optional vga vesa -dev/fb/vga.c optional vga dev/glxiic/glxiic.c optional glxiic dev/glxsb/glxsb.c optional glxsb dev/glxsb/glxsb_hash.c optional glxsb -dev/gpio/bytgpio.c optional bytgpio -dev/gpio/chvgpio.c optional chvgpio dev/hyperv/vmbus/i386/hyperv_machdep.c optional hyperv dev/hyperv/vmbus/i386/vmbus_vector.S optional hyperv -dev/ichwd/ichwd.c optional ichwd -dev/if_ndis/if_ndis.c optional ndis -dev/if_ndis/if_ndis_pccard.c optional ndis pccard -dev/if_ndis/if_ndis_pci.c optional ndis cardbus | ndis pci -dev/if_ndis/if_ndis_usb.c optional ndis usb -dev/imcsmb/imcsmb.c optional imcsmb -dev/imcsmb/imcsmb_pci.c optional imcsmb pci -dev/intel/spi.c optional intelspi -dev/io/iodev.c optional io dev/le/if_le_isa.c optional le isa dev/nctgpio/nctgpio.c optional nctgpio dev/nfe/if_nfe.c optional nfe pci Modified: head/sys/conf/files.x86 ============================================================================== --- head/sys/conf/files.x86 Wed Oct 30 19:53:37 2019 (r354203) +++ head/sys/conf/files.x86 Wed Oct 30 19:53:46 2019 (r354204) @@ -60,6 +60,17 @@ dev/acpica/acpi_pcib_acpi.c optional acpi pci dev/acpica/acpi_pcib_pci.c optional acpi pci dev/acpica/acpi_pxm.c optional acpi dev/acpica/acpi_timer.c optional acpi +dev/amdsbwd/amdsbwd.c optional amdsbwd +dev/amdsmn/amdsmn.c optional amdsmn | amdtemp +dev/amdtemp/amdtemp.c optional amdtemp +dev/arcmsr/arcmsr.c optional arcmsr pci +dev/asmc/asmc.c optional asmc isa +dev/atkbdc/atkbd.c optional atkbd atkbdc +dev/atkbdc/atkbd_atkbdc.c optional atkbd atkbdc +dev/atkbdc/atkbdc.c optional atkbdc +dev/atkbdc/atkbdc_isa.c optional atkbdc isa +dev/atkbdc/atkbdc_subr.c optional atkbdc +dev/atkbdc/psm.c optional psm atkbdc dev/bxe/bxe.c optional bxe pci dev/bxe/bxe_stats.c optional bxe pci dev/bxe/bxe_debug.c optional bxe pci @@ -68,10 +79,19 @@ dev/bxe/bxe_elink.c optional bxe pci dev/bxe/57710_init_values.c optional bxe pci dev/bxe/57711_init_values.c optional bxe pci dev/bxe/57712_init_values.c optional bxe pci +dev/coretemp/coretemp.c optional coretemp +dev/cpuctl/cpuctl.c optional cpuctl +dev/dpms/dpms.c optional dpms +dev/fb/fb.c optional fb | vga +dev/fb/s3_pci.c optional s3pci +dev/fb/vesa.c optional vga vesa +dev/fb/vga.c optional vga dev/fdc/fdc.c optional fdc dev/fdc/fdc_acpi.c optional fdc dev/fdc/fdc_isa.c optional fdc isa dev/fdc/fdc_pccard.c optional fdc pccard +dev/gpio/bytgpio.c optional bytgpio +dev/gpio/chvgpio.c optional chvgpio dev/hpt27xx/hpt27xx_os_bsd.c optional hpt27xx dev/hpt27xx/hpt27xx_osm_bsd.c optional hpt27xx dev/hpt27xx/hpt27xx_config.c optional hpt27xx @@ -130,6 +150,15 @@ dev/hyperv/vmbus/vmbus_et.c optional hyperv dev/hyperv/vmbus/vmbus_if.m optional hyperv dev/hyperv/vmbus/vmbus_res.c optional hyperv dev/hyperv/vmbus/vmbus_xact.c optional hyperv +dev/ichwd/ichwd.c optional ichwd +dev/if_ndis/if_ndis.c optional ndis +dev/if_ndis/if_ndis_pccard.c optional ndis pccard +dev/if_ndis/if_ndis_pci.c optional ndis cardbus | ndis pci +dev/if_ndis/if_ndis_usb.c optional ndis usb +dev/imcsmb/imcsmb.c optional imcsmb +dev/imcsmb/imcsmb_pci.c optional imcsmb pci +dev/intel/spi.c optional intelspi +dev/io/iodev.c optional io dev/ipmi/ipmi.c optional ipmi dev/ipmi/ipmi_acpi.c optional ipmi acpi dev/ipmi/ipmi_isa.c optional ipmi isa From owner-svn-src-all@freebsd.org Wed Oct 30 20:08:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4953B15FCF5; Wed, 30 Oct 2019 20:08: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473KJW0wy4z4Wfq; Wed, 30 Oct 2019 20:08:11 +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 04ADFF851; Wed, 30 Oct 2019 20:08:11 +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 x9UK8AuK060758; Wed, 30 Oct 2019 20:08:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UK8AKf060757; Wed, 30 Oct 2019 20:08:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201910302008.x9UK8AKf060757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 30 Oct 2019 20:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354205 - head/sys/dev/ow X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/ow X-SVN-Commit-Revision: 354205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 20:08:11 -0000 Author: imp Date: Wed Oct 30 20:08:10 2019 New Revision: 354205 URL: https://svnweb.freebsd.org/changeset/base/354205 Log: Remove redundant hw sysctl declaration. gcc CI complains, but clang doesn't. Modified: head/sys/dev/ow/ow.c Modified: head/sys/dev/ow/ow.c ============================================================================== --- head/sys/dev/ow/ow.c Wed Oct 30 19:53:46 2019 (r354204) +++ head/sys/dev/ow/ow.c Wed Oct 30 20:08:10 2019 (r354205) @@ -161,7 +161,6 @@ static struct ow_timing timing_overdrive = { .t_lowr = 1, /* 1 <= t < 2 */ }; -SYSCTL_DECL(_hw); SYSCTL_NODE(_hw, OID_AUTO, ow, CTLFLAG_RD, 0, "1-Wire protocol"); SYSCTL_NODE(_hw_ow, OID_AUTO, regular, CTLFLAG_RD, 0, "Regular mode timings"); From owner-svn-src-all@freebsd.org Wed Oct 30 20:43:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6317160C21; Wed, 30 Oct 2019 20:43:27 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473L5C4Qwkz4Yw3; Wed, 30 Oct 2019 20:43:27 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B928FF62; Wed, 30 Oct 2019 20:43:27 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9UKhR7a083958; Wed, 30 Oct 2019 20:43:27 GMT (envelope-from kibab@FreeBSD.org) Received: (from kibab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UKhRth083957; Wed, 30 Oct 2019 20:43:27 GMT (envelope-from kibab@FreeBSD.org) Message-Id: <201910302043.x9UKhRth083957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kibab set sender to kibab@FreeBSD.org using -f From: Ilya Bakulin Date: Wed, 30 Oct 2019 20:43:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354206 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kibab X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 354206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 20:43:27 -0000 Author: kibab Date: Wed Oct 30 20:43:27 2019 New Revision: 354206 URL: https://svnweb.freebsd.org/changeset/base/354206 Log: Use the new cam_sim_alloc_dev function to properly initialize SIM Using cam_sim_alloc_dev() allows to properly set sim_dev field so that sdiob(4) can attach to the CAM device that represents SDIO card. The same change for SDHCI driver happened in r348800. Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D22192 Modified: head/sys/arm/allwinner/aw_mmc.c Modified: head/sys/arm/allwinner/aw_mmc.c ============================================================================== --- head/sys/arm/allwinner/aw_mmc.c Wed Oct 30 20:08:10 2019 (r354205) +++ head/sys/arm/allwinner/aw_mmc.c Wed Oct 30 20:43:27 2019 (r354206) @@ -526,8 +526,8 @@ aw_mmc_attach(device_t dev) } mtx_init(&sc->sim_mtx, "awmmcsim", NULL, MTX_DEF); - sc->sim = cam_sim_alloc(aw_mmc_cam_action, aw_mmc_cam_poll, - "aw_mmc_sim", sc, device_get_unit(dev), + sc->sim = cam_sim_alloc_dev(aw_mmc_cam_action, aw_mmc_cam_poll, + "aw_mmc_sim", sc, dev, &sc->sim_mtx, 1, 1, sc->devq); if (sc->sim == NULL) { @@ -1514,6 +1514,7 @@ static device_method_t aw_mmc_methods[] = { /* Bus interface */ DEVMETHOD(bus_read_ivar, aw_mmc_read_ivar), DEVMETHOD(bus_write_ivar, aw_mmc_write_ivar), + DEVMETHOD(bus_add_child, bus_generic_add_child), /* MMC bridge interface */ DEVMETHOD(mmcbr_update_ios, aw_mmc_update_ios), From owner-svn-src-all@freebsd.org Wed Oct 30 20:45:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 10F31160CEE; Wed, 30 Oct 2019 20:45:13 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473L7D6j2Jz4Z4w; Wed, 30 Oct 2019 20:45:12 +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 C930EFF6A; Wed, 30 Oct 2019 20:45:12 +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 x9UKjCOW084113; Wed, 30 Oct 2019 20:45:12 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UKjCOi084112; Wed, 30 Oct 2019 20:45:12 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201910302045.x9UKjCOi084112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Wed, 30 Oct 2019 20:45:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354207 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 354207 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 20:45:13 -0000 Author: erj Date: Wed Oct 30 20:45:12 2019 New Revision: 354207 URL: https://svnweb.freebsd.org/changeset/base/354207 Log: iflib: cleanup memory leaks on driver detach From Jake: The iflib stack failed to release all of the memory allocated under M_IFLIB during device detach. Specifically, the ifmp_ring, the ift_ifdi Tx DMA info, and the ifr_ifdi Rx DMA info were not being released. Release this memory so that iflib won't leak memory when a device detaches. Since we're freeing the ift_ifdi pointer during iflib_txq_destroy we need to call this only after iflib_dma_free in iflib_tx_structures_free. Additionally, also ensure that we destroy the callout mutex associated with each Tx queue when we free it. Signed-off-by: Jacob Keller Submitted by: Jacob Keller Reviewed by: erj@, gallatin@ MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D22157 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Oct 30 20:43:27 2019 (r354206) +++ head/sys/net/iflib.c Wed Oct 30 20:45:12 2019 (r354207) @@ -1725,6 +1725,14 @@ iflib_txq_destroy(iflib_txq_t txq) for (int i = 0; i < txq->ift_size; i++) iflib_txsd_destroy(ctx, txq, i); + + if (txq->ift_br != NULL) { + ifmp_ring_free(txq->ift_br); + txq->ift_br = NULL; + } + + mtx_destroy(&txq->ift_mtx); + if (txq->ift_sds.ifsd_map != NULL) { free(txq->ift_sds.ifsd_map, M_IFLIB); txq->ift_sds.ifsd_map = NULL; @@ -1745,6 +1753,9 @@ iflib_txq_destroy(iflib_txq_t txq) bus_dma_tag_destroy(txq->ift_tso_buf_tag); txq->ift_tso_buf_tag = NULL; } + if (txq->ift_ifdi != NULL) { + free(txq->ift_ifdi, M_IFLIB); + } } static void @@ -2225,6 +2236,8 @@ iflib_rx_sds_free(iflib_rxq_t rxq) } free(rxq->ifr_fl, M_IFLIB); rxq->ifr_fl = NULL; + free(rxq->ifr_ifdi, M_IFLIB); + rxq->ifr_ifdi = NULL; rxq->ifr_cq_cidx = 0; } } @@ -5658,9 +5671,9 @@ iflib_tx_structures_free(if_ctx_t ctx) int i, j; for (i = 0; i < NTXQSETS(ctx); i++, txq++) { - iflib_txq_destroy(txq); for (j = 0; j < sctx->isc_ntxqs; j++) iflib_dma_free(&txq->ift_ifdi[j]); + iflib_txq_destroy(txq); } free(ctx->ifc_txqs, M_IFLIB); ctx->ifc_txqs = NULL; From owner-svn-src-all@freebsd.org Wed Oct 30 21:48:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 01CC1162654; Wed, 30 Oct 2019 21:48:44 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473MXW6Bgyz4d89; Wed, 30 Oct 2019 21:48:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7F6818A3D; Wed, 30 Oct 2019 21:48:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9ULmh3w019395; Wed, 30 Oct 2019 21:48:43 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9ULmhFP019394; Wed, 30 Oct 2019 21:48:43 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201910302148.x9ULmhFP019394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 30 Oct 2019 21:48:43 +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: r354208 - stable/11/sys/dev/e1000 X-SVN-Group: stable-11 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/11/sys/dev/e1000 X-SVN-Commit-Revision: 354208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 21:48:44 -0000 Author: marius Date: Wed Oct 30 21:48:43 2019 New Revision: 354208 URL: https://svnweb.freebsd.org/changeset/base/354208 Log: MFC: r353778 (partial) In em_handle_link(), only re-arm the link state change interrupt for 82574 and also only if such a device uses MSI-X, i. e. takes advantage of autoclearing. In case of INTx and MSI re-arming isn't appropriate here and setting EM_MSIX_LINK isn't either. Modified: stable/11/sys/dev/e1000/if_em.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/e1000/if_em.c ============================================================================== --- stable/11/sys/dev/e1000/if_em.c Wed Oct 30 20:45:12 2019 (r354207) +++ stable/11/sys/dev/e1000/if_em.c Wed Oct 30 21:48:43 2019 (r354208) @@ -1760,6 +1760,7 @@ static void em_handle_link(void *context, int pending) { struct adapter *adapter = context; + struct e1000_hw *hw = &adapter->hw; struct tx_ring *txr = adapter->tx_rings; if_t ifp = adapter->ifp; @@ -1770,8 +1771,8 @@ em_handle_link(void *context, int pending) callout_stop(&adapter->timer); em_update_link_status(adapter); callout_reset(&adapter->timer, hz, em_local_timer, adapter); - E1000_WRITE_REG(&adapter->hw, E1000_IMS, - EM_MSIX_LINK | E1000_IMS_LSC); + if (hw->mac.type == e1000_82574 && adapter->msix_mem != NULL) + E1000_WRITE_REG(hw, E1000_IMS, EM_MSIX_LINK | E1000_IMS_LSC); if (adapter->link_active) { for (int i = 0; i < adapter->num_queues; i++, txr++) { EM_TX_LOCK(txr); From owner-svn-src-all@freebsd.org Wed Oct 30 21:49:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D73E1626D5; Wed, 30 Oct 2019 21:49:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473MYW3h89z4dGV; Wed, 30 Oct 2019 21:49:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61C0218A3E; Wed, 30 Oct 2019 21:49:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9ULnZ1O019474; Wed, 30 Oct 2019 21:49:35 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9ULnZGN019473; Wed, 30 Oct 2019 21:49:35 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201910302149.x9ULnZGN019473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 30 Oct 2019 21:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r354209 - stable/10/sys/dev/e1000 X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/10/sys/dev/e1000 X-SVN-Commit-Revision: 354209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2019 21:49:35 -0000 Author: marius Date: Wed Oct 30 21:49:34 2019 New Revision: 354209 URL: https://svnweb.freebsd.org/changeset/base/354209 Log: MFC: r353778 (partial) In em_handle_link(), only re-arm the link state change interrupt for 82574 and also only if such a device uses MSI-X, i. e. takes advantage of autoclearing. In case of INTx and MSI re-arming isn't appropriate here and setting EM_MSIX_LINK isn't either. Modified: stable/10/sys/dev/e1000/if_em.c Modified: stable/10/sys/dev/e1000/if_em.c ============================================================================== --- stable/10/sys/dev/e1000/if_em.c Wed Oct 30 21:48:43 2019 (r354208) +++ stable/10/sys/dev/e1000/if_em.c Wed Oct 30 21:49:34 2019 (r354209) @@ -1774,6 +1774,7 @@ static void em_handle_link(void *context, int pending) { struct adapter *adapter = context; + struct e1000_hw *hw = &adapter->hw; struct tx_ring *txr = adapter->tx_rings; struct ifnet *ifp = adapter->ifp; @@ -1784,8 +1785,8 @@ em_handle_link(void *context, int pending) callout_stop(&adapter->timer); em_update_link_status(adapter); callout_reset(&adapter->timer, hz, em_local_timer, adapter); - E1000_WRITE_REG(&adapter->hw, E1000_IMS, - EM_MSIX_LINK | E1000_IMS_LSC); + if (hw->mac.type == e1000_82574 && adapter->msix_mem != NULL) + E1000_WRITE_REG(hw, E1000_IMS, EM_MSIX_LINK | E1000_IMS_LSC); if (adapter->link_active) { for (int i = 0; i < adapter->num_queues; i++, txr++) { EM_TX_LOCK(txr); From owner-svn-src-all@freebsd.org Thu Oct 31 00:35:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B8EA16710B; Thu, 31 Oct 2019 00:35:27 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473RDt6XpJz4nKm; Thu, 31 Oct 2019 00:35:26 +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 C48FE1A8E2; Thu, 31 Oct 2019 00:35:26 +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 x9V0ZQIr020185; Thu, 31 Oct 2019 00:35:26 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9V0ZQKe020184; Thu, 31 Oct 2019 00:35:26 GMT (envelope-from np@FreeBSD.org) Message-Id: <201910310035.x9V0ZQKe020184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 31 Oct 2019 00:35:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354210 - head/sys/dev/cxgbe/common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/common X-SVN-Commit-Revision: 354210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 00:35:27 -0000 Author: np Date: Thu Oct 31 00:35:26 2019 New Revision: 354210 URL: https://svnweb.freebsd.org/changeset/base/354210 Log: cxgbe(4): Use correct size while converting lpacaps32 to native endianness. Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Wed Oct 30 21:49:34 2019 (r354209) +++ head/sys/dev/cxgbe/common/t4_hw.c Thu Oct 31 00:35:26 2019 (r354210) @@ -8548,7 +8548,7 @@ static void handle_port_info(struct port_info *pi, con lc->supported = be32_to_cpu(p->u.info32.pcaps32); lc->advertising = be32_to_cpu(p->u.info32.acaps32); - lc->lp_advertising = be16_to_cpu(p->u.info32.lpacaps32); + lc->lp_advertising = be32_to_cpu(p->u.info32.lpacaps32); lc->link_ok = (stat & F_FW_PORT_CMD_LSTATUS32) != 0; lc->link_down_rc = G_FW_PORT_CMD_LINKDNRC32(stat); From owner-svn-src-all@freebsd.org Thu Oct 31 09:14:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F06D61A1AAF; Thu, 31 Oct 2019 09:14:53 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473fmF6ZJcz42sZ; Thu, 31 Oct 2019 09:14:53 +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 A808C2077B; Thu, 31 Oct 2019 09:14:53 +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 x9V9ErE2027740; Thu, 31 Oct 2019 09:14:53 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9V9Epv6027728; Thu, 31 Oct 2019 09:14:51 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910310914.x9V9Epv6027728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 31 Oct 2019 09:14: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: r354211 - in stable/12: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zstreamdump cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/common/zfs sys/cddl/con... X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/12: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zstreamdump cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/comm... X-SVN-Commit-Revision: 354211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 09:14:54 -0000 Author: avg Date: Thu Oct 31 09:14:50 2019 New Revision: 354211 URL: https://svnweb.freebsd.org/changeset/base/354211 Log: MFC r353176,r353304,r353556,r353559: large_dnode improvements and fixes r353176: MFV r350898, r351075: 8423 8199 7432 Implement large_dnode pool feature This updates FreeBSD large_dnode code (that was imported from ZoL) to a version that was committed to illumos. It has some cleanups, improvements and fixes comparing to what we have in FreeBSD now. I think that the most significant update is 8199 multi-threaded dmu_object_alloc(). r353304: zfs: use atomic_load_64 to read atomic variable in dmu_object_alloc_impl r353556: MFV r353551: 10452 ZoL: merge in large dnode feature fixes r353559: MFV r353558: 10572 10579 Fix race in dnode_check_slots_free() Modified: stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c stable/12/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c stable/12/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/12/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Oct 31 09:14:50 2019 (r354211) @@ -2131,7 +2131,8 @@ static object_viewer_t *object_viewer[DMU_OT_NUMTYPES }; static void -dump_object(objset_t *os, uint64_t object, int verbosity, int *print_header) +dump_object(objset_t *os, uint64_t object, int verbosity, int *print_header, + uint64_t *dnode_slots_used) { dmu_buf_t *db = NULL; dmu_object_info_t doi; @@ -2151,7 +2152,7 @@ dump_object(objset_t *os, uint64_t object, int verbosi CTASSERT(sizeof (bonus_size) >= NN_NUMBUF_SZ); if (*print_header) { - (void) printf("\n%10s %3s %5s %5s %5s %6s %5s %6s %s\n", + (void) printf("\n%10s %3s %5s %5s %5s %6s %5s %6s %s\n", "Object", "lvl", "iblk", "dblk", "dsize", "dnsize", "lsize", "%full", "type"); *print_header = 0; @@ -2170,6 +2171,9 @@ dump_object(objset_t *os, uint64_t object, int verbosi } dmu_object_info_from_dnode(dn, &doi); + if (dnode_slots_used != NULL) + *dnode_slots_used = doi.doi_dnodesize / DNODE_MIN_SIZE; + zdb_nicenum(doi.doi_metadata_block_size, iblk, sizeof (iblk)); zdb_nicenum(doi.doi_data_block_size, dblk, sizeof (dblk)); zdb_nicenum(doi.doi_max_offset, lsize, sizeof (lsize)); @@ -2192,8 +2196,9 @@ dump_object(objset_t *os, uint64_t object, int verbosi ZDB_COMPRESS_NAME(doi.doi_compress)); } - (void) printf("%10lld %3u %5s %5s %5s %6s %5s %6s %s%s\n", - (u_longlong_t)object, doi.doi_indirection, iblk, dblk, + (void) printf("%10" PRIu64 + " %3u %5s %5s %5s %5s %5s %6s %s%s\n", + object, doi.doi_indirection, iblk, dblk, asize, dnsize, lsize, fill, ZDB_OT_NAME(doi.doi_type), aux); if (doi.doi_bonus_type != DMU_OT_NONE && verbosity > 3) { @@ -2302,6 +2307,9 @@ dump_dir(objset_t *os) int print_header = 1; unsigned i; int error; + uint64_t total_slots_used = 0; + uint64_t max_slot_used = 0; + uint64_t dnode_slots; /* make sure nicenum has enough space */ CTASSERT(sizeof (numbuf) >= NN_NUMBUF_SZ); @@ -2346,7 +2354,7 @@ dump_dir(objset_t *os) if (zopt_objects != 0) { for (i = 0; i < zopt_objects; i++) dump_object(os, zopt_object[i], verbosity, - &print_header); + &print_header, NULL); (void) printf("\n"); return; } @@ -2371,22 +2379,37 @@ dump_dir(objset_t *os) if (BP_IS_HOLE(os->os_rootbp)) return; - dump_object(os, 0, verbosity, &print_header); + dump_object(os, 0, verbosity, &print_header, NULL); object_count = 0; if (DMU_USERUSED_DNODE(os) != NULL && DMU_USERUSED_DNODE(os)->dn_type != 0) { - dump_object(os, DMU_USERUSED_OBJECT, verbosity, &print_header); - dump_object(os, DMU_GROUPUSED_OBJECT, verbosity, &print_header); + dump_object(os, DMU_USERUSED_OBJECT, verbosity, &print_header, + NULL); + dump_object(os, DMU_GROUPUSED_OBJECT, verbosity, &print_header, + NULL); } object = 0; while ((error = dmu_object_next(os, &object, B_FALSE, 0)) == 0) { - dump_object(os, object, verbosity, &print_header); + dump_object(os, object, verbosity, &print_header, &dnode_slots); object_count++; + total_slots_used += dnode_slots; + max_slot_used = object + dnode_slots - 1; } (void) printf("\n"); + (void) printf(" Dnode slots:\n"); + (void) printf("\tTotal used: %10llu\n", + (u_longlong_t)total_slots_used); + (void) printf("\tMax used: %10llu\n", + (u_longlong_t)max_slot_used); + (void) printf("\tPercent empty: %10lf\n", + (double)(max_slot_used - total_slots_used)*100 / + (double)max_slot_used); + + (void) printf("\n"); + if (error != ESRCH) { (void) fprintf(stderr, "dmu_object_next() = %d\n", error); abort(); @@ -2578,7 +2601,7 @@ dump_path_impl(objset_t *os, uint64_t obj, char *name) return (dump_path_impl(os, child_obj, s + 1)); /*FALLTHROUGH*/ case DMU_OT_PLAIN_FILE_CONTENTS: - dump_object(os, child_obj, dump_opt['v'], &header); + dump_object(os, child_obj, dump_opt['v'], &header, NULL); return (0); default: (void) fprintf(stderr, "object %llu has non-file/directory " Modified: stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c Thu Oct 31 09:14:50 2019 (r354211) @@ -84,15 +84,15 @@ zil_prt_rec_create(zilog_t *zilog, int txtype, void *a } (void) printf("%s%s", tab_prefix, ctime(&crtime)); - (void) printf("%sdoid %llu, foid %llu, slots %llu, mode %llo\n", tab_prefix, - (u_longlong_t)lr->lr_doid, - (u_longlong_t)LR_FOID_GET_OBJ(lr->lr_foid), - (u_longlong_t)LR_FOID_GET_SLOTS(lr->lr_foid), - (longlong_t)lr->lr_mode); - (void) printf("%suid %llu, gid %llu, gen %llu, rdev 0x%llx\n", - tab_prefix, - (u_longlong_t)lr->lr_uid, (u_longlong_t)lr->lr_gid, - (u_longlong_t)lr->lr_gen, (u_longlong_t)lr->lr_rdev); + (void) printf("%sdoid %" PRIu64 ", foid %" PRIu64 ", slots %" PRIu64 + ", mode %" PRIo64 "\n", + tab_prefix, lr->lr_doid, + (uint64_t)LR_FOID_GET_OBJ(lr->lr_foid), + (uint64_t)LR_FOID_GET_SLOTS(lr->lr_foid), + lr->lr_mode); + (void) printf("%suid %" PRIu64 ", gid %" PRIu64 ", gen %" PRIu64 + ", rdev %#" PRIx64 "\n", + tab_prefix, lr->lr_uid, lr->lr_gid, lr->lr_gen, lr->lr_rdev); } /* ARGSUSED */ Modified: stable/12/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c Thu Oct 31 09:14:50 2019 (r354211) @@ -416,13 +416,15 @@ main(int argc, char *argv[]) drro->drr_toguid = BSWAP_64(drro->drr_toguid); } if (verbose) { - (void) printf("OBJECT object = %llu type = %u " - "bonustype = %u blksz = %u bonuslen = %u\n", - (u_longlong_t)drro->drr_object, + (void) printf("OBJECT object = %" PRIu64 + " type = %u bonustype = %u blksz = %u" + " bonuslen = %u dn_slots = %u\n", + drro->drr_object, drro->drr_type, drro->drr_bonustype, drro->drr_blksz, - drro->drr_bonuslen); + drro->drr_bonuslen, + drro->drr_dn_slots); } if (drro->drr_bonuslen > 0) { (void) ssread(buf, Modified: stable/12/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/ztest/ztest.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/cddl/contrib/opensolaris/cmd/ztest/ztest.c Thu Oct 31 09:14:50 2019 (r354211) @@ -196,6 +196,7 @@ extern uint64_t zfs_deadman_synctime_ms; extern int metaslab_preload_limit; extern boolean_t zfs_compressed_arc_enabled; extern boolean_t zfs_abd_scatter_enabled; +extern int dmu_object_alloc_chunk_shift; extern boolean_t zfs_force_some_double_word_sm_entries; static ztest_shared_opts_t *ztest_shared_opts; @@ -322,6 +323,7 @@ static ztest_shared_callstate_t *ztest_shared_callstat ztest_func_t ztest_dmu_read_write; ztest_func_t ztest_dmu_write_parallel; ztest_func_t ztest_dmu_object_alloc_free; +ztest_func_t ztest_dmu_object_next_chunk; ztest_func_t ztest_dmu_commit_callbacks; ztest_func_t ztest_zap; ztest_func_t ztest_zap_parallel; @@ -363,6 +365,7 @@ ztest_info_t ztest_info[] = { { ztest_dmu_read_write, 1, &zopt_always }, { ztest_dmu_write_parallel, 10, &zopt_always }, { ztest_dmu_object_alloc_free, 1, &zopt_always }, + { ztest_dmu_object_next_chunk, 1, &zopt_sometimes }, { ztest_dmu_commit_callbacks, 1, &zopt_always }, { ztest_zap, 30, &zopt_always }, { ztest_zap_parallel, 100, &zopt_always }, @@ -1366,7 +1369,7 @@ ztest_bt_bonus(dmu_buf_t *db) * it unique to the object, generation, and offset to verify that data * is not getting overwritten by data from other dnodes. */ -#define ZTEST_BONUS_FILL_TOKEN(obj, ds, gen, offset) \ +#define ZTEST_BONUS_FILL_TOKEN(obj, ds, gen, offset) \ (((ds) << 48) | ((gen) << 32) | ((obj) << 8) | (offset)) /* @@ -1895,6 +1898,7 @@ ztest_replay_setattr(void *arg1, void *arg2, boolean_t ztest_bt_generate(bbt, os, lr->lr_foid, dnodesize, -1ULL, lr->lr_mode, txg, crtxg); ztest_fill_unused_bonus(db, bbt, lr->lr_foid, os, bbt->bt_gen); + dmu_buf_rele(db, FTAG); (void) ztest_log_setattr(zd, tx, lr); @@ -3815,8 +3819,10 @@ ztest_dmu_object_alloc_free(ztest_ds_t *zd, uint64_t i ztest_od_t od[4]; int batchsize = sizeof (od) / sizeof (od[0]); - for (int b = 0; b < batchsize; b++) - ztest_od_init(&od[b], id, FTAG, b, DMU_OT_UINT64_OTHER, 0, 0, 0); + for (int b = 0; b < batchsize; b++) { + ztest_od_init(&od[b], id, FTAG, b, DMU_OT_UINT64_OTHER, + 0, 0, 0); + } /* * Destroy the previous batch of objects, create a new batch, @@ -3831,6 +3837,26 @@ ztest_dmu_object_alloc_free(ztest_ds_t *zd, uint64_t i } /* + * Rewind the global allocator to verify object allocation backfilling. + */ +void +ztest_dmu_object_next_chunk(ztest_ds_t *zd, uint64_t id) +{ + objset_t *os = zd->zd_os; + int dnodes_per_chunk = 1 << dmu_object_alloc_chunk_shift; + uint64_t object; + + /* + * Rewind the global allocator randomly back to a lower object number + * to force backfilling and reclamation of recently freed dnodes. + */ + mutex_enter(&os->os_obj_lock); + object = ztest_random(os->os_obj_next_chunk); + os->os_obj_next_chunk = P2ALIGN(object, dnodes_per_chunk); + mutex_exit(&os->os_obj_lock); +} + +/* * Verify that dmu_{read,write} work as expected. */ void @@ -3876,8 +3902,10 @@ ztest_dmu_read_write(ztest_ds_t *zd, uint64_t id) /* * Read the directory info. If it's the first time, set things up. */ - ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0, chunksize); - ztest_od_init(&od[1], id, FTAG, 1, DMU_OT_UINT64_OTHER, 0, 0, chunksize); + ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0, + chunksize); + ztest_od_init(&od[1], id, FTAG, 1, DMU_OT_UINT64_OTHER, 0, 0, + chunksize); if (ztest_object_init(zd, od, sizeof (od), B_FALSE) != 0) return; @@ -4146,8 +4174,10 @@ ztest_dmu_read_write_zcopy(ztest_ds_t *zd, uint64_t id /* * Read the directory info. If it's the first time, set things up. */ - ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, 0, 0); - ztest_od_init(&od[1], id, FTAG, 1, DMU_OT_UINT64_OTHER, 0, 0, chunksize); + ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, + 0, 0); + ztest_od_init(&od[1], id, FTAG, 1, DMU_OT_UINT64_OTHER, 0, 0, + chunksize); if (ztest_object_init(zd, od, sizeof (od), B_FALSE) != 0) return; @@ -4347,7 +4377,8 @@ ztest_dmu_write_parallel(ztest_ds_t *zd, uint64_t id) * to verify that parallel writes to an object -- even to the * same blocks within the object -- doesn't cause any trouble. */ - ztest_od_init(&od[0], ID_PARALLEL, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0, 0); + ztest_od_init(&od[0], ID_PARALLEL, FTAG, 0, DMU_OT_UINT64_OTHER, + 0, 0, 0); if (ztest_object_init(zd, od, sizeof (od), B_FALSE) != 0) return; @@ -4366,7 +4397,8 @@ ztest_dmu_prealloc(ztest_ds_t *zd, uint64_t id) uint64_t blocksize = ztest_random_blocksize(); void *data; - ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, 0, 0); + ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, + 0, 0); if (ztest_object_init(zd, od, sizeof (od), !ztest_random(2)) != 0) return; @@ -4590,7 +4622,8 @@ ztest_zap_parallel(ztest_ds_t *zd, uint64_t id) char name[20], string_value[20]; void *data; - ztest_od_init(&od[0], ID_PARALLEL, FTAG, micro, DMU_OT_ZAP_OTHER, 0, 0, 0); + ztest_od_init(&od[0], ID_PARALLEL, FTAG, micro, DMU_OT_ZAP_OTHER, + 0, 0, 0); if (ztest_object_init(zd, od, sizeof (od), B_FALSE) != 0) return; @@ -5411,7 +5444,8 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_t id) blocksize = ztest_random_blocksize(); blocksize = MIN(blocksize, 2048); /* because we write so many */ - ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, 0, 0); + ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, + 0, 0); if (ztest_object_init(zd, od, sizeof (od), B_FALSE) != 0) return; Modified: stable/12/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Thu Oct 31 09:14:50 2019 (r354211) @@ -292,10 +292,11 @@ zfs_prop_init(void) ZFS_VOLMODE_DEFAULT, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_VOLUME, "default | geom | dev | none", "VOLMODE", volmode_table); + zprop_register_index(ZFS_PROP_DNODESIZE, "dnodesize", ZFS_DNSIZE_LEGACY, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "legacy | auto | 1k | 2k | 4k | 8k | 16k", "DNSIZE", dnsize_table); - + /* inherit index (boolean) properties */ zprop_register_index(ZFS_PROP_ATIME, "atime", 1, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "on | off", "ATIME", boolean_table); Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Thu Oct 31 09:14:50 2019 (r354211) @@ -1812,6 +1812,9 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t *tx) FTAG); } } + + if (tx->tx_txg > dn->dn_dirty_txg) + dn->dn_dirty_txg = tx->tx_txg; mutex_exit(&dn->dn_mtx); if (db->db_blkid == DMU_SPILL_BLKID) @@ -3757,7 +3760,8 @@ dbuf_write_ready(zio_t *zio, arc_buf_t *buf, void *vdb if (dn->dn_type == DMU_OT_DNODE) { i = 0; while (i < db->db.db_size) { - dnode_phys_t *dnp = db->db.db_data + i; + dnode_phys_t *dnp = + (void *)(((char *)db->db.db_data) + i); i += DNODE_MIN_SIZE; if (dnp->dn_type != DMU_OT_NONE) { Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Thu Oct 31 09:14:50 2019 (r354211) @@ -32,6 +32,14 @@ #include #include +/* + * Each of the concurrent object allocators will grab + * 2^dmu_object_alloc_chunk_shift dnode slots at a time. The default is to + * grab 128 slots, which is 4 blocks worth. This was experimentally + * determined to be the lowest value that eliminates the measurable effect + * of lock contention from this code path. + */ +int dmu_object_alloc_chunk_shift = 7; static uint64_t dmu_object_alloc_impl(objset_t *os, dmu_object_type_t ot, int blocksize, @@ -44,6 +52,10 @@ dmu_object_alloc_impl(objset_t *os, dmu_object_type_t dnode_t *dn = NULL; int dn_slots = dnodesize >> DNODE_SHIFT; boolean_t restarted = B_FALSE; + uint64_t *cpuobj = &os->os_obj_next_percpu[CPU_SEQID % + os->os_obj_next_percpu_len]; + int dnodes_per_chunk = 1 << dmu_object_alloc_chunk_shift; + int error; if (dn_slots == 0) { dn_slots = DNODE_MIN_SLOTS; @@ -51,93 +63,149 @@ dmu_object_alloc_impl(objset_t *os, dmu_object_type_t ASSERT3S(dn_slots, >=, DNODE_MIN_SLOTS); ASSERT3S(dn_slots, <=, DNODE_MAX_SLOTS); } - - mutex_enter(&os->os_obj_lock); + + /* + * The "chunk" of dnodes that is assigned to a CPU-specific + * allocator needs to be at least one block's worth, to avoid + * lock contention on the dbuf. It can be at most one L1 block's + * worth, so that the "rescan after polishing off a L1's worth" + * logic below will be sure to kick in. + */ + if (dnodes_per_chunk < DNODES_PER_BLOCK) + dnodes_per_chunk = DNODES_PER_BLOCK; + if (dnodes_per_chunk > L1_dnode_count) + dnodes_per_chunk = L1_dnode_count; + +#ifdef __FreeBSD__ + object = atomic_load_64(cpuobj); +#else + object = *cpuobj; +#endif + for (;;) { - object = os->os_obj_next; /* - * Each time we polish off a L1 bp worth of dnodes (2^12 - * objects), move to another L1 bp that's still - * reasonably sparse (at most 1/4 full). Look from the - * beginning at most once per txg. If we still can't - * allocate from that L1 block, search for an empty L0 - * block, which will quickly skip to the end of the - * metadnode if the no nearby L0 blocks are empty. This - * fallback avoids a pathology where full dnode blocks - * containing large dnodes appear sparse because they - * have a low blk_fill, leading to many failed - * allocation attempts. In the long term a better - * mechanism to search for sparse metadnode regions, - * such as spacemaps, could be implemented. - * - * os_scan_dnodes is set during txg sync if enough objects - * have been freed since the previous rescan to justify - * backfilling again. - * - * Note that dmu_traverse depends on the behavior that we use - * multiple blocks of the dnode object before going back to - * reuse objects. Any change to this algorithm should preserve - * that property or find another solution to the issues - * described in traverse_visitbp. + * If we finished a chunk of dnodes, get a new one from + * the global allocator. */ - if (P2PHASE(object, L1_dnode_count) == 0) { - uint64_t offset; - uint64_t blkfill; - int minlvl; - int error; - if (os->os_rescan_dnodes) { - offset = 0; - os->os_rescan_dnodes = B_FALSE; - } else { - offset = object << DNODE_SHIFT; + if ((P2PHASE(object, dnodes_per_chunk) == 0) || + (P2PHASE(object + dn_slots - 1, dnodes_per_chunk) < + dn_slots)) { + DNODE_STAT_BUMP(dnode_alloc_next_chunk); + mutex_enter(&os->os_obj_lock); + ASSERT0(P2PHASE(os->os_obj_next_chunk, + dnodes_per_chunk)); + object = os->os_obj_next_chunk; + + /* + * Each time we polish off a L1 bp worth of dnodes + * (2^12 objects), move to another L1 bp that's + * still reasonably sparse (at most 1/4 full). Look + * from the beginning at most once per txg. If we + * still can't allocate from that L1 block, search + * for an empty L0 block, which will quickly skip + * to the end of the metadnode if the no nearby L0 + * blocks are empty. This fallback avoids a + * pathology where full dnode blocks containing + * large dnodes appear sparse because they have a + * low blk_fill, leading to many failed allocation + * attempts. In the long term a better mechanism to + * search for sparse metadnode regions, such as + * spacemaps, could be implemented. + * + * os_scan_dnodes is set during txg sync if enough + * objects have been freed since the previous + * rescan to justify backfilling again. + * + * Note that dmu_traverse depends on the behavior + * that we use multiple blocks of the dnode object + * before going back to reuse objects. Any change + * to this algorithm should preserve that property + * or find another solution to the issues described + * in traverse_visitbp. + */ + if (P2PHASE(object, L1_dnode_count) == 0) { + uint64_t offset; + uint64_t blkfill; + int minlvl; + if (os->os_rescan_dnodes) { + offset = 0; + os->os_rescan_dnodes = B_FALSE; + } else { + offset = object << DNODE_SHIFT; + } + blkfill = restarted ? 1 : DNODES_PER_BLOCK >> 2; + minlvl = restarted ? 1 : 2; + restarted = B_TRUE; + error = dnode_next_offset(DMU_META_DNODE(os), + DNODE_FIND_HOLE, &offset, minlvl, + blkfill, 0); + if (error == 0) { + object = offset >> DNODE_SHIFT; + } } - blkfill = restarted ? 1 : DNODES_PER_BLOCK >> 2; - minlvl = restarted ? 1 : 2; - restarted = B_TRUE; - error = dnode_next_offset(DMU_META_DNODE(os), - DNODE_FIND_HOLE, &offset, minlvl, blkfill, 0); - if (error == 0) - object = offset >> DNODE_SHIFT; + /* + * Note: if "restarted", we may find a L0 that + * is not suitably aligned. + */ + os->os_obj_next_chunk = + P2ALIGN(object, dnodes_per_chunk) + + dnodes_per_chunk; + (void) atomic_swap_64(cpuobj, object); + mutex_exit(&os->os_obj_lock); } - os->os_obj_next = object + dn_slots; /* + * The value of (*cpuobj) before adding dn_slots is the object + * ID assigned to us. The value afterwards is the object ID + * assigned to whoever wants to do an allocation next. + */ + object = atomic_add_64_nv(cpuobj, dn_slots) - dn_slots; + + /* * XXX We should check for an i/o error here and return * up to our caller. Actually we should pre-read it in * dmu_tx_assign(), but there is currently no mechanism * to do so. */ - (void) dnode_hold_impl(os, object, DNODE_MUST_BE_FREE, dn_slots, - FTAG, &dn); - if (dn) - break; - - if (dmu_object_next(os, &object, B_TRUE, 0) == 0) - os->os_obj_next = object; - else + error = dnode_hold_impl(os, object, DNODE_MUST_BE_FREE, + dn_slots, FTAG, &dn); + if (error == 0) { + rw_enter(&dn->dn_struct_rwlock, RW_WRITER); /* - * Skip to next known valid starting point for a dnode. + * Another thread could have allocated it; check + * again now that we have the struct lock. */ - os->os_obj_next = P2ROUNDUP(object + 1, - DNODES_PER_BLOCK); - } + if (dn->dn_type == DMU_OT_NONE) { + dnode_allocate(dn, ot, blocksize, 0, + bonustype, bonuslen, dn_slots, tx); + rw_exit(&dn->dn_struct_rwlock); + dmu_tx_add_new_object(tx, dn); + dnode_rele(dn, FTAG); + return (object); + } + rw_exit(&dn->dn_struct_rwlock); + dnode_rele(dn, FTAG); + DNODE_STAT_BUMP(dnode_alloc_race); + } - dnode_allocate(dn, ot, blocksize, indirect_blockshift, - bonustype, bonuslen, dn_slots, tx); - mutex_exit(&os->os_obj_lock); - - dmu_tx_add_new_object(tx, dn); - dnode_rele(dn, FTAG); - - return (object); + /* + * Skip to next known valid starting point on error. This + * is the start of the next block of dnodes. + */ + if (dmu_object_next(os, &object, B_TRUE, 0) != 0) { + object = P2ROUNDUP(object + 1, DNODES_PER_BLOCK); + DNODE_STAT_BUMP(dnode_alloc_next_block); + } + (void) atomic_swap_64(cpuobj, object); + } } uint64_t dmu_object_alloc(objset_t *os, dmu_object_type_t ot, int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) { - return dmu_object_alloc_impl(os, ot, blocksize, 0, bonustype, - bonuslen, 0, tx); + return (dmu_object_alloc_impl(os, ot, blocksize, 0, bonustype, + bonuslen, 0, tx)); } uint64_t @@ -145,8 +213,8 @@ dmu_object_alloc_ibs(objset_t *os, dmu_object_type_t o int indirect_blockshift, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) { - return dmu_object_alloc_impl(os, ot, blocksize, indirect_blockshift, - bonustype, bonuslen, 0, tx); + return (dmu_object_alloc_impl(os, ot, blocksize, indirect_blockshift, + bonustype, bonuslen, 0, tx)); } uint64_t @@ -178,7 +246,7 @@ dmu_object_claim_dnsize(objset_t *os, uint64_t object, dn_slots = DNODE_MIN_SLOTS; ASSERT3S(dn_slots, >=, DNODE_MIN_SLOTS); ASSERT3S(dn_slots, <=, DNODE_MAX_SLOTS); - + if (object == DMU_META_DNODE_OBJECT && !dmu_tx_private_ok(tx)) return (SET_ERROR(EBADF)); @@ -199,7 +267,7 @@ dmu_object_reclaim(objset_t *os, uint64_t object, dmu_ int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) { return (dmu_object_reclaim_dnsize(os, object, ot, blocksize, bonustype, - bonuslen, 0, tx)); + bonuslen, DNODE_MIN_SIZE, tx)); } int @@ -211,6 +279,9 @@ dmu_object_reclaim_dnsize(objset_t *os, uint64_t objec int dn_slots = dnodesize >> DNODE_SHIFT; int err; + if (dn_slots == 0) + dn_slots = DNODE_MIN_SLOTS; + if (object == DMU_META_DNODE_OBJECT) return (SET_ERROR(EBADF)); @@ -260,28 +331,52 @@ int dmu_object_next(objset_t *os, uint64_t *objectp, boolean_t hole, uint64_t txg) { uint64_t offset; - dmu_object_info_t doi; + uint64_t start_obj; struct dsl_dataset *ds = os->os_dsl_dataset; - int dnodesize; int error; - /* - * Avoid expensive dnode hold if this dataset doesn't use large dnodes. - */ - if (ds && ds->ds_feature_inuse[SPA_FEATURE_LARGE_DNODE]) { - error = dmu_object_info(os, *objectp, &doi); - if (error && !(error == EINVAL && *objectp == 0)) - return (SET_ERROR(error)); - else - dnodesize = doi.doi_dnodesize; + if (*objectp == 0) { + start_obj = 1; + } else if (ds && ds->ds_feature_inuse[SPA_FEATURE_LARGE_DNODE]) { + uint64_t i = *objectp + 1; + uint64_t last_obj = *objectp | (DNODES_PER_BLOCK - 1); + dmu_object_info_t doi; + + /* + * Scan through the remaining meta dnode block. The contents + * of each slot in the block are known so it can be quickly + * checked. If the block is exhausted without a match then + * hand off to dnode_next_offset() for further scanning. + */ + while (i <= last_obj) { + error = dmu_object_info(os, i, &doi); + if (error == ENOENT) { + if (hole) { + *objectp = i; + return (0); + } else { + i++; + } + } else if (error == EEXIST) { + i++; + } else if (error == 0) { + if (hole) { + i += doi.doi_dnodesize >> DNODE_SHIFT; + } else { + *objectp = i; + return (0); + } + } else { + return (error); + } + } + + start_obj = i; } else { - dnodesize = DNODE_MIN_SIZE; + start_obj = *objectp + 1; } - if (*objectp == 0) - offset = 1 << DNODE_SHIFT; - else - offset = (*objectp << DNODE_SHIFT) + dnodesize; + offset = start_obj << DNODE_SHIFT; error = dnode_next_offset(DMU_META_DNODE(os), (hole ? DNODE_FIND_HOLE : 0), &offset, 0, DNODES_PER_BLOCK, txg); Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Thu Oct 31 09:14:50 2019 (r354211) @@ -566,6 +566,9 @@ dmu_objset_open_impl(spa_t *spa, dsl_dataset_t *ds, bl mutex_init(&os->os_userused_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&os->os_obj_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&os->os_user_ptr_lock, NULL, MUTEX_DEFAULT, NULL); + os->os_obj_next_percpu_len = boot_ncpus; + os->os_obj_next_percpu = kmem_zalloc(os->os_obj_next_percpu_len * + sizeof (os->os_obj_next_percpu[0]), KM_SLEEP); dnode_special_open(os, &os->os_phys->os_meta_dnode, DMU_META_DNODE_OBJECT, &os->os_meta_dnode); @@ -844,6 +847,9 @@ dmu_objset_evict_done(objset_t *os) rw_enter(&os_lock, RW_READER); rw_exit(&os_lock); + kmem_free(os->os_obj_next_percpu, + os->os_obj_next_percpu_len * sizeof (os->os_obj_next_percpu[0])); + mutex_destroy(&os->os_lock); mutex_destroy(&os->os_userused_lock); mutex_destroy(&os->os_obj_lock); @@ -1243,10 +1249,23 @@ dmu_objset_sync_dnodes(multilist_sublist_t *list, dmu_ ASSERT3U(dn->dn_nlevels, <=, DN_MAX_LEVELS); multilist_sublist_remove(list, dn); + /* + * If we are not doing useraccounting (os_synced_dnodes == NULL) + * we are done with this dnode for this txg. Unset dn_dirty_txg + * if later txgs aren't dirtying it so that future holders do + * not get a stale value. Otherwise, we will do this in + * userquota_updates_task() when processing has completely + * finished for this txg. + */ multilist_t *newlist = dn->dn_objset->os_synced_dnodes; if (newlist != NULL) { (void) dnode_add_ref(dn, newlist); multilist_insert(newlist, dn); + } else { + mutex_enter(&dn->dn_mtx); + if (dn->dn_dirty_txg == tx->tx_txg) + dn->dn_dirty_txg = 0; + mutex_exit(&dn->dn_mtx); } dnode_sync(dn, tx); @@ -1606,6 +1625,8 @@ userquota_updates_task(void *arg) dn->dn_id_flags |= DN_ID_CHKED_BONUS; } dn->dn_id_flags &= ~(DN_ID_NEW_EXIST); + if (dn->dn_dirty_txg == spa_syncing_txg(os->os_spa)) + dn->dn_dirty_txg = 0; mutex_exit(&dn->dn_mtx); multilist_sublist_remove(list, dn); Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Thu Oct 31 09:14:50 2019 (r354211) @@ -1441,17 +1441,12 @@ dmu_recv_begin_check(void *arg, dmu_tx_t *tx) /* * The receiving code doesn't know how to translate large blocks * to smaller ones, so the pool must have the LARGE_BLOCKS - * feature enabled if the stream has LARGE_BLOCKS. + * feature enabled if the stream has LARGE_BLOCKS. Same with + * large dnodes. */ if ((featureflags & DMU_BACKUP_FEATURE_LARGE_BLOCKS) && !spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_LARGE_BLOCKS)) return (SET_ERROR(ENOTSUP)); - - /* - * The receiving code doesn't know how to translate large dnodes - * to smaller ones, so the pool must have the LARGE_DNODE - * feature enabled if the stream has LARGE_DNODE. - */ if ((featureflags & DMU_BACKUP_FEATURE_LARGE_DNODE) && !spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_LARGE_DNODE)) return (SET_ERROR(ENOTSUP)); @@ -1659,6 +1654,9 @@ dmu_recv_resume_begin_check(void *arg, dmu_tx_t *tx) dsl_dataset_t *ds; const char *tofs = drba->drba_cookie->drc_tofs; + /* 6 extra bytes for /%recv */ + char recvname[ZFS_MAX_DATASET_NAME_LEN + 6]; + /* already checked */ ASSERT3U(drrb->drr_magic, ==, DMU_BACKUP_MAGIC); ASSERT(featureflags & DMU_BACKUP_FEATURE_RESUMING); @@ -1686,8 +1684,18 @@ dmu_recv_resume_begin_check(void *arg, dmu_tx_t *tx) !spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_LZ4_COMPRESS)) return (SET_ERROR(ENOTSUP)); - /* 6 extra bytes for /%recv */ - char recvname[ZFS_MAX_DATASET_NAME_LEN + 6]; + /* + * The receiving code doesn't know how to translate large blocks + * to smaller ones, so the pool must have the LARGE_BLOCKS + * feature enabled if the stream has LARGE_BLOCKS. Same with + * large dnodes. + */ + if ((featureflags & DMU_BACKUP_FEATURE_LARGE_BLOCKS) && + !spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_LARGE_BLOCKS)) + return (SET_ERROR(ENOTSUP)); + if ((featureflags & DMU_BACKUP_FEATURE_LARGE_DNODE) && + !spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_LARGE_DNODE)) + return (SET_ERROR(ENOTSUP)); (void) snprintf(recvname, sizeof (recvname), "%s/%s", tofs, recv_clone_name); @@ -2149,6 +2157,8 @@ receive_object(struct receive_writer_arg *rwa, struct dmu_tx_t *tx; uint64_t object; int err; + uint8_t dn_slots = drro->drr_dn_slots != 0 ? + drro->drr_dn_slots : DNODE_MIN_SLOTS; if (drro->drr_type == DMU_OT_NONE || !DMU_OT_IS_VALID(drro->drr_type) || @@ -2159,15 +2169,16 @@ receive_object(struct receive_writer_arg *rwa, struct drro->drr_blksz < SPA_MINBLOCKSIZE || drro->drr_blksz > spa_maxblocksize(dmu_objset_spa(rwa->os)) || drro->drr_bonuslen > - DN_BONUS_SIZE(spa_maxdnodesize(dmu_objset_spa(rwa->os)))) { + DN_BONUS_SIZE(spa_maxdnodesize(dmu_objset_spa(rwa->os))) || + dn_slots > + (spa_maxdnodesize(dmu_objset_spa(rwa->os)) >> DNODE_SHIFT)) { return (SET_ERROR(EINVAL)); } err = dmu_object_info(rwa->os, drro->drr_object, &doi); - if (err != 0 && err != ENOENT) + if (err != 0 && err != ENOENT && err != EEXIST) return (SET_ERROR(EINVAL)); - object = err == 0 ? drro->drr_object : DMU_NEW_OBJECT; if (drro->drr_object > rwa->max_object) rwa->max_object = drro->drr_object; @@ -2180,18 +2191,66 @@ receive_object(struct receive_writer_arg *rwa, struct if (err == 0) { int nblkptr; + object = drro->drr_object; + nblkptr = deduce_nblkptr(drro->drr_bonustype, drro->drr_bonuslen); if (drro->drr_blksz != doi.doi_data_block_size || - nblkptr < doi.doi_nblkptr) { + nblkptr < doi.doi_nblkptr || + dn_slots != doi.doi_dnodesize >> DNODE_SHIFT) { err = dmu_free_long_range(rwa->os, drro->drr_object, 0, DMU_OBJECT_END); if (err != 0) return (SET_ERROR(EINVAL)); } + } else if (err == EEXIST) { + /* + * The object requested is currently an interior slot of a + * multi-slot dnode. This will be resolved when the next txg + * is synced out, since the send stream will have told us + * to free this slot when we freed the associated dnode + * earlier in the stream. + */ + txg_wait_synced(dmu_objset_pool(rwa->os), 0); + object = drro->drr_object; + } else { + /* object is free and we are about to allocate a new one */ + object = DMU_NEW_OBJECT; } + /* + * If this is a multi-slot dnode there is a chance that this + * object will expand into a slot that is already used by + * another object from the previous snapshot. We must free + * these objects before we attempt to allocate the new dnode. + */ + if (dn_slots > 1) { + boolean_t need_sync = B_FALSE; + + for (uint64_t slot = drro->drr_object + 1; + slot < drro->drr_object + dn_slots; + slot++) { + dmu_object_info_t slot_doi; + + err = dmu_object_info(rwa->os, slot, &slot_doi); + if (err == ENOENT || err == EEXIST) + continue; + else if (err != 0) + return (err); + + err = dmu_free_long_object(rwa->os, slot); + + if (err != 0) + return (err); + + need_sync = B_TRUE; + } + + if (need_sync) + txg_wait_synced(dmu_objset_pool(rwa->os), 0); + } + tx = dmu_tx_create(rwa->os); dmu_tx_hold_bonus(tx, object); err = dmu_tx_assign(tx, TXG_WAIT); @@ -2205,15 +2264,17 @@ receive_object(struct receive_writer_arg *rwa, struct err = dmu_object_claim_dnsize(rwa->os, drro->drr_object, drro->drr_type, drro->drr_blksz, drro->drr_bonustype, drro->drr_bonuslen, - drro->drr_dn_slots << DNODE_SHIFT, tx); + 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_bonuslen != doi.doi_bonus_size || + drro->drr_dn_slots != (doi.doi_dnodesize >> DNODE_SHIFT)) { /* currently allocated, but with different properties */ - err = dmu_object_reclaim(rwa->os, drro->drr_object, + err = dmu_object_reclaim_dnsize(rwa->os, drro->drr_object, drro->drr_type, drro->drr_blksz, - drro->drr_bonustype, drro->drr_bonuslen, tx); + drro->drr_bonustype, drro->drr_bonuslen, + drro->drr_dn_slots << DNODE_SHIFT, tx); } if (err != 0) { dmu_tx_commit(tx); @@ -2263,13 +2324,11 @@ receive_freeobjects(struct receive_writer_arg *rwa, dmu_object_info_t doi; int err; - err = dmu_object_info(rwa->os, obj, &doi); - if (err == ENOENT) { - obj++; - continue; - } else if (err != 0) { + err = dmu_object_info(rwa->os, obj, NULL); + if (err == ENOENT) + continue; + else if (err != 0) return (err); - } err = dmu_free_long_object(rwa->os, obj); if (err != 0) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Thu Oct 31 09:14:50 2019 (r354211) @@ -1252,11 +1252,13 @@ dmu_tx_sa_registration_hold(sa_os_t *sa, dmu_tx_t *tx) void dmu_tx_hold_spill(dmu_tx_t *tx, uint64_t object) { - dmu_tx_hold_t *txh = dmu_tx_hold_object_impl(tx, - tx->tx_objset, object, THT_SPILL, 0, 0); + dmu_tx_hold_t *txh; - (void) refcount_add_many(&txh->txh_space_towrite, - SPA_OLD_MAXBLOCKSIZE, FTAG); + txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, object, + THT_SPILL, 0, 0); + if (txh != NULL) + (void) refcount_add_many(&txh->txh_space_towrite, + SPA_OLD_MAXBLOCKSIZE, FTAG); } void Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Thu Oct 31 09:14:50 2019 (r354211) @@ -40,21 +40,41 @@ #include #include +dnode_stats_t dnode_stats = { + { "dnode_hold_dbuf_hold", KSTAT_DATA_UINT64 }, + { "dnode_hold_dbuf_read", KSTAT_DATA_UINT64 }, + { "dnode_hold_alloc_hits", KSTAT_DATA_UINT64 }, + { "dnode_hold_alloc_misses", KSTAT_DATA_UINT64 }, + { "dnode_hold_alloc_interior", KSTAT_DATA_UINT64 }, + { "dnode_hold_alloc_lock_retry", KSTAT_DATA_UINT64 }, + { "dnode_hold_alloc_lock_misses", KSTAT_DATA_UINT64 }, + { "dnode_hold_alloc_type_none", KSTAT_DATA_UINT64 }, + { "dnode_hold_free_hits", KSTAT_DATA_UINT64 }, + { "dnode_hold_free_misses", KSTAT_DATA_UINT64 }, + { "dnode_hold_free_lock_misses", KSTAT_DATA_UINT64 }, + { "dnode_hold_free_lock_retry", KSTAT_DATA_UINT64 }, + { "dnode_hold_free_overflow", KSTAT_DATA_UINT64 }, + { "dnode_hold_free_refcount", KSTAT_DATA_UINT64 }, + { "dnode_hold_free_txg", KSTAT_DATA_UINT64 }, + { "dnode_free_interior_lock_retry", KSTAT_DATA_UINT64 }, + { "dnode_allocate", KSTAT_DATA_UINT64 }, + { "dnode_reallocate", KSTAT_DATA_UINT64 }, + { "dnode_buf_evict", KSTAT_DATA_UINT64 }, + { "dnode_alloc_next_chunk", KSTAT_DATA_UINT64 }, + { "dnode_alloc_race", KSTAT_DATA_UINT64 }, + { "dnode_alloc_next_block", KSTAT_DATA_UINT64 }, + { "dnode_move_invalid", KSTAT_DATA_UINT64 }, + { "dnode_move_recheck1", KSTAT_DATA_UINT64 }, + { "dnode_move_recheck2", KSTAT_DATA_UINT64 }, + { "dnode_move_special", KSTAT_DATA_UINT64 }, + { "dnode_move_handle", KSTAT_DATA_UINT64 }, + { "dnode_move_rwlock", KSTAT_DATA_UINT64 }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Oct 31 11:31:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0094D1A4E6C; Thu, 31 Oct 2019 11:31:14 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473jnY6G9pz48wZ; Thu, 31 Oct 2019 11:31:13 +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 BA43A22048; Thu, 31 Oct 2019 11:31:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VBVD2k005044; Thu, 31 Oct 2019 11:31:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VBVDBS005043; Thu, 31 Oct 2019 11:31:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910311131.x9VBVDBS005043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 31 Oct 2019 11:31:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354212 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 354212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 11:31:14 -0000 Author: avg Date: Thu Oct 31 11:31:13 2019 New Revision: 354212 URL: https://svnweb.freebsd.org/changeset/base/354212 Log: iicbb: allow longer SCL low timeout and other improvements First, SCL low timeout is set to 25 milliseconds by default as opposed to 1 millisecond before. The new value is based on the SMBus specification. The timeout can be changed on a per bus basis using dev.iicbb.N.scl_low_timeout sysctl. The driver uses DELAY to wait for high SCL up to 1 millisecond, then it switches to pause_sbt(SBT_1MS) for the rest of the timeout. While here I made a number of other changes. 'udelay' that's used for timing clock and data signals is now calculated based on the requested bus frequency (dev.iicbus.N.frequency) instead of being hardcoded to 10 microseconds. The calculations are done in such a fashion that the default bus frequency of 100000 is converted to udelay of 10 us. This is for backward compatibility. The actual frequency will be less than a quarter (I think) of the requested frequency. Also, I added detection of stuck low SCL in a few places. Previously, the code would just carry on after the SCL low timeout and that might potentially lead to misinterpreted bits. Finally, I fixed several style issues near the code that I changed. Many more are still remaining. Tested by accessing HTU21 temperature and humidity sensor in this setup: superio0: at port 0x2e-0x2f on isa0 gpio1: at GPIO ldn 0x07 on superio0 pcib0: allocated type 4 (0x220-0x226) for rid 0 of gpio1 gpiobus1: on gpio1 gpioiic0: at pins 14-15 on gpiobus1 gpioiic0: SCL pin: 14, SDA pin: 15 iicbb0: on gpioiic0 iicbus0: on iicbb0 master-only iic0: on iicbus0 Discussed with: ian, imp MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D22109 Modified: head/sys/dev/iicbus/iicbb.c Modified: head/sys/dev/iicbus/iicbb.c ============================================================================== --- head/sys/dev/iicbus/iicbb.c Thu Oct 31 09:14:50 2019 (r354211) +++ head/sys/dev/iicbus/iicbb.c Thu Oct 31 11:31:13 2019 (r354212) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef FDT @@ -68,9 +69,13 @@ __FBSDID("$FreeBSD$"); #include "iicbus_if.h" #include "iicbb_if.h" +/* Based on the SMBus specification. */ +#define DEFAULT_SCL_LOW_TIMEOUT (25 * 1000) + struct iicbb_softc { device_t iicbus; - int udelay; /* signal toggle delay in usec */ + u_int udelay; /* signal toggle delay in usec */ + u_int scl_low_timeout; }; static int iicbb_attach(device_t); @@ -86,6 +91,7 @@ static int iicbb_write(device_t, const char *, int, in static int iicbb_read(device_t, char *, int, int *, int, int); static int iicbb_reset(device_t, u_char, u_char, u_char *); static int iicbb_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs); +static void iicbb_set_speed(struct iicbb_softc *sc, u_char); #ifdef FDT static phandle_t iicbb_get_node(device_t, device_t); #endif @@ -142,9 +148,19 @@ iicbb_attach(device_t dev) sc->iicbus = device_add_child(dev, "iicbus", -1); if (!sc->iicbus) return (ENXIO); - sc->udelay = 10; /* 10 uS default */ - bus_generic_attach(dev); + sc->scl_low_timeout = DEFAULT_SCL_LOW_TIMEOUT; + + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "delay", CTLFLAG_RD, &sc->udelay, + 0, "Signal change delay controlled by bus frequency, microseconds"); + + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "scl_low_timeout", CTLFLAG_RWTUN, &sc->scl_low_timeout, + 0, "SCL low timeout, microseconds"); + bus_generic_attach(dev); return (0); } @@ -201,24 +217,17 @@ iicbb_print_child(device_t bus, device_t dev) return (retval); } -#define I2C_SETSDA(sc,dev,val) do { \ - IICBB_SETSDA(device_get_parent(dev), val); \ +#define I2C_GETSDA(dev) (IICBB_GETSDA(device_get_parent(dev))) +#define I2C_SETSDA(dev, x) (IICBB_SETSDA(device_get_parent(dev), x)) +#define I2C_GETSCL(dev) (IICBB_GETSCL(device_get_parent(dev))) +#define I2C_SETSCL(dev, x) (IICBB_SETSCL(device_get_parent(dev), x)) + +#define I2C_SET(sc, dev, ctrl, val) do { \ + iicbb_setscl(dev, ctrl); \ + I2C_SETSDA(dev, val); \ DELAY(sc->udelay); \ } while (0) -#define I2C_SETSCL(dev,val) do { \ - iicbb_setscl(dev, val, 100); \ - } while (0) - -#define I2C_SET(sc,dev,ctrl,data) do { \ - I2C_SETSCL(dev, ctrl); \ - I2C_SETSDA(sc, dev, data); \ - } while (0) - -#define I2C_GETSDA(dev) (IICBB_GETSDA(device_get_parent(dev))) - -#define I2C_GETSCL(dev) (IICBB_GETSCL(device_get_parent(dev))) - static int i2c_debug = 0; #define I2C_DEBUG(x) do { \ if (i2c_debug) (x); \ @@ -229,20 +238,37 @@ static int i2c_debug = 0; } while (0) static void -iicbb_setscl(device_t dev, int val, int timeout) +iicbb_setscl(device_t dev, int val) { struct iicbb_softc *sc = device_get_softc(dev); - int k = 0; + sbintime_t now, end; + int fast_timeout; - IICBB_SETSCL(device_get_parent(dev), val); + I2C_SETSCL(dev, val); DELAY(sc->udelay); - while (val && !I2C_GETSCL(dev) && k++ < timeout) { - IICBB_SETSCL(device_get_parent(dev), val); + /* Pulling low cannot fail. */ + if (!val) + return; + + /* Use DELAY for up to 1 ms, then switch to pause. */ + end = sbinuptime() + sc->scl_low_timeout * SBT_1US; + fast_timeout = MIN(sc->scl_low_timeout, 1000); + while (fast_timeout > 0) { + if (I2C_GETSCL(dev)) + return; + I2C_SETSCL(dev, 1); /* redundant ? */ DELAY(sc->udelay); + fast_timeout -= sc->udelay; } - return; + while (!I2C_GETSCL(dev)) { + now = sbinuptime(); + if (now >= end) + break; + pause_sbt("iicbb-scl-low", SBT_1MS, C_PREL(8), 0); + } + } static void @@ -290,6 +316,11 @@ iicbb_ack(device_t dev, int timeout) I2C_SET(sc,dev,0,1); I2C_SET(sc,dev,1,1); + + /* SCL must be high now. */ + if (!I2C_GETSCL(dev)) + return (IIC_ETIMEOUT); + do { noack = I2C_GETSDA(dev); if (!noack) @@ -301,14 +332,14 @@ iicbb_ack(device_t dev, int timeout) I2C_SET(sc,dev,0,1); I2C_DEBUG(printf("%c ",noack?'-':'+')); - return (noack); + return (noack ? IIC_ENOACK : 0); } static void iicbb_sendbyte(device_t dev, u_char data, int timeout) { int i; - + for (i=7; i>=0; i--) { if (data&(1<")); I2C_DEBUG(printf("\n")); + + /* SCL must be high now. */ + if (!I2C_GETSCL(dev)) + return (IIC_ETIMEOUT); return (0); } @@ -408,15 +445,13 @@ iicbb_write(device_t dev, const char *buf, int len, in iicbb_sendbyte(dev,(u_char)*buf++, timeout); /* check for ack */ - if (iicbb_ack(dev, timeout)) { - error = IIC_ENOACK; - goto error; - } - bytes ++; - len --; + error = iicbb_ack(dev, timeout); + if (error != 0) + break; + bytes++; + len--; } -error: *sent = bytes; return (error); } @@ -452,6 +487,24 @@ iicbb_transfer(device_t dev, struct iic_msg *msgs, uin IICBB_POST_XFER(device_get_parent(dev)); return (error); +} + +static void +iicbb_set_speed(struct iicbb_softc *sc, u_char speed) +{ + u_int busfreq, period; + + /* + * NB: the resulting frequency will be a quarter (even less) of the + * configured bus frequency. This is for historic reasons. The default + * bus frequency is 100 kHz. And the historic default udelay is 10 + * microseconds. The cycle of sending a bit takes four udelay-s plus + * SCL is kept low for extra two udelay-s. The actual I/O toggling also + * has an overhead. + */ + busfreq = IICBUS_GET_FREQUENCY(sc->iicbus, speed); + period = 1000000 / busfreq; /* Hz -> uS */ + sc->udelay = MAX(period, 1); } DRIVER_MODULE(iicbus, iicbb, iicbus_driver, iicbus_devclass, 0, 0); From owner-svn-src-all@freebsd.org Thu Oct 31 11:59:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0D891A58E2; Thu, 31 Oct 2019 11:59:00 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473kPc6BGTz4BLN; Thu, 31 Oct 2019 11:59:00 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6F7D22462; Thu, 31 Oct 2019 11:59:00 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VBx0kA020964; Thu, 31 Oct 2019 11:59:00 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VBx0AK020963; Thu, 31 Oct 2019 11:59:00 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201910311159.x9VBx0AK020963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Thu, 31 Oct 2019 11:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354213 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 354213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 11:59:01 -0000 Author: luporl Date: Thu Oct 31 11:59:00 2019 New Revision: 354213 URL: https://svnweb.freebsd.org/changeset/base/354213 Log: [PPC64] Fix trapstk overflow In some scenarios, the 4K trapstk may overflow, corrupting tmpstk. This was observed during remote debugging, with the following steps: At remote host (R): - enter kdb during boot - switch to gdb backend At local host (L): - attach gdb to R - try to read an invalid memory position At R: - a DSI trap occurs and kdb restarts (all this occurs on trapstk) - while printing the stacktrace, trapstk overflows and corrupts tmpstk Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D22200 Modified: head/sys/powerpc/aim/locore64.S Modified: head/sys/powerpc/aim/locore64.S ============================================================================== --- head/sys/powerpc/aim/locore64.S Thu Oct 31 11:31:13 2019 (r354212) +++ head/sys/powerpc/aim/locore64.S Thu Oct 31 11:59:00 2019 (r354213) @@ -66,7 +66,7 @@ TOC_ENTRY(tmpstk) TOC_ENTRY(can_wakeup) #ifdef KDB -#define TRAPSTKSZ 4096 /* 4k trap stack */ +#define TRAPSTKSZ 8192 /* 8k trap stack */ GLOBAL(trapstk) .space TRAPSTKSZ TOC_ENTRY(trapstk) From owner-svn-src-all@freebsd.org Thu Oct 31 12:03:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A6461A6578; Thu, 31 Oct 2019 12:03:49 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473kW85ldSz4CB7; Thu, 31 Oct 2019 12:03:48 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F0D622628; Thu, 31 Oct 2019 12:03:48 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VC3ml9026676; Thu, 31 Oct 2019 12:03:48 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VC3mN0026674; Thu, 31 Oct 2019 12:03:48 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201910311203.x9VC3mN0026674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Thu, 31 Oct 2019 12:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354214 - in head/sys/powerpc: include powerpc X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: in head/sys/powerpc: include powerpc X-SVN-Commit-Revision: 354214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 12:03:49 -0000 Author: luporl Date: Thu Oct 31 12:03:47 2019 New Revision: 354214 URL: https://svnweb.freebsd.org/changeset/base/354214 Log: Fix GDB machdep code for PPC/PPC64 There was a couple issues with GDB machdep code for PPC/PPC64, the main ones being: - wrong register sizes being returned - pcb_context index was wrong (this affects all PPC variants) Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D22201 Modified: head/sys/powerpc/include/gdb_machdep.h head/sys/powerpc/powerpc/gdb_machdep.c Modified: head/sys/powerpc/include/gdb_machdep.h ============================================================================== --- head/sys/powerpc/include/gdb_machdep.h Thu Oct 31 11:59:00 2019 (r354213) +++ head/sys/powerpc/include/gdb_machdep.h Thu Oct 31 12:03:47 2019 (r354214) @@ -36,10 +36,43 @@ #define PPC_GDB_NREGS4 (70 + 1) #define PPC_GDB_NREGS8 (1 + 32) #define PPC_GDB_NREGS16 0 + #else +/* + * 0 - 32*GPR(4/8) + * 32 - 32*FPR(8) + * 64 - PC, PS (4/8) + * 66 - CR (4) + * 67 - LR, CTR (4/8) + * 69 - XER, FPSCR (4) + * 71 - 32*VR(16) + * 103 - VSCR, VRSAVE (4) + */ + +#define PPC_REGNUM_R0 0 +#define PPC_REGNUM_R31 (PPC_REGNUM_R0 + 31) +#define PPC_REGNUM_FR0 32 +#define PPC_REGNUM_FR31 (PPC_REGNUM_FR0 + 31) +#define PPC_REGNUM_PC 64 +#define PPC_REGNUM_PS 65 +#define PPC_REGNUM_CR 66 +#define PPC_REGNUM_LR 67 +#define PPC_REGNUM_CTR 68 +#define PPC_REGNUM_XER 69 +#define PPC_REGNUM_FPSCR 70 +#define PPC_REGNUM_VR0 71 +#define PPC_REGNUM_VR31 (PPC_REGNUM_VR0 + 31) + #define PPC_GDB_NREGS0 0 + +#ifdef __powerpc64__ +#define PPC_GDB_NREGS4 5 +#define PPC_GDB_NREGS8 (64 + 4) +#else #define PPC_GDB_NREGS4 (32 + 7 + 2) #define PPC_GDB_NREGS8 32 +#endif + #define PPC_GDB_NREGS16 32 #endif @@ -61,9 +94,15 @@ gdb_cpu_regsz(int regnum) if (regnum == 71 || regnum >= 73) return (8); #else - if (regnum >= 32 && regnum <= 63) +#ifdef __powerpc64__ + if ((regnum >= PPC_REGNUM_R0 && regnum <= PPC_REGNUM_PS) || + regnum == PPC_REGNUM_LR || regnum == PPC_REGNUM_CTR) return (8); - if (regnum >= 71 && regnum <= 102) +#else + if (regnum >= PPC_REGNUM_FR0 && regnum <= PPC_REGNUM_FR31) + return (8); +#endif + if (regnum >= PPC_REGNUM_VR0 && regnum <= PPC_REGNUM_VR31) return (16); #endif return (4); Modified: head/sys/powerpc/powerpc/gdb_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/gdb_machdep.c Thu Oct 31 11:59:00 2019 (r354213) +++ head/sys/powerpc/powerpc/gdb_machdep.c Thu Oct 31 12:03:47 2019 (r354214) @@ -65,8 +65,10 @@ gdb_cpu_getreg(int regnum, size_t *regsz) if (regnum == 1) return (&kdb_thrctx->pcb_sp); - if (regnum >= 14 && regnum <= 31) - return (kdb_thrctx->pcb_context + (regnum - 14)); + if (regnum == 2 && *regsz == 8) + return (&kdb_thrctx->pcb_toc); + if (regnum >= 12 && regnum <= 31) + return (kdb_thrctx->pcb_context + (regnum - 12)); if (regnum == 64) return (&kdb_thrctx->pcb_lr); From owner-svn-src-all@freebsd.org Thu Oct 31 12:51:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62DA81A77C7; Thu, 31 Oct 2019 12:51:28 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 473lZ64Cx9z4FNB; Thu, 31 Oct 2019 12:51:25 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 2c6e3ef1; Thu, 31 Oct 2019 13:51:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=lsRg2lpCu3RW3SYh6Ql1RghmbZY=; b=fSkH85xe6tRpgq6XUxAWa+SyPKZv l1UDL0s3AiCxlFRWvvcE7XJ8kvW+iVmOMwxrGZ+NkjkuqTXGSdIw+i/hq+yoZ7p8 VhfRQL2u4bQip5h4+ZDLsE6rv6LvqSQgZu8OVCnia5NWuh4YD+ZeFj1w4hF47xdU ZmSW9+EvajU7RGE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=p0nJwtUB5zeq9qYPXzSwLyH5Alz07iDwI5C+mbZfQLoP1LxoV0Zp5/xx 2KIS2j2mymKir+ouJWYWlwf7IqauCus0FHlzYm776jsB36GChIpHfXP5zrpsBPDn X2as2MXk183dBEXIHiB1jD/85AXC69xW9eYRa5+kRpnzqsDKSic= Received: from sonic.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 0ece2121 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 31 Oct 2019 13:51:18 +0100 (CET) Date: Thu, 31 Oct 2019 13:51:18 +0100 From: Emmanuel Vadot To: Ilya Bakulin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r354206 - head/sys/arm/allwinner Message-Id: <20191031135118.4e9222bb05879d1602bf3161@bidouilliste.com> In-Reply-To: <201910302043.x9UKhRth083957@repo.freebsd.org> References: <201910302043.x9UKhRth083957@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 473lZ64Cx9z4FNB X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mail header.b=fSkH85xe; dmarc=none; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.177.182 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-0.86 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mail]; NEURAL_HAM_MEDIUM(-0.37)[-0.374,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:212.83.177.182/32]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MV_CASE(0.50)[]; DMARC_NA(0.00)[bidouilliste.com]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.97)[-0.967,0]; DKIM_TRACE(0.00)[bidouilliste.com:+]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(0.39)[ip: (-0.61), ipnet: 212.83.160.0/19(2.44), asn: 12876(0.10), country: FR(-0.00)]; ASN(0.00)[asn:12876, ipnet:212.83.160.0/19, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 12:51:28 -0000 On Wed, 30 Oct 2019 20:43:27 +0000 (UTC) Ilya Bakulin wrote: > Author: kibab > Date: Wed Oct 30 20:43:27 2019 > New Revision: 354206 > URL: https://svnweb.freebsd.org/changeset/base/354206 > > Log: > Use the new cam_sim_alloc_dev function to properly initialize SIM > > Using cam_sim_alloc_dev() allows to properly set sim_dev field so that > sdiob(4) can attach to the CAM device that represents SDIO card. > The same change for SDHCI driver happened in r348800. > > Approved by: imp (mentor) > Differential Revision: https://reviews.freebsd.org/D22192 > > Modified: > head/sys/arm/allwinner/aw_mmc.c > > Modified: head/sys/arm/allwinner/aw_mmc.c > ============================================================================== > --- head/sys/arm/allwinner/aw_mmc.c Wed Oct 30 20:08:10 2019 (r354205) > +++ head/sys/arm/allwinner/aw_mmc.c Wed Oct 30 20:43:27 2019 (r354206) > @@ -526,8 +526,8 @@ aw_mmc_attach(device_t dev) > } > > mtx_init(&sc->sim_mtx, "awmmcsim", NULL, MTX_DEF); > - sc->sim = cam_sim_alloc(aw_mmc_cam_action, aw_mmc_cam_poll, > - "aw_mmc_sim", sc, device_get_unit(dev), > + sc->sim = cam_sim_alloc_dev(aw_mmc_cam_action, aw_mmc_cam_poll, > + "aw_mmc_sim", sc, dev, > &sc->sim_mtx, 1, 1, sc->devq); > > if (sc->sim == NULL) { > @@ -1514,6 +1514,7 @@ static device_method_t aw_mmc_methods[] = { > /* Bus interface */ > DEVMETHOD(bus_read_ivar, aw_mmc_read_ivar), > DEVMETHOD(bus_write_ivar, aw_mmc_write_ivar), > + DEVMETHOD(bus_add_child, bus_generic_add_child), Why is this change needed ? > > /* MMC bridge interface */ > DEVMETHOD(mmcbr_update_ios, aw_mmc_update_ios), -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Thu Oct 31 14:22:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7911615A33F; Thu, 31 Oct 2019 14:22:55 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473nbg2dHlz4LmY; Thu, 31 Oct 2019 14:22:55 +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 3E67D23F9A; Thu, 31 Oct 2019 14:22:55 +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 x9VEMtWt008676; Thu, 31 Oct 2019 14:22:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VEMtQY008675; Thu, 31 Oct 2019 14:22:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910311422.x9VEMtQY008675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 31 Oct 2019 14:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354215 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 354215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 14:22:55 -0000 Author: markj Date: Thu Oct 31 14:22:54 2019 New Revision: 354215 URL: https://svnweb.freebsd.org/changeset/base/354215 Log: Fix a typo in r353895. Reported by: andrew MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/machdep.c Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Thu Oct 31 12:03:47 2019 (r354214) +++ head/sys/arm64/arm64/machdep.c Thu Oct 31 14:22:54 2019 (r354215) @@ -748,7 +748,7 @@ init_proc0(vm_offset_t kstack) thread0.td_kstack = kstack; thread0.td_kstack_pages = KSTACK_PAGES; thread0.td_pcb = (struct pcb *)(thread0.td_kstack + - thread0.td_kstack_pages * KSTACK_PAGES) - 1; + thread0.td_kstack_pages * PAGE_SIZE) - 1; thread0.td_pcb->pcb_fpflags = 0; thread0.td_pcb->pcb_fpusaved = &thread0.td_pcb->pcb_fpustate; thread0.td_pcb->pcb_vfpcpu = UINT_MAX; From owner-svn-src-all@freebsd.org Thu Oct 31 14:49:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E096215B38C; Thu, 31 Oct 2019 14:49:30 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473pBL4C26z4N5C; Thu, 31 Oct 2019 14:49:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 728C124350; Thu, 31 Oct 2019 14:49:30 +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 x9VEnULC021200; Thu, 31 Oct 2019 14:49:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VEnUJ1021199; Thu, 31 Oct 2019 14:49:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910311449.x9VEnUJ1021199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 31 Oct 2019 14:49:30 +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: r354216 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 354216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 14:49:31 -0000 Author: markj Date: Thu Oct 31 14:49:30 2019 New Revision: 354216 URL: https://svnweb.freebsd.org/changeset/base/354216 Log: MFC r353699: Clean up some nits in link_elf_(un)load_file(). Modified: stable/12/sys/kern/link_elf_obj.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/link_elf_obj.c ============================================================================== --- stable/12/sys/kern/link_elf_obj.c Thu Oct 31 14:22:54 2019 (r354215) +++ stable/12/sys/kern/link_elf_obj.c Thu Oct 31 14:49:30 2019 (r354216) @@ -779,7 +779,6 @@ link_elf_load_file(linker_class_t cls, const char *fil error = ENOMEM; goto out; } - ef->address = (caddr_t) vm_map_min(kernel_map); /* * In order to satisfy amd64's architectural requirements on the @@ -794,9 +793,10 @@ link_elf_load_file(linker_class_t cls, const char *fil error = vm_map_find(kernel_map, ef->object, 0, &mapbase, round_page(mapsize), 0, VMFS_OPTIMAL_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0); - if (error) { + if (error != KERN_SUCCESS) { vm_object_deallocate(ef->object); - ef->object = 0; + ef->object = NULL; + error = ENOMEM; goto out; } @@ -1084,11 +1084,9 @@ link_elf_unload_file(linker_file_t file) free(ef->relatab, M_LINKER); free(ef->progtab, M_LINKER); - if (ef->object) { - vm_map_remove(kernel_map, (vm_offset_t) ef->address, - (vm_offset_t) ef->address + - (ef->object->size << PAGE_SHIFT)); - } + if (ef->object != NULL) + vm_map_remove(kernel_map, (vm_offset_t)ef->address, + (vm_offset_t)ef->address + ptoa(ef->object->size)); free(ef->e_shdr, M_LINKER); free(ef->ddbsymtab, M_LINKER); free(ef->ddbstrtab, M_LINKER); From owner-svn-src-all@freebsd.org Thu Oct 31 15:16:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 052C315C698; Thu, 31 Oct 2019 15:16:11 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473pn663RKz4SMm; Thu, 31 Oct 2019 15:16:10 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3249248C3; Thu, 31 Oct 2019 15:16:10 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VFGA0T041523; Thu, 31 Oct 2019 15:16:10 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VFGAhK041522; Thu, 31 Oct 2019 15:16:10 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201910311516.x9VFGAhK041522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 31 Oct 2019 15:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354217 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 354217 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 15:16:11 -0000 Author: mw Date: Thu Oct 31 15:16:10 2019 New Revision: 354217 URL: https://svnweb.freebsd.org/changeset/base/354217 Log: Fix pmap_change_attr() on arm64 to allow KV addresses Altough in the comment above the pmap_change_attr() it was mentioned that VA could be in KV or DMAP memory space. However, pmap_change_attr_locked() was accepting only the values inside the DMAP memory range. To fix that, the condition check was changed so also the va inside the KV memory range would be accepted. The sample use case that wasn't supported is the PCI Device that has the BAR which should me mapped with the Write Combine attribute - for example BAR2 of the ENA network controller on the A1 instances on AWS. Tested on A1 AWS instance and changed ENA BAR2 mapped resource to be write-combined memory region. Differential Revision: https://reviews.freebsd.org/D22055 MFC after: 2 weeks Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Oct 31 14:49:30 2019 (r354216) +++ head/sys/arm64/arm64/pmap.c Thu Oct 31 15:16:10 2019 (r354217) @@ -5291,7 +5291,8 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size offset = va & PAGE_MASK; size = round_page(offset + size); - if (!VIRT_IN_DMAP(base)) + if (!VIRT_IN_DMAP(base) && + !(base >= VM_MIN_KERNEL_ADDRESS && base < VM_MAX_KERNEL_ADDRESS)) return (EINVAL); for (tmpva = base; tmpva < base + size; ) { From owner-svn-src-all@freebsd.org Thu Oct 31 15:38:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E742F15D031; Thu, 31 Oct 2019 15:38:17 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473qGd5bpYz4TGs; Thu, 31 Oct 2019 15:38:17 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A43AC24C73; Thu, 31 Oct 2019 15:38:17 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VFcHIo053036; Thu, 31 Oct 2019 15:38:17 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VFcHPE053035; Thu, 31 Oct 2019 15:38:17 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201910311538.x9VFcHPE053035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 31 Oct 2019 15:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354218 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 354218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 15:38:18 -0000 Author: mw Date: Thu Oct 31 15:38:17 2019 New Revision: 354218 URL: https://svnweb.freebsd.org/changeset/base/354218 Log: Add WC support for arm64 in the ENA driver As the pmamp_change_attr() is public on arm64 since r351131, it can be used on the arm64 to map memory range as with the write combined attribute. It requires the driver to use generic VM_MEMATTR_WRITE_COMBINING flag instead of the x86 specific PAT_WRITE_COMBINING. Differential Revision: https://reviews.freebsd.org/D21931 Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Oct 31 15:16:10 2019 (r354217) +++ head/sys/dev/ena/ena.c Thu Oct 31 15:38:17 2019 (r354218) @@ -3309,7 +3309,7 @@ ena_calc_io_queue_num(struct ena_adapter *adapter, static int ena_enable_wc(struct resource *res) { -#if defined(__i386) || defined(__amd64) +#if defined(__i386) || defined(__amd64) || defined(__aarch64__) vm_offset_t va; vm_size_t len; int rc; @@ -3317,7 +3317,7 @@ ena_enable_wc(struct resource *res) va = (vm_offset_t)rman_get_virtual(res); len = rman_get_size(res); /* Enable write combining */ - rc = pmap_change_attr(va, len, PAT_WRITE_COMBINING); + rc = pmap_change_attr(va, len, VM_MEMATTR_WRITE_COMBINING); if (unlikely(rc != 0)) { ena_trace(ENA_ALERT, "pmap_change_attr failed, %d\n", rc); return (rc); @@ -4352,14 +4352,6 @@ ena_attach(device_t pdev) set_default_llq_configurations(&llq_config); -#if defined(__arm__) || defined(__aarch64__) - /* - * Force LLQ disable, as the driver is not supporting WC enablement - * on the ARM architecture. Using LLQ without WC would affect - * performance in a negative way. - */ - ena_dev->supported_features &= ~(1 << ENA_ADMIN_LLQ); -#endif rc = ena_set_queues_placement_policy(pdev, ena_dev, &get_feat_ctx.llq, &llq_config); if (unlikely(rc != 0)) { From owner-svn-src-all@freebsd.org Thu Oct 31 15:39:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C21C15D0FC; Thu, 31 Oct 2019 15:39:55 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473qJW1jrgz4TQP; Thu, 31 Oct 2019 15:39:55 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E59C24C82; Thu, 31 Oct 2019 15:39:55 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VFdt06053144; Thu, 31 Oct 2019 15:39:55 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VFds1q053143; Thu, 31 Oct 2019 15:39:54 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201910311539.x9VFds1q053143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 31 Oct 2019 15:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354219 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 354219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 15:39:55 -0000 Author: mw Date: Thu Oct 31 15:39:54 2019 New Revision: 354219 URL: https://svnweb.freebsd.org/changeset/base/354219 Log: Fix ENA keep-alive timeout due to prolonged reset When the ENA_FLAG_DEVICE_RUNNING flag is disabled, the AENQ handlers aren't executed. To fix that, the watchdog timestamp should be updated just before enabling the watchdog. Timer service was always being enabled, even if the device wasn't up before the reset. That shouldn't happen, as the timer service is being executed only for working interface. Differential Revision: https://reviews.freebsd.org/D21932 Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Oct 31 15:38:17 2019 (r354218) +++ head/sys/dev/ena/ena.c Thu Oct 31 15:39:54 2019 (r354219) @@ -2350,8 +2350,14 @@ ena_up(struct ena_adapter *adapter) if_setdrvflagbits(adapter->ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE); - callout_reset_sbt(&adapter->timer_service, SBT_1S, SBT_1S, - ena_timer_service, (void *)adapter, 0); + /* Activate timer service only if the device is running. + * If this flag is not set, it means that the driver is being + * reset and timer service will be activated afterwards. + */ + if (ENA_FLAG_ISSET(ENA_FLAG_DEVICE_RUNNING, adapter)) { + callout_reset_sbt(&adapter->timer_service, SBT_1S, + SBT_1S, ena_timer_service, (void *)adapter, 0); + } ENA_FLAG_SET_ATOMIC(ENA_FLAG_DEV_UP, adapter); @@ -4222,9 +4228,20 @@ ena_restore_device(struct ena_adapter *adapter) } } + /* Indicate that device is running again and ready to work */ ENA_FLAG_SET_ATOMIC(ENA_FLAG_DEVICE_RUNNING, adapter); - callout_reset_sbt(&adapter->timer_service, SBT_1S, SBT_1S, - ena_timer_service, (void *)adapter, 0); + + if (ENA_FLAG_ISSET(ENA_FLAG_DEV_UP_BEFORE_RESET, adapter)) { + /* + * As the AENQ handlers weren't executed during reset because + * the flag ENA_FLAG_DEVICE_RUNNING was turned off, the + * timestamp must be updated again That will prevent next reset + * caused by missing keep alive. + */ + adapter->keep_alive_timestamp = getsbinuptime(); + callout_reset_sbt(&adapter->timer_service, SBT_1S, SBT_1S, + ena_timer_service, (void *)adapter, 0); + } device_printf(dev, "Device reset completed successfully, Driver info: %s\n", ena_version); From owner-svn-src-all@freebsd.org Thu Oct 31 15:44:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E49B15D3CF; Thu, 31 Oct 2019 15:44:27 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473qPl19Jfz4TpW; Thu, 31 Oct 2019 15:44:27 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0177E24E47; Thu, 31 Oct 2019 15:44:27 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VFiQwT058598; Thu, 31 Oct 2019 15:44:26 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VFiQot058596; Thu, 31 Oct 2019 15:44:26 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201910311544.x9VFiQot058596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 31 Oct 2019 15:44:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354220 - in head/sys: dev/ena modules/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys: dev/ena modules/ena X-SVN-Commit-Revision: 354220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 15:44:27 -0000 Author: mw Date: Thu Oct 31 15:44:26 2019 New Revision: 354220 URL: https://svnweb.freebsd.org/changeset/base/354220 Log: Split Rx/Tx from initialization code in ENA driver Move Rx/Tx routines to separate file. Some functions: * ena_restore_device, * ena_destroy_device, * ena_up, * ena_down, * ena_refill_rx_bufs could be reused in upcoming netmap code in the driver. To make it possible, they were moved to ena.h header. Differential Revision: https://reviews.freebsd.org/D21933 Submitted by: Rafal Kozik Obtained from: Semihalf Sponsored by: Amazon, Inc. Added: head/sys/dev/ena/ena_datapath.c (contents, props changed) head/sys/dev/ena/ena_datapath.h (contents, props changed) Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h head/sys/modules/ena/Makefile Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Oct 31 15:39:54 2019 (r354219) +++ head/sys/dev/ena/ena.c Thu Oct 31 15:44:26 2019 (r354220) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "ena_datapath.h" #include "ena.h" #include "ena_sysctl.h" @@ -102,7 +103,6 @@ static int ena_setup_tx_resources(struct ena_adapter * static void ena_free_tx_resources(struct ena_adapter *, int); static int ena_setup_all_tx_resources(struct ena_adapter *); static void ena_free_all_tx_resources(struct ena_adapter *); -static inline int validate_rx_req_id(struct ena_ring *, uint16_t); static int ena_setup_rx_resources(struct ena_adapter *, unsigned int); static void ena_free_rx_resources(struct ena_adapter *, unsigned int); static int ena_setup_all_rx_resources(struct ena_adapter *); @@ -111,7 +111,6 @@ static inline int ena_alloc_rx_mbuf(struct ena_adapter struct ena_rx_buffer *); static void ena_free_rx_mbuf(struct ena_adapter *, struct ena_ring *, struct ena_rx_buffer *); -static int ena_refill_rx_bufs(struct ena_ring *, uint32_t); static void ena_free_rx_bufs(struct ena_adapter *, unsigned int); static void ena_refill_all_rx_bufs(struct ena_adapter *); static void ena_free_all_rx_bufs(struct ena_adapter *); @@ -121,16 +120,6 @@ static void ena_destroy_all_tx_queues(struct ena_adapt static void ena_destroy_all_rx_queues(struct ena_adapter *); static void ena_destroy_all_io_queues(struct ena_adapter *); static int ena_create_io_queues(struct ena_adapter *); -static int ena_tx_cleanup(struct ena_ring *); -static int ena_rx_cleanup(struct ena_ring *); -static inline int validate_tx_req_id(struct ena_ring *, uint16_t); -static void ena_rx_hash_mbuf(struct ena_ring *, struct ena_com_rx_ctx *, - struct mbuf *); -static struct mbuf* ena_rx_mbuf(struct ena_ring *, struct ena_com_rx_buf_info *, - struct ena_com_rx_ctx *, uint16_t *); -static inline void ena_rx_checksum(struct ena_ring *, struct ena_com_rx_ctx *, - struct mbuf *); -static void ena_cleanup(void *arg, int pending); static int ena_handle_msix(void *); static int ena_enable_msix(struct ena_adapter *); static void ena_setup_mgmnt_intr(struct ena_adapter *); @@ -144,8 +133,6 @@ static void ena_disable_msix(struct ena_adapter *); static void ena_unmask_all_io_irqs(struct ena_adapter *); static int ena_rss_configure(struct ena_adapter *); static int ena_up_complete(struct ena_adapter *); -static int ena_up(struct ena_adapter *); -static void ena_down(struct ena_adapter *); static uint64_t ena_get_counter(if_t, ift_counter); static int ena_media_change(if_t); static void ena_media_status(if_t, struct ifmediareq *); @@ -156,15 +143,6 @@ static void ena_update_host_info(struct ena_admin_host static void ena_update_hwassist(struct ena_adapter *); static int ena_setup_ifnet(device_t, struct ena_adapter *, struct ena_com_dev_get_features_ctx *); -static void ena_tx_csum(struct ena_com_tx_ctx *, struct mbuf *); -static int ena_check_and_collapse_mbuf(struct ena_ring *tx_ring, - struct mbuf **mbuf); -static void ena_dmamap_llq(void *, bus_dma_segment_t *, int, int); -static int ena_xmit_mbuf(struct ena_ring *, struct mbuf **); -static void ena_start_xmit(struct ena_ring *); -static int ena_mq_start(if_t, struct mbuf *); -static void ena_deferred_mq_start(void *, int); -static void ena_qflush(if_t); static int ena_enable_wc(struct resource *); static int ena_set_queues_placement_policy(device_t, struct ena_com_dev *, struct ena_admin_feature_llq_desc *, struct ena_llq_configurations *); @@ -766,25 +744,6 @@ ena_free_all_tx_resources(struct ena_adapter *adapter) ena_free_tx_resources(adapter, i); } -static inline int -validate_rx_req_id(struct ena_ring *rx_ring, uint16_t req_id) -{ - if (likely(req_id < rx_ring->ring_size)) - return (0); - - device_printf(rx_ring->adapter->pdev, "Invalid rx req_id: %hu\n", - req_id); - counter_u64_add(rx_ring->rx_stats.bad_req_id, 1); - - /* Trigger device reset */ - if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, rx_ring->adapter))) { - rx_ring->adapter->reset_reason = ENA_REGS_RESET_INV_RX_REQ_ID; - ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, rx_ring->adapter); - } - - return (EFAULT); -} - /** * ena_setup_rx_resources - allocate Rx resources (Descriptors) * @adapter: network interface device structure @@ -1024,7 +983,7 @@ ena_free_rx_mbuf(struct ena_adapter *adapter, struct e * @num: number of descriptors to refill * Refills the ring with newly allocated DMA-mapped mbufs for receiving **/ -static int +int ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t num) { struct ena_adapter *adapter = rx_ring->adapter; @@ -1227,30 +1186,6 @@ ena_destroy_all_io_queues(struct ena_adapter *adapter) ena_destroy_all_rx_queues(adapter); } -static inline int -validate_tx_req_id(struct ena_ring *tx_ring, uint16_t req_id) -{ - struct ena_adapter *adapter = tx_ring->adapter; - struct ena_tx_buffer *tx_info = NULL; - - if (likely(req_id < tx_ring->ring_size)) { - tx_info = &tx_ring->tx_buffer_info[req_id]; - if (tx_info->mbuf != NULL) - return (0); - device_printf(adapter->pdev, - "tx_info doesn't have valid mbuf\n"); - } - - device_printf(adapter->pdev, "Invalid req_id: %hu\n", req_id); - counter_u64_add(tx_ring->tx_stats.bad_req_id, 1); - - /* Trigger device reset */ - adapter->reset_reason = ENA_REGS_RESET_INV_TX_REQ_ID; - ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); - - return (EFAULT); -} - static int ena_create_io_queues(struct ena_adapter *adapter) { @@ -1344,475 +1279,6 @@ err_tx: return (ENXIO); } -/** - * ena_tx_cleanup - clear sent packets and corresponding descriptors - * @tx_ring: ring for which we want to clean packets - * - * Once packets are sent, we ask the device in a loop for no longer used - * descriptors. We find the related mbuf chain in a map (index in an array) - * and free it, then update ring state. - * This is performed in "endless" loop, updating ring pointers every - * TX_COMMIT. The first check of free descriptor is performed before the actual - * loop, then repeated at the loop end. - **/ -static int -ena_tx_cleanup(struct ena_ring *tx_ring) -{ - struct ena_adapter *adapter; - struct ena_com_io_cq* io_cq; - uint16_t next_to_clean; - uint16_t req_id; - uint16_t ena_qid; - unsigned int total_done = 0; - int rc; - int commit = TX_COMMIT; - int budget = TX_BUDGET; - int work_done; - bool above_thresh; - - adapter = tx_ring->que->adapter; - ena_qid = ENA_IO_TXQ_IDX(tx_ring->que->id); - io_cq = &adapter->ena_dev->io_cq_queues[ena_qid]; - next_to_clean = tx_ring->next_to_clean; - - do { - struct ena_tx_buffer *tx_info; - struct mbuf *mbuf; - - rc = ena_com_tx_comp_req_id_get(io_cq, &req_id); - if (unlikely(rc != 0)) - break; - - rc = validate_tx_req_id(tx_ring, req_id); - if (unlikely(rc != 0)) - break; - - tx_info = &tx_ring->tx_buffer_info[req_id]; - - mbuf = tx_info->mbuf; - - tx_info->mbuf = NULL; - bintime_clear(&tx_info->timestamp); - - /* Map is no longer required */ - if (tx_info->head_mapped == true) { - bus_dmamap_sync(adapter->tx_buf_tag, tx_info->map_head, - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(adapter->tx_buf_tag, - tx_info->map_head); - tx_info->head_mapped = false; - } - if (tx_info->seg_mapped == true) { - bus_dmamap_sync(adapter->tx_buf_tag, tx_info->map_seg, - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(adapter->tx_buf_tag, - tx_info->map_seg); - tx_info->seg_mapped = false; - } - - ena_trace(ENA_DBG | ENA_TXPTH, "tx: q %d mbuf %p completed\n", - tx_ring->qid, mbuf); - - m_freem(mbuf); - - total_done += tx_info->tx_descs; - - tx_ring->free_tx_ids[next_to_clean] = req_id; - next_to_clean = ENA_TX_RING_IDX_NEXT(next_to_clean, - tx_ring->ring_size); - - if (unlikely(--commit == 0)) { - commit = TX_COMMIT; - /* update ring state every TX_COMMIT descriptor */ - tx_ring->next_to_clean = next_to_clean; - ena_com_comp_ack( - &adapter->ena_dev->io_sq_queues[ena_qid], - total_done); - ena_com_update_dev_comp_head(io_cq); - total_done = 0; - } - } while (likely(--budget)); - - work_done = TX_BUDGET - budget; - - ena_trace(ENA_DBG | ENA_TXPTH, "tx: q %d done. total pkts: %d\n", - tx_ring->qid, work_done); - - /* If there is still something to commit update ring state */ - if (likely(commit != TX_COMMIT)) { - tx_ring->next_to_clean = next_to_clean; - ena_com_comp_ack(&adapter->ena_dev->io_sq_queues[ena_qid], - total_done); - ena_com_update_dev_comp_head(io_cq); - } - - /* - * Need to make the rings circular update visible to - * ena_xmit_mbuf() before checking for tx_ring->running. - */ - mb(); - - above_thresh = ena_com_sq_have_enough_space(tx_ring->ena_com_io_sq, - ENA_TX_RESUME_THRESH); - if (unlikely(!tx_ring->running && above_thresh)) { - ENA_RING_MTX_LOCK(tx_ring); - above_thresh = - ena_com_sq_have_enough_space(tx_ring->ena_com_io_sq, - ENA_TX_RESUME_THRESH); - if (!tx_ring->running && above_thresh) { - tx_ring->running = true; - counter_u64_add(tx_ring->tx_stats.queue_wakeup, 1); - taskqueue_enqueue(tx_ring->enqueue_tq, - &tx_ring->enqueue_task); - } - ENA_RING_MTX_UNLOCK(tx_ring); - } - - return (work_done); -} - -static void -ena_rx_hash_mbuf(struct ena_ring *rx_ring, struct ena_com_rx_ctx *ena_rx_ctx, - struct mbuf *mbuf) -{ - struct ena_adapter *adapter = rx_ring->adapter; - - if (likely(ENA_FLAG_ISSET(ENA_FLAG_RSS_ACTIVE, adapter))) { - mbuf->m_pkthdr.flowid = ena_rx_ctx->hash; - - if (ena_rx_ctx->frag && - (ena_rx_ctx->l3_proto != ENA_ETH_IO_L3_PROTO_UNKNOWN)) { - M_HASHTYPE_SET(mbuf, M_HASHTYPE_OPAQUE_HASH); - return; - } - - switch (ena_rx_ctx->l3_proto) { - case ENA_ETH_IO_L3_PROTO_IPV4: - switch (ena_rx_ctx->l4_proto) { - case ENA_ETH_IO_L4_PROTO_TCP: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_RSS_TCP_IPV4); - break; - case ENA_ETH_IO_L4_PROTO_UDP: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_RSS_UDP_IPV4); - break; - default: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_RSS_IPV4); - } - break; - case ENA_ETH_IO_L3_PROTO_IPV6: - switch (ena_rx_ctx->l4_proto) { - case ENA_ETH_IO_L4_PROTO_TCP: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_RSS_TCP_IPV6); - break; - case ENA_ETH_IO_L4_PROTO_UDP: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_RSS_UDP_IPV6); - break; - default: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_RSS_IPV6); - } - break; - case ENA_ETH_IO_L3_PROTO_UNKNOWN: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_NONE); - break; - default: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_OPAQUE_HASH); - } - } else { - mbuf->m_pkthdr.flowid = rx_ring->qid; - M_HASHTYPE_SET(mbuf, M_HASHTYPE_NONE); - } -} - -/** - * ena_rx_mbuf - assemble mbuf from descriptors - * @rx_ring: ring for which we want to clean packets - * @ena_bufs: buffer info - * @ena_rx_ctx: metadata for this packet(s) - * @next_to_clean: ring pointer, will be updated only upon success - * - **/ -static struct mbuf* -ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_rx_buf_info *ena_bufs, - struct ena_com_rx_ctx *ena_rx_ctx, uint16_t *next_to_clean) -{ - struct mbuf *mbuf; - struct ena_rx_buffer *rx_info; - struct ena_adapter *adapter; - unsigned int descs = ena_rx_ctx->descs; - int rc; - uint16_t ntc, len, req_id, buf = 0; - - ntc = *next_to_clean; - adapter = rx_ring->adapter; - - len = ena_bufs[buf].len; - req_id = ena_bufs[buf].req_id; - rc = validate_rx_req_id(rx_ring, req_id); - if (unlikely(rc != 0)) - return (NULL); - - rx_info = &rx_ring->rx_buffer_info[req_id]; - if (unlikely(rx_info->mbuf == NULL)) { - device_printf(adapter->pdev, "NULL mbuf in rx_info"); - return (NULL); - } - - ena_trace(ENA_DBG | ENA_RXPTH, "rx_info %p, mbuf %p, paddr %jx\n", - rx_info, rx_info->mbuf, (uintmax_t)rx_info->ena_buf.paddr); - - bus_dmamap_sync(adapter->rx_buf_tag, rx_info->map, - BUS_DMASYNC_POSTREAD); - mbuf = rx_info->mbuf; - mbuf->m_flags |= M_PKTHDR; - mbuf->m_pkthdr.len = len; - mbuf->m_len = len; - mbuf->m_pkthdr.rcvif = rx_ring->que->adapter->ifp; - - /* Fill mbuf with hash key and it's interpretation for optimization */ - ena_rx_hash_mbuf(rx_ring, ena_rx_ctx, mbuf); - - ena_trace(ENA_DBG | ENA_RXPTH, "rx mbuf 0x%p, flags=0x%x, len: %d\n", - mbuf, mbuf->m_flags, mbuf->m_pkthdr.len); - - /* DMA address is not needed anymore, unmap it */ - bus_dmamap_unload(rx_ring->adapter->rx_buf_tag, rx_info->map); - - rx_info->mbuf = NULL; - rx_ring->free_rx_ids[ntc] = req_id; - ntc = ENA_RX_RING_IDX_NEXT(ntc, rx_ring->ring_size); - - /* - * While we have more than 1 descriptors for one rcvd packet, append - * other mbufs to the main one - */ - while (--descs) { - ++buf; - len = ena_bufs[buf].len; - req_id = ena_bufs[buf].req_id; - rc = validate_rx_req_id(rx_ring, req_id); - if (unlikely(rc != 0)) { - /* - * If the req_id is invalid, then the device will be - * reset. In that case we must free all mbufs that - * were already gathered. - */ - m_freem(mbuf); - return (NULL); - } - rx_info = &rx_ring->rx_buffer_info[req_id]; - - if (unlikely(rx_info->mbuf == NULL)) { - device_printf(adapter->pdev, "NULL mbuf in rx_info"); - /* - * If one of the required mbufs was not allocated yet, - * we can break there. - * All earlier used descriptors will be reallocated - * later and not used mbufs can be reused. - * The next_to_clean pointer will not be updated in case - * of an error, so caller should advance it manually - * in error handling routine to keep it up to date - * with hw ring. - */ - m_freem(mbuf); - return (NULL); - } - - bus_dmamap_sync(adapter->rx_buf_tag, rx_info->map, - BUS_DMASYNC_POSTREAD); - if (unlikely(m_append(mbuf, len, rx_info->mbuf->m_data) == 0)) { - counter_u64_add(rx_ring->rx_stats.mbuf_alloc_fail, 1); - ena_trace(ENA_WARNING, "Failed to append Rx mbuf %p\n", - mbuf); - } - - ena_trace(ENA_DBG | ENA_RXPTH, - "rx mbuf updated. len %d\n", mbuf->m_pkthdr.len); - - /* Free already appended mbuf, it won't be useful anymore */ - bus_dmamap_unload(rx_ring->adapter->rx_buf_tag, rx_info->map); - m_freem(rx_info->mbuf); - rx_info->mbuf = NULL; - - rx_ring->free_rx_ids[ntc] = req_id; - ntc = ENA_RX_RING_IDX_NEXT(ntc, rx_ring->ring_size); - } - - *next_to_clean = ntc; - - return (mbuf); -} - -/** - * ena_rx_checksum - indicate in mbuf if hw indicated a good cksum - **/ -static inline void -ena_rx_checksum(struct ena_ring *rx_ring, struct ena_com_rx_ctx *ena_rx_ctx, - struct mbuf *mbuf) -{ - - /* if IP and error */ - if (unlikely((ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV4) && - ena_rx_ctx->l3_csum_err)) { - /* ipv4 checksum error */ - mbuf->m_pkthdr.csum_flags = 0; - counter_u64_add(rx_ring->rx_stats.bad_csum, 1); - ena_trace(ENA_DBG, "RX IPv4 header checksum error\n"); - return; - } - - /* if TCP/UDP */ - if ((ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_TCP) || - (ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_UDP)) { - if (ena_rx_ctx->l4_csum_err) { - /* TCP/UDP checksum error */ - mbuf->m_pkthdr.csum_flags = 0; - counter_u64_add(rx_ring->rx_stats.bad_csum, 1); - ena_trace(ENA_DBG, "RX L4 checksum error\n"); - } else { - mbuf->m_pkthdr.csum_flags = CSUM_IP_CHECKED; - mbuf->m_pkthdr.csum_flags |= CSUM_IP_VALID; - } - } -} - -/** - * ena_rx_cleanup - handle rx irq - * @arg: ring for which irq is being handled - **/ -static int -ena_rx_cleanup(struct ena_ring *rx_ring) -{ - struct ena_adapter *adapter; - struct mbuf *mbuf; - struct ena_com_rx_ctx ena_rx_ctx; - struct ena_com_io_cq* io_cq; - struct ena_com_io_sq* io_sq; - if_t ifp; - uint16_t ena_qid; - uint16_t next_to_clean; - uint32_t refill_required; - uint32_t refill_threshold; - uint32_t do_if_input = 0; - unsigned int qid; - int rc, i; - int budget = RX_BUDGET; - - adapter = rx_ring->que->adapter; - ifp = adapter->ifp; - qid = rx_ring->que->id; - ena_qid = ENA_IO_RXQ_IDX(qid); - io_cq = &adapter->ena_dev->io_cq_queues[ena_qid]; - io_sq = &adapter->ena_dev->io_sq_queues[ena_qid]; - next_to_clean = rx_ring->next_to_clean; - - ena_trace(ENA_DBG, "rx: qid %d\n", qid); - - do { - ena_rx_ctx.ena_bufs = rx_ring->ena_bufs; - ena_rx_ctx.max_bufs = adapter->max_rx_sgl_size; - ena_rx_ctx.descs = 0; - bus_dmamap_sync(io_cq->cdesc_addr.mem_handle.tag, - io_cq->cdesc_addr.mem_handle.map, BUS_DMASYNC_POSTREAD); - rc = ena_com_rx_pkt(io_cq, io_sq, &ena_rx_ctx); - - if (unlikely(rc != 0)) - goto error; - - if (unlikely(ena_rx_ctx.descs == 0)) - break; - - ena_trace(ENA_DBG | ENA_RXPTH, "rx: q %d got packet from ena. " - "descs #: %d l3 proto %d l4 proto %d hash: %x\n", - rx_ring->qid, ena_rx_ctx.descs, ena_rx_ctx.l3_proto, - ena_rx_ctx.l4_proto, ena_rx_ctx.hash); - - /* Receive mbuf from the ring */ - mbuf = ena_rx_mbuf(rx_ring, rx_ring->ena_bufs, - &ena_rx_ctx, &next_to_clean); - bus_dmamap_sync(io_cq->cdesc_addr.mem_handle.tag, - io_cq->cdesc_addr.mem_handle.map, BUS_DMASYNC_PREREAD); - /* Exit if we failed to retrieve a buffer */ - if (unlikely(mbuf == NULL)) { - for (i = 0; i < ena_rx_ctx.descs; ++i) { - rx_ring->free_rx_ids[next_to_clean] = - rx_ring->ena_bufs[i].req_id; - next_to_clean = - ENA_RX_RING_IDX_NEXT(next_to_clean, - rx_ring->ring_size); - - } - break; - } - - if (((ifp->if_capenable & IFCAP_RXCSUM) != 0) || - ((ifp->if_capenable & IFCAP_RXCSUM_IPV6) != 0)) { - ena_rx_checksum(rx_ring, &ena_rx_ctx, mbuf); - } - - counter_enter(); - counter_u64_add_protected(rx_ring->rx_stats.bytes, - mbuf->m_pkthdr.len); - counter_u64_add_protected(adapter->hw_stats.rx_bytes, - mbuf->m_pkthdr.len); - counter_exit(); - /* - * LRO is only for IP/TCP packets and TCP checksum of the packet - * should be computed by hardware. - */ - do_if_input = 1; - if (((ifp->if_capenable & IFCAP_LRO) != 0) && - ((mbuf->m_pkthdr.csum_flags & CSUM_IP_VALID) != 0) && - (ena_rx_ctx.l4_proto == ENA_ETH_IO_L4_PROTO_TCP)) { - /* - * Send to the stack if: - * - LRO not enabled, or - * - no LRO resources, or - * - lro enqueue fails - */ - if ((rx_ring->lro.lro_cnt != 0) && - (tcp_lro_rx(&rx_ring->lro, mbuf, 0) == 0)) - do_if_input = 0; - } - if (do_if_input != 0) { - ena_trace(ENA_DBG | ENA_RXPTH, - "calling if_input() with mbuf %p\n", mbuf); - (*ifp->if_input)(ifp, mbuf); - } - - counter_enter(); - counter_u64_add_protected(rx_ring->rx_stats.cnt, 1); - counter_u64_add_protected(adapter->hw_stats.rx_packets, 1); - counter_exit(); - } while (--budget); - - rx_ring->next_to_clean = next_to_clean; - - refill_required = ena_com_free_desc(io_sq); - refill_threshold = min_t(int, - rx_ring->ring_size / ENA_RX_REFILL_THRESH_DIVIDER, - ENA_RX_REFILL_THRESH_PACKET); - - if (refill_required > refill_threshold) { - ena_com_update_dev_comp_head(rx_ring->ena_com_io_cq); - ena_refill_rx_bufs(rx_ring, refill_required); - } - - tcp_lro_flush_all(&rx_ring->lro); - - return (RX_BUDGET - budget); - -error: - counter_u64_add(rx_ring->rx_stats.bad_desc_num, 1); - - /* Too many desc from the device. Trigger reset */ - if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { - adapter->reset_reason = ENA_REGS_RESET_TOO_MANY_RX_DESCS; - ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); - } - - return (0); -} - /********************************************************************* * * MSIX & Interrupt Service routine @@ -1833,52 +1299,6 @@ ena_intr_msix_mgmnt(void *arg) ena_com_aenq_intr_handler(adapter->ena_dev, arg); } -static void -ena_cleanup(void *arg, int pending) -{ - struct ena_que *que = arg; - struct ena_adapter *adapter = que->adapter; - if_t ifp = adapter->ifp; - struct ena_ring *tx_ring; - struct ena_ring *rx_ring; - struct ena_com_io_cq* io_cq; - struct ena_eth_io_intr_reg intr_reg; - int qid, ena_qid; - int txc, rxc, i; - - if (unlikely((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)) - return; - - ena_trace(ENA_DBG, "MSI-X TX/RX routine\n"); - - tx_ring = que->tx_ring; - rx_ring = que->rx_ring; - qid = que->id; - ena_qid = ENA_IO_TXQ_IDX(qid); - io_cq = &adapter->ena_dev->io_cq_queues[ena_qid]; - - tx_ring->first_interrupt = true; - rx_ring->first_interrupt = true; - - for (i = 0; i < CLEAN_BUDGET; ++i) { - rxc = ena_rx_cleanup(rx_ring); - txc = ena_tx_cleanup(tx_ring); - - if (unlikely((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)) - return; - - if ((txc != TX_BUDGET) && (rxc != RX_BUDGET)) - break; - } - - /* Signal that work is done and unmask interrupt */ - ena_com_update_intr_reg(&intr_reg, - RX_IRQ_INTERVAL, - TX_IRQ_INTERVAL, - true); - ena_com_unmask_intr(io_cq, &intr_reg); -} - /** * ena_handle_msix - MSIX Interrupt Handler for Tx/Rx * @arg: queue @@ -2289,7 +1709,7 @@ ena_up_complete(struct ena_adapter *adapter) return (0); } -static int +int ena_up(struct ena_adapter *adapter) { int rc = 0; @@ -2666,7 +2086,7 @@ ena_setup_ifnet(device_t pdev, struct ena_adapter *ada return (0); } -static void +void ena_down(struct ena_adapter *adapter) { int rc; @@ -2701,579 +2121,7 @@ ena_down(struct ena_adapter *adapter) } } -static void -ena_tx_csum(struct ena_com_tx_ctx *ena_tx_ctx, struct mbuf *mbuf) -{ - struct ena_com_tx_meta *ena_meta; - struct ether_vlan_header *eh; - struct mbuf *mbuf_next; - u32 mss; - bool offload; - uint16_t etype; - int ehdrlen; - struct ip *ip; - int iphlen; - struct tcphdr *th; - int offset; - - offload = false; - ena_meta = &ena_tx_ctx->ena_meta; - mss = mbuf->m_pkthdr.tso_segsz; - - if (mss != 0) - offload = true; - - if ((mbuf->m_pkthdr.csum_flags & CSUM_TSO) != 0) - offload = true; - - if ((mbuf->m_pkthdr.csum_flags & CSUM_OFFLOAD) != 0) - offload = true; - - if (!offload) { - ena_tx_ctx->meta_valid = 0; - return; - } - - /* Determine where frame payload starts. */ - eh = mtod(mbuf, struct ether_vlan_header *); - if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { - etype = ntohs(eh->evl_proto); - ehdrlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; - } else { - etype = ntohs(eh->evl_encap_proto); - ehdrlen = ETHER_HDR_LEN; - } - - mbuf_next = m_getptr(mbuf, ehdrlen, &offset); - ip = (struct ip *)(mtodo(mbuf_next, offset)); - iphlen = ip->ip_hl << 2; - - mbuf_next = m_getptr(mbuf, iphlen + ehdrlen, &offset); - th = (struct tcphdr *)(mtodo(mbuf_next, offset)); - - if ((mbuf->m_pkthdr.csum_flags & CSUM_IP) != 0) { - ena_tx_ctx->l3_csum_enable = 1; - } - if ((mbuf->m_pkthdr.csum_flags & CSUM_TSO) != 0) { - ena_tx_ctx->tso_enable = 1; - ena_meta->l4_hdr_len = (th->th_off); - } - - switch (etype) { - case ETHERTYPE_IP: - ena_tx_ctx->l3_proto = ENA_ETH_IO_L3_PROTO_IPV4; - if ((ip->ip_off & htons(IP_DF)) != 0) - ena_tx_ctx->df = 1; - break; - case ETHERTYPE_IPV6: - ena_tx_ctx->l3_proto = ENA_ETH_IO_L3_PROTO_IPV6; - - default: - break; - } - - if (ip->ip_p == IPPROTO_TCP) { - ena_tx_ctx->l4_proto = ENA_ETH_IO_L4_PROTO_TCP; - if ((mbuf->m_pkthdr.csum_flags & - (CSUM_IP_TCP | CSUM_IP6_TCP)) != 0) - ena_tx_ctx->l4_csum_enable = 1; - else - ena_tx_ctx->l4_csum_enable = 0; - } else if (ip->ip_p == IPPROTO_UDP) { - ena_tx_ctx->l4_proto = ENA_ETH_IO_L4_PROTO_UDP; - if ((mbuf->m_pkthdr.csum_flags & - (CSUM_IP_UDP | CSUM_IP6_UDP)) != 0) - ena_tx_ctx->l4_csum_enable = 1; - else - ena_tx_ctx->l4_csum_enable = 0; - } else { - ena_tx_ctx->l4_proto = ENA_ETH_IO_L4_PROTO_UNKNOWN; - ena_tx_ctx->l4_csum_enable = 0; - } - - ena_meta->mss = mss; - ena_meta->l3_hdr_len = iphlen; - ena_meta->l3_hdr_offset = ehdrlen; - ena_tx_ctx->meta_valid = 1; -} - static int -ena_check_and_collapse_mbuf(struct ena_ring *tx_ring, struct mbuf **mbuf) -{ - struct ena_adapter *adapter; - struct mbuf *collapsed_mbuf; - int num_frags; - - adapter = tx_ring->adapter; - num_frags = ena_mbuf_count(*mbuf); - - /* One segment must be reserved for configuration descriptor. */ - if (num_frags < adapter->max_tx_sgl_size) - return (0); - counter_u64_add(tx_ring->tx_stats.collapse, 1); - - collapsed_mbuf = m_collapse(*mbuf, M_NOWAIT, - adapter->max_tx_sgl_size - 1); - if (unlikely(collapsed_mbuf == NULL)) { - counter_u64_add(tx_ring->tx_stats.collapse_err, 1); - return (ENOMEM); - } - - /* If mbuf was collapsed succesfully, original mbuf is released. */ - *mbuf = collapsed_mbuf; - - return (0); -} - -static void -ena_dmamap_llq(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - struct ena_com_buf *ena_buf = arg; - - if (unlikely(error != 0)) { - ena_buf->paddr = 0; - return; - } - - KASSERT(nseg == 1, ("Invalid num of segments for LLQ dma")); - - ena_buf->paddr = segs->ds_addr; - ena_buf->len = segs->ds_len; -} - -static int -ena_tx_map_mbuf(struct ena_ring *tx_ring, struct ena_tx_buffer *tx_info, - struct mbuf *mbuf, void **push_hdr, u16 *header_len) -{ - struct ena_adapter *adapter = tx_ring->adapter; - struct ena_com_buf *ena_buf; - bus_dma_segment_t segs[ENA_BUS_DMA_SEGS]; - uint32_t mbuf_head_len, frag_len; - uint16_t push_len = 0; - uint16_t delta = 0; - int i, rc, nsegs; - - mbuf_head_len = mbuf->m_len; - tx_info->mbuf = mbuf; - ena_buf = tx_info->bufs; - - if (tx_ring->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { - /* - * When the device is LLQ mode, the driver will copy - * the header into the device memory space. - * the ena_com layer assumes the header is in a linear - * memory space. - * This assumption might be wrong since part of the header - * can be in the fragmented buffers. - * First check if header fits in the mbuf. If not, copy it to - * separate buffer that will be holding linearized data. - */ - push_len = min_t(uint32_t, mbuf->m_pkthdr.len, - tx_ring->tx_max_header_size); - *header_len = push_len; - /* If header is in linear space, just point into mbuf's data. */ - if (likely(push_len <= mbuf_head_len)) { - *push_hdr = mbuf->m_data; - /* - * Otherwise, copy whole portion of header from multiple mbufs - * to intermediate buffer. - */ - } else { - m_copydata(mbuf, 0, push_len, - tx_ring->push_buf_intermediate_buf); - *push_hdr = tx_ring->push_buf_intermediate_buf; - - counter_u64_add(tx_ring->tx_stats.llq_buffer_copy, 1); - delta = push_len - mbuf_head_len; - } - - ena_trace(ENA_DBG | ENA_TXPTH, - "mbuf: %p header_buf->vaddr: %p push_len: %d\n", - mbuf, *push_hdr, push_len); - - /* - * If header was in linear memory space, map for the dma rest of the data - * in the first mbuf of the mbuf chain. - */ - if (mbuf_head_len > push_len) { - rc = bus_dmamap_load(adapter->tx_buf_tag, - tx_info->map_head, - mbuf->m_data + push_len, mbuf_head_len - push_len, - ena_dmamap_llq, ena_buf, BUS_DMA_NOWAIT); - if (unlikely((rc != 0) || (ena_buf->paddr == 0))) - goto single_dma_error; - - ena_buf++; - tx_info->num_of_bufs++; - - tx_info->head_mapped = true; - } - mbuf = mbuf->m_next; - } else { - *push_hdr = NULL; - /* - * header_len is just a hint for the device. Because FreeBSD is not - * giving us information about packet header length and it is not - * guaranteed that all packet headers will be in the 1st mbuf, setting - * header_len to 0 is making the device ignore this value and resolve - * header on it's own. - */ - *header_len = 0; - } - - /* - * If header is in non linear space (delta > 0), then skip mbufs - * containing header and map the last one containing both header and the - * packet data. - * The first segment is already counted in. - * If LLQ is not supported, the loop will be skipped. - */ - while (delta > 0) { - frag_len = mbuf->m_len; - - /* - * If whole segment contains header just move to the - * next one and reduce delta. - */ - if (unlikely(delta >= frag_len)) { - delta -= frag_len; - } else { - /* - * Map rest of the packet data that was contained in - * the mbuf. - */ - rc = bus_dmamap_load(adapter->tx_buf_tag, - tx_info->map_head, mbuf->m_data + delta, - frag_len - delta, ena_dmamap_llq, ena_buf, - BUS_DMA_NOWAIT); - if (unlikely((rc != 0) || (ena_buf->paddr == 0))) - goto single_dma_error; - - ena_buf++; - tx_info->num_of_bufs++; - tx_info->head_mapped = true; - - delta = 0; - } - - mbuf = mbuf->m_next; - } - - if (mbuf == NULL) { - return (0); - } - - /* Map rest of the mbufs */ - rc = bus_dmamap_load_mbuf_sg(adapter->tx_buf_tag, tx_info->map_seg, mbuf, - segs, &nsegs, BUS_DMA_NOWAIT); - if (unlikely((rc != 0) || (nsegs == 0))) { - ena_trace(ENA_WARNING, - "dmamap load failed! err: %d nsegs: %d\n", rc, nsegs); - goto dma_error; - } - - for (i = 0; i < nsegs; i++) { - ena_buf->len = segs[i].ds_len; - ena_buf->paddr = segs[i].ds_addr; - ena_buf++; - } - tx_info->num_of_bufs += nsegs; - tx_info->seg_mapped = true; - - return (0); - -dma_error: - if (tx_info->head_mapped == true) - bus_dmamap_unload(adapter->tx_buf_tag, tx_info->map_head); -single_dma_error: - counter_u64_add(tx_ring->tx_stats.dma_mapping_err, 1); - tx_info->mbuf = NULL; - return (rc); -} - -static int -ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf **mbuf) -{ - struct ena_adapter *adapter; - struct ena_tx_buffer *tx_info; - struct ena_com_tx_ctx ena_tx_ctx; - struct ena_com_dev *ena_dev; - struct ena_com_io_sq* io_sq; - void *push_hdr; - uint16_t next_to_use; - uint16_t req_id; - uint16_t ena_qid; - uint16_t header_len; - int rc; - int nb_hw_desc; - - ena_qid = ENA_IO_TXQ_IDX(tx_ring->que->id); - adapter = tx_ring->que->adapter; - ena_dev = adapter->ena_dev; - io_sq = &ena_dev->io_sq_queues[ena_qid]; - - rc = ena_check_and_collapse_mbuf(tx_ring, mbuf); - if (unlikely(rc != 0)) { - ena_trace(ENA_WARNING, - "Failed to collapse mbuf! err: %d\n", rc); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Oct 31 15:51:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0711F15D614; Thu, 31 Oct 2019 15:51:20 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473qYg6RgLz4V4K; Thu, 31 Oct 2019 15:51:19 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C17C524FA1; Thu, 31 Oct 2019 15:51:19 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VFpJji060538; Thu, 31 Oct 2019 15:51:19 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VFpIo8060532; Thu, 31 Oct 2019 15:51:18 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201910311551.x9VFpIo8060532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 31 Oct 2019 15:51:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354221 - in head/sys: contrib/ena-com dev/ena modules/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys: contrib/ena-com dev/ena modules/ena X-SVN-Commit-Revision: 354221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 15:51:20 -0000 Author: mw Date: Thu Oct 31 15:51:18 2019 New Revision: 354221 URL: https://svnweb.freebsd.org/changeset/base/354221 Log: Introduce NETMAP support in ENA Mock implementation of NETMAP routines is located in ena_netmap.c/.h files. All code is protected under the DEV_NETMAP macro. Makefile was updated with files and flag. As ENA driver provide own implementations of (un)likely it must be undefined before including NETMAP headers. ena_netmap_attach function is called on the end of NIC attach. It fills structure with NIC configuration and callbacks. Then provides it to netmap_attach. Similarly netmap_detach is called during ena_detach. Three callbacks are used. nm_register is implemented by ena_netmap_reg. It is called when user space application open or close NIC in NETMAP mode. Current action is recognized based on onoff parameter: true means on and false off. As NICs rings need to be reconfigured ena_down and ena_up are reused. When user space application wants to receive new packets from NIC nm_rxsync is called, and when there are new packets ready for Tx nm_txsync is called. Differential Revision: https://reviews.freebsd.org/D21934 Submitted by: Rafal Kozik Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Added: head/sys/dev/ena/ena_netmap.c (contents, props changed) head/sys/dev/ena/ena_netmap.h (contents, props changed) Modified: head/sys/contrib/ena-com/ena_plat.h head/sys/dev/ena/ena.c head/sys/modules/ena/Makefile Modified: head/sys/contrib/ena-com/ena_plat.h ============================================================================== --- head/sys/contrib/ena-com/ena_plat.h Thu Oct 31 15:44:26 2019 (r354220) +++ head/sys/contrib/ena-com/ena_plat.h Thu Oct 31 15:51:18 2019 (r354221) @@ -103,6 +103,7 @@ extern struct ena_bus_space ebs; #define ENA_RSC (1 << 6) /* Goes with TXPTH or RXPTH, free/alloc res. */ #define ENA_IOQ (1 << 7) /* Detailed info about IO queues. */ #define ENA_ADMQ (1 << 8) /* Detailed info about admin queue. */ +#define ENA_NETMAP (1 << 9) /* Detailed info about netmap. */ extern int ena_log_level; Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Oct 31 15:44:26 2019 (r354220) +++ head/sys/dev/ena/ena.c Thu Oct 31 15:51:18 2019 (r354221) @@ -80,6 +80,10 @@ __FBSDID("$FreeBSD$"); #include "ena.h" #include "ena_sysctl.h" +#ifdef DEV_NETMAP +#include "ena_netmap.h" +#endif /* DEV_NETMAP */ + /********************************************************* * Function prototypes *********************************************************/ @@ -3317,12 +3321,24 @@ ena_attach(device_t pdev) sizeof(struct ena_hw_stats)); ena_sysctl_add_nodes(adapter); +#ifdef DEV_NETMAP + rc = ena_netmap_attach(adapter); + if (rc != 0) { + device_printf(pdev, "netmap attach failed: %d\n", rc); + goto err_detach; + } +#endif /* DEV_NETMAP */ + /* Tell the stack that the interface is not active */ if_setdrvflagbits(adapter->ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); ENA_FLAG_SET_ATOMIC(ENA_FLAG_DEVICE_RUNNING, adapter); return (0); +#ifdef DEV_NETMAP +err_detach: + ether_ifdetach(adapter->ifp); +#endif /* DEV_NETMAP */ err_msix_free: ena_com_dev_reset(adapter->ena_dev, ENA_REGS_RESET_INIT_ERR); ena_free_mgmnt_irq(adapter); @@ -3378,6 +3394,10 @@ ena_detach(device_t pdev) ena_destroy_device(adapter, true); sx_unlock(&adapter->ioctl_sx); +#ifdef DEV_NETMAP + netmap_detach(adapter->ifp); +#endif /* DEV_NETMAP */ + ena_free_all_io_rings_resources(adapter); ena_free_counters((counter_u64_t *)&adapter->hw_stats, @@ -3518,5 +3538,8 @@ MODULE_PNP_INFO("U16:vendor;U16:device", pci, ena, ena nitems(ena_vendor_info_array) - 1); MODULE_DEPEND(ena, pci, 1, 1, 1); MODULE_DEPEND(ena, ether, 1, 1, 1); +#ifdef DEV_NETMAP +MODULE_DEPEND(ena, netmap, 1, 1, 1); +#endif /* DEV_NETMAP */ /*********************************************************************/ Added: head/sys/dev/ena/ena_netmap.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ena/ena_netmap.c Thu Oct 31 15:51:18 2019 (r354221) @@ -0,0 +1,111 @@ +/*- + * BSD LICENSE + * + * Copyright (c) 2015-2019 Amazon.com, Inc. or its affiliates. + * 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 COPYRIGHT HOLDERS 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 COPYRIGHT + * OWNER 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$"); + +#ifdef DEV_NETMAP + +#include "ena.h" +#include "ena_netmap.h" + +static int ena_netmap_reg(struct netmap_adapter *, int); +static int ena_netmap_txsync(struct netmap_kring *, int); +static int ena_netmap_rxsync(struct netmap_kring *, int); + +int +ena_netmap_attach(struct ena_adapter *adapter) +{ + struct netmap_adapter na; + + ena_trace(ENA_NETMAP, "netmap attach\n"); + + bzero(&na, sizeof(na)); + na.na_flags = NAF_MOREFRAG; + na.ifp = adapter->ifp; + na.num_tx_desc = adapter->tx_ring_size; + na.num_rx_desc = adapter->rx_ring_size; + na.num_tx_rings = adapter->num_queues; + na.num_rx_rings = adapter->num_queues; + na.rx_buf_maxsize = adapter->buf_ring_size; + na.nm_txsync = ena_netmap_txsync; + na.nm_rxsync = ena_netmap_rxsync; + na.nm_register = ena_netmap_reg; + + return (netmap_attach(&na)); +} + +static int +ena_netmap_reg(struct netmap_adapter *na, int onoff) +{ + struct ifnet *ifp = na->ifp; + struct ena_adapter* adapter = ifp->if_softc; + int rc; + + sx_xlock(&adapter->ioctl_sx); + ENA_FLAG_CLEAR_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); + ena_down(adapter); + + if (onoff) { + ena_trace(ENA_NETMAP, "netmap on\n"); + nm_set_native_flags(na); + } else { + ena_trace(ENA_NETMAP, "netmap off\n"); + nm_clear_native_flags(na); + } + + rc = ena_up(adapter); + if (rc != 0) { + ena_trace(ENA_WARNING, "ena_up failed with rc=%d\n", rc); + adapter->reset_reason = ENA_REGS_RESET_DRIVER_INVALID_STATE; + nm_clear_native_flags(na); + ena_destroy_device(adapter, false); + ENA_FLAG_SET_ATOMIC(ENA_FLAG_DEV_UP_BEFORE_RESET, adapter); + rc = ena_restore_device(adapter); + } + sx_unlock(&adapter->ioctl_sx); + + return (rc); +} + +static int +ena_netmap_txsync(struct netmap_kring *kring, int flags) +{ + ena_trace(ENA_NETMAP, "netmap txsync\n"); + return (0); +} + +static int +ena_netmap_rxsync(struct netmap_kring *kring, int flags) +{ + ena_trace(ENA_NETMAP, "netmap rxsync\n"); + return (0); +} + +#endif /* DEV_NETMAP */ Added: head/sys/dev/ena/ena_netmap.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ena/ena_netmap.h Thu Oct 31 15:51:18 2019 (r354221) @@ -0,0 +1,51 @@ +/*- + * BSD LICENSE + * + * Copyright (c) 2015-2019 Amazon.com, Inc. or its affiliates. + * 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 COPYRIGHT HOLDERS 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 COPYRIGHT + * OWNER 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 _ENA_NETMAP_H_ +#define _ENA_NETMAP_H_ + +/* Undef (un)likely as they are defined in netmap_kern.h */ +#ifdef likely +#undef likely +#endif /* likely */ +#ifdef unlikely +#undef unlikely +#endif /* unlikely */ + +#include +#include +#include + +int ena_netmap_attach(struct ena_adapter *); + +#endif /* _ENA_NETMAP_H_ */ Modified: head/sys/modules/ena/Makefile ============================================================================== --- head/sys/modules/ena/Makefile Thu Oct 31 15:44:26 2019 (r354220) +++ head/sys/modules/ena/Makefile Thu Oct 31 15:51:18 2019 (r354221) @@ -34,7 +34,8 @@ ${SRCTOP}/sys/contrib/ena-com KMOD = if_ena -SRCS = ena.c ena_com.c ena_eth_com.c ena_sysctl.c ena_datapath.c +SRCS = ena_com.c ena_eth_com.c +SRCS += ena.c ena_sysctl.c ena_datapath.c ena_netmap.c SRCS += device_if.h bus_if.h pci_if.h CFLAGS += -I${SRCTOP}/sys/contrib From owner-svn-src-all@freebsd.org Thu Oct 31 15:57:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0599D15D982; Thu, 31 Oct 2019 15:57:46 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473qj56vrsz4VTB; Thu, 31 Oct 2019 15:57:45 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D02F725024; Thu, 31 Oct 2019 15:57:45 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VFvjZ6065192; Thu, 31 Oct 2019 15:57:45 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VFviVO065187; Thu, 31 Oct 2019 15:57:44 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201910311557.x9VFviVO065187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 31 Oct 2019 15:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354222 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 354222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 15:57:46 -0000 Author: mw Date: Thu Oct 31 15:57:44 2019 New Revision: 354222 URL: https://svnweb.freebsd.org/changeset/base/354222 Log: Add support for ENA NETMAP Rx Most of code used for Rx ring initialization could be reused in NETMAP. Reset of NETMAP ring and new alloc method was added. Driver decides if use kernels mbufs or NETMAPs slots based on IFCAP_NETMAP flag. It allows to reuse ena_refill_rx_bufs, which provides proper handling of Rx out of order completion. ena_netmap_alloc_rx_slot takes exactly the same arguments as ena_alloc_rx_mbuf, but instead of allocating one mbuf it takes one slot from NETMAP ring. Based on queue id proper netmap_ring is found. As NETMAP provides the "partial opening" feature not all of the rings are avaiable. Not used points to invalid ring. If there is available slot, it is taken from the ring. Its buffer is mapped to DMA and its index is stored in ena_rx_buffer field in ena_rx_buffer structure. Then ena_buf is filled with addresses and ring state is updated. Cleanup is handled by ena_netmap_free_rx_slot. It unmaps DMA and returns buffer to ring. As we could not return more bufs than we have taken and we should not override occupied slots, buf_index should be 0. It is being checked by assertion. ena_netmap_rxsync callback puts received packets back to NETMAP ring and passes them to user space by updating ring pointers. First it fills ena_netmap_ctx. Then it performs two actions: * ena_netmap_rx_frames moves received frames from NIC to NETMAP ring, * ena_netmap_rx_cleanup fills NIC ring with slots released by userspace app. In case of Rx error that could be handled by NIC driver (for example by performing reset) rx sync should return 0. ena_netmap_rx_frames first checks if NETMAP ring is in consistent state and then in the loop receives new frames. When all available frames are taken nr_hwtail is updated. Receiving one frame is handled by ena_netmap_rx_frame. If no error occurrs, each Descriptor is loaded by ena_netmap_rx_load_desc function. If packets take more than one segments NS_MOREFRAG flag must be set in all, but not last slot. In case of wrong req_id packet is removed from NETMAP ring. If packet is successful received counters are updated. Refiling of NIC ring is performed by ena_netmap_rx_cleanup function. It calculates number of available slots and call ena_refill_rx_bufs with proper number. Differential Revision: https://reviews.freebsd.org/D21935 Submitted by: Rafal Kozik Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h head/sys/dev/ena/ena_datapath.c head/sys/dev/ena/ena_netmap.c head/sys/dev/ena/ena_netmap.h Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Oct 31 15:51:18 2019 (r354221) +++ head/sys/dev/ena/ena.c Thu Oct 31 15:57:44 2019 (r354222) @@ -764,6 +764,11 @@ ena_setup_rx_resources(struct ena_adapter *adapter, un size = sizeof(struct ena_rx_buffer) * rx_ring->ring_size; +#ifdef DEV_NETMAP + ena_netmap_reset_rx_ring(adapter, qid); + rx_ring->initialized = false; +#endif /* DEV_NETMAP */ + /* * Alloc extra element so in rx path * we can always prefetch rx_info + 1 @@ -1008,8 +1013,12 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t req_id = rx_ring->free_rx_ids[next_to_use]; rx_info = &rx_ring->rx_buffer_info[req_id]; - - rc = ena_alloc_rx_mbuf(adapter, rx_ring, rx_info); +#ifdef DEV_NETMAP + if (adapter->ifp->if_capenable & IFCAP_NETMAP) + rc = ena_netmap_alloc_rx_slot(adapter, rx_ring, rx_info); + else +#endif /* DEV_NETMAP */ + rc = ena_alloc_rx_mbuf(adapter, rx_ring, rx_info); if (unlikely(rc != 0)) { ena_trace(ENA_WARNING, "failed to alloc buffer for rx queue %d\n", @@ -1054,6 +1063,14 @@ ena_free_rx_bufs(struct ena_adapter *adapter, unsigned if (rx_info->mbuf != NULL) ena_free_rx_mbuf(adapter, rx_ring, rx_info); +#ifdef DEV_NETMAP + if (((if_getflags(adapter->ifp) & IFF_DYING) == 0) && + (adapter->ifp->if_capenable & IFCAP_NETMAP)) { + if (rx_info->netmap_buf_idx != 0) + ena_netmap_free_rx_slot(adapter, rx_ring, + rx_info); + } +#endif /* DEV_NETMAP */ } } @@ -1072,10 +1089,12 @@ ena_refill_all_rx_bufs(struct ena_adapter *adapter) rx_ring = &adapter->rx_ring[i]; bufs_num = rx_ring->ring_size - 1; rc = ena_refill_rx_bufs(rx_ring, bufs_num); - if (unlikely(rc != bufs_num)) ena_trace(ENA_WARNING, "refilling Queue %d failed. " "Allocated %d buffers from: %d\n", i, rc, bufs_num); +#ifdef DEV_NETMAP + rx_ring->initialized = true; +#endif /* DEV_NETMAP */ } } Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Thu Oct 31 15:51:18 2019 (r354221) +++ head/sys/dev/ena/ena.h Thu Oct 31 15:57:44 2019 (r354222) @@ -252,6 +252,9 @@ struct ena_rx_buffer { struct mbuf *mbuf; bus_dmamap_t map; struct ena_com_buf ena_buf; +#ifdef DEV_NETMAP + uint32_t netmap_buf_idx; +#endif /* DEV_NETMAP */ } __aligned(CACHE_LINE_SIZE); struct ena_stats_tx { @@ -351,6 +354,10 @@ struct ena_ring { /* Used for LLQ */ uint8_t *push_buf_intermediate_buf; + +#ifdef DEV_NETMAP + bool initialized; +#endif /* DEV_NETMAP */ } __aligned(CACHE_LINE_SIZE); struct ena_stats_dev { @@ -470,5 +477,25 @@ void ena_down(struct ena_adapter *); int ena_restore_device(struct ena_adapter *); void ena_destroy_device(struct ena_adapter *, bool); int ena_refill_rx_bufs(struct ena_ring *, uint32_t); +inline int validate_rx_req_id(struct ena_ring *, uint16_t); + +inline int +validate_rx_req_id(struct ena_ring *rx_ring, uint16_t req_id) +{ + if (likely(req_id < rx_ring->ring_size)) + return (0); + + device_printf(rx_ring->adapter->pdev, "Invalid rx req_id: %hu\n", + req_id); + counter_u64_add(rx_ring->rx_stats.bad_req_id, 1); + + /* Trigger device reset */ + if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, rx_ring->adapter))) { + rx_ring->adapter->reset_reason = ENA_REGS_RESET_INV_RX_REQ_ID; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, rx_ring->adapter); + } + + return (EFAULT); +} #endif /* !(ENA_H) */ Modified: head/sys/dev/ena/ena_datapath.c ============================================================================== --- head/sys/dev/ena/ena_datapath.c Thu Oct 31 15:51:18 2019 (r354221) +++ head/sys/dev/ena/ena_datapath.c Thu Oct 31 15:57:44 2019 (r354222) @@ -32,6 +32,9 @@ __FBSDID("$FreeBSD$"); #include "ena.h" #include "ena_datapath.h" +#ifdef DEV_NETMAP +#include "ena_netmap.h" +#endif /* DEV_NETMAP */ /********************************************************************* * Static functions prototypes @@ -40,7 +43,6 @@ __FBSDID("$FreeBSD$"); static int ena_tx_cleanup(struct ena_ring *); static int ena_rx_cleanup(struct ena_ring *); static inline int validate_tx_req_id(struct ena_ring *, uint16_t); -static inline int validate_rx_req_id(struct ena_ring *, uint16_t); static void ena_rx_hash_mbuf(struct ena_ring *, struct ena_com_rx_ctx *, struct mbuf *); static struct mbuf* ena_rx_mbuf(struct ena_ring *, struct ena_com_rx_buf_info *, @@ -206,25 +208,6 @@ validate_tx_req_id(struct ena_ring *tx_ring, uint16_t return (EFAULT); } -static inline int -validate_rx_req_id(struct ena_ring *rx_ring, uint16_t req_id) -{ - if (likely(req_id < rx_ring->ring_size)) - return (0); - - device_printf(rx_ring->adapter->pdev, "Invalid rx req_id: %hu\n", - req_id); - counter_u64_add(rx_ring->rx_stats.bad_req_id, 1); - - /* Trigger device reset */ - if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, rx_ring->adapter))) { - rx_ring->adapter->reset_reason = ENA_REGS_RESET_INV_RX_REQ_ID; - ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, rx_ring->adapter); - } - - return (EFAULT); -} - /** * ena_tx_cleanup - clear sent packets and corresponding descriptors * @tx_ring: ring for which we want to clean packets @@ -577,6 +560,9 @@ ena_rx_cleanup(struct ena_ring *rx_ring) unsigned int qid; int rc, i; int budget = RX_BUDGET; +#ifdef DEV_NETMAP + int done; +#endif /* DEV_NETMAP */ adapter = rx_ring->que->adapter; ifp = adapter->ifp; @@ -585,6 +571,11 @@ ena_rx_cleanup(struct ena_ring *rx_ring) io_cq = &adapter->ena_dev->io_cq_queues[ena_qid]; io_sq = &adapter->ena_dev->io_sq_queues[ena_qid]; next_to_clean = rx_ring->next_to_clean; + +#ifdef DEV_NETMAP + if (netmap_rx_irq(adapter->ifp, rx_ring->qid, &done) != NM_IRQ_PASS) + return (0); +#endif /* DEV_NETMAP */ ena_trace(ENA_DBG, "rx: qid %d\n", qid); Modified: head/sys/dev/ena/ena_netmap.c ============================================================================== --- head/sys/dev/ena/ena_netmap.c Thu Oct 31 15:51:18 2019 (r354221) +++ head/sys/dev/ena/ena_netmap.c Thu Oct 31 15:57:44 2019 (r354222) @@ -35,10 +35,37 @@ __FBSDID("$FreeBSD$"); #include "ena.h" #include "ena_netmap.h" +#define ENA_NETMAP_MORE_FRAMES 1 +#define ENA_NETMAP_NO_MORE_FRAMES 0 +#define ENA_MAX_FRAMES 16384 + +struct ena_netmap_ctx { + struct netmap_kring *kring; + struct ena_adapter *adapter; + struct netmap_adapter *na; + struct netmap_slot *slots; + struct ena_ring *ring; + struct ena_com_io_cq *io_cq; + struct ena_com_io_sq *io_sq; + u_int nm_i; + uint16_t nt; + uint16_t lim; +}; + +/* Netmap callbacks */ static int ena_netmap_reg(struct netmap_adapter *, int); static int ena_netmap_txsync(struct netmap_kring *, int); static int ena_netmap_rxsync(struct netmap_kring *, int); +/* Helper functions */ +static int ena_netmap_rx_frames(struct ena_netmap_ctx *); +static int ena_netmap_rx_frame(struct ena_netmap_ctx *); +static int ena_netmap_rx_load_desc(struct ena_netmap_ctx *, uint16_t, + int *); +static void ena_netmap_rx_cleanup(struct ena_netmap_ctx *); +static void ena_netmap_fill_ctx(struct netmap_kring *, + struct ena_netmap_ctx *, uint16_t); + int ena_netmap_attach(struct ena_adapter *adapter) { @@ -61,6 +88,124 @@ ena_netmap_attach(struct ena_adapter *adapter) return (netmap_attach(&na)); } +int +ena_netmap_alloc_rx_slot(struct ena_adapter *adapter, + struct ena_ring *rx_ring, struct ena_rx_buffer *rx_info) +{ + struct netmap_adapter *na = NA(adapter->ifp); + struct netmap_kring *kring; + struct netmap_ring *ring; + struct netmap_slot *slot; + void *addr; + uint64_t paddr; + int nm_i, qid, head, lim, rc; + + /* if previously allocated frag is not used */ + if (unlikely(rx_info->netmap_buf_idx != 0)) + return (0); + + qid = rx_ring->qid; + kring = na->rx_rings[qid]; + nm_i = kring->nr_hwcur; + head = kring->rhead; + + ena_trace(ENA_NETMAP | ENA_DBG, "nr_hwcur: %d, nr_hwtail: %d, " + "rhead: %d, rcur: %d, rtail: %d\n", kring->nr_hwcur, + kring->nr_hwtail, kring->rhead, kring->rcur, kring->rtail); + + if ((nm_i == head) && rx_ring->initialized) { + ena_trace(ENA_NETMAP, "No free slots in netmap ring\n"); + return (ENOMEM); + } + + ring = kring->ring; + if (ring == NULL) { + device_printf(adapter->pdev, "Rx ring %d is NULL\n", qid); + return (EFAULT); + } + slot = &ring->slot[nm_i]; + + addr = PNMB(na, slot, &paddr); + if (addr == NETMAP_BUF_BASE(na)) { + device_printf(adapter->pdev, "Bad buff in slot\n"); + return (EFAULT); + } + + rc = netmap_load_map(na, adapter->rx_buf_tag, rx_info->map, addr); + if (rc != 0) { + ena_trace(ENA_WARNING, "DMA mapping error\n"); + return (rc); + } + bus_dmamap_sync(adapter->rx_buf_tag, rx_info->map, BUS_DMASYNC_PREREAD); + + rx_info->ena_buf.paddr = paddr; + rx_info->ena_buf.len = ring->nr_buf_size; + rx_info->mbuf = NULL; + rx_info->netmap_buf_idx = slot->buf_idx; + + slot->buf_idx = 0; + + lim = kring->nkr_num_slots - 1; + kring->nr_hwcur = nm_next(nm_i, lim); + + return (0); +} + +void +ena_netmap_free_rx_slot(struct ena_adapter *adapter, + struct ena_ring *rx_ring, struct ena_rx_buffer *rx_info) +{ + struct netmap_adapter *na; + struct netmap_kring *kring; + struct netmap_slot *slot; + int nm_i, qid, lim; + + na = NA(adapter->ifp); + if (na == NULL) { + device_printf(adapter->pdev, "netmap adapter is NULL\n"); + return; + } + + if (na->rx_rings == NULL) { + device_printf(adapter->pdev, "netmap rings are NULL\n"); + return; + } + + qid = rx_ring->qid; + kring = na->rx_rings[qid]; + if (kring == NULL) { + device_printf(adapter->pdev, + "netmap kernel ring %d is NULL\n", qid); + return; + } + + lim = kring->nkr_num_slots - 1; + nm_i = nm_prev(kring->nr_hwcur, lim); + + if (kring->nr_mode != NKR_NETMAP_ON) + return; + + bus_dmamap_sync(adapter->rx_buf_tag, rx_info->map, + BUS_DMASYNC_POSTREAD); + netmap_unload_map(na, adapter->rx_buf_tag, rx_info->map); + + slot = &kring->ring->slot[nm_i]; + + ENA_ASSERT(slot->buf_idx == 0, "Overwrite slot buf\n"); + slot->buf_idx = rx_info->netmap_buf_idx; + slot->flags = NS_BUF_CHANGED; + + rx_info->netmap_buf_idx = 0; + kring->nr_hwcur = nm_i; +} + +void +ena_netmap_reset_rx_ring(struct ena_adapter *adapter, int qid) +{ + if (adapter->ifp->if_capenable & IFCAP_NETMAP) + netmap_reset(NA(adapter->ifp), NR_RX, qid, 0); +} + static int ena_netmap_reg(struct netmap_adapter *na, int onoff) { @@ -104,8 +249,192 @@ ena_netmap_txsync(struct netmap_kring *kring, int flag static int ena_netmap_rxsync(struct netmap_kring *kring, int flags) { - ena_trace(ENA_NETMAP, "netmap rxsync\n"); + struct ena_netmap_ctx ctx; + int rc; + + ena_netmap_fill_ctx(kring, &ctx, ENA_IO_RXQ_IDX(kring->ring_id)); + ctx.ring = &ctx.adapter->rx_ring[kring->ring_id]; + + if (ctx.kring->rhead > ctx.lim) { + /* Probably not needed to release slots from RX ring. */ + return (netmap_ring_reinit(ctx.kring)); + } + + if (unlikely((if_getdrvflags(ctx.na->ifp) & IFF_DRV_RUNNING) == 0)) + return (0); + + if (unlikely(!ENA_FLAG_ISSET(ENA_FLAG_LINK_UP, ctx.adapter))) + return (0); + + if ((rc = ena_netmap_rx_frames(&ctx)) != 0) + return (rc); + + ena_netmap_rx_cleanup(&ctx); + return (0); +} + +static inline int +ena_netmap_rx_frames(struct ena_netmap_ctx *ctx) +{ + int rc = 0; + int frames_counter = 0; + + ctx->nt = ctx->ring->next_to_clean; + ctx->nm_i = ctx->kring->nr_hwtail; + + while((rc = ena_netmap_rx_frame(ctx)) == ENA_NETMAP_MORE_FRAMES) { + frames_counter++; + /* In case of multiple frames, it is not an error. */ + rc = 0; + if (frames_counter > ENA_MAX_FRAMES) { + device_printf(ctx->adapter->pdev, + "Driver is stuck in the Rx loop\n"); + break; + } + }; + + ctx->kring->nr_hwtail = ctx->nm_i; + ctx->kring->nr_kflags &= ~NKR_PENDINTR; + ctx->ring->next_to_clean = ctx->nt; + + return (rc); +} + +static inline int +ena_netmap_rx_frame(struct ena_netmap_ctx *ctx) +{ + struct ena_com_rx_ctx ena_rx_ctx; + int rc, len = 0; + uint16_t buf, nm; + + ena_rx_ctx.ena_bufs = ctx->ring->ena_bufs; + ena_rx_ctx.max_bufs = ctx->adapter->max_rx_sgl_size; + bus_dmamap_sync(ctx->io_cq->cdesc_addr.mem_handle.tag, + ctx->io_cq->cdesc_addr.mem_handle.map, BUS_DMASYNC_POSTREAD); + + rc = ena_com_rx_pkt(ctx->io_cq, ctx->io_sq, &ena_rx_ctx); + if (unlikely(rc != 0)) { + ena_trace(ENA_ALERT, "Too many desc from the device.\n"); + counter_u64_add(ctx->ring->rx_stats.bad_desc_num, 1); + ctx->adapter->reset_reason = ENA_REGS_RESET_TOO_MANY_RX_DESCS; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, ctx->adapter); + return (rc); + } + if (unlikely(ena_rx_ctx.descs == 0)) + return (ENA_NETMAP_NO_MORE_FRAMES); + + ena_trace(ENA_NETMAP | ENA_DBG, "Rx: q %d got packet from ena. descs #:" + " %d l3 proto %d l4 proto %d hash: %x\n", ctx->ring->qid, + ena_rx_ctx.descs, ena_rx_ctx.l3_proto, ena_rx_ctx.l4_proto, + ena_rx_ctx.hash); + + for (buf = 0; buf < ena_rx_ctx.descs; buf++) + if ((rc = ena_netmap_rx_load_desc(ctx, buf, &len)) != 0) + break; + /* + * ena_netmap_rx_load_desc doesn't know the number of descriptors. + * It just set flag NS_MOREFRAG to all slots, then here flag of + * last slot is cleared. + */ + ctx->slots[nm_prev(ctx->nm_i, ctx->lim)].flags = NS_BUF_CHANGED; + + if (rc != 0) { + goto rx_clear_desc; + } + + bus_dmamap_sync(ctx->io_cq->cdesc_addr.mem_handle.tag, + ctx->io_cq->cdesc_addr.mem_handle.map, BUS_DMASYNC_PREREAD); + + counter_enter(); + counter_u64_add_protected(ctx->ring->rx_stats.bytes, len); + counter_u64_add_protected(ctx->adapter->hw_stats.rx_bytes, len); + counter_u64_add_protected(ctx->ring->rx_stats.cnt, 1); + counter_u64_add_protected(ctx->adapter->hw_stats.rx_packets, 1); + counter_exit(); + + return (ENA_NETMAP_MORE_FRAMES); + +rx_clear_desc: + nm = ctx->nm_i; + + /* Remove failed packet from ring */ + while(buf--) { + ctx->slots[nm].flags = 0; + ctx->slots[nm].len = 0; + nm = nm_prev(nm, ctx->lim); + } + + return (rc); +} + +static inline int +ena_netmap_rx_load_desc(struct ena_netmap_ctx *ctx, uint16_t buf, int *len) +{ + struct ena_rx_buffer *rx_info; + uint16_t req_id; + int rc; + + req_id = ctx->ring->ena_bufs[buf].req_id; + rc = validate_rx_req_id(ctx->ring, req_id); + if (unlikely(rc != 0)) + return (rc); + + rx_info = &ctx->ring->rx_buffer_info[req_id]; + bus_dmamap_sync(ctx->adapter->rx_buf_tag, rx_info->map, + BUS_DMASYNC_POSTREAD); + netmap_unload_map(ctx->na, ctx->adapter->rx_buf_tag, rx_info->map); + + ENA_ASSERT(ctx->slots[ctx->nm_i].buf_idx == 0, "Rx idx is not 0.\n"); + + ctx->slots[ctx->nm_i].buf_idx = rx_info->netmap_buf_idx; + rx_info->netmap_buf_idx = 0; + /* + * Set NS_MOREFRAG to all slots. + * Then ena_netmap_rx_frame clears it from last one. + */ + ctx->slots[ctx->nm_i].flags |= NS_MOREFRAG | NS_BUF_CHANGED; + ctx->slots[ctx->nm_i].len = ctx->ring->ena_bufs[buf].len; + *len += ctx->slots[ctx->nm_i].len; + ctx->ring->free_rx_ids[ctx->nt] = req_id; + ena_trace(ENA_DBG, "rx_info %p, buf_idx %d, paddr %jx, nm: %d\n", + rx_info, ctx->slots[ctx->nm_i].buf_idx, + (uintmax_t)rx_info->ena_buf.paddr, ctx->nm_i); + + ctx->nm_i = nm_next(ctx->nm_i, ctx->lim); + ctx->nt = ENA_RX_RING_IDX_NEXT(ctx->nt, ctx->ring->ring_size); + + return (0); +} + +static inline void +ena_netmap_rx_cleanup(struct ena_netmap_ctx *ctx) +{ + int refill_required; + + refill_required = ctx->kring->rhead - ctx->kring->nr_hwcur; + if (ctx->kring->nr_hwcur != ctx->kring->nr_hwtail) + refill_required -= 1; + + if (refill_required == 0) + return; + else if (refill_required < 0) + refill_required += ctx->kring->nkr_num_slots; + + ena_refill_rx_bufs(ctx->ring, refill_required); +} + +static inline void +ena_netmap_fill_ctx(struct netmap_kring *kring, struct ena_netmap_ctx *ctx, + uint16_t ena_qid) +{ + ctx->kring = kring; + ctx->na = kring->na; + ctx->adapter = ctx->na->ifp->if_softc; + ctx->lim = kring->nkr_num_slots - 1; + ctx->io_cq = &ctx->adapter->ena_dev->io_cq_queues[ena_qid]; + ctx->io_sq = &ctx->adapter->ena_dev->io_sq_queues[ena_qid]; + ctx->slots = kring->ring->slot; } #endif /* DEV_NETMAP */ Modified: head/sys/dev/ena/ena_netmap.h ============================================================================== --- head/sys/dev/ena/ena_netmap.h Thu Oct 31 15:51:18 2019 (r354221) +++ head/sys/dev/ena/ena_netmap.h Thu Oct 31 15:57:44 2019 (r354222) @@ -47,5 +47,10 @@ #include int ena_netmap_attach(struct ena_adapter *); +int ena_netmap_alloc_rx_slot(struct ena_adapter *, struct ena_ring *, + struct ena_rx_buffer *); +void ena_netmap_free_rx_slot(struct ena_adapter *, struct ena_ring *, + struct ena_rx_buffer *); +void ena_netmap_reset_rx_ring(struct ena_adapter *, int); #endif /* _ENA_NETMAP_H_ */ From owner-svn-src-all@freebsd.org Thu Oct 31 15:59:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 248D415DA79; Thu, 31 Oct 2019 15:59:31 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473ql66p54z4VdN; Thu, 31 Oct 2019 15:59:30 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4E2F25030; Thu, 31 Oct 2019 15:59:30 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VFxUt5065310; Thu, 31 Oct 2019 15:59:30 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VFxT8S065305; Thu, 31 Oct 2019 15:59:29 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201910311559.x9VFxT8S065305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 31 Oct 2019 15:59:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354223 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 354223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 15:59:31 -0000 Author: mw Date: Thu Oct 31 15:59:29 2019 New Revision: 354223 URL: https://svnweb.freebsd.org/changeset/base/354223 Log: Add support for ENA NETMAP Tx Two new tables are added to ena_tx_buffer structure: * netmap_map_seg stores DMA mapping structures, * netmap_buf_idx stores buff indexes taken from the slots. When Tx resources are being set, the new mapping structures are created and netmap Tx rings are being reset. When Tx resources are being released, used netmap bufs are unmapped from DMA and then mapping structures are destroyed. When Tx interrupt occurrs, ena_netmap_tx_irq is called. ena_netmap_txsync callback signalizes that there are new packets which should be transmitted. First, it fills ena_netmap_ctx. Then it performs two actions: * ena_netmap_tx_frames moves packets from netmap ring to NIC, * ena_netmap_tx_cleanup restores buffers from NIC and gives them back to the userspace app. 0 is returned in case of Tx error that could be handled by the driver. ena_netmap_tx_frames checks if there are packets ready for transmission. Then, for each of them, ena_netmap_tx_frame is called. If error occurs, transmitting is stopped, but if the error was cause due to HW ring being full, information about that is not propagated to the userspace app. When all packets are ready, doorbell is written to NIC and netmap ring state is updated. Parsing of one packet is done by the ena_netmap_tx_frame function. First, it checks if number of slots does not exceed NIC limit. Invalid packets are being dropped and the error is propagated to the upper layer. As each netmap buffer has equal size, which is typically greater then 2KiB, there shouldn't be any packets which contain too many slots. Then, the ena_com_tx_ctx structure is being filled. As netmap does not support any hardware offloads, ena_com_tx_meta structure is set to zero. After that, ena_netmap_map_slots maps all memory slots for DMA. If the device works in the LLQ mode, the push header is being determined by checking if the header fits within the first socket. If so, the portion of data is being copied directly from the slot. In other case, the data is copied to the intermediate buffer. First slots are treated the same as as the others, because DMA mapping has no impact on LLQ mode. Index of each netmap buffer is taken from slot and stored in netmap_buf_idx array. In case of mapping error, memory is unmapped and packets are put back to the netmap ring. ena_netmap_tx_cleanup performs out of order cleanup of sent buffers. First, req_id is taken and is validated. As validate_tx_req_id from ena.c is specific to kernels mbuf, another implementation is provided. Each req_id is cleaned up by ena_netmap_tx_clean_one function. Buffers are being unmaped from DMA and put back to netmap ring. In the end, state of netmap and NIC rings are being updated. Differential Revision: https://reviews.freebsd.org/D21936 Submitted by: Rafal Kozik Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h head/sys/dev/ena/ena_datapath.c head/sys/dev/ena/ena_netmap.c head/sys/dev/ena/ena_netmap.h Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Oct 31 15:57:44 2019 (r354222) +++ head/sys/dev/ena/ena.c Thu Oct 31 15:59:29 2019 (r354223) @@ -103,6 +103,7 @@ static int ena_setup_tx_dma_tag(struct ena_adapter *); static int ena_free_tx_dma_tag(struct ena_adapter *); static int ena_setup_rx_dma_tag(struct ena_adapter *); static int ena_free_rx_dma_tag(struct ena_adapter *); +static void ena_release_all_tx_dmamap(struct ena_ring *); static int ena_setup_tx_resources(struct ena_adapter *, int); static void ena_free_tx_resources(struct ena_adapter *, int); static int ena_setup_all_tx_resources(struct ena_adapter *); @@ -531,6 +532,44 @@ ena_free_rx_dma_tag(struct ena_adapter *adapter) return (ret); } +static void +ena_release_all_tx_dmamap(struct ena_ring *tx_ring) +{ + struct ena_adapter *adapter = tx_ring->adapter; + struct ena_tx_buffer *tx_info; + bus_dma_tag_t tx_tag = adapter->tx_buf_tag;; + int i; +#ifdef DEV_NETMAP + struct ena_netmap_tx_info *nm_info; + int j; +#endif /* DEV_NETMAP */ + + for (i = 0; i < tx_ring->ring_size; ++i) { + tx_info = &tx_ring->tx_buffer_info[i]; +#ifdef DEV_NETMAP + if (adapter->ifp->if_capenable & IFCAP_NETMAP) { + nm_info = &tx_info->nm_info; + for (j = 0; j < ENA_PKT_MAX_BUFS; ++j) { + if (nm_info->map_seg[j] != NULL) { + bus_dmamap_destroy(tx_tag, + nm_info->map_seg[j]); + nm_info->map_seg[j] = NULL; + } + } + } +#endif /* DEV_NETMAP */ + if (tx_info->map_head != NULL) { + bus_dmamap_destroy(tx_tag, tx_info->map_head); + tx_info->map_head = NULL; + } + + if (tx_info->map_seg != NULL) { + bus_dmamap_destroy(tx_tag, tx_info->map_seg); + tx_info->map_seg = NULL; + } + } +} + /** * ena_setup_tx_resources - allocate Tx resources (Descriptors) * @adapter: network interface device structure @@ -544,7 +583,13 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in struct ena_que *que = &adapter->que[qid]; struct ena_ring *tx_ring = que->tx_ring; int size, i, err; +#ifdef DEV_NETMAP + bus_dmamap_t *map; + int j; + ena_netmap_reset_tx_ring(adapter, qid); +#endif /* DEV_NETMAP */ + size = sizeof(struct ena_tx_buffer) * tx_ring->ring_size; tx_ring->tx_buffer_info = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); @@ -587,7 +632,7 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in ena_trace(ENA_ALERT, "Unable to create Tx DMA map_head for buffer %d\n", i); - goto err_buf_info_unmap; + goto err_map_release; } tx_ring->tx_buffer_info[i].seg_mapped = false; @@ -597,9 +642,24 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in ena_trace(ENA_ALERT, "Unable to create Tx DMA map_seg for buffer %d\n", i); - goto err_buf_info_head_unmap; + goto err_map_release; } tx_ring->tx_buffer_info[i].head_mapped = false; + +#ifdef DEV_NETMAP + if (adapter->ifp->if_capenable & IFCAP_NETMAP) { + map = tx_ring->tx_buffer_info[i].nm_info.map_seg; + for (j = 0; j < ENA_PKT_MAX_BUFS; j++) { + err = bus_dmamap_create(adapter->tx_buf_tag, 0, + &map[j]); + if (unlikely(err != 0)) { + ena_trace(ENA_ALERT, "Unable to create " + "Tx DMA for buffer %d %d\n", i, j); + goto err_map_release; + } + } + } +#endif /* DEV_NETMAP */ } /* Allocate taskqueues */ @@ -610,7 +670,7 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in ena_trace(ENA_ALERT, "Unable to create taskqueue for enqueue task\n"); i = tx_ring->ring_size; - goto err_buf_info_unmap; + goto err_map_release; } tx_ring->running = true; @@ -620,17 +680,8 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in return (0); -err_buf_info_head_unmap: - bus_dmamap_destroy(adapter->tx_buf_tag, - tx_ring->tx_buffer_info[i].map_head); -err_buf_info_unmap: - while (i--) { - bus_dmamap_destroy(adapter->tx_buf_tag, - tx_ring->tx_buffer_info[i].map_head); - bus_dmamap_destroy(adapter->tx_buf_tag, - tx_ring->tx_buffer_info[i].map_seg); - } - free(tx_ring->push_buf_intermediate_buf, M_DEVBUF); +err_map_release: + ena_release_all_tx_dmamap(tx_ring); err_tx_ids_free: free(tx_ring->free_tx_ids, M_DEVBUF); tx_ring->free_tx_ids = NULL; @@ -652,6 +703,10 @@ static void ena_free_tx_resources(struct ena_adapter *adapter, int qid) { struct ena_ring *tx_ring = &adapter->tx_ring[qid]; +#ifdef DEV_NETMAP + struct ena_netmap_tx_info *nm_info; + int j; +#endif /* DEV_NETMAP */ while (taskqueue_cancel(tx_ring->enqueue_tq, &tx_ring->enqueue_task, NULL)) @@ -686,6 +741,24 @@ ena_free_tx_resources(struct ena_adapter *adapter, int } bus_dmamap_destroy(adapter->tx_buf_tag, tx_ring->tx_buffer_info[i].map_seg); + +#ifdef DEV_NETMAP + if (adapter->ifp->if_capenable & IFCAP_NETMAP) { + nm_info = &tx_ring->tx_buffer_info[i].nm_info; + for (j = 0; j < ENA_PKT_MAX_BUFS; j++) { + if (nm_info->socket_buf_idx[j] != 0) { + bus_dmamap_sync(adapter->tx_buf_tag, + nm_info->map_seg[j], + BUS_DMASYNC_POSTWRITE); + ena_netmap_unload(adapter, + nm_info->map_seg[j]); + } + bus_dmamap_destroy(adapter->tx_buf_tag, + nm_info->map_seg[j]); + nm_info->socket_buf_idx[j] = 0; + } + } +#endif /* DEV_NETMAP */ m_freem(tx_ring->tx_buffer_info[i].mbuf); tx_ring->tx_buffer_info[i].mbuf = NULL; Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Thu Oct 31 15:57:44 2019 (r354222) +++ head/sys/dev/ena/ena.h Thu Oct 31 15:59:29 2019 (r354223) @@ -226,6 +226,14 @@ struct ena_calc_queue_size_ctx { uint16_t max_rx_sgl_size; }; +#ifdef DEV_NETMAP +struct ena_netmap_tx_info { + uint32_t socket_buf_idx[ENA_PKT_MAX_BUFS]; + bus_dmamap_t map_seg[ENA_PKT_MAX_BUFS]; + unsigned int sockets_used; +}; +#endif + struct ena_tx_buffer { struct mbuf *mbuf; /* # of ena desc for this specific mbuf @@ -244,6 +252,10 @@ struct ena_tx_buffer { /* Used to detect missing tx packets */ struct bintime timestamp; bool print_once; + +#ifdef DEV_NETMAP + struct ena_netmap_tx_info nm_info; +#endif /* DEV_NETMAP */ struct ena_com_buf bufs[ENA_PKT_MAX_BUFS]; } __aligned(CACHE_LINE_SIZE); Modified: head/sys/dev/ena/ena_datapath.c ============================================================================== --- head/sys/dev/ena/ena_datapath.c Thu Oct 31 15:57:44 2019 (r354222) +++ head/sys/dev/ena/ena_datapath.c Thu Oct 31 15:59:29 2019 (r354223) @@ -239,6 +239,11 @@ ena_tx_cleanup(struct ena_ring *tx_ring) io_cq = &adapter->ena_dev->io_cq_queues[ena_qid]; next_to_clean = tx_ring->next_to_clean; +#ifdef DEV_NETMAP + if (netmap_tx_irq(adapter->ifp, tx_ring->qid) != NM_IRQ_PASS) + return (0); +#endif /* DEV_NETMAP */ + do { struct ena_tx_buffer *tx_info; struct mbuf *mbuf; Modified: head/sys/dev/ena/ena_netmap.c ============================================================================== --- head/sys/dev/ena/ena_netmap.c Thu Oct 31 15:57:44 2019 (r354222) +++ head/sys/dev/ena/ena_netmap.c Thu Oct 31 15:59:29 2019 (r354223) @@ -58,6 +58,23 @@ static int ena_netmap_txsync(struct netmap_kring *, in static int ena_netmap_rxsync(struct netmap_kring *, int); /* Helper functions */ +static int ena_netmap_tx_frames(struct ena_netmap_ctx *); +static int ena_netmap_tx_frame(struct ena_netmap_ctx *); +static inline uint16_t ena_netmap_count_slots(struct ena_netmap_ctx *); +static inline uint16_t ena_netmap_packet_len(struct netmap_slot *, u_int, + uint16_t); +static int ena_netmap_copy_data(struct netmap_adapter *, + struct netmap_slot *, u_int, uint16_t, uint16_t, void *); +static int ena_netmap_map_single_slot(struct netmap_adapter *, + struct netmap_slot *, bus_dma_tag_t, bus_dmamap_t, void **, uint64_t *); +static int ena_netmap_tx_map_slots(struct ena_netmap_ctx *, + struct ena_tx_buffer *, void **, uint16_t *, uint16_t *); +static void ena_netmap_unmap_last_socket_chain(struct ena_netmap_ctx *, + struct ena_tx_buffer *); +static void ena_netmap_tx_cleanup(struct ena_netmap_ctx *); +static uint16_t ena_netmap_tx_clean_one(struct ena_netmap_ctx *, + uint16_t); +static inline int validate_tx_req_id(struct ena_ring *, uint16_t); static int ena_netmap_rx_frames(struct ena_netmap_ctx *); static int ena_netmap_rx_frame(struct ena_netmap_ctx *); static int ena_netmap_rx_load_desc(struct ena_netmap_ctx *, uint16_t, @@ -206,6 +223,13 @@ ena_netmap_reset_rx_ring(struct ena_adapter *adapter, netmap_reset(NA(adapter->ifp), NR_RX, qid, 0); } +void +ena_netmap_reset_tx_ring(struct ena_adapter *adapter, int qid) +{ + if (adapter->ifp->if_capenable & IFCAP_NETMAP) + netmap_reset(NA(adapter->ifp), NR_TX, qid, 0); +} + static int ena_netmap_reg(struct netmap_adapter *na, int onoff) { @@ -242,11 +266,578 @@ ena_netmap_reg(struct netmap_adapter *na, int onoff) static int ena_netmap_txsync(struct netmap_kring *kring, int flags) { - ena_trace(ENA_NETMAP, "netmap txsync\n"); + struct ena_netmap_ctx ctx; + int rc = 0; + + ena_netmap_fill_ctx(kring, &ctx, ENA_IO_TXQ_IDX(kring->ring_id)); + ctx.ring = &ctx.adapter->tx_ring[kring->ring_id]; + + ENA_RING_MTX_LOCK(ctx.ring); + if (unlikely(!ENA_FLAG_ISSET(ENA_FLAG_DEV_UP, ctx.adapter))) + goto txsync_end; + + if (unlikely(!ENA_FLAG_ISSET(ENA_FLAG_LINK_UP, ctx.adapter))) + goto txsync_end; + + rc = ena_netmap_tx_frames(&ctx); + ena_netmap_tx_cleanup(&ctx); + +txsync_end: + ENA_RING_MTX_UNLOCK(ctx.ring); + return (rc); +} + +static int +ena_netmap_tx_frames(struct ena_netmap_ctx *ctx) +{ + struct ena_ring *tx_ring = ctx->ring; + int rc = 0; + + ctx->nm_i = ctx->kring->nr_hwcur; + ctx->nt = ctx->ring->next_to_use; + + __builtin_prefetch(&ctx->slots[ctx->nm_i]); + + while (ctx->nm_i != ctx->kring->rhead) { + if ((rc = ena_netmap_tx_frame(ctx)) != 0) { + /* + * When there is no empty space in Tx ring, error is + * still being returned. It should not be passed to the + * netmap, as application knows current ring state from + * netmap ring pointers. Returning error there could + * cause application to exit, but the Tx ring is commonly + * being full. + */ + if (rc == ENA_COM_NO_MEM) + rc = 0; + break; + } + tx_ring->acum_pkts++; + } + + /* If any packet was sent... */ + if (likely(ctx->nm_i != ctx->kring->nr_hwcur)) { + wmb(); + /* ...send the doorbell to the device. */ + ena_com_write_sq_doorbell(ctx->io_sq); + counter_u64_add(ctx->ring->tx_stats.doorbells, 1); + tx_ring->acum_pkts = 0; + + ctx->ring->next_to_use = ctx->nt; + ctx->kring->nr_hwcur = ctx->nm_i; + } + + return (rc); +} + +static int +ena_netmap_tx_frame(struct ena_netmap_ctx *ctx) +{ + struct ena_com_tx_ctx ena_tx_ctx; + struct ena_adapter *adapter; + struct ena_ring *tx_ring; + struct ena_tx_buffer *tx_info; + uint16_t req_id; + uint16_t header_len; + uint16_t packet_len; + int nb_hw_desc; + int rc; + void *push_hdr; + + adapter = ctx->adapter; + if (ena_netmap_count_slots(ctx) > adapter->max_tx_sgl_size) { + ena_trace(ENA_WARNING, "Too many slots per packet\n"); + return (EINVAL); + } + + tx_ring = ctx->ring; + + req_id = tx_ring->free_tx_ids[ctx->nt]; + tx_info = &tx_ring->tx_buffer_info[req_id]; + tx_info->num_of_bufs = 0; + tx_info->nm_info.sockets_used = 0; + + rc = ena_netmap_tx_map_slots(ctx, tx_info, &push_hdr, &header_len, + &packet_len); + if (unlikely(rc != 0)) { + device_printf(adapter->pdev, "Failed to map Tx slot\n"); + return (rc); + } + + bzero(&ena_tx_ctx, sizeof(struct ena_com_tx_ctx)); + ena_tx_ctx.ena_bufs = tx_info->bufs; + ena_tx_ctx.push_header = push_hdr; + ena_tx_ctx.num_bufs = tx_info->num_of_bufs; + ena_tx_ctx.req_id = req_id; + ena_tx_ctx.header_len = header_len; + + /* There are no any offloads, as the netmap doesn't support them */ + + if (tx_ring->acum_pkts == DB_THRESHOLD || + ena_com_is_doorbell_needed(ctx->io_sq, &ena_tx_ctx)) { + wmb(); + ena_com_write_sq_doorbell(ctx->io_sq); + counter_u64_add(tx_ring->tx_stats.doorbells, 1); + tx_ring->acum_pkts = 0; + } + + rc = ena_com_prepare_tx(ctx->io_sq, &ena_tx_ctx, &nb_hw_desc); + if (unlikely(rc != 0)) { + if (likely(rc == ENA_COM_NO_MEM)) { + ena_trace(ENA_NETMAP | ENA_DBG | ENA_TXPTH, + "Tx ring[%d] is out of space\n", tx_ring->que->id); + } else { + device_printf(adapter->pdev, + "Failed to prepare Tx bufs\n"); + } + counter_u64_add(tx_ring->tx_stats.prepare_ctx_err, 1); + + ena_netmap_unmap_last_socket_chain(ctx, tx_info); + return (rc); + } + + counter_enter(); + counter_u64_add_protected(tx_ring->tx_stats.cnt, 1); + counter_u64_add_protected(tx_ring->tx_stats.bytes, packet_len); + counter_u64_add_protected(adapter->hw_stats.tx_packets, 1); + counter_u64_add_protected(adapter->hw_stats.tx_bytes, packet_len); + counter_exit(); + + tx_info->tx_descs = nb_hw_desc; + + ctx->nt = ENA_TX_RING_IDX_NEXT(ctx->nt, ctx->ring->ring_size); + + for (unsigned int i = 0; i < tx_info->num_of_bufs; i++) + bus_dmamap_sync(adapter->tx_buf_tag, + tx_info->nm_info.map_seg[i], BUS_DMASYNC_PREWRITE); + return (0); } +static inline uint16_t +ena_netmap_count_slots(struct ena_netmap_ctx *ctx) +{ + uint16_t slots = 1; + uint16_t nm = ctx->nm_i; + + while ((ctx->slots[nm].flags & NS_MOREFRAG) != 0) { + slots++; + nm = nm_next(nm, ctx->lim); + } + + return slots; +} + +static inline uint16_t +ena_netmap_packet_len(struct netmap_slot *slots, u_int slot_index, + uint16_t limit) +{ + struct netmap_slot *nm_slot; + uint16_t packet_size = 0; + + do { + nm_slot = &slots[slot_index]; + packet_size += nm_slot->len; + slot_index = nm_next(slot_index, limit); + } while ((nm_slot->flags & NS_MOREFRAG) != 0); + + return packet_size; +} + static int +ena_netmap_copy_data(struct netmap_adapter *na, struct netmap_slot *slots, + u_int slot_index, uint16_t limit, uint16_t bytes_to_copy, void *destination) +{ + struct netmap_slot *nm_slot; + void *slot_vaddr; + uint16_t packet_size; + uint16_t data_amount; + + packet_size = 0; + do { + nm_slot = &slots[slot_index]; + slot_vaddr = NMB(na, nm_slot); + if (unlikely(slot_vaddr == NULL)) + return (EINVAL); + + data_amount = min_t(uint16_t, bytes_to_copy, nm_slot->len); + memcpy(destination, slot_vaddr, data_amount); + bytes_to_copy -= data_amount; + + slot_index = nm_next(slot_index, limit); + } while ((nm_slot->flags & NS_MOREFRAG) != 0 && bytes_to_copy > 0); + + return (0); +} + +static int +ena_netmap_map_single_slot(struct netmap_adapter *na, struct netmap_slot *slot, + bus_dma_tag_t dmatag, bus_dmamap_t dmamap, void **vaddr, uint64_t *paddr) +{ + int rc; + + *vaddr = PNMB(na, slot, paddr); + if (unlikely(vaddr == NULL)) { + ena_trace(ENA_ALERT, "Slot address is NULL\n"); + return (EINVAL); + } + + rc = netmap_load_map(na, dmatag, dmamap, *vaddr); + if (unlikely(rc != 0)) { + ena_trace(ENA_ALERT, "Failed to map slot %d for DMA\n", + slot->buf_idx); + return (EINVAL); + } + + return (0); +} + +static int +ena_netmap_tx_map_slots(struct ena_netmap_ctx *ctx, + struct ena_tx_buffer *tx_info, void **push_hdr, uint16_t *header_len, + uint16_t *packet_len) +{ + struct netmap_slot *slot; + struct ena_com_buf *ena_buf; + struct ena_adapter *adapter; + struct ena_ring *tx_ring; + struct ena_netmap_tx_info *nm_info; + bus_dmamap_t *nm_maps; + void *vaddr; + uint64_t paddr; + uint32_t *nm_buf_idx; + uint32_t slot_head_len; + uint32_t frag_len; + uint32_t remaining_len; + uint16_t push_len; + uint16_t delta; + int rc; + + adapter = ctx->adapter; + tx_ring = ctx->ring; + ena_buf = tx_info->bufs; + nm_info = &tx_info->nm_info; + nm_maps = nm_info->map_seg; + nm_buf_idx = nm_info->socket_buf_idx; + slot = &ctx->slots[ctx->nm_i]; + + slot_head_len = slot->len; + *packet_len = ena_netmap_packet_len(ctx->slots, ctx->nm_i, ctx->lim); + remaining_len = *packet_len; + delta = 0; + + __builtin_prefetch(&ctx->slots[ctx->nm_i + 1]); + if (tx_ring->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { + /* + * When the device is in LLQ mode, the driver will copy + * the header into the device memory space. + * The ena_com layer assumes that the header is in a linear + * memory space. + * This assumption might be wrong since part of the header + * can be in the fragmented buffers. + * First, check if header fits in the first slot. If not, copy + * it to separate buffer that will be holding linearized data. + */ + push_len = min_t(uint32_t, *packet_len, + tx_ring->tx_max_header_size); + *header_len = push_len; + /* If header is in linear space, just point to socket's data. */ + if (likely(push_len <= slot_head_len)) { + *push_hdr = NMB(ctx->na, slot); + if (unlikely(push_hdr == NULL)) { + device_printf(adapter->pdev, + "Slot vaddress is NULL\n"); + return (EINVAL); + } + /* + * Otherwise, copy whole portion of header from multiple slots + * to intermediate buffer. + */ + } else { + rc = ena_netmap_copy_data(ctx->na, + ctx->slots, + ctx->nm_i, + ctx->lim, + push_len, + tx_ring->push_buf_intermediate_buf); + if (unlikely(rc)) { + device_printf(adapter->pdev, + "Failed to copy data from slots to push_buf\n"); + return (EINVAL); + } + + *push_hdr = tx_ring->push_buf_intermediate_buf; + counter_u64_add(tx_ring->tx_stats.llq_buffer_copy, 1); + + delta = push_len - slot_head_len; + } + + ena_trace(ENA_NETMAP | ENA_DBG | ENA_TXPTH, + "slot: %d header_buf->vaddr: %p push_len: %d\n", + slot->buf_idx, *push_hdr, push_len); + + /* + * If header was in linear memory space, map for the dma rest of the data + * in the first mbuf of the mbuf chain. + */ + if (slot_head_len > push_len) { + rc = ena_netmap_map_single_slot(ctx->na, + slot, + adapter->tx_buf_tag, + *nm_maps, + &vaddr, + &paddr); + if (unlikely(rc != 0)) { + device_printf(adapter->pdev, + "DMA mapping error\n"); + return (rc); + } + nm_maps++; + + ena_buf->paddr = paddr + push_len; + ena_buf->len = slot->len - push_len; + ena_buf++; + + tx_info->num_of_bufs++; + } + + remaining_len -= slot->len; + + /* Save buf idx before advancing */ + *nm_buf_idx = slot->buf_idx; + nm_buf_idx++; + slot->buf_idx = 0; + + /* Advance to the next socket */ + ctx->nm_i = nm_next(ctx->nm_i, ctx->lim); + slot = &ctx->slots[ctx->nm_i]; + nm_info->sockets_used++; + + /* + * If header is in non linear space (delta > 0), then skip mbufs + * containing header and map the last one containing both header + * and the packet data. + * The first segment is already counted in. + */ + while (delta > 0) { + __builtin_prefetch(&ctx->slots[ctx->nm_i + 1]); + frag_len = slot->len; + + /* + * If whole segment contains header just move to the + * next one and reduce delta. + */ + if (unlikely(delta >= frag_len)) { + delta -= frag_len; + } else { + /* + * Map the data and then assign it with the + * offsets + */ + rc = ena_netmap_map_single_slot(ctx->na, + slot, + adapter->tx_buf_tag, + *nm_maps, + &vaddr, + &paddr); + if (unlikely(rc != 0)) { + device_printf(adapter->pdev, + "DMA mapping error\n"); + goto error_map; + } + nm_maps++; + + ena_buf->paddr = paddr + delta; + ena_buf->len = slot->len - delta; + ena_buf++; + + tx_info->num_of_bufs++; + delta = 0; + } + + remaining_len -= slot->len; + + /* Save buf idx before advancing */ + *nm_buf_idx = slot->buf_idx; + nm_buf_idx++; + slot->buf_idx = 0; + + /* Advance to the next socket */ + ctx->nm_i = nm_next(ctx->nm_i, ctx->lim); + slot = &ctx->slots[ctx->nm_i]; + nm_info->sockets_used++; + } + } else { + *push_hdr = NULL; + /* + * header_len is just a hint for the device. Because netmap is + * not giving us any information about packet header length and + * it is not guaranteed that all packet headers will be in the + * 1st slot, setting header_len to 0 is making the device ignore + * this value and resolve header on it's own. + */ + *header_len = 0; + } + + /* Map all remaining data (regular routine for non-LLQ mode) */ + while (remaining_len > 0) { + __builtin_prefetch(&ctx->slots[ctx->nm_i + 1]); + + rc = ena_netmap_map_single_slot(ctx->na, + slot, + adapter->tx_buf_tag, + *nm_maps, + &vaddr, + &paddr); + if (unlikely(rc != 0)) { + device_printf(adapter->pdev, + "DMA mapping error\n"); + goto error_map; + } + nm_maps++; + + ena_buf->paddr = paddr; + ena_buf->len = slot->len; + ena_buf++; + + tx_info->num_of_bufs++; + + remaining_len -= slot->len; + + /* Save buf idx before advancing */ + *nm_buf_idx = slot->buf_idx; + nm_buf_idx++; + slot->buf_idx = 0; + + /* Advance to the next socket */ + ctx->nm_i = nm_next(ctx->nm_i, ctx->lim); + slot = &ctx->slots[ctx->nm_i]; + nm_info->sockets_used++; + } + + return (0); + +error_map: + ena_netmap_unmap_last_socket_chain(ctx, tx_info); + + return (rc); +} + +static void +ena_netmap_unmap_last_socket_chain(struct ena_netmap_ctx *ctx, + struct ena_tx_buffer *tx_info) +{ + struct ena_netmap_tx_info *nm_info; + int n; + + nm_info = &tx_info->nm_info; + + /** + * As the used sockets must not be equal to the buffers used in the LLQ + * mode, they must be treated separately. + * First, unmap the DMA maps. + */ + n = tx_info->num_of_bufs; + while (n--) { + netmap_unload_map(ctx->na, ctx->adapter->tx_buf_tag, + nm_info->map_seg[n]); + } + tx_info->num_of_bufs = 0; + + /* Next, retain the sockets back to the userspace */ + n = nm_info->sockets_used; + while (n--) { + ctx->slots[ctx->nm_i].buf_idx = nm_info->socket_buf_idx[n]; + ctx->slots[ctx->nm_i].flags = NS_BUF_CHANGED; + nm_info->socket_buf_idx[n] = 0; + ctx->nm_i = nm_prev(ctx->nm_i, ctx->lim); + } + nm_info->sockets_used = 0; +} + +static void +ena_netmap_tx_cleanup(struct ena_netmap_ctx *ctx) +{ + uint16_t req_id; + uint16_t total_tx_descs = 0; + + ctx->nm_i = ctx->kring->nr_hwtail; + ctx->nt = ctx->ring->next_to_clean; + + /* Reclaim buffers for completed transmissions */ + while (ena_com_tx_comp_req_id_get(ctx->io_cq, &req_id) >= 0) { + if (validate_tx_req_id(ctx->ring, req_id) != 0) + break; + total_tx_descs += ena_netmap_tx_clean_one(ctx, req_id); + } + + ctx->kring->nr_hwtail = ctx->nm_i; + + if (total_tx_descs > 0) { + /* acknowledge completion of sent packets */ + ctx->ring->next_to_clean = ctx->nt; + ena_com_comp_ack(ctx->ring->ena_com_io_sq, total_tx_descs); + ena_com_update_dev_comp_head(ctx->ring->ena_com_io_cq); + } +} + +static uint16_t +ena_netmap_tx_clean_one(struct ena_netmap_ctx *ctx, uint16_t req_id) +{ + struct ena_tx_buffer *tx_info; + struct ena_netmap_tx_info *nm_info; + int n; + + tx_info = &ctx->ring->tx_buffer_info[req_id]; + nm_info = &tx_info->nm_info; + + /** + * As the used sockets must not be equal to the buffers used in the LLQ + * mode, they must be treated separately. + * First, unmap the DMA maps. + */ + n = tx_info->num_of_bufs; + for (n = 0; n < tx_info->num_of_bufs; n++) { + netmap_unload_map(ctx->na, ctx->adapter->tx_buf_tag, + nm_info->map_seg[n]); + } + tx_info->num_of_bufs = 0; + + /* Next, retain the sockets back to the userspace */ + for (n = 0; n < nm_info->sockets_used; n++) { + ctx->nm_i = nm_next(ctx->nm_i, ctx->lim); + ENA_ASSERT(ctx->slots[ctx->nm_i].buf_idx == 0, + "Tx idx is not 0.\n"); + ctx->slots[ctx->nm_i].buf_idx = nm_info->socket_buf_idx[n]; + ctx->slots[ctx->nm_i].flags = NS_BUF_CHANGED; + nm_info->socket_buf_idx[n] = 0; + } + nm_info->sockets_used = 0; + + ctx->ring->free_tx_ids[ctx->nt] = req_id; + ctx->nt = ENA_TX_RING_IDX_NEXT(ctx->nt, ctx->lim); + + return tx_info->tx_descs; +} + +static inline int +validate_tx_req_id(struct ena_ring *tx_ring, uint16_t req_id) +{ + struct ena_adapter *adapter = tx_ring->adapter; + + if (likely(req_id < tx_ring->ring_size)) + return (0); + + ena_trace(ENA_WARNING, "Invalid req_id: %hu\n", req_id); + counter_u64_add(tx_ring->tx_stats.bad_req_id, 1); + + adapter->reset_reason = ENA_REGS_RESET_INV_TX_REQ_ID; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); + + return (EFAULT); +} + +static int ena_netmap_rxsync(struct netmap_kring *kring, int flags) { struct ena_netmap_ctx ctx; @@ -435,6 +1026,14 @@ ena_netmap_fill_ctx(struct netmap_kring *kring, struct ctx->io_cq = &ctx->adapter->ena_dev->io_cq_queues[ena_qid]; ctx->io_sq = &ctx->adapter->ena_dev->io_sq_queues[ena_qid]; ctx->slots = kring->ring->slot; +} + +void +ena_netmap_unload(struct ena_adapter *adapter, bus_dmamap_t map) +{ + struct netmap_adapter *na = NA(adapter->ifp); + + netmap_unload_map(na, adapter->tx_buf_tag, map); } #endif /* DEV_NETMAP */ Modified: head/sys/dev/ena/ena_netmap.h ============================================================================== --- head/sys/dev/ena/ena_netmap.h Thu Oct 31 15:57:44 2019 (r354222) +++ head/sys/dev/ena/ena_netmap.h Thu Oct 31 15:59:29 2019 (r354223) @@ -52,5 +52,7 @@ int ena_netmap_alloc_rx_slot(struct ena_adapter *, str void ena_netmap_free_rx_slot(struct ena_adapter *, struct ena_ring *, struct ena_rx_buffer *); void ena_netmap_reset_rx_ring(struct ena_adapter *, int); +void ena_netmap_reset_tx_ring(struct ena_adapter *, int); +void ena_netmap_unload(struct ena_adapter *, bus_dmamap_t); #endif /* _ENA_NETMAP_H_ */ From owner-svn-src-all@freebsd.org Thu Oct 31 16:02:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C7A215DDD6; Thu, 31 Oct 2019 16:02:43 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473qpq2hwmz4W31; Thu, 31 Oct 2019 16:02:43 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 411672520D; Thu, 31 Oct 2019 16:02:43 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VG2hNi070641; Thu, 31 Oct 2019 16:02:43 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VG2gBo070638; Thu, 31 Oct 2019 16:02:42 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201910311602.x9VG2gBo070638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 31 Oct 2019 16:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354224 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 354224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 16:02:43 -0000 Author: mw Date: Thu Oct 31 16:02:42 2019 New Revision: 354224 URL: https://svnweb.freebsd.org/changeset/base/354224 Log: Add support for ENA NETMAP partial initialization In NETMAP mode not all queues need to be allocated to NETMAP. Some of them could be left to the kernel. Configuration is managed by the flags nr_mode and nr_pending_mode provided per each NETMAP kring. ENA driver checks those flags and perform proper rings initialization. Differential Revision: https://reviews.freebsd.org/D21937 Submitted by: Rafal Kozik Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena_netmap.c head/sys/dev/ena/ena_netmap.h Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Oct 31 15:59:29 2019 (r354223) +++ head/sys/dev/ena/ena.c Thu Oct 31 16:02:42 2019 (r354224) @@ -1087,7 +1087,7 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t req_id = rx_ring->free_rx_ids[next_to_use]; rx_info = &rx_ring->rx_buffer_info[req_id]; #ifdef DEV_NETMAP - if (adapter->ifp->if_capenable & IFCAP_NETMAP) + if (ena_rx_ring_in_netmap(adapter, rx_ring->qid)) rc = ena_netmap_alloc_rx_slot(adapter, rx_ring, rx_info); else #endif /* DEV_NETMAP */ Modified: head/sys/dev/ena/ena_netmap.c ============================================================================== --- head/sys/dev/ena/ena_netmap.c Thu Oct 31 15:59:29 2019 (r354223) +++ head/sys/dev/ena/ena_netmap.c Thu Oct 31 16:02:42 2019 (r354224) @@ -206,6 +206,8 @@ ena_netmap_free_rx_slot(struct ena_adapter *adapter, BUS_DMASYNC_POSTREAD); netmap_unload_map(na, adapter->rx_buf_tag, rx_info->map); + KASSERT(kring->ring == NULL, ("Netmap Rx ring is NULL\n")); + slot = &kring->ring->slot[nm_i]; ENA_ASSERT(slot->buf_idx == 0, "Overwrite slot buf\n"); @@ -216,18 +218,54 @@ ena_netmap_free_rx_slot(struct ena_adapter *adapter, kring->nr_hwcur = nm_i; } +static bool +ena_ring_in_netmap(struct ena_adapter *adapter, int qid, enum txrx x) +{ + struct netmap_adapter *na; + struct netmap_kring *kring; + + if (adapter->ifp->if_capenable & IFCAP_NETMAP) { + na = NA(adapter->ifp); + kring = (x == NR_RX) ? na->rx_rings[qid] : na->tx_rings[qid]; + if (kring->nr_mode == NKR_NETMAP_ON) + return true; + } + return false; +} + +bool +ena_tx_ring_in_netmap(struct ena_adapter *adapter, int qid) +{ + return ena_ring_in_netmap(adapter, qid, NR_TX); +} + +bool +ena_rx_ring_in_netmap(struct ena_adapter *adapter, int qid) +{ + return ena_ring_in_netmap(adapter, qid, NR_RX); +} + +static void +ena_netmap_reset_ring(struct ena_adapter *adapter, int qid, enum txrx x) +{ + if (!ena_ring_in_netmap(adapter, qid, x)) + return; + + netmap_reset(NA(adapter->ifp), x, qid, 0); + ena_trace(ENA_NETMAP, "%s ring %d is in netmap mode\n", + (x == NR_TX) ? "Tx" : "Rx", qid); +} + void ena_netmap_reset_rx_ring(struct ena_adapter *adapter, int qid) { - if (adapter->ifp->if_capenable & IFCAP_NETMAP) - netmap_reset(NA(adapter->ifp), NR_RX, qid, 0); + ena_netmap_reset_ring(adapter, qid, NR_RX); } void ena_netmap_reset_tx_ring(struct ena_adapter *adapter, int qid) { - if (adapter->ifp->if_capenable & IFCAP_NETMAP) - netmap_reset(NA(adapter->ifp), NR_TX, qid, 0); + ena_netmap_reset_ring(adapter, qid, NR_TX); } static int @@ -235,7 +273,9 @@ ena_netmap_reg(struct netmap_adapter *na, int onoff) { struct ifnet *ifp = na->ifp; struct ena_adapter* adapter = ifp->if_softc; - int rc; + struct netmap_kring *kring; + enum txrx t; + int rc, i; sx_xlock(&adapter->ioctl_sx); ENA_FLAG_CLEAR_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); @@ -243,10 +283,26 @@ ena_netmap_reg(struct netmap_adapter *na, int onoff) if (onoff) { ena_trace(ENA_NETMAP, "netmap on\n"); + for_rx_tx(t) { + for (i = 0; i <= nma_get_nrings(na, t); i++) { + kring = NMR(na, t)[i]; + if (nm_kring_pending_on(kring)) { + kring->nr_mode = NKR_NETMAP_ON; + } + } + } nm_set_native_flags(na); } else { ena_trace(ENA_NETMAP, "netmap off\n"); nm_clear_native_flags(na); + for_rx_tx(t) { + for (i = 0; i <= nma_get_nrings(na, t); i++) { + kring = NMR(na, t)[i]; + if (nm_kring_pending_off(kring)) { + kring->nr_mode = NKR_NETMAP_OFF; + } + } + } } rc = ena_up(adapter); Modified: head/sys/dev/ena/ena_netmap.h ============================================================================== --- head/sys/dev/ena/ena_netmap.h Thu Oct 31 15:59:29 2019 (r354223) +++ head/sys/dev/ena/ena_netmap.h Thu Oct 31 16:02:42 2019 (r354224) @@ -51,6 +51,8 @@ int ena_netmap_alloc_rx_slot(struct ena_adapter *, str struct ena_rx_buffer *); void ena_netmap_free_rx_slot(struct ena_adapter *, struct ena_ring *, struct ena_rx_buffer *); +bool ena_rx_ring_in_netmap(struct ena_adapter *, int); +bool ena_tx_ring_in_netmap(struct ena_adapter *, int); void ena_netmap_reset_rx_ring(struct ena_adapter *, int); void ena_netmap_reset_tx_ring(struct ena_adapter *, int); void ena_netmap_unload(struct ena_adapter *, bus_dmamap_t); From owner-svn-src-all@freebsd.org Thu Oct 31 16:03:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 72F2E15DF78; Thu, 31 Oct 2019 16:03:44 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473qr02GLlz4WBL; Thu, 31 Oct 2019 16:03:44 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3103725219; Thu, 31 Oct 2019 16:03:44 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VG3iNr070722; Thu, 31 Oct 2019 16:03:44 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VG3ihm070721; Thu, 31 Oct 2019 16:03:44 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201910311603.x9VG3ihm070721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 31 Oct 2019 16:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354225 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 354225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 16:03:44 -0000 Author: mw Date: Thu Oct 31 16:03:43 2019 New Revision: 354225 URL: https://svnweb.freebsd.org/changeset/base/354225 Log: Update ENA version to v2.1.0 In this release the netmap support was introduced. Moreover, it is also now possible to use the LLQ mode of the driver on the arm64 AWS instances (A1 type). Differential Revision: https://reviews.freebsd.org/D21938 Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.h Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Thu Oct 31 16:02:42 2019 (r354224) +++ head/sys/dev/ena/ena.h Thu Oct 31 16:03:43 2019 (r354225) @@ -40,7 +40,7 @@ #include "ena-com/ena_eth_com.h" #define DRV_MODULE_VER_MAJOR 2 -#define DRV_MODULE_VER_MINOR 0 +#define DRV_MODULE_VER_MINOR 1 #define DRV_MODULE_VER_SUBMINOR 0 #define DRV_MODULE_NAME "ena" From owner-svn-src-all@freebsd.org Thu Oct 31 20:29:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBC991655AC; Thu, 31 Oct 2019 20:29:46 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473xky4bQcz3JYD; Thu, 31 Oct 2019 20:29:46 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DB219C; Thu, 31 Oct 2019 20:29:46 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VKTkuR025464; Thu, 31 Oct 2019 20:29:46 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VKTkO7025461; Thu, 31 Oct 2019 20:29:46 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201910312029.x9VKTkO7025461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Thu, 31 Oct 2019 20:29:46 +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: r354226 - stable/12/lib/libsecureboot X-SVN-Group: stable-12 X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: stable/12/lib/libsecureboot X-SVN-Commit-Revision: 354226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 20:29:47 -0000 Author: sjg Date: Thu Oct 31 20:29:45 2019 New Revision: 354226 URL: https://svnweb.freebsd.org/changeset/base/354226 Log: Initialize verbosity and debug level from env For EFI at least, we can seed the environment with VE_VERBOSE etc. MFC of r354038 Reviewed by: stevek imp Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22135 Modified: stable/12/lib/libsecureboot/verify_file.c stable/12/lib/libsecureboot/vets.c Modified: stable/12/lib/libsecureboot/verify_file.c ============================================================================== --- stable/12/lib/libsecureboot/verify_file.c Thu Oct 31 16:03:43 2019 (r354225) +++ stable/12/lib/libsecureboot/verify_file.c Thu Oct 31 20:29:45 2019 (r354226) @@ -292,6 +292,28 @@ verify_tweak(int fd, off_t off, struct stat *stp, } } +#ifndef VE_DEBUG_LEVEL +# define VE_DEBUG_LEVEL 0 +#endif + +static int +getenv_int(const char *var, int def) +{ + const char *cp; + char *ep; + long val; + + val = def; + cp = getenv(var); + if (cp && *cp) { + val = strtol(cp, &ep, 0); + if ((ep && *ep) || val != (int)val) { + val = def; + } + } + return (int)val; +} + /** * @brief verify an open file * @@ -331,9 +353,8 @@ verify_file(int fd, const char *filename, off_t off, i if (verifying < 0) { verifying = ve_trust_init(); -#ifdef VE_DEBUG_LEVEL - ve_debug_set(VE_DEBUG_LEVEL); -#endif + verbose = getenv_int("VE_VERBOSE", VE_VERBOSE_DEFAULT); + ve_debug_set(getenv_int("VE_DEBUG_LEVEL", VE_DEBUG_LEVEL)); /* initialize ve_status with default result */ rc = verifying ? VE_NOT_CHECKED : VE_NOT_VERIFYING; ve_status_set(0, rc); Modified: stable/12/lib/libsecureboot/vets.c ============================================================================== --- stable/12/lib/libsecureboot/vets.c Thu Oct 31 16:03:43 2019 (r354225) +++ stable/12/lib/libsecureboot/vets.c Thu Oct 31 20:29:45 2019 (r354226) @@ -240,7 +240,7 @@ ve_forbidden_digest_add(hash_data *digest, size_t num) static size_t ve_anchors_add(br_x509_certificate *xcs, size_t num, anchor_list *anchors, - char *anchors_name) + const char *anchors_name) { br_x509_trust_anchor ta; size_t u; From owner-svn-src-all@freebsd.org Thu Oct 31 20:37:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6179165A0E; Thu, 31 Oct 2019 20:37: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473xvh5nvsz3KG8; Thu, 31 Oct 2019 20:37:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA92B28D; Thu, 31 Oct 2019 20:37:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VKbKww031525; Thu, 31 Oct 2019 20:37:20 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VKbK1k031523; Thu, 31 Oct 2019 20:37:20 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201910312037.x9VKbK1k031523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 31 Oct 2019 20:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354227 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 354227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 20:37:21 -0000 Author: brooks Date: Thu Oct 31 20:37:19 2019 New Revision: 354227 URL: https://svnweb.freebsd.org/changeset/base/354227 Log: Allow bsd.compat.mk to be reliably included outside Makefile.inc1. Replace explicit TARGET_* variables with COMPAT_* versions defined based on where the file is being included. Also, require that bsd.compat.mk be included directly. It's not going to be widely used so always loading it in bsd.prog.mk doesn't make sense. Instead users can include it directly. Reviewed by: imp, bdrewery (prior revision) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22059 Modified: head/share/mk/bsd.README head/share/mk/bsd.compat.mk head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Thu Oct 31 20:29:45 2019 (r354226) +++ head/share/mk/bsd.README Thu Oct 31 20:37:19 2019 (r354227) @@ -379,10 +379,6 @@ LINKMODE Mode of links created with LINKS [${BINMODE}] MAN Manual pages. If no MAN variable is defined, "MAN=${PROG}.1" is assumed. See bsd.man.mk for more details. -NEED_COMPAT Build and link targeting a compatability ABI or fail if it - is not available. Supported values are "32", "soft", and - "any" being a wildcard. - PROG The name of the program to build. If not supplied, nothing is built. @@ -445,9 +441,6 @@ SUBDIR A list of subdirectories that should be built Each of the targets will execute the same target in the subdirectories. -WANT_COMPAT Similar to NEED_COMPAT, but build with the base ABI if - the specified ABI is not available. - The include file includes the file named "../Makefile.inc" if it exists, as well as the include file . @@ -470,6 +463,20 @@ If foo does not have a manual page at all, add the lin If foo has multiple source files, add the line: SRCS= a.c b.c c.c d.c + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +The include file, , allows programs (built with +) to be built for one the ABI(s) supported by the +top-level Makefile.libcompat. It requires that also be +included. + +NEED_COMPAT Build and link targeting a compatibility ABI or fail if it + is not available. Supported values are "32", "soft", and + "any" being a wildcard. + +WANT_COMPAT Similar to NEED_COMPAT, but build with the base ABI if + the specified ABI is not available. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Modified: head/share/mk/bsd.compat.mk ============================================================================== --- head/share/mk/bsd.compat.mk Thu Oct 31 20:29:45 2019 (r354226) +++ head/share/mk/bsd.compat.mk Thu Oct 31 20:37:19 2019 (r354227) @@ -3,14 +3,22 @@ .if !targets(__<${_this:T}>__) __<${_this:T}>__: +.if defined(_LIBCOMPAT) +COMPAT_ARCH= ${TARGET_ARCH} +COMPAT_CPUTYPE= ${TARGET_CPUTYPE} +.else +COMPAT_ARCH= ${MACHINE_ARCH} +COMPAT_CPUTYPE= ${CPUTYPE} +.endif + # ------------------------------------------------------------------- # 32 bit world -.if ${TARGET_ARCH} == "amd64" +.if ${COMPAT_ARCH} == "amd64" HAS_COMPAT=32 -.if empty(TARGET_CPUTYPE) +.if empty(COMPAT_CPUTYPE) LIB32CPUFLAGS= -march=i686 -mmmx -msse -msse2 .else -LIB32CPUFLAGS= -march=${TARGET_CPUTYPE} +LIB32CPUFLAGS= -march=${COMPAT_CPUTYPE} .endif .if (defined(WANT_COMPILER_TYPE) && ${WANT_COMPILER_TYPE} == gcc) || \ (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc) @@ -24,29 +32,29 @@ LIB32WMAKEFLAGS= \ AS="${XAS} --32" \ LD="${XLD} -m elf_i386_fbsd -L${LIBCOMPATTMP}/usr/lib32" -.elif ${TARGET_ARCH} == "powerpc64" +.elif ${COMPAT_ARCH} == "powerpc64" HAS_COMPAT=32 -.if empty(TARGET_CPUTYPE) +.if empty(COMPAT_CPUTYPE) LIB32CPUFLAGS= -mcpu=powerpc .else -LIB32CPUFLAGS= -mcpu=${TARGET_CPUTYPE} +LIB32CPUFLAGS= -mcpu=${COMPAT_CPUTYPE} .endif LIB32CPUFLAGS+= -m32 LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc LIB32WMAKEFLAGS= \ LD="${XLD} -m elf32ppc_fbsd" -.elif ${TARGET_ARCH:Mmips64*} != "" +.elif ${COMPAT_ARCH:Mmips64*} != "" HAS_COMPAT=32 .if (defined(WANT_COMPILER_TYPE) && ${WANT_COMPILER_TYPE} == gcc) || \ (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc) -.if empty(TARGET_CPUTYPE) +.if empty(COMPAT_CPUTYPE) LIB32CPUFLAGS= -march=mips3 .else -LIB32CPUFLAGS= -march=${TARGET_CPUTYPE} +LIB32CPUFLAGS= -march=${COMPAT_CPUTYPE} .endif .else -.if ${TARGET_ARCH:Mmips64el*} != "" +.if ${COMPAT_ARCH:Mmips64el*} != "" LIB32CPUFLAGS= -target mipsel-unknown-freebsd13.0 .else LIB32CPUFLAGS= -target mips-unknown-freebsd13.0 @@ -54,7 +62,7 @@ LIB32CPUFLAGS= -target mips-unknown-freebsd13.0 .endif LIB32CPUFLAGS+= -mabi=32 LIB32WMAKEENV= MACHINE=mips MACHINE_ARCH=mips -.if ${TARGET_ARCH:Mmips64el*} != "" +.if ${COMPAT_ARCH:Mmips64el*} != "" LIB32WMAKEFLAGS= LD="${XLD} -m elf32ltsmip_fbsd" .else LIB32WMAKEFLAGS= LD="${XLD} -m elf32btsmip_fbsd" @@ -70,11 +78,11 @@ LIB32WMAKEFLAGS+= -DCOMPAT_32BIT # ------------------------------------------------------------------- # soft-fp world -.if ${TARGET_ARCH:Marmv[67]*} != "" +.if ${COMPAT_ARCH:Marmv[67]*} != "" HAS_COMPAT=SOFT LIBSOFTCFLAGS= -DCOMPAT_SOFTFP LIBSOFTCPUFLAGS= -mfloat-abi=softfp -LIBSOFTWMAKEENV= CPUTYPE=soft MACHINE=arm MACHINE_ARCH=${TARGET_ARCH} +LIBSOFTWMAKEENV= CPUTYPE=soft MACHINE=arm MACHINE_ARCH=${COMPAT_ARCH} LIBSOFTWMAKEFLAGS= -DCOMPAT_SOFTFP .endif Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Thu Oct 31 20:29:45 2019 (r354226) +++ head/share/mk/bsd.prog.mk Thu Oct 31 20:37:19 2019 (r354227) @@ -2,7 +2,6 @@ # $FreeBSD$ .include -# .include .include .include From owner-svn-src-all@freebsd.org Thu Oct 31 20:42:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9322A165CC6; Thu, 31 Oct 2019 20:42:37 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473y1n3Kdrz3Kdh; Thu, 31 Oct 2019 20:42:37 +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 55DCE449; Thu, 31 Oct 2019 20:42:37 +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 x9VKgbV7036900; Thu, 31 Oct 2019 20:42:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VKgb8T036899; Thu, 31 Oct 2019 20:42:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201910312042.x9VKgb8T036899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 31 Oct 2019 20:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354228 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 354228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 20:42:37 -0000 Author: emaste Date: Thu Oct 31 20:42:36 2019 New Revision: 354228 URL: https://svnweb.freebsd.org/changeset/base/354228 Log: avoid kernel stack data leak in core dump thrmisc note bzero the entire thrmisc struct, not just the padding. Other core dump notes are already done this way. Reported by: Ilja Van Sprundel Reviewed by: markj MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Thu Oct 31 20:37:19 2019 (r354227) +++ head/sys/kern/imgact_elf.c Thu Oct 31 20:42:36 2019 (r354228) @@ -2229,7 +2229,7 @@ __elfN(note_thrmisc)(void *arg, struct sbuf *sb, size_ td = (struct thread *)arg; if (sb != NULL) { KASSERT(*sizep == sizeof(thrmisc), ("invalid size")); - bzero(&thrmisc._pad, sizeof(thrmisc._pad)); + bzero(&thrmisc, sizeof(thrmisc)); strcpy(thrmisc.pr_tname, td->td_name); sbuf_bcat(sb, &thrmisc, sizeof(thrmisc)); } From owner-svn-src-all@freebsd.org Thu Oct 31 21:01:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E9407166953; Thu, 31 Oct 2019 21:01:36 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473yRh5s0Mz3M0n; Thu, 31 Oct 2019 21:01:36 +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 AC5297C9; Thu, 31 Oct 2019 21:01:36 +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 x9VL1a5l043281; Thu, 31 Oct 2019 21:01:36 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VL1YhC043270; Thu, 31 Oct 2019 21:01:34 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201910312101.x9VL1YhC043270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Thu, 31 Oct 2019 21:01:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354229 - in head: share/man/man4 sys/dev/netmap sys/net tools/tools/netmap usr.sbin usr.sbin/valectl X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/netmap sys/net tools/tools/netmap usr.sbin usr.sbin/valectl X-SVN-Commit-Revision: 354229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 21:01:37 -0000 Author: vmaffione Date: Thu Oct 31 21:01:34 2019 New Revision: 354229 URL: https://svnweb.freebsd.org/changeset/base/354229 Log: add valectl to the system commands The valectl(4) program is used to manage vale(4) switches. Add it to the system commands so that it can be used right away. This program was previously called vale-ctl, and stored in tools/tools/netmap Reviewed by: hrs, bcr, lwhsu, kevans MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22146 Added: head/usr.sbin/valectl/ head/usr.sbin/valectl/Makefile (contents, props changed) head/usr.sbin/valectl/valectl.8 - copied, changed from r354228, head/tools/tools/netmap/vale-ctl.4 head/usr.sbin/valectl/valectl.c - copied, changed from r354228, head/tools/tools/netmap/vale-ctl.c Deleted: head/tools/tools/netmap/vale-ctl.4 head/tools/tools/netmap/vale-ctl.c Modified: head/share/man/man4/netmap.4 head/sys/dev/netmap/netmap_bdg.c head/sys/net/netmap_legacy.h head/tools/tools/netmap/Makefile head/tools/tools/netmap/README head/tools/tools/netmap/lb.8 head/usr.sbin/Makefile Modified: head/share/man/man4/netmap.4 ============================================================================== --- head/share/man/man4/netmap.4 Thu Oct 31 20:42:36 2019 (r354228) +++ head/share/man/man4/netmap.4 Thu Oct 31 21:01:34 2019 (r354229) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 20, 2018 +.Dd October 26, 2019 .Dt NETMAP 4 .Os .Sh NAME @@ -1087,14 +1087,14 @@ changing port names, e.g., .Pp The following command attaches an interface and the host stack to a switch: -.Dl vale-ctl -h vale2:em0 +.Dl valectl -h vale2:em0 Other .Nm clients attached to the same switch can now communicate with the network card or the host. .Sh SEE ALSO .Xr vale 4 , -.Xr vale-ctl 4 , +.Xr valectl 8 , .Xr bridge 8 , .Xr lb 8 , .Xr nmreplay 8 , Modified: head/sys/dev/netmap/netmap_bdg.c ============================================================================== --- head/sys/dev/netmap/netmap_bdg.c Thu Oct 31 20:42:36 2019 (r354228) +++ head/sys/dev/netmap/netmap_bdg.c Thu Oct 31 21:01:34 2019 (r354229) @@ -1442,7 +1442,7 @@ put_out: /* nm_bdg_ctl callback for the bwrap. - * Called on bridge-attach and detach, as an effect of vale-ctl -[ahd]. + * Called on bridge-attach and detach, as an effect of valectl -[ahd]. * On attach, it needs to provide a fake netmap_priv_d structure and * perform a netmap_do_regif() on the bwrap. This will put both the * bwrap and the hwna in netmap mode, with the netmap rings shared Modified: head/sys/net/netmap_legacy.h ============================================================================== --- head/sys/net/netmap_legacy.h Thu Oct 31 20:42:36 2019 (r354228) +++ head/sys/net/netmap_legacy.h Thu Oct 31 21:01:34 2019 (r354229) @@ -116,13 +116,13 @@ * nr_cmd (in) if non-zero indicates a special command: * NETMAP_BDG_ATTACH and nr_name = vale*:ifname * attaches the NIC to the switch; nr_ringid specifies - * which rings to use. Used by vale-ctl -a ... + * which rings to use. Used by valectl -a ... * nr_arg1 = NETMAP_BDG_HOST also attaches the host port - * as in vale-ctl -h ... + * as in valectl -h ... * * NETMAP_BDG_DETACH and nr_name = vale*:ifname * disconnects a previously attached NIC. - * Used by vale-ctl -d ... + * Used by valectl -d ... * * NETMAP_BDG_LIST * list the configuration of VALE switches. @@ -133,10 +133,10 @@ * * NETMAP_BDG_NEWIF * create a persistent VALE port with name nr_name. - * Used by vale-ctl -n ... + * Used by valectl -n ... * * NETMAP_BDG_DELIF - * delete a persistent VALE port. Used by vale-ctl -d ... + * delete a persistent VALE port. Used by valectl -d ... * * nr_arg1, nr_arg2, nr_arg3 (in/out) command specific * Modified: head/tools/tools/netmap/Makefile ============================================================================== --- head/tools/tools/netmap/Makefile Thu Oct 31 20:42:36 2019 (r354228) +++ head/tools/tools/netmap/Makefile Thu Oct 31 21:01:34 2019 (r354229) @@ -3,7 +3,7 @@ # # For multiple programs using a single source file each, # we can just define 'progs' and create custom targets. -PROGS = pkt-gen nmreplay bridge vale-ctl lb +PROGS = pkt-gen nmreplay bridge lb CLEANFILES = $(PROGS) *.o MAN= @@ -31,9 +31,6 @@ bridge: bridge.o nmreplay: nmreplay.o $(CC) $(CFLAGS) -o nmreplay nmreplay.o $(LDFLAGS) - -vale-ctl: vale-ctl.o - $(CC) $(CFLAGS) -o vale-ctl vale-ctl.o lb: lb.o pkt_hash.o $(CC) $(CFLAGS) -o lb lb.o pkt_hash.o $(LDFLAGS) Modified: head/tools/tools/netmap/README ============================================================================== --- head/tools/tools/netmap/README Thu Oct 31 20:42:36 2019 (r354228) +++ head/tools/tools/netmap/README Thu Oct 31 21:01:34 2019 (r354229) @@ -6,8 +6,6 @@ This directory contains applications that use the netm bridge a two-port jumper wire, also using the netmap API - vale-ctl the program to control and inspect VALE switches - lb an L3/L4 load balancer nmreplay a tool to playback a pcap file to a netmap port Modified: head/tools/tools/netmap/lb.8 ============================================================================== --- head/tools/tools/netmap/lb.8 Thu Oct 31 20:42:36 2019 (r354228) +++ head/tools/tools/netmap/lb.8 Thu Oct 31 21:01:34 2019 (r354229) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2018 +.Dd October 26, 2019 .Dt LB 8 .Os .Sh NAME @@ -111,7 +111,7 @@ If .Nm does not exit cleanly the ports will not be removed. Please use -.Xr vale-ctl 4 +.Xr valectl 8 to remove any stale persistent VALE port. .Sh SEE ALSO .Xr netmap 4 , Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Thu Oct 31 20:42:36 2019 (r354228) +++ head/usr.sbin/Makefile Thu Oct 31 21:01:34 2019 (r354229) @@ -96,6 +96,7 @@ SUBDIR= adduser \ trpt \ tzsetup \ ugidfw \ + valectl \ vigr \ vipw \ wake \ Added: head/usr.sbin/valectl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/valectl/Makefile Thu Oct 31 21:01:34 2019 (r354229) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +PROG= valectl +MAN= valectl.8 + +WARNS?= 3 + +.include Copied and modified: head/usr.sbin/valectl/valectl.8 (from r354228, head/tools/tools/netmap/vale-ctl.4) ============================================================================== --- head/tools/tools/netmap/vale-ctl.4 Thu Oct 31 20:42:36 2019 (r354228, copy source) +++ head/usr.sbin/valectl/valectl.8 Thu Oct 31 21:01:34 2019 (r354229) @@ -24,15 +24,15 @@ .\" .\" $FreeBSD$ .\" -.Dd October 24, 2018 -.Dt VALE-CTL 4 +.Dd October 26, 2019 +.Dt VALECTL 8 .Os .Sh NAME -.Nm vale-ctl +.Nm valectl .Nd manage VALE switches provided by netmap .Sh SYNOPSIS .Bk -words -.Bl -tag -width "vale-ctl" +.Bl -tag -width "valectl" .It Nm .Op Fl g Ar valeSSS:PPP .Op Fl a Ar valeSSS:interface @@ -158,6 +158,6 @@ harware netmap ports. .Sh AUTHORS .An -nosplit .Nm -has been written by +was written by .An Michio Honda at NetApp. Copied and modified: head/usr.sbin/valectl/valectl.c (from r354228, head/tools/tools/netmap/vale-ctl.c) ============================================================================== --- head/tools/tools/netmap/vale-ctl.c Thu Oct 31 20:42:36 2019 (r354228, copy source) +++ head/usr.sbin/valectl/valectl.c Thu Oct 31 21:01:34 2019 (r354229) @@ -42,10 +42,8 @@ #include /* basename */ #include /* atoi, free */ -/* XXX cut and paste from pkt-gen.c because I'm not sure whether this - * program may include nm_util.h - */ -void parse_nmr_config(const char* conf, struct nmreq *nmr) +static void +parse_nmr_config(const char* conf, struct nmreq *nmr) { char *w, *tok; int i, v; @@ -201,7 +199,7 @@ usage(int errcode) { fprintf(stderr, "Usage:\n" - "vale-ctl arguments\n" + "valectl 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" From owner-svn-src-all@freebsd.org Thu Oct 31 21:33:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6113C167892; Thu, 31 Oct 2019 21:33:01 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473z7x1xW5z3NsY; Thu, 31 Oct 2019 21:33:01 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2567CDB6; Thu, 31 Oct 2019 21:33:01 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VLX1Fp066376; Thu, 31 Oct 2019 21:33:01 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VLWxAO066341; Thu, 31 Oct 2019 21:32:59 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201910312132.x9VLWxAO066341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Thu, 31 Oct 2019 21:32: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: r354230 - in stable/12/stand: . efi/loader ficl ficl/amd64 ficl/i386 ficl/x86 i386/loader libsa libsa/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in stable/12/stand: . efi/loader ficl ficl/amd64 ficl/i386 ficl/x86 i386/loader libsa libsa/x86 X-SVN-Commit-Revision: 354230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 21:33:01 -0000 Author: sjg Date: Thu Oct 31 21:32:59 2019 New Revision: 354230 URL: https://svnweb.freebsd.org/changeset/base/354230 Log: Add support for hypervisor check on x86 Add ficl words for isvirtualized and move ficl inb and outb words to ficl/x86/sysdep.c so can be shared by i386 and amd64 MFC of r354043, r354055 Reviewed by: imp bdrewery Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22069 Added: stable/12/stand/ficl/x86/ - copied from r354043, head/stand/ficl/x86/ stable/12/stand/libsa/x86/ - copied from r354043, head/stand/libsa/x86/ Modified: stable/12/stand/defs.mk stable/12/stand/efi/loader/main.c stable/12/stand/ficl/amd64/sysdep.c stable/12/stand/ficl/i386/sysdep.c stable/12/stand/ficl/loader.c stable/12/stand/i386/loader/main.c stable/12/stand/libsa/Makefile stable/12/stand/libsa/stand.h Modified: stable/12/stand/defs.mk ============================================================================== --- stable/12/stand/defs.mk Thu Oct 31 21:01:34 2019 (r354229) +++ stable/12/stand/defs.mk Thu Oct 31 21:32:59 2019 (r354230) @@ -182,14 +182,15 @@ CFLAGS+=-I. all: ${PROG} .if !defined(NO_OBJ) -_ILINKS=machine +_ILINKS=include/machine .if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64" -_ILINKS+=${MACHINE_CPUARCH} +_ILINKS+=include/${MACHINE_CPUARCH} .endif .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -_ILINKS+=x86 +_ILINKS+=include/x86 .endif -CLEANFILES+=${_ILINKS} +CFLAGS+= -Iinclude +CLEANDIRS+= include beforedepend: ${_ILINKS} beforebuild: ${_ILINKS} @@ -204,8 +205,8 @@ ${OBJS}: ${_link} .NOPATH: ${_ILINKS} -${_ILINKS}: - @case ${.TARGET} in \ +${_ILINKS}: .NOMETA + @case ${.TARGET:T} in \ machine) \ if [ ${DO32:U0} -eq 0 ]; then \ path=${SYSDIR}/${MACHINE}/include ; \ @@ -215,8 +216,11 @@ ${_ILINKS}: *) \ path=${SYSDIR}/${.TARGET:T}/include ;; \ esac ; \ + case ${.TARGET} in \ + */*) mkdir -p ${.TARGET:H};; \ + esac ; \ path=`(cd $$path && /bin/pwd)` ; \ - ${ECHO} ${.TARGET:T} "->" $$path ; \ - ln -fhs $$path ${.TARGET:T} + ${ECHO} ${.TARGET} "->" $$path ; \ + ln -fhs $$path ${.TARGET} .endif # !NO_OBJ .endif # __BOOT_DEFS_MK__ Modified: stable/12/stand/efi/loader/main.c ============================================================================== --- stable/12/stand/efi/loader/main.c Thu Oct 31 21:01:34 2019 (r354229) +++ stable/12/stand/efi/loader/main.c Thu Oct 31 21:32:59 2019 (r354230) @@ -863,6 +863,9 @@ main(int argc, CHAR16 *argv[]) archsw.arch_getdev = efi_getdev; archsw.arch_copyin = efi_copyin; archsw.arch_copyout = efi_copyout; +#ifdef __amd64__ + archsw.arch_hypervisor = x86_hypervisor; +#endif archsw.arch_readin = efi_readin; archsw.arch_zfs_probe = efi_zfs_probe; Modified: stable/12/stand/ficl/amd64/sysdep.c ============================================================================== --- stable/12/stand/ficl/amd64/sysdep.c Thu Oct 31 21:01:34 2019 (r354229) +++ stable/12/stand/ficl/amd64/sysdep.c Thu Oct 31 21:32:59 2019 (r354230) @@ -17,6 +17,8 @@ #endif #include "ficl.h" +#include "../x86/sysdep.c" + /* ******************* FreeBSD P O R T B E G I N S H E R E ******************** Michael Smith */ Modified: stable/12/stand/ficl/i386/sysdep.c ============================================================================== --- stable/12/stand/ficl/i386/sysdep.c Thu Oct 31 21:01:34 2019 (r354229) +++ stable/12/stand/ficl/i386/sysdep.c Thu Oct 31 21:32:59 2019 (r354230) @@ -14,12 +14,11 @@ #include #else #include -#ifdef __i386__ -#include #endif -#endif #include "ficl.h" +#include "../x86/sysdep.c" + /* ******************* FreeBSD P O R T B E G I N S H E R E ******************** Michael Smith */ @@ -80,53 +79,6 @@ void ficlFree (void *p) free(p); } -#ifndef TESTMAIN -/* - * outb ( port# c -- ) - * Store a byte to I/O port number port# - */ -void -ficlOutb(FICL_VM *pVM) -{ - u_char c; - uint32_t port; - - port=stackPopUNS(pVM->pStack); - c=(u_char)stackPopINT(pVM->pStack); - outb(port,c); -} - -/* - * inb ( port# -- c ) - * Fetch a byte from I/O port number port# - */ -void -ficlInb(FICL_VM *pVM) -{ - u_char c; - uint32_t port; - - port=stackPopUNS(pVM->pStack); - c=inb(port); - stackPushINT(pVM->pStack,c); -} - -/* - * Glue function to add the appropriate forth words to access x86 special cpu - * functionality. - */ -static void ficlCompileCpufunc(FICL_SYSTEM *pSys) -{ - FICL_DICT *dp = pSys->dp; - assert (dp); - - dictAppendWord(dp, "outb", ficlOutb, FW_DEFAULT); - dictAppendWord(dp, "inb", ficlInb, FW_DEFAULT); -} - -FICL_COMPILE_SET(ficlCompileCpufunc); - -#endif /* ** Stub function for dictionary access control - does nothing Modified: stable/12/stand/ficl/loader.c ============================================================================== --- stable/12/stand/ficl/loader.c Thu Oct 31 21:01:34 2019 (r354229) +++ stable/12/stand/ficl/loader.c Thu Oct 31 21:32:59 2019 (r354230) @@ -287,6 +287,32 @@ ficlFindfile(FICL_VM *pVM) return; } +#ifndef TESTMAIN + +/* isvirtualized? - Return whether the loader runs under a + * hypervisor. + * + * isvirtualized? ( -- flag ) + */ +static void +ficlIsvirtualizedQ(FICL_VM *pVM) +{ + FICL_INT flag; + const char *hv; + +#if FICL_ROBUST > 1 + vmCheckStack(pVM, 0, 1); +#endif + + hv = (archsw.arch_hypervisor != NULL) + ? (*archsw.arch_hypervisor)() + : NULL; + flag = (hv != NULL) ? FICL_TRUE : FICL_FALSE; + stackPushINT(pVM->pStack, flag); +} + +#endif /* ndef TESTMAIN */ + void ficlCcall(FICL_VM *pVM) { @@ -840,7 +866,10 @@ void ficlCompilePlatform(FICL_SYSTEM *pSys) dictAppendWord(dp, "ccall", ficlCcall, FW_DEFAULT); dictAppendWord(dp, "uuid-from-string", ficlUuidFromString, FW_DEFAULT); dictAppendWord(dp, "uuid-to-string", ficlUuidToString, FW_DEFAULT); - +#ifndef TESTMAIN + dictAppendWord(dp, "isvirtualized?",ficlIsvirtualizedQ, FW_DEFAULT); +#endif + SET_FOREACH(fnpp, Xficl_compile_set) (*fnpp)(pSys); Modified: stable/12/stand/i386/loader/main.c ============================================================================== --- stable/12/stand/i386/loader/main.c Thu Oct 31 21:01:34 2019 (r354229) +++ stable/12/stand/i386/loader/main.c Thu Oct 31 21:32:59 2019 (r354230) @@ -167,6 +167,7 @@ main(void) archsw.arch_readin = i386_readin; archsw.arch_isainb = isa_inb; archsw.arch_isaoutb = isa_outb; + archsw.arch_hypervisor = x86_hypervisor; #ifdef LOADER_ZFS_SUPPORT archsw.arch_zfs_probe = i386_zfs_probe; Modified: stable/12/stand/libsa/Makefile ============================================================================== --- stable/12/stand/libsa/Makefile Thu Oct 31 21:01:34 2019 (r354229) +++ stable/12/stand/libsa/Makefile Thu Oct 31 21:32:59 2019 (r354230) @@ -71,6 +71,11 @@ SRCS+= divmoddi4.c divmodsi4.c divdi3.c divsi3.c m SRCS+= udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c SRCS+= ashldi3.c ashrdi3.c lshrdi3.c +.if ${MACHINE_CPUARCH:Namd64:Ni386} == "" +.PATH: ${SASRC}/x86 +SRCS+= hypervisor.c +.endif + .if ${MACHINE_CPUARCH} == "powerpc" SRCS+= syncicache.c .endif Modified: stable/12/stand/libsa/stand.h ============================================================================== --- stable/12/stand/libsa/stand.h Thu Oct 31 21:01:34 2019 (r354229) +++ stable/12/stand/libsa/stand.h Thu Oct 31 21:32:59 2019 (r354230) @@ -435,6 +435,8 @@ void *Reallocf(void *, size_t, const char *, int); void Free(void *, const char *, int); extern void mallocstats(void); +const char *x86_hypervisor(void); + #ifdef DEBUG_MALLOC #define malloc(x) Malloc(x, __FILE__, __LINE__) #define memalign(x, y) Memalign(x, y, __FILE__, __LINE__) From owner-svn-src-all@freebsd.org Thu Oct 31 22:16:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 735A01786F1; Thu, 31 Oct 2019 22:16:21 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47405x2R0Tz3Qgq; Thu, 31 Oct 2019 22:16:21 +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 32F0C14F6; Thu, 31 Oct 2019 22:16:21 +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 x9VMGLwX090708; Thu, 31 Oct 2019 22:16:21 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VMGLuN090707; Thu, 31 Oct 2019 22:16:21 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201910312216.x9VMGLuN090707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Thu, 31 Oct 2019 22:16:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354231 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 354231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 22:16:21 -0000 Author: vmaffione Date: Thu Oct 31 22:16:20 2019 New Revision: 354231 URL: https://svnweb.freebsd.org/changeset/base/354231 Log: netmap: fix build issue in netmap_user.h The issue was a comparison of integers of different signs on 32 bit architectures. Reported by: jenkins MFC after: 1 week Modified: head/sys/net/netmap_user.h Modified: head/sys/net/netmap_user.h ============================================================================== --- head/sys/net/netmap_user.h Thu Oct 31 21:32:59 2019 (r354230) +++ head/sys/net/netmap_user.h Thu Oct 31 22:16:20 2019 (r354231) @@ -1116,7 +1116,7 @@ nm_dispatch(struct nm_desc *d, int cnt, nm_cb_t cb, u_ slot = &ring->slot[i]; d->hdr.len += slot->len; nbuf = (u_char *)NETMAP_BUF(ring, slot->buf_idx); - if (oldbuf != NULL && nbuf - oldbuf == ring->nr_buf_size && + if (oldbuf != NULL && nbuf - oldbuf == (int)ring->nr_buf_size && oldlen == ring->nr_buf_size) { d->hdr.caplen += slot->len; oldbuf = nbuf; From owner-svn-src-all@freebsd.org Thu Oct 31 22:29:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3DD5178B85; Thu, 31 Oct 2019 22:29:13 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4740Nn52jgz3R75; Thu, 31 Oct 2019 22:29:13 +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 9036116B3; Thu, 31 Oct 2019 22:29:13 +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 x9VMTDhl096453; Thu, 31 Oct 2019 22:29:13 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VMTDDM096452; Thu, 31 Oct 2019 22:29:13 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201910312229.x9VMTDDM096452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 31 Oct 2019 22:29:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354232 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 354232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2019 22:29:13 -0000 Author: brooks Date: Thu Oct 31 22:29:13 2019 New Revision: 354232 URL: https://svnweb.freebsd.org/changeset/base/354232 Log: truss: centralize pointer-constructing casts. In nearly all cases, the caller has a uintptr_t compatible argument so this eliminates a large number of casts. Add a print_pointer function to centralize printing pointers. Reviewed by: jhb Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22212 Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Thu Oct 31 22:16:20 2019 (r354231) +++ head/usr.bin/truss/syscalls.c Thu Oct 31 22:29:13 2019 (r354232) @@ -1051,12 +1051,12 @@ get_syscall(struct threadinfo *t, u_int number, u_int * Copy a fixed amount of bytes from the process. */ static int -get_struct(pid_t pid, void *offset, void *buf, int len) +get_struct(pid_t pid, uintptr_t offset, void *buf, int len) { struct ptrace_io_desc iorequest; iorequest.piod_op = PIOD_READ_D; - iorequest.piod_offs = offset; + iorequest.piod_offs = (void *)offset; iorequest.piod_addr = buf; iorequest.piod_len = len; if (ptrace(PT_IO, pid, (caddr_t)&iorequest, 0) < 0) @@ -1072,7 +1072,7 @@ get_struct(pid_t pid, void *offset, void *buf, int len * only get that much. */ static char * -get_string(pid_t pid, void *addr, int max) +get_string(pid_t pid, uintptr_t addr, int max) { struct ptrace_io_desc iorequest; char *buf, *nbuf; @@ -1093,7 +1093,7 @@ get_string(pid_t pid, void *addr, int max) return (NULL); for (;;) { iorequest.piod_op = PIOD_READ_D; - iorequest.piod_offs = (char *)addr + offset; + iorequest.piod_offs = (void *)(addr + offset); iorequest.piod_addr = buf + offset; iorequest.piod_len = size; if (ptrace(PT_IO, pid, (caddr_t)&iorequest, 0) < 0) { @@ -1183,8 +1183,16 @@ print_utrace(FILE *fp, void *utrace_addr, size_t len) } static void -print_sockaddr(FILE *fp, struct trussinfo *trussinfo, void *arg, socklen_t len) +print_pointer(FILE *fp, uintptr_t arg) { + + fprintf(fp, "%p", (void *)arg); +} + +static void +print_sockaddr(FILE *fp, struct trussinfo *trussinfo, uintptr_t arg, + socklen_t len) +{ char addr[64]; struct sockaddr_in *lsin; struct sockaddr_in6 *lsin6; @@ -1193,20 +1201,20 @@ print_sockaddr(FILE *fp, struct trussinfo *trussinfo, u_char *q; pid_t pid = trussinfo->curthread->proc->pid; - if (arg == NULL) { + if (arg == 0) { fputs("NULL", fp); return; } /* If the length is too small, just bail. */ if (len < sizeof(*sa)) { - fprintf(fp, "%p", arg); + print_pointer(fp, arg); return; } sa = calloc(1, len); if (get_struct(pid, arg, sa, len) == -1) { free(sa); - fprintf(fp, "%p", arg); + print_pointer(fp, arg); return; } @@ -1252,7 +1260,7 @@ print_sockaddr(FILE *fp, struct trussinfo *trussinfo, #define IOV_LIMIT 16 static void -print_iovec(FILE *fp, struct trussinfo *trussinfo, void *arg, int iovcnt) +print_iovec(FILE *fp, struct trussinfo *trussinfo, uintptr_t arg, int iovcnt) { struct iovec iov[IOV_LIMIT]; size_t max_string = trussinfo->strsize; @@ -1263,7 +1271,7 @@ print_iovec(FILE *fp, struct trussinfo *trussinfo, voi bool buf_truncated, iov_truncated; if (iovcnt <= 0) { - fprintf(fp, "%p", arg); + print_pointer(fp, arg); return; } if (iovcnt > IOV_LIMIT) { @@ -1273,7 +1281,7 @@ print_iovec(FILE *fp, struct trussinfo *trussinfo, voi iov_truncated = false; } if (get_struct(pid, arg, &iov, iovcnt * sizeof(struct iovec)) == -1) { - fprintf(fp, "%p", arg); + print_pointer(fp, arg); return; } @@ -1287,7 +1295,7 @@ print_iovec(FILE *fp, struct trussinfo *trussinfo, voi buf_truncated = false; } fprintf(fp, "%s{", (i > 0) ? "," : ""); - if (len && get_struct(pid, iov[i].iov_base, &tmp2, len) != -1) { + if (len && get_struct(pid, (uintptr_t)iov[i].iov_base, &tmp2, len) != -1) { tmp3 = malloc(len * 4 + 1); while (len) { if (strvisx(tmp3, tmp2, len, @@ -1301,7 +1309,7 @@ print_iovec(FILE *fp, struct trussinfo *trussinfo, voi buf_truncated ? "..." : ""); free(tmp3); } else { - fprintf(fp, "%p", iov[i].iov_base); + print_pointer(fp, (uintptr_t)iov[i].iov_base); } fprintf(fp, ",%zu}", iov[i].iov_len); } @@ -1521,8 +1529,8 @@ print_cmsgs(FILE *fp, pid_t pid, bool receive, struct return; } cmsgbuf = calloc(1, len); - if (get_struct(pid, msghdr->msg_control, cmsgbuf, len) == -1) { - fprintf(fp, "%p", msghdr->msg_control); + if (get_struct(pid, (uintptr_t)msghdr->msg_control, cmsgbuf, len) == -1) { + print_pointer(fp, (uintptr_t)msghdr->msg_control); free(cmsgbuf); return; } @@ -1602,11 +1610,11 @@ print_arg(struct syscall_args *sc, unsigned long *args case PUInt: { unsigned int val; - if (get_struct(pid, (void *)args[sc->offset], &val, + if (get_struct(pid, args[sc->offset], &val, sizeof(val)) == 0) fprintf(fp, "{ %u }", val); else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } case LongHex: @@ -1629,7 +1637,7 @@ print_arg(struct syscall_args *sc, unsigned long *args /* NULL-terminated string. */ char *tmp2; - tmp2 = get_string(pid, (void*)args[sc->offset], 0); + tmp2 = get_string(pid, args[sc->offset], 0); fprintf(fp, "\"%s\"", tmp2); free(tmp2); break; @@ -1659,7 +1667,7 @@ print_arg(struct syscall_args *sc, unsigned long *args len = max_string; truncated = 1; } - if (len && get_struct(pid, (void*)args[sc->offset], &tmp2, len) + if (len && get_struct(pid, args[sc->offset], &tmp2, len) != -1) { tmp3 = malloc(len * 4 + 1); while (len) { @@ -1673,7 +1681,7 @@ print_arg(struct syscall_args *sc, unsigned long *args "..." : ""); free(tmp3); } else { - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); } break; } @@ -1697,7 +1705,7 @@ print_arg(struct syscall_args *sc, unsigned long *args (trussinfo->flags & EXECVEARGS) == 0) || ((sc->type & ARG_MASK) == ExecEnv && (trussinfo->flags & EXECVEENVS) == 0)) { - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } @@ -1708,13 +1716,13 @@ print_arg(struct syscall_args *sc, unsigned long *args */ addr = args[sc->offset]; if (addr % sizeof(char *) != 0) { - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } len = PAGE_SIZE - (addr & PAGE_MASK); - if (get_struct(pid, (void *)addr, u.buf, len) == -1) { - fprintf(fp, "0x%lx", args[sc->offset]); + if (get_struct(pid, addr, u.buf, len) == -1) { + print_pointer(fp, args[sc->offset]); break; } @@ -1722,7 +1730,7 @@ print_arg(struct syscall_args *sc, unsigned long *args first = 1; i = 0; while (u.strarray[i] != NULL) { - string = get_string(pid, u.strarray[i], 0); + string = get_string(pid, (uintptr_t)u.strarray[i], 0); fprintf(fp, "%s \"%s\"", first ? "" : ",", string); free(string); first = 0; @@ -1731,7 +1739,7 @@ print_arg(struct syscall_args *sc, unsigned long *args if (i == len / sizeof(char *)) { addr += len; len = PAGE_SIZE; - if (get_struct(pid, (void *)addr, u.buf, len) == + if (get_struct(pid, addr, u.buf, len) == -1) { fprintf(fp, ", "); break; @@ -1771,22 +1779,22 @@ print_arg(struct syscall_args *sc, unsigned long *args case PQuadHex: { uint64_t val; - if (get_struct(pid, (void *)args[sc->offset], &val, + if (get_struct(pid, args[sc->offset], &val, sizeof(val)) == 0) fprintf(fp, "{ 0x%jx }", (uintmax_t)val); else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } case Ptr: - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; case Readlinkres: { char *tmp2; if (retval[0] == -1) break; - tmp2 = get_string(pid, (void*)args[sc->offset], retval[0]); + tmp2 = get_string(pid, args[sc->offset], retval[0]); fprintf(fp, "\"%s\"", tmp2); free(tmp2); break; @@ -1811,12 +1819,11 @@ print_arg(struct syscall_args *sc, unsigned long *args case Timespec: { struct timespec ts; - if (get_struct(pid, (void *)args[sc->offset], &ts, - sizeof(ts)) != -1) + if (get_struct(pid, args[sc->offset], &ts, sizeof(ts)) != -1) fprintf(fp, "{ %jd.%09ld }", (intmax_t)ts.tv_sec, ts.tv_nsec); else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } case Timespec2: { @@ -1824,8 +1831,7 @@ print_arg(struct syscall_args *sc, unsigned long *args const char *sep; unsigned int i; - if (get_struct(pid, (void *)args[sc->offset], &ts, sizeof(ts)) - != -1) { + if (get_struct(pid, args[sc->offset], &ts, sizeof(ts)) != -1) { fputs("{ ", fp); sep = ""; for (i = 0; i < nitems(ts); i++) { @@ -1847,57 +1853,54 @@ print_arg(struct syscall_args *sc, unsigned long *args } fputs(" }", fp); } else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } case Timeval: { struct timeval tv; - if (get_struct(pid, (void *)args[sc->offset], &tv, sizeof(tv)) - != -1) + if (get_struct(pid, args[sc->offset], &tv, sizeof(tv)) != -1) fprintf(fp, "{ %jd.%06ld }", (intmax_t)tv.tv_sec, tv.tv_usec); else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } case Timeval2: { struct timeval tv[2]; - if (get_struct(pid, (void *)args[sc->offset], &tv, sizeof(tv)) - != -1) + if (get_struct(pid, args[sc->offset], &tv, sizeof(tv)) != -1) fprintf(fp, "{ %jd.%06ld, %jd.%06ld }", (intmax_t)tv[0].tv_sec, tv[0].tv_usec, (intmax_t)tv[1].tv_sec, tv[1].tv_usec); else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } case Itimerval: { struct itimerval itv; - if (get_struct(pid, (void *)args[sc->offset], &itv, - sizeof(itv)) != -1) + if (get_struct(pid, args[sc->offset], &itv, sizeof(itv)) != -1) fprintf(fp, "{ %jd.%06ld, %jd.%06ld }", (intmax_t)itv.it_interval.tv_sec, itv.it_interval.tv_usec, (intmax_t)itv.it_value.tv_sec, itv.it_value.tv_usec); else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } case LinuxSockArgs: { struct linux_socketcall_args largs; - if (get_struct(pid, (void *)args[sc->offset], (void *)&largs, + if (get_struct(pid, args[sc->offset], (void *)&largs, sizeof(largs)) != -1) fprintf(fp, "{ %s, 0x%lx }", lookup(linux_socketcall_ops, largs.what, 10), (long unsigned int)largs.args); else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } case Pollfd: { @@ -1914,8 +1917,7 @@ print_arg(struct syscall_args *sc, unsigned long *args if ((pfd = malloc(bytes)) == NULL) err(1, "Cannot malloc %zu bytes for pollfd array", bytes); - if (get_struct(pid, (void *)args[sc->offset], pfd, bytes) - != -1) { + if (get_struct(pid, args[sc->offset], pfd, bytes) != -1) { fputs("{", fp); for (i = 0; i < numfds; i++) { fprintf(fp, " %d/%s", pfd[i].fd, @@ -1923,7 +1925,7 @@ print_arg(struct syscall_args *sc, unsigned long *args } fputs(" }", fp); } else { - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); } free(pfd); break; @@ -1942,8 +1944,7 @@ print_arg(struct syscall_args *sc, unsigned long *args if ((fds = malloc(bytes)) == NULL) err(1, "Cannot malloc %zu bytes for fd_set array", bytes); - if (get_struct(pid, (void *)args[sc->offset], fds, bytes) - != -1) { + if (get_struct(pid, args[sc->offset], fds, bytes) != -1) { fputs("{", fp); for (i = 0; i < numfds; i++) { if (FD_ISSET(i, fds)) @@ -1951,7 +1952,7 @@ print_arg(struct syscall_args *sc, unsigned long *args } fputs(" }", fp); } else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); free(fds); break; } @@ -1964,9 +1965,9 @@ print_arg(struct syscall_args *sc, unsigned long *args int i, first; sig = args[sc->offset]; - if (get_struct(pid, (void *)args[sc->offset], (void *)&ss, + if (get_struct(pid, args[sc->offset], (void *)&ss, sizeof(ss)) == -1) { - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } fputs("{ ", fp); @@ -2044,22 +2045,21 @@ print_arg(struct syscall_args *sc, unsigned long *args * the next argument contains a socklen_t by value. */ if (sc->type & OUT) { - if (get_struct(pid, (void *)args[sc->offset + 1], - &len, sizeof(len)) == -1) { - fprintf(fp, "0x%lx", args[sc->offset]); + if (get_struct(pid, args[sc->offset + 1], &len, + sizeof(len)) == -1) { + print_pointer(fp, args[sc->offset]); break; } } else len = args[sc->offset + 1]; - print_sockaddr(fp, trussinfo, (void *)args[sc->offset], len); + print_sockaddr(fp, trussinfo, args[sc->offset], len); break; } case Sigaction: { struct sigaction sa; - if (get_struct(pid, (void *)args[sc->offset], &sa, sizeof(sa)) - != -1) { + if (get_struct(pid, args[sc->offset], &sa, sizeof(sa)) != -1) { fputs("{ ", fp); if (sa.sa_handler == SIG_DFL) fputs("SIG_DFL", fp); @@ -2070,7 +2070,7 @@ print_arg(struct syscall_args *sc, unsigned long *args fprintf(fp, " %s ss_t }", xlookup_bits(sigaction_flags, sa.sa_flags)); } else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } case Kevent: { @@ -2099,7 +2099,7 @@ print_arg(struct syscall_args *sc, unsigned long *args bytes); } else ke = NULL; - if (numevents >= 0 && get_struct(pid, (void *)args[sc->offset], + if (numevents >= 0 && get_struct(pid, args[sc->offset], ke, bytes) != -1) { fputc('{', fp); for (i = 0; i < numevents; i++) { @@ -2108,7 +2108,7 @@ print_arg(struct syscall_args *sc, unsigned long *args } fputs(" }", fp); } else { - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); } free(ke); break; @@ -2134,7 +2134,7 @@ print_arg(struct syscall_args *sc, unsigned long *args } else ke11 = NULL; memset(&ke, 0, sizeof(ke)); - if (numevents >= 0 && get_struct(pid, (void *)args[sc->offset], + if (numevents >= 0 && get_struct(pid, args[sc->offset], ke11, bytes) != -1) { fputc('{', fp); for (i = 0; i < numevents; i++) { @@ -2149,7 +2149,7 @@ print_arg(struct syscall_args *sc, unsigned long *args } fputs(" }", fp); } else { - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); } free(ke11); break; @@ -2157,7 +2157,7 @@ print_arg(struct syscall_args *sc, unsigned long *args case Stat: { struct stat st; - if (get_struct(pid, (void *)args[sc->offset], &st, sizeof(st)) + if (get_struct(pid, args[sc->offset], &st, sizeof(st)) != -1) { char mode[12]; @@ -2167,14 +2167,14 @@ print_arg(struct syscall_args *sc, unsigned long *args (uintmax_t)st.st_ino, (intmax_t)st.st_size, (long)st.st_blksize); } else { - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); } break; } case Stat11: { struct freebsd11_stat st; - if (get_struct(pid, (void *)args[sc->offset], &st, sizeof(st)) + if (get_struct(pid, args[sc->offset], &st, sizeof(st)) != -1) { char mode[12]; @@ -2184,7 +2184,7 @@ print_arg(struct syscall_args *sc, unsigned long *args (uintmax_t)st.st_ino, (intmax_t)st.st_size, (long)st.st_blksize); } else { - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); } break; } @@ -2192,7 +2192,7 @@ print_arg(struct syscall_args *sc, unsigned long *args unsigned int i; struct statfs buf; - if (get_struct(pid, (void *)args[sc->offset], &buf, + if (get_struct(pid, args[sc->offset], &buf, sizeof(buf)) != -1) { char fsid[17]; @@ -2208,14 +2208,14 @@ print_arg(struct syscall_args *sc, unsigned long *args "fsid=%s }", buf.f_fstypename, buf.f_mntonname, buf.f_mntfromname, fsid); } else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } case Rusage: { struct rusage ru; - if (get_struct(pid, (void *)args[sc->offset], &ru, sizeof(ru)) + if (get_struct(pid, args[sc->offset], &ru, sizeof(ru)) != -1) { fprintf(fp, "{ u=%jd.%06ld,s=%jd.%06ld,in=%ld,out=%ld }", @@ -2223,24 +2223,24 @@ print_arg(struct syscall_args *sc, unsigned long *args (intmax_t)ru.ru_stime.tv_sec, ru.ru_stime.tv_usec, ru.ru_inblock, ru.ru_oublock); } else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } case Rlimit: { struct rlimit rl; - if (get_struct(pid, (void *)args[sc->offset], &rl, sizeof(rl)) + if (get_struct(pid, args[sc->offset], &rl, sizeof(rl)) != -1) { fprintf(fp, "{ cur=%ju,max=%ju }", rl.rlim_cur, rl.rlim_max); } else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } case ExitStatus: { int status; - if (get_struct(pid, (void *)args[sc->offset], &status, + if (get_struct(pid, args[sc->offset], &status, sizeof(status)) != -1) { fputs("{ ", fp); if (WIFCONTINUED(status)) @@ -2257,7 +2257,7 @@ print_arg(struct syscall_args *sc, unsigned long *args strsig2(WTERMSIG(status))); fputs(" }", fp); } else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } case Waitoptions: @@ -2293,7 +2293,7 @@ print_arg(struct syscall_args *sc, unsigned long *args memset(name, 0, sizeof(name)); len = args[sc->offset + 1]; - if (get_struct(pid, (void *)args[sc->offset], oid, + if (get_struct(pid, args[sc->offset], oid, len * sizeof(oid[0])) != -1) { fprintf(fp, "\""); if (oid[0] == CTL_SYSCTL) { @@ -2362,11 +2362,11 @@ print_arg(struct syscall_args *sc, unsigned long *args len = args[sc->offset + 1]; utrace_addr = calloc(1, len); - if (get_struct(pid, (void *)args[sc->offset], + if (get_struct(pid, args[sc->offset], (void *)utrace_addr, len) != -1) print_utrace(fp, utrace_addr, len); else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); free(utrace_addr); break; } @@ -2381,7 +2381,7 @@ print_arg(struct syscall_args *sc, unsigned long *args ndescriptors = nitems(descriptors); truncated = true; } - if (get_struct(pid, (void *)args[sc->offset], + if (get_struct(pid, args[sc->offset], descriptors, ndescriptors * sizeof(descriptors[0])) != -1) { fprintf(fp, "{"); for (i = 0; i < ndescriptors; i++) @@ -2389,7 +2389,7 @@ print_arg(struct syscall_args *sc, unsigned long *args descriptors[i]); fprintf(fp, truncated ? ", ... }" : " }"); } else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } case Pipe2: @@ -2399,9 +2399,9 @@ print_arg(struct syscall_args *sc, unsigned long *args uint32_t rights; if (sc->type & OUT) { - if (get_struct(pid, (void *)args[sc->offset], &rights, + if (get_struct(pid, args[sc->offset], &rights, sizeof(rights)) == -1) { - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } } else @@ -2483,13 +2483,13 @@ print_arg(struct syscall_args *sc, unsigned long *args case CapRights: { cap_rights_t rights; - if (get_struct(pid, (void *)args[sc->offset], &rights, + if (get_struct(pid, args[sc->offset], &rights, sizeof(rights)) != -1) { fputs("{ ", fp); sysdecode_cap_rights(fp, &rights); fputs(" }", fp); } else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } case Acltype: @@ -2537,33 +2537,30 @@ print_arg(struct syscall_args *sc, unsigned long *args case Schedparam: { struct sched_param sp; - if (get_struct(pid, (void *)args[sc->offset], &sp, - sizeof(sp)) != -1) + if (get_struct(pid, args[sc->offset], &sp, sizeof(sp)) != -1) fprintf(fp, "{ %d }", sp.sched_priority); else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } case PSig: { int sig; - if (get_struct(pid, (void *)args[sc->offset], &sig, - sizeof(sig)) == 0) + if (get_struct(pid, args[sc->offset], &sig, sizeof(sig)) == 0) fprintf(fp, "{ %s }", strsig2(sig)); else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } case Siginfo: { siginfo_t si; - if (get_struct(pid, (void *)args[sc->offset], &si, - sizeof(si)) != -1) { + if (get_struct(pid, args[sc->offset], &si, sizeof(si)) != -1) { fprintf(fp, "{ signo=%s", strsig2(si.si_signo)); decode_siginfo(fp, &si); fprintf(fp, " }"); } else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } case Iovec: @@ -2572,15 +2569,15 @@ print_arg(struct syscall_args *sc, unsigned long *args * syscall argument is the number of elements of the array. */ - print_iovec(fp, trussinfo, (void *)args[sc->offset], + print_iovec(fp, trussinfo, args[sc->offset], (int)args[sc->offset + 1]); break; case Sctpsndrcvinfo: { struct sctp_sndrcvinfo info; - if (get_struct(pid, (void *)args[sc->offset], + if (get_struct(pid, args[sc->offset], &info, sizeof(struct sctp_sndrcvinfo)) == -1) { - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } print_sctp_sndrcvinfo(fp, sc->type & OUT, &info); @@ -2589,15 +2586,15 @@ print_arg(struct syscall_args *sc, unsigned long *args case Msghdr: { struct msghdr msghdr; - if (get_struct(pid, (void *)args[sc->offset], + if (get_struct(pid, args[sc->offset], &msghdr, sizeof(struct msghdr)) == -1) { - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } fputs("{", fp); - print_sockaddr(fp, trussinfo, msghdr.msg_name, msghdr.msg_namelen); + print_sockaddr(fp, trussinfo, (uintptr_t)msghdr.msg_name, msghdr.msg_namelen); fprintf(fp, ",%d,", msghdr.msg_namelen); - print_iovec(fp, trussinfo, msghdr.msg_iov, msghdr.msg_iovlen); + print_iovec(fp, trussinfo, (uintptr_t)msghdr.msg_iov, msghdr.msg_iovlen); fprintf(fp, ",%d,", msghdr.msg_iovlen); print_cmsgs(fp, pid, sc->type & OUT, &msghdr); fprintf(fp, ",%u,", msghdr.msg_controllen); @@ -2617,25 +2614,25 @@ print_arg(struct syscall_args *sc, unsigned long *args break; case CloudABIFDStat: { cloudabi_fdstat_t fds; - if (get_struct(pid, (void *)args[sc->offset], &fds, sizeof(fds)) + if (get_struct(pid, args[sc->offset], &fds, sizeof(fds)) != -1) { fprintf(fp, "{ %s, ", xlookup(cloudabi_filetype, fds.fs_filetype)); fprintf(fp, "%s, ... }", xlookup_bits(cloudabi_fdflags, fds.fs_flags)); } else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } case CloudABIFileStat: { cloudabi_filestat_t fsb; - if (get_struct(pid, (void *)args[sc->offset], &fsb, sizeof(fsb)) + if (get_struct(pid, args[sc->offset], &fsb, sizeof(fsb)) != -1) fprintf(fp, "{ %s, %ju }", xlookup(cloudabi_filetype, fsb.st_filetype), (uintmax_t)fsb.st_size); else - fprintf(fp, "0x%lx", args[sc->offset]); + print_pointer(fp, args[sc->offset]); break; } case CloudABIFileType: From owner-svn-src-all@freebsd.org Fri Nov 1 00:00:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 36B1017A891; Fri, 1 Nov 2019 00:00:18 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4742Pt0Wc5z40Zs; Fri, 1 Nov 2019 00:00:18 +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 E8DF7269F; Fri, 1 Nov 2019 00:00:17 +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 xA100HXW049534; Fri, 1 Nov 2019 00:00:17 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA100H3Z049532; Fri, 1 Nov 2019 00:00:17 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201911010000.xA100H3Z049532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 1 Nov 2019 00:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r354233 - in releng/12.1: . lib/csu/common sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in releng/12.1: . lib/csu/common sys/conf X-SVN-Commit-Revision: 354233 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2019 00:00:18 -0000 Author: gjb Date: Fri Nov 1 00:00:17 2019 New Revision: 354233 URL: https://svnweb.freebsd.org/changeset/base/354233 Log: - Switch releng/12.1 from RC2 to RELEASE. - Add the anticipated 12.1-RELEASE date to UPDATING. - Set a static __FreeBSD_version. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (Netgate) Modified: releng/12.1/UPDATING releng/12.1/lib/csu/common/crtbrand.c releng/12.1/sys/conf/newvers.sh Modified: releng/12.1/UPDATING ============================================================================== --- releng/12.1/UPDATING Thu Oct 31 22:29:13 2019 (r354232) +++ releng/12.1/UPDATING Fri Nov 1 00:00:17 2019 (r354233) @@ -16,6 +16,9 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20191104: + 12.1-RELEASE. + 20190914: The vfs.fusefs.sync_unmount and vfs.fusefs.init_backgrounded sysctls and the "-o sync_unmount" and "-o init_backgrounded" mount options have Modified: releng/12.1/lib/csu/common/crtbrand.c ============================================================================== --- releng/12.1/lib/csu/common/crtbrand.c Thu Oct 31 22:29:13 2019 (r354232) +++ releng/12.1/lib/csu/common/crtbrand.c Fri Nov 1 00:00:17 2019 (r354233) @@ -65,5 +65,5 @@ static const struct { .descsz = sizeof(int32_t), .type = NT_FREEBSD_ABI_TAG, .name = NOTE_FREEBSD_VENDOR, - .desc = __FreeBSD_version + .desc = 1201000 }; Modified: releng/12.1/sys/conf/newvers.sh ============================================================================== --- releng/12.1/sys/conf/newvers.sh Thu Oct 31 22:29:13 2019 (r354232) +++ releng/12.1/sys/conf/newvers.sh Fri Nov 1 00:00:17 2019 (r354233) @@ -46,7 +46,7 @@ TYPE="FreeBSD" REVISION="12.1" -BRANCH="RC2" +BRANCH="RELEASE" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri Nov 1 00:04:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0D7217AC75; Fri, 1 Nov 2019 00:04:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4742WC3hxtz411T; Fri, 1 Nov 2019 00:04:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-5.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id E09A5177AD; Fri, 1 Nov 2019 00:04:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r354218 - head/sys/dev/ena To: Marcin Wojtas , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201910311538.x9VFcHPE053035@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <2fc49b6e-0294-cb5f-bbca-8a53f6aba036@FreeBSD.org> Date: Thu, 31 Oct 2019 17:04:49 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <201910311538.x9VFcHPE053035@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, 01 Nov 2019 00:04:55 -0000 On 10/31/19 8:38 AM, Marcin Wojtas wrote: > Author: mw > Date: Thu Oct 31 15:38:17 2019 > New Revision: 354218 > URL: https://svnweb.freebsd.org/changeset/base/354218 > > Log: > Add WC support for arm64 in the ENA driver > > As the pmamp_change_attr() is public on arm64 since r351131, it can be > used on the arm64 to map memory range as with the write combined > attribute. > > It requires the driver to use generic VM_MEMATTR_WRITE_COMBINING flag > instead of the x86 specific PAT_WRITE_COMBINING. > > Differential Revision: https://reviews.freebsd.org/D21931 > Submitted by: Michal Krawczyk > Obtained from: Semihalf > Sponsored by: Amazon, Inc. This isn't the right API for this, but the right API isn't ready yet on arm64. I have a patch to add bus_map_resource support on all platforms that I'm working on testing, and that will be the right way to request this in the future once it lands. -- -- John Baldwin From owner-svn-src-all@freebsd.org Fri Nov 1 01:08:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCED117C125 for ; Fri, 1 Nov 2019 01:08:15 +0000 (UTC) (envelope-from mw@semihalf.com) Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4743wG5M0mz43dJ for ; Fri, 1 Nov 2019 01:08:14 +0000 (UTC) (envelope-from mw@semihalf.com) Received: by mail-qt1-x831.google.com with SMTP id o3so11056290qtj.8 for ; Thu, 31 Oct 2019 18:08:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nEn2m2gvkEX0H2IHDf+jBrK61vMxuTyOYeHcalb42j8=; b=UioHO9GRi2MSYQI6t15ov18TNGpEz86+0PM7G/oG5H5CMs6Vjh8K4s8xIsLYgGxlI0 IKfbDXf/3tieywq7D+q7DEsZSi+wC0KbLPe2bc45cj+1aQ1uck0gXtUNPNNjzwk/zQ4F gHztwMzvLTvErRIb44/3BqMZPq+VjKbpW9Nsu8UD7wshkx5x9emen48FQABhMTklJgTI VBzaaB6h4XkKGS6LgmH83jFzz7jGhxiN/nWQRpckVdh/jt73FGan0yGX2TsWZjeuEyFz UN2uKuKXOSzB7TAEAOHXwlb0vhHlupdKH3YeFy8QA0dg1z/XDMIupZ16Vu5m2z56vFBL SbyA== 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=nEn2m2gvkEX0H2IHDf+jBrK61vMxuTyOYeHcalb42j8=; b=gfQ9kCrzqLjzETMERPI4kASt7ixh170WgK8MylClldt7iKBvgUoHmV5jVRpP7x6FZs SZ8U4RUX5gZu6G+/YyNFuqh9rHX/YJLJKsP3681UgcMkfpy70ywDaXO8MzJTsPMYqe69 EH/vIkLBH60xtFzYROSlKLmKY8KOhInxvYcUSX9x5lE86ulK6efY5vqgFZGBQh15TChF lUxjGtlWSYNGZQ8TfcUIyMkOHFm0lFQDP41WLpB4h4m+DfYjz0YqNRnIG4BoEfvbebCO dD2nEpQEsWqm07SJG19wBohtlxEyPoNMtKE3H1oa8qsy6Ac2Iklpg1LrtvY5YrRYdYe7 a/cg== X-Gm-Message-State: APjAAAURjudQvBGqH+j+IqlT/1a768Ji8yFZLLVqqdaLVqoM7kluuxB6 rXS8mGiU9WdkNIMQtvlEfFCuOe1xkkuDMMbAQ5Qb+g== X-Google-Smtp-Source: APXvYqyqfh33n9xK1GPYz5GGEcFidNvAQ90XzZayZxxVoOLqC2RsgiBMs/rfvIsJbnnu4NMJtDLwHnIbojipyRQcJgk= X-Received: by 2002:a0c:f704:: with SMTP id w4mr7696691qvn.167.1572570492312; Thu, 31 Oct 2019 18:08:12 -0700 (PDT) MIME-Version: 1.0 References: <201910311538.x9VFcHPE053035@repo.freebsd.org> <2fc49b6e-0294-cb5f-bbca-8a53f6aba036@FreeBSD.org> In-Reply-To: <2fc49b6e-0294-cb5f-bbca-8a53f6aba036@FreeBSD.org> From: Marcin Wojtas Date: Fri, 1 Nov 2019 02:08:02 +0100 Message-ID: Subject: Re: svn commit: r354218 - head/sys/dev/ena To: John Baldwin Cc: Marcin Wojtas , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 4743wG5M0mz43dJ X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=UioHO9GR; dmarc=none; spf=none (mx1.freebsd.org: domain of mw@semihalf.com has no SPF policy when checking 2607:f8b0:4864:20::831) smtp.mailfrom=mw@semihalf.com X-Spamd-Result: default: False [-5.05 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[semihalf-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[semihalf.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[semihalf-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[1.3.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.75)[ip: (-9.29), ipnet: 2607:f8b0::/32(-2.39), asn: 15169(-2.04), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] 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, 01 Nov 2019 01:08:15 -0000 Hi John, Sure, will be happy to test. Please let me know and cc mk@semihalf.com. Best regards, Marcin pt., 1 lis 2019 o 01:04 John Baldwin napisa=C5=82(a): > On 10/31/19 8:38 AM, Marcin Wojtas wrote: > > Author: mw > > Date: Thu Oct 31 15:38:17 2019 > > New Revision: 354218 > > URL: https://svnweb.freebsd.org/changeset/base/354218 > > > > Log: > > Add WC support for arm64 in the ENA driver > > > > As the pmamp_change_attr() is public on arm64 since r351131, it can b= e > > used on the arm64 to map memory range as with the write combined > > attribute. > > > > It requires the driver to use generic VM_MEMATTR_WRITE_COMBINING flag > > instead of the x86 specific PAT_WRITE_COMBINING. > > > > Differential Revision: https://reviews.freebsd.org/D21931 > > Submitted by: Michal Krawczyk > > Obtained from: Semihalf > > Sponsored by: Amazon, Inc. > > This isn't the right API for this, but the right API isn't ready yet on > arm64. I have a patch to add bus_map_resource support on all platforms > that I'm working on testing, and that will be the right way to request > this in the future once it lands. > > -- > -- > John Baldwin > From owner-svn-src-all@freebsd.org Fri Nov 1 02:48:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E861517F848; Fri, 1 Nov 2019 02:48:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47468D5vnvz49k8; Fri, 1 Nov 2019 02:48:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAEFC4744; Fri, 1 Nov 2019 02:48:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA12miCA048774; Fri, 1 Nov 2019 02:48:44 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA12micA048772; Fri, 1 Nov 2019 02:48:44 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201911010248.xA12micA048772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 1 Nov 2019 02:48:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354234 - head/lib/geom/eli X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/lib/geom/eli X-SVN-Commit-Revision: 354234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2019 02:48:45 -0000 Author: asomers Date: Fri Nov 1 02:48:43 2019 New Revision: 354234 URL: https://svnweb.freebsd.org/changeset/base/354234 Log: geli: raise WARNS to 6 MFC after: 2 weeks Sponsored by: Axcient Modified: head/lib/geom/eli/Makefile head/lib/geom/eli/geom_eli.c Modified: head/lib/geom/eli/Makefile ============================================================================== --- head/lib/geom/eli/Makefile Fri Nov 1 00:00:17 2019 (r354233) +++ head/lib/geom/eli/Makefile Fri Nov 1 02:48:43 2019 (r354234) @@ -13,8 +13,6 @@ SRCS+= sha512c.c LIBADD= md crypto -WARNS?= 3 - CFLAGS+=-I${SRCTOP}/sys .include Modified: head/lib/geom/eli/geom_eli.c ============================================================================== --- head/lib/geom/eli/geom_eli.c Fri Nov 1 00:00:17 2019 (r354233) +++ head/lib/geom/eli/geom_eli.c Fri Nov 1 02:48:43 2019 (r354234) @@ -706,7 +706,7 @@ eli_init(struct gctl_req *req) unsigned char key[G_ELI_USERKEYLEN]; char backfile[MAXPATHLEN]; const char *str, *prov; - unsigned int secsize, version; + unsigned int secsize, eli_version; off_t mediasize; intmax_t val; int error, i, nargs, nparams, param; @@ -723,16 +723,16 @@ eli_init(struct gctl_req *req) strlcpy(md.md_magic, G_ELI_MAGIC, sizeof(md.md_magic)); val = gctl_get_intmax(req, "mdversion"); if (val == -1) { - version = G_ELI_VERSION; + eli_version = G_ELI_VERSION; } else if (val < 0 || val > G_ELI_VERSION) { gctl_error(req, "Invalid version specified should be between %u and %u.", G_ELI_VERSION_00, G_ELI_VERSION); return; } else { - version = val; + eli_version = val; } - md.md_version = version; + md.md_version = eli_version; md.md_flags = G_ELI_FLAG_AUTORESIZE; if (gctl_get_int(req, "boot")) md.md_flags |= G_ELI_FLAG_BOOT; @@ -747,7 +747,7 @@ eli_init(struct gctl_req *req) md.md_ealgo = CRYPTO_ALGORITHM_MIN - 1; str = gctl_get_ascii(req, "aalgo"); if (*str != '\0') { - if (version < G_ELI_VERSION_01) { + if (eli_version < G_ELI_VERSION_01) { gctl_error(req, "Data authentication is supported starting from version %u.", G_ELI_VERSION_01); @@ -779,7 +779,7 @@ eli_init(struct gctl_req *req) md.md_ealgo > CRYPTO_ALGORITHM_MAX) { str = gctl_get_ascii(req, "ealgo"); if (*str == '\0') { - if (version < G_ELI_VERSION_05) + if (eli_version < G_ELI_VERSION_05) str = "aes-cbc"; else str = GELI_ENC_ALGO; @@ -791,14 +791,14 @@ eli_init(struct gctl_req *req) return; } if (md.md_ealgo == CRYPTO_CAMELLIA_CBC && - version < G_ELI_VERSION_04) { + eli_version < G_ELI_VERSION_04) { gctl_error(req, "Camellia-CBC algorithm is supported starting from version %u.", G_ELI_VERSION_04); return; } if (md.md_ealgo == CRYPTO_AES_XTS && - version < G_ELI_VERSION_05) { + eli_version < G_ELI_VERSION_05) { gctl_error(req, "AES-XTS algorithm is supported starting from version %u.", G_ELI_VERSION_05); @@ -1904,7 +1904,7 @@ eli_version(struct gctl_req *req) { struct g_eli_metadata md; const char *name; - unsigned int version; + unsigned int eli_version; int error, i, nargs; nargs = gctl_get_int(req, "nargs"); @@ -1934,8 +1934,8 @@ eli_version(struct gctl_req *req) gctl_error(req, "Not fully done."); continue; } - version = le32dec(&md.md_version); - printf("%s: %u\n", name, version); + eli_version = le32dec(&md.md_version); + printf("%s: %u\n", name, eli_version); } } From owner-svn-src-all@freebsd.org Fri Nov 1 02:55:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1200117FE50; Fri, 1 Nov 2019 02:55:59 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4746JZ5Zqhz4BMl; Fri, 1 Nov 2019 02:55:58 +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 A43EB4900; Fri, 1 Nov 2019 02:55:58 +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 xA12twxi054499; Fri, 1 Nov 2019 02:55:58 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA12twuX054498; Fri, 1 Nov 2019 02:55:58 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201911010255.xA12twuX054498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 1 Nov 2019 02:55:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354235 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 354235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2019 02:55:59 -0000 Author: jhibbits Date: Fri Nov 1 02:55:58 2019 New Revision: 354235 URL: https://svnweb.freebsd.org/changeset/base/354235 Log: powerpc/booke: Fix TLB1 entry accounting It's possible, with per-CPU mappings, for TLB1 indices to get out of sync. This presents a problem when trying to insert an entry into TLB1 of all CPUs. Currently that's done by assuming (hoping) that the TLBs are perfectly synced, and inserting to the same index for all CPUs. However, with aforementioned private mappings, this can result in overwriting mappings on the other CPUs. An example: CPU0 CPU1 3 private mappings kick off CPU 1 initialize shared mappings (3 indices low) Load kernel module, triggers 20 new mappings Sync mappings at N-3 initialize 3 private mappings. At this point, CPU 1 has all the correct mappings, while CPU 0 is missing 3 mappings that were shared across to CPU 1. When CPU 0 tries to access memory in one of the overwritten mappings, it hangs while tripping through the TLB miss handler. Device mappings are not stored in any page table. This fixes by introducing a '-1' index for tlb1_write_entry_int(), so each CPU searches for an available index private to itself. MFC after: 3 weeks Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Fri Nov 1 02:48:43 2019 (r354234) +++ head/sys/powerpc/booke/pmap.c Fri Nov 1 02:55:58 2019 (r354235) @@ -1881,7 +1881,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o } #ifdef SMP - void +void tlb1_ap_prep(void) { tlb_entry_t *e, tmp; @@ -3776,14 +3776,34 @@ struct tlbwrite_args { unsigned int idx; }; +static uint32_t +tlb1_find_free(void) +{ + tlb_entry_t e; + int i; + + for (i = 0; i < TLB1_ENTRIES; i++) { + tlb1_read_entry(&e, i); + if ((e.mas1 & MAS1_VALID) == 0) + return (i); + } + return (-1); +} + static void tlb1_write_entry_int(void *arg) { struct tlbwrite_args *args = arg; - uint32_t mas0; + uint32_t idx, mas0; + idx = args->idx; + if (idx == -1) { + idx = tlb1_find_free(); + if (idx == -1) + panic("No free TLB1 entries!\n"); + } /* Select entry */ - mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(args->idx); + mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(idx); mtspr(SPR_MAS0, mas0); mtspr(SPR_MAS1, args->e->mas1); @@ -3897,10 +3917,9 @@ tlb1_set_entry(vm_offset_t va, vm_paddr_t pa, vm_size_ uint32_t ts, tid; int tsize, index; + /* First try to update an existing entry. */ for (index = 0; index < TLB1_ENTRIES; index++) { tlb1_read_entry(&e, index); - if ((e.mas1 & MAS1_VALID) == 0) - break; /* Check if we're just updating the flags, and update them. */ if (e.phys == pa && e.virt == va && e.size == size) { e.mas2 = (va & MAS2_EPN_MASK) | flags; @@ -3908,10 +3927,6 @@ tlb1_set_entry(vm_offset_t va, vm_paddr_t pa, vm_size_ return (0); } } - if (index >= TLB1_ENTRIES) { - printf("tlb1_set_entry: TLB1 full!\n"); - return (-1); - } /* Convert size to TSIZE */ tsize = size2tsize(size); @@ -3931,13 +3946,8 @@ tlb1_set_entry(vm_offset_t va, vm_paddr_t pa, vm_size_ e.mas3 = (pa & MAS3_RPN) | MAS3_SR | MAS3_SW | MAS3_SX; e.mas7 = (pa >> 32) & MAS7_RPN; - tlb1_write_entry(&e, index); + tlb1_write_entry(&e, -1); - /* - * XXX in general TLB1 updates should be propagated between CPUs, - * since current design assumes to have the same TLB1 set-up on all - * cores. - */ return (0); } From owner-svn-src-all@freebsd.org Fri Nov 1 03:10:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DDA941A1679; Fri, 1 Nov 2019 03:10:53 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4746dn5cLBz4CZd; Fri, 1 Nov 2019 03:10:53 +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 A39DE4B9A; Fri, 1 Nov 2019 03:10:53 +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 xA13ArMb061758; Fri, 1 Nov 2019 03:10:53 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA13ArC0061756; Fri, 1 Nov 2019 03:10:53 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201911010310.xA13ArC0061756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 1 Nov 2019 03:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354236 - head/sbin/mdmfs X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/mdmfs X-SVN-Commit-Revision: 354236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2019 03:10:53 -0000 Author: kevans Date: Fri Nov 1 03:10:53 2019 New Revision: 354236 URL: https://svnweb.freebsd.org/changeset/base/354236 Log: mdmfs(8): add -k skel option to populate fs from a skeleton mdmfs(8) lacks the ability to populate throwaway memory filesystems from an existing directory. This features permits an interesting setup where /var for instance lives on a device where wear-leveling is something you want to avoid as much as possible and nonetheless you don't want to lose your logs, ports metadata, etc. Here are the steps: 1. Copy /var to /var.bak; 2. Mount an mfs into /var using -k /var.bak at startup; 3. Synchronize /var to /var.bak weekly and on shutdown. Note that this more or less mimics OpenBSD's mount_mfs(8) -P flag. PR: 146254 Submitted by: jlh (many moons ago) MFC after: 1 week Modified: head/sbin/mdmfs/mdmfs.8 head/sbin/mdmfs/mdmfs.c Modified: head/sbin/mdmfs/mdmfs.8 ============================================================================== --- head/sbin/mdmfs/mdmfs.8 Fri Nov 1 02:55:58 2019 (r354235) +++ head/sbin/mdmfs/mdmfs.8 Fri Nov 1 03:10:53 2019 (r354236) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 9, 2017 +.Dd October 31, 2019 .Dt MDMFS 8 .Os .Sh NAME @@ -48,6 +48,7 @@ filesystem .Op Fl F Ar file .Op Fl f Ar frag-size .Op Fl i Ar bytes +.Op Fl k Ar skel .Op Fl m Ar percent-free .Op Fl O Ar optimization .Op Fl o Ar mount-options @@ -193,6 +194,11 @@ memory disk backed by The fragment size of the file system in bytes. .It Fl i Ar bytes Number of bytes per inode. +.It Fl k Ar skel +Copy the content of directory +.Ar skel +into +.Ar mount-point . .It Fl l Enable multilabel MAC on the new file system. .It Fl L Modified: head/sbin/mdmfs/mdmfs.c ============================================================================== --- head/sbin/mdmfs/mdmfs.c Fri Nov 1 02:55:58 2019 (r354235) +++ head/sbin/mdmfs/mdmfs.c Fri Nov 1 03:10:53 2019 (r354236) @@ -88,6 +88,7 @@ static void do_mount_md(const char *, const char *); static void do_mount_tmpfs(const char *, const char *); static void do_mtptsetup(const char *, struct mtpt_info *); static void do_newfs(const char *); +static void do_copy(const char *, const char *); static void extract_ugid(const char *, struct mtpt_info *); static int run(int *, const char *, ...) __printflike(2, 3); static const char *run_exitstr(int); @@ -104,7 +105,7 @@ main(int argc, char **argv) enum md_types mdtype; /* The type of our memory disk. */ bool have_mdtype, mlmac; bool detach, softdep, autounit, newfs; - const char *mtpoint, *size_arg, *unitstr; + const char *mtpoint, *size_arg, *skel, *unitstr; char *p; int ch, idx; void *set; @@ -118,6 +119,7 @@ main(int argc, char **argv) mlmac = false; newfs = true; have_mdtype = false; + skel = NULL; mdtype = MD_SWAP; mdname = MD_NAME; mdnamelen = strlen(mdname); @@ -142,7 +144,7 @@ main(int argc, char **argv) } while ((ch = getopt(argc, argv, - "a:b:Cc:Dd:E:e:F:f:hi:LlMm:NnO:o:Pp:Ss:tT:Uv:w:X")) != -1) + "a:b:Cc:Dd:E:e:F:f:hi:k:LlMm:NnO:o:Pp:Ss:tT:Uv:w:X")) != -1) switch (ch) { case 'a': argappend(&newfs_arg, "-a %s", optarg); @@ -184,6 +186,9 @@ main(int argc, char **argv) case 'i': argappend(&newfs_arg, "-i %s", optarg); break; + case 'k': + skel = optarg; + break; case 'L': loudsubs = true; break; @@ -359,6 +364,8 @@ main(int argc, char **argv) } do_mtptsetup(mtpoint, &mi); + if (skel != NULL) + do_copy(mtpoint, skel); return (0); } @@ -615,7 +622,24 @@ do_newfs(const char *args) run_exitnumber(rv)); } + /* + * Copy skel into the mountpoint. + */ +static void +do_copy(const char *mtpoint, const char *skel) +{ + int rv; + + rv = chdir(skel); + if (rv != 0) + err(1, "chdir to %s", skel); + rv = run(NULL, "/bin/pax -rw -pe . %s", mtpoint); + if (rv != 0) + errx(1, "skel copy failed"); +} + +/* * 'str' should be a user and group name similar to the last argument * to chown(1); i.e., a user, followed by a colon, followed by a * group. The user and group in 'str' may be either a [ug]id or a @@ -822,8 +846,8 @@ usage(void) fprintf(stderr, "usage: %s [-DLlMNnPStUX] [-a maxcontig] [-b block-size]\n" "\t[-c blocks-per-cylinder-group][-d max-extent-size] [-E path-mdconfig]\n" -"\t[-e maxbpg] [-F file] [-f frag-size] [-i bytes] [-m percent-free]\n" -"\t[-O optimization] [-o mount-options]\n" +"\t[-e maxbpg] [-F file] [-f frag-size] [-i bytes] [-k skel]\n" +"\t[-m percent-free] [-O optimization] [-o mount-options]\n" "\t[-p permissions] [-s size] [-v version] [-w user:group]\n" "\tmd-device mount-point\n", getprogname()); exit(1); From owner-svn-src-all@freebsd.org Fri Nov 1 03:12:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3A5C1A19F6; Fri, 1 Nov 2019 03:12:36 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4746gm4pMSz4D11; Fri, 1 Nov 2019 03:12:36 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 7CA3518D62; Fri, 1 Nov 2019 03:12:36 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f171.google.com with SMTP id 205so7986226qkk.1; Thu, 31 Oct 2019 20:12:36 -0700 (PDT) X-Gm-Message-State: APjAAAVxVGrfx+13OcEGtKM0Hj4G2vU5cGqbi+Je66csIuyKebHVV28P +W6ibk3PsqSNEXKbAjCU4rVsyxvVmSwJL7Aew4M= X-Google-Smtp-Source: APXvYqwcpyTSqefPIoAR5htHV8UE0lXxuYAZkXuCmYy/enlZvkcafZCaxKbyW6fndjBtQhv/ikRQ3VNF+HGw8fpJx20= X-Received: by 2002:ae9:ef50:: with SMTP id d77mr2648199qkg.430.1572577955910; Thu, 31 Oct 2019 20:12:35 -0700 (PDT) MIME-Version: 1.0 References: <201911010310.xA13ArC0061756@repo.freebsd.org> In-Reply-To: <201911010310.xA13ArC0061756@repo.freebsd.org> From: Kyle Evans Date: Thu, 31 Oct 2019 22:12:24 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r354236 - head/sbin/mdmfs To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head 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, 01 Nov 2019 03:12:36 -0000 On Thu, Oct 31, 2019 at 10:11 PM Kyle Evans wrote: > > Author: kevans > Date: Fri Nov 1 03:10:53 2019 > New Revision: 354236 > URL: https://svnweb.freebsd.org/changeset/base/354236 > > Log: > mdmfs(8): add -k skel option to populate fs from a skeleton > > mdmfs(8) lacks the ability to populate throwaway memory filesystems from an > existing directory. > > This features permits an interesting setup where /var for instance lives on > a device where wear-leveling is something you want to avoid as much as > possible and nonetheless you don't want to lose your logs, ports metadata, > etc. Here are the steps: > > 1. Copy /var to /var.bak; > 2. Mount an mfs into /var using -k /var.bak at startup; > 3. Synchronize /var to /var.bak weekly and on shutdown. > > Note that this more or less mimics OpenBSD's mount_mfs(8) -P flag. > > PR: 146254 > Submitted by: jlh (many moons ago) > MFC after: 1 week Reviewed by: bcr (manpages) Differential Revision: https://reviews.freebsd.org/D19963 From owner-svn-src-all@freebsd.org Fri Nov 1 06:54:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 307CD1AACE6; Fri, 1 Nov 2019 06:54:08 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474CbN0GTMz3MkT; Fri, 1 Nov 2019 06:54:08 +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 E085E74FC; Fri, 1 Nov 2019 06:54:07 +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 xA16s7JG098378; Fri, 1 Nov 2019 06:54:07 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA16s760098377; Fri, 1 Nov 2019 06:54:07 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911010654.xA16s760098377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 1 Nov 2019 06:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354237 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 354237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2019 06:54:08 -0000 Author: tsoome Date: Fri Nov 1 06:54:07 2019 New Revision: 354237 URL: https://svnweb.freebsd.org/changeset/base/354237 Log: loader: asprinf does crash arm64 due to missing NULL pointer check PCHAR macro needs to check if d is NULL. MFC after: 3 days Modified: head/stand/libsa/printf.c Modified: head/stand/libsa/printf.c ============================================================================== --- head/stand/libsa/printf.c Fri Nov 1 03:10:53 2019 (r354236) +++ head/stand/libsa/printf.c Fri Nov 1 06:54:07 2019 (r354237) @@ -247,7 +247,17 @@ ksprintn(char *nbuf, uintmax_t num, int base, int *len static int kvprintf(char const *fmt, kvprintf_fn_t *func, void *arg, int radix, va_list ap) { -#define PCHAR(c) {int cc=(c); if (func) (*func)(cc, arg); else *d++ = cc; retval++; } +#define PCHAR(c) { \ + int cc = (c); \ + \ + if (func) { \ + (*func)(cc, arg); \ + } else if (d != NULL) { \ + *d++ = cc; \ + } \ + retval++; \ + } + char nbuf[MAXNBUF]; char *d; const char *p, *percent, *q; From owner-svn-src-all@freebsd.org Fri Nov 1 09:16:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E05021AE10D; Fri, 1 Nov 2019 09:16:58 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474GmB5cmZz3yBj; Fri, 1 Nov 2019 09:16:58 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A533C8DCB; Fri, 1 Nov 2019 09:16:58 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA19GwDh080544; Fri, 1 Nov 2019 09:16:58 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA19Gw86080543; Fri, 1 Nov 2019 09:16:58 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201911010916.xA19Gw86080543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Fri, 1 Nov 2019 09:16:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354238 - head/contrib/netbsd-tests/lib/libexecinfo X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libexecinfo X-SVN-Commit-Revision: 354238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2019 09:16:58 -0000 Author: lwhsu Date: Fri Nov 1 09:16:58 2019 New Revision: 354238 URL: https://svnweb.freebsd.org/changeset/base/354238 Log: Temporarily skip lib.libexecinfo.backtrace_test.backtrace_fmt_basic on i386 PR: 241562 Sponsored by: The FreeBSD Foundation Modified: head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Modified: head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c ============================================================================== --- head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Fri Nov 1 06:54:07 2019 (r354237) +++ head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Fri Nov 1 09:16:58 2019 (r354238) @@ -151,6 +151,11 @@ ATF_TC_HEAD(backtrace_fmt_basic, tc) ATF_TC_BODY(backtrace_fmt_basic, tc) { +#if defined(__i386__) + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/241562"); +#endif + myfunc(12); if (prevent_inline) From owner-svn-src-all@freebsd.org Fri Nov 1 11:28:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA78A15A191; Fri, 1 Nov 2019 11:28:43 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474KhC502dz46b0; Fri, 1 Nov 2019 11:28:43 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E859A50E; Fri, 1 Nov 2019 11:28:43 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA1BShnt057228; Fri, 1 Nov 2019 11:28:43 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA1BShOC057227; Fri, 1 Nov 2019 11:28:43 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201911011128.xA1BShOC057227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Fri, 1 Nov 2019 11:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354239 - head/contrib/gdb/gdb X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/contrib/gdb/gdb X-SVN-Commit-Revision: 354239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2019 11:28:43 -0000 Author: luporl Date: Fri Nov 1 11:28:43 2019 New Revision: 354239 URL: https://svnweb.freebsd.org/changeset/base/354239 Log: [PPC64] Fix GDB sigtramp detection Current implementation of ppcfbsd_pc_in_sigtramp() seems to take only 32-bit PowerPC in account, as on 64-bit PowerPC most kernel instruction addresses will be wrongly reported as in sigtramp. This change adds proper sigtramp detection for PPC64. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D22199 Modified: head/contrib/gdb/gdb/ppcfbsd-tdep.c Modified: head/contrib/gdb/gdb/ppcfbsd-tdep.c ============================================================================== --- head/contrib/gdb/gdb/ppcfbsd-tdep.c Fri Nov 1 09:16:58 2019 (r354238) +++ head/contrib/gdb/gdb/ppcfbsd-tdep.c Fri Nov 1 11:28:43 2019 (r354239) @@ -487,6 +487,12 @@ ppcfbsd_pc_in_sigtramp (CORE_ADDR pc, char *func_name) return (pc >= 0x7fffef00U) ? 1 : 0; } +static int +ppc64_fbsd_pc_in_sigtramp (CORE_ADDR pc, char *func_name) +{ + return (pc >= 0x3fffffffffffe000U && pc <= 0x3fffffffffffefffU) ? 1 : 0; +} + /* NetBSD is confused. It appears that 1.5 was using the correct SVr4 convention but, 1.6 switched to the below broken convention. For the moment use the broken convention. Ulgh!. */ @@ -518,10 +524,9 @@ ppcfbsd_init_abi (struct gdbarch_info info, /* FreeBSD doesn't support the 128-bit `long double' from the psABI. */ set_gdbarch_long_double_bit (gdbarch, 64); - set_gdbarch_pc_in_sigtramp (gdbarch, ppcfbsd_pc_in_sigtramp); - if (tdep->wordsize == 4) { + set_gdbarch_pc_in_sigtramp (gdbarch, ppcfbsd_pc_in_sigtramp); set_gdbarch_return_value (gdbarch, ppcfbsd_return_value); set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets); @@ -529,6 +534,7 @@ ppcfbsd_init_abi (struct gdbarch_info info, if (tdep->wordsize == 8) { + set_gdbarch_pc_in_sigtramp (gdbarch, ppc64_fbsd_pc_in_sigtramp); set_gdbarch_convert_from_func_ptr_addr (gdbarch, ppc64_fbsd_convert_from_func_ptr_addr); From owner-svn-src-all@freebsd.org Fri Nov 1 16:06:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09D2917A292; Fri, 1 Nov 2019 16:06:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474RrZ6S4bz4QKW; Fri, 1 Nov 2019 16:06:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-5.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 3D5D51EAF9; Fri, 1 Nov 2019 16:06:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r354239 - head/contrib/gdb/gdb To: Leandro Lupori , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201911011128.xA1BShOC057227@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Fri, 1 Nov 2019 09:06:18 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <201911011128.xA1BShOC057227@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, 01 Nov 2019 16:06:23 -0000 On 11/1/19 4:28 AM, Leandro Lupori wrote: > Author: luporl > Date: Fri Nov 1 11:28:43 2019 > New Revision: 354239 > URL: https://svnweb.freebsd.org/changeset/base/354239 > > Log: > [PPC64] Fix GDB sigtramp detection > > Current implementation of ppcfbsd_pc_in_sigtramp() seems to take only 32-bit > PowerPC in account, as on 64-bit PowerPC most kernel instruction addresses will > be wrongly reported as in sigtramp. > > This change adds proper sigtramp detection for PPC64. It's probably not worth fixing this in /usr/bin/gdb? At this point gdb is only installed for the kgdb in /usr/libexec on all platforms but sparc64 to serve as a fall-back for the crashinfo script in case the ports gdb isn't installed. The ports gdb should handle signal trampolines fine on ppc. It uses instruction matching patterns to detect trampolines on all supported platforms instead of static sigtramp locations. -- John Baldwin From owner-svn-src-all@freebsd.org Fri Nov 1 19:26:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 790E017F5C6; Fri, 1 Nov 2019 19:26:41 +0000 (UTC) (envelope-from luporl@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474XHj2c1fz4f7W; Fri, 1 Nov 2019 19:26:41 +0000 (UTC) (envelope-from luporl@freebsd.org) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: luporl/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 2B941578; Fri, 1 Nov 2019 19:26:41 +0000 (UTC) (envelope-from luporl@freebsd.org) Received: by mail-io1-f52.google.com with SMTP id h9so12097370ioh.2; Fri, 01 Nov 2019 12:26:41 -0700 (PDT) X-Gm-Message-State: APjAAAUHqizQAgVjWYu9/Qj1XgVXj1C/IxY4j9LPybtPLq+iiVsmdwEn ZYCiFSQPhtEQn1Lthkce1owOmemqcnG8n8dOkPU= X-Google-Smtp-Source: APXvYqzUX6uuudz29RZn6FfALkQ0AJ7dzOlrRI4iZS61bxrIs6/kjwwgBRpjBHltwr2O6ZrTWy2egn5IWk4v7KRo2Nw= X-Received: by 2002:a6b:908a:: with SMTP id s132mr12226883iod.118.1572636400421; Fri, 01 Nov 2019 12:26:40 -0700 (PDT) MIME-Version: 1.0 References: <201911011128.xA1BShOC057227@repo.freebsd.org> In-Reply-To: From: luporl Date: Fri, 1 Nov 2019 16:26:29 -0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r354239 - head/contrib/gdb/gdb To: John Baldwin 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: Fri, 01 Nov 2019 19:26:41 -0000 Well, after evaluating remote kernel debugging through serial port, on amd64, I've run into several issues while using latest ports gdb/kgdb. I don't remember all of them, but were things like step/next not always working, connection being lost, and similar things. OTOH, /usr/libexec/kgdb worked fine and reliably, although older and more limited. This is probably due to some incompatibility in GDB Remote Serial Protocol, between the kernel backend and newer GDB from ports. So, that's why I chose to use /usr/libexec/kgdb while fixing/enabling remote debugging on PPC64, because it works reasonably well, and I could focus on testing/fixing other parts first. With only this change on gdb, it is now possible to use it to test some basic functionality, like remote debugger attach, backtrace and data inspection. My goal is not to fix every issue in /usr/libexec/kgdb, but just to get the basics working, to then move on and switch to ports' GDB. - Leandro On Fri, Nov 1, 2019 at 1:06 PM John Baldwin wrote: > On 11/1/19 4:28 AM, Leandro Lupori wrote: > > Author: luporl > > Date: Fri Nov 1 11:28:43 2019 > > New Revision: 354239 > > URL: https://svnweb.freebsd.org/changeset/base/354239 > > > > Log: > > [PPC64] Fix GDB sigtramp detection > > > > Current implementation of ppcfbsd_pc_in_sigtramp() seems to take only > 32-bit > > PowerPC in account, as on 64-bit PowerPC most kernel instruction > addresses will > > be wrongly reported as in sigtramp. > > > > This change adds proper sigtramp detection for PPC64. > > It's probably not worth fixing this in /usr/bin/gdb? At this point gdb is > only > installed for the kgdb in /usr/libexec on all platforms but sparc64 to > serve as > a fall-back for the crashinfo script in case the ports gdb isn't > installed. The > ports gdb should handle signal trampolines fine on ppc. It uses > instruction > matching patterns to detect trampolines on all supported platforms instead > of > static sigtramp locations. > > -- > John Baldwin > From owner-svn-src-all@freebsd.org Fri Nov 1 19:34:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2A3217FBC2; Fri, 1 Nov 2019 19:34:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474XSG4GzTz4fbH; Fri, 1 Nov 2019 19:34:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-5.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 8358C6A4; Fri, 1 Nov 2019 19:34:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r354239 - head/contrib/gdb/gdb To: luporl Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201911011128.xA1BShOC057227@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Fri, 1 Nov 2019 12:34:02 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2019 19:34:06 -0000 On 11/1/19 12:26 PM, luporl wrote: > Well, after evaluating remote kernel debugging through serial port, on > amd64, I've run into several issues while using latest ports gdb/kgdb. > I don't remember all of them, but were things like step/next not always > working, connection being lost, and similar things. > OTOH, /usr/libexec/kgdb worked fine and reliably, although older and more > limited. > This is probably due to some incompatibility in GDB Remote Serial Protocol, > between the kernel backend and newer GDB from ports. > > So, that's why I chose to use /usr/libexec/kgdb while fixing/enabling > remote debugging on PPC64, because it works reasonably well, and I could > focus on testing/fixing other parts first. > With only this change on gdb, it is now possible to use it to test some > basic functionality, like remote debugger attach, backtrace and data > inspection. > > My goal is not to fix every issue in /usr/libexec/kgdb, but just to get the > basics working, to then move on and switch to ports' GDB. What's odd about this commit is it only affects userland binaries, not the kernel, so a bit odd for kgdb, especially since the old kgdb in the tree doesn't include user support IIRC, only kernel bits (in modern gdb, kgdb is just a wrapper, and you can use 'target vmcore' from within gdb itself against a crash dump, etc.) -- John Baldwin From owner-svn-src-all@freebsd.org Fri Nov 1 19:42:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2907117FF75; Fri, 1 Nov 2019 19:42:57 +0000 (UTC) (envelope-from luporl@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474XfT0HVRz4g2C; Fri, 1 Nov 2019 19:42:57 +0000 (UTC) (envelope-from luporl@freebsd.org) Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: luporl/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id D28007DF; Fri, 1 Nov 2019 19:42:56 +0000 (UTC) (envelope-from luporl@freebsd.org) Received: by mail-io1-f45.google.com with SMTP id c6so12054874ioo.13; Fri, 01 Nov 2019 12:42:56 -0700 (PDT) X-Gm-Message-State: APjAAAW8ICd+6FKth9LYyuosQuGpySElDr5lLFgy6KWxucZ73TDpPDL+ agry5L/OC6hwXVGpvWTu3OJWCguGvGW4sZ8ISgg= X-Google-Smtp-Source: APXvYqxNiTm3fHKd1OEJ9jjxPSC7ap8y4zuytAag/uA1WBoUADlCxqw6iWgn+yVvcX6uuyVltne8hF/YZCu1j2Km02I= X-Received: by 2002:a02:1c41:: with SMTP id c62mr9208188jac.132.1572637376229; Fri, 01 Nov 2019 12:42:56 -0700 (PDT) MIME-Version: 1.0 References: <201911011128.xA1BShOC057227@repo.freebsd.org> In-Reply-To: From: luporl Date: Fri, 1 Nov 2019 16:42:45 -0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r354239 - head/contrib/gdb/gdb To: John Baldwin 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: Fri, 01 Nov 2019 19:42:57 -0000 The kernel parts were fixed by r354213 and r354214. I've used old kgdb to test remote debugging through serial only, not for inspecting crash dumps. On Fri, Nov 1, 2019 at 4:34 PM John Baldwin wrote: > On 11/1/19 12:26 PM, luporl wrote: > > Well, after evaluating remote kernel debugging through serial port, on > > amd64, I've run into several issues while using latest ports gdb/kgdb. > > I don't remember all of them, but were things like step/next not always > > working, connection being lost, and similar things. > > OTOH, /usr/libexec/kgdb worked fine and reliably, although older and more > > limited. > > This is probably due to some incompatibility in GDB Remote Serial > Protocol, > > between the kernel backend and newer GDB from ports. > > > > So, that's why I chose to use /usr/libexec/kgdb while fixing/enabling > > remote debugging on PPC64, because it works reasonably well, and I could > > focus on testing/fixing other parts first. > > With only this change on gdb, it is now possible to use it to test some > > basic functionality, like remote debugger attach, backtrace and data > > inspection. > > > > My goal is not to fix every issue in /usr/libexec/kgdb, but just to get > the > > basics working, to then move on and switch to ports' GDB. > > What's odd about this commit is it only affects userland binaries, not the > kernel, so a bit odd for kgdb, especially since the old kgdb in the tree > doesn't include user support IIRC, only kernel bits (in modern gdb, kgdb > is just a wrapper, and you can use 'target vmcore' from within gdb itself > against a crash dump, etc.) > > -- > John Baldwin > From owner-svn-src-all@freebsd.org Fri Nov 1 21:21:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 990A41A364F for ; Fri, 1 Nov 2019 21:21:21 +0000 (UTC) (envelope-from ilya@bakulin.de) Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474Zr06VJ3z3HQ1 for ; Fri, 1 Nov 2019 21:21:20 +0000 (UTC) (envelope-from ilya@bakulin.de) Received: by mail-lf1-x131.google.com with SMTP id 19so3019003lft.13 for ; Fri, 01 Nov 2019 14:21:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bakulin-de.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ETd2ezv4qQjF568YrqipIdIbrMabjDYsJFoQbAl3TY8=; b=WeYlZ1/NMzZCVqAos5PdqKiRv9xJuCoDcpyYN9SdBz7vsI30EIsM/WvCZwtIRyHmQH 9sJM/Lbf4XHzCNnvwccabWFTlz5VhOVePdKub0pcLH2E9lSoiDWr9wQmem4UwvtJJR0s F4dPgSdEPZlaIfqaS2sABcVJitlqGh3lq2rxyRv7lFiExU0II9OIuozo80mqKsQCgd4I QArn+sCcvb+Weps0uvmC7/CpRPX6WyUKu7pt+2dXEhAhf1tQi8c+Hedqr0vjL5Td5j+0 1VAZt/JcSO8evNZ88YxrccnTUkR+byCeIw4gbiUuCf9nh69koIHchu6Yqj6LpaJfEeQ+ UPiw== 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=ETd2ezv4qQjF568YrqipIdIbrMabjDYsJFoQbAl3TY8=; b=n4ZEDbut4oTbgGWcf9sWJO7SjZ+fVLSkZe6VenTdmrkZVJw9pq6HiCuH/EogdpX/zT TjCDDSMVmpaEsfK11tdtHhtySC8tysjoXRG0KkLbzfBF76sFV7yTmIfoLUWcGGonC0V+ 7zHRdCQ9f7oTur05AHii82hwRyL7lCqwLLsWk60MRvu8NT1Be7hEWDt24z1ggt6NtMBy XdQ1qdwpihWCw0mxKEYYNgb9XxxqqqlW9SuwMMqgItn0SsJvuka0zRzjuBYItt2BbUQd pfpYpgb1r10I4/Evfe+334iuGHsYwHr9SolOGQZN/HK2gaVAFPtDsRyiQFM68cntMm7x X4jg== X-Gm-Message-State: APjAAAWB/EmlN8yFRX0oB54UhWGkVsJTIIzQ8mispgtjvvgwZc2j3r4W yZdk6ZQfC28jpWkhWK3vm8MhRXqXOjPAH/iIZnLpUQ== X-Google-Smtp-Source: APXvYqzMF/dPMiQatg/urqeio05abpIafFxI7OHoYu3/zmexpXaRVA2hRf202j6Rj3SZ3m4c3b1EaCmrC6Us4Dz9mGQ= X-Received: by 2002:a19:6813:: with SMTP id d19mr8867874lfc.144.1572643278573; Fri, 01 Nov 2019 14:21:18 -0700 (PDT) MIME-Version: 1.0 References: <201910302043.x9UKhRth083957@repo.freebsd.org> <20191031135118.4e9222bb05879d1602bf3161@bidouilliste.com> In-Reply-To: <20191031135118.4e9222bb05879d1602bf3161@bidouilliste.com> From: Ilya Bakulin Date: Fri, 1 Nov 2019 22:21:07 +0100 Message-ID: Subject: Re: svn commit: r354206 - head/sys/arm/allwinner To: Emmanuel Vadot Cc: Ilya Bakulin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 474Zr06VJ3z3HQ1 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bakulin-de.20150623.gappssmtp.com header.s=20150623 header.b=WeYlZ1/N; dmarc=none; spf=none (mx1.freebsd.org: domain of ilya@bakulin.de has no SPF policy when checking 2a00:1450:4864:20::131) smtp.mailfrom=ilya@bakulin.de X-Spamd-Result: default: False [-4.03 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[bakulin-de.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bakulin.de]; URI_COUNT_ODD(1.00)[9]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bakulin-de.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[1.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.73)[ip: (-8.77), ipnet: 2a00:1450::/32(-2.78), asn: 15169(-2.04), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] 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, 01 Nov 2019 21:21:21 -0000 The first part (cam_sim_alloc -> cam_sim_alloc_dev) is necessary to properly fill cam_sim structure so that sdiob(4) can attach to the SDIO card. See https://svnweb.freebsd.org/base?view=revision&revision=r348800 for the details. The second part (new DEVMETHOD) is needed because now MMC adapter becomes a bus (like, something that has children) and without this change the kernel panics when trying to attach sdiob(4). On Thu, Oct 31, 2019 at 1:51 PM Emmanuel Vadot wrote: > On Wed, 30 Oct 2019 20:43:27 +0000 (UTC) > Ilya Bakulin wrote: > > > Author: kibab > > Date: Wed Oct 30 20:43:27 2019 > > New Revision: 354206 > > URL: https://svnweb.freebsd.org/changeset/base/354206 > > > > Log: > > Use the new cam_sim_alloc_dev function to properly initialize SIM > > > > Using cam_sim_alloc_dev() allows to properly set sim_dev field so that > > sdiob(4) can attach to the CAM device that represents SDIO card. > > The same change for SDHCI driver happened in r348800. > > > > Approved by: imp (mentor) > > Differential Revision: https://reviews.freebsd.org/D22192 > > > > Modified: > > head/sys/arm/allwinner/aw_mmc.c > > > > Modified: head/sys/arm/allwinner/aw_mmc.c > > > ============================================================================== > > --- head/sys/arm/allwinner/aw_mmc.c Wed Oct 30 20:08:10 2019 > (r354205) > > +++ head/sys/arm/allwinner/aw_mmc.c Wed Oct 30 20:43:27 2019 > (r354206) > > @@ -526,8 +526,8 @@ aw_mmc_attach(device_t dev) > > } > > > > mtx_init(&sc->sim_mtx, "awmmcsim", NULL, MTX_DEF); > > - sc->sim = cam_sim_alloc(aw_mmc_cam_action, aw_mmc_cam_poll, > > - "aw_mmc_sim", sc, device_get_unit(dev), > > + sc->sim = cam_sim_alloc_dev(aw_mmc_cam_action, aw_mmc_cam_poll, > > + "aw_mmc_sim", sc, dev, > > &sc->sim_mtx, 1, 1, sc->devq); > > > > if (sc->sim == NULL) { > > @@ -1514,6 +1514,7 @@ static device_method_t aw_mmc_methods[] = { > > /* Bus interface */ > > DEVMETHOD(bus_read_ivar, aw_mmc_read_ivar), > > DEVMETHOD(bus_write_ivar, aw_mmc_write_ivar), > > + DEVMETHOD(bus_add_child, bus_generic_add_child), > > Why is this change needed ? > > > > > /* MMC bridge interface */ > > DEVMETHOD(mmcbr_update_ios, aw_mmc_update_ios), > > > -- > Emmanuel Vadot > From owner-svn-src-all@freebsd.org Fri Nov 1 21:26:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D88371A37CC; Fri, 1 Nov 2019 21:26:44 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474ZyD5NYlz3HfP; Fri, 1 Nov 2019 21:26:44 +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 97EB919269; Fri, 1 Nov 2019 21:26:44 +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 xA1LQiul030198; Fri, 1 Nov 2019 21:26:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA1LQibN030196; Fri, 1 Nov 2019 21:26:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201911012126.xA1LQibN030196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 1 Nov 2019 21:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354240 - in head/stand: efi/loader i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: efi/loader i386/libi386 X-SVN-Commit-Revision: 354240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2019 21:26:44 -0000 Author: imp Date: Fri Nov 1 21:26:43 2019 New Revision: 354240 URL: https://svnweb.freebsd.org/changeset/base/354240 Log: We don't support configuring serial PCI cards in EFI. Make this clearer in the source rather than obfuscaring it behind NO_PCI (nothing else declares that, so it's not making the ifdefs clearer). Modified: head/stand/efi/loader/Makefile head/stand/i386/libi386/comconsole.c Modified: head/stand/efi/loader/Makefile ============================================================================== --- head/stand/efi/loader/Makefile Fri Nov 1 11:28:43 2019 (r354239) +++ head/stand/efi/loader/Makefile Fri Nov 1 21:26:43 2019 (r354240) @@ -55,7 +55,7 @@ CFLAGS+= -I${EFISRC}/include CFLAGS+= -I${EFISRC}/include/${MACHINE} CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include CFLAGS+= -I${BOOTSRC}/i386/libi386 -CFLAGS+= -DNO_PCI -DEFI +CFLAGS+= -DEFI .if !defined(BOOT_HIDE_SERIAL_NUMBERS) # Export serial numbers, UUID, and asset tag from loader. Modified: head/stand/i386/libi386/comconsole.c ============================================================================== --- head/stand/i386/libi386/comconsole.c Fri Nov 1 11:28:43 2019 (r354239) +++ head/stand/i386/libi386/comconsole.c Fri Nov 1 21:26:43 2019 (r354240) @@ -214,7 +214,8 @@ comc_port_set(struct env_var *ev, int flags, const voi static uint32_t comc_parse_pcidev(const char *string) { -#ifdef NO_PCI +#ifdef EFI + /* We don't support PCI in EFI yet */ return (0); #else char *p, *p1; @@ -256,7 +257,8 @@ comc_parse_pcidev(const char *string) static int comc_pcidev_handle(uint32_t locator) { -#ifdef NO_PCI +#ifdef EFI + /* We don't support PCI in EFI yet */ return (CMD_ERROR); #else char intbuf[64]; From owner-svn-src-all@freebsd.org Fri Nov 1 22:49:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFDFF1A585C; Fri, 1 Nov 2019 22:49:45 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474cp14GSvz3MmK; Fri, 1 Nov 2019 22:49:45 +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 75C861A11F; Fri, 1 Nov 2019 22:49:45 +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 xA1MnjRh089169; Fri, 1 Nov 2019 22:49:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA1Mnj0A089165; Fri, 1 Nov 2019 22:49:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201911012249.xA1Mnj0A089165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 1 Nov 2019 22:49:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354241 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 354241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2019 22:49:45 -0000 Author: mav Date: Fri Nov 1 22:49:44 2019 New Revision: 354241 URL: https://svnweb.freebsd.org/changeset/base/354241 Log: Some more taskqueue optimizations. - Optimize enqueue for two task priority values by adding new tq_hint field, pointing to the last task inserted into the middle of the list. In case of more then two priority values it should halve average search. - Move tq_active insert/remove out of the taskqueue_run_locked loop. Instead of dirtying few shared cache lines per task introduce different mechanism to drain active tasks, based on task sequence number counter, that uses only cache lines already present in cache. Since the new mechanism does not need ordering, switch tq_active from TAILQ to LIST. - Move static and dynamic struct taskqueue fields into different cache lines. Move lock into its own cache line, so that heavy lock spinning by multiple waiting threads would not affect the running thread. - While there, correct some TQ_SLEEP() wait messages. This change fixes certain ZFS write workloads, causing huge congestion on taskqueue lock. Those workloads combine some large block writes to saturate the pool and trigger allocation throttling, which uses higher priority tasks to requeue the delayed I/Os, with many small blocks to generate deep queue of small tasks for taskqueue to sort. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/kern/subr_gtaskqueue.c head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Fri Nov 1 21:26:43 2019 (r354240) +++ head/sys/kern/subr_gtaskqueue.c Fri Nov 1 22:49:44 2019 (r354241) @@ -57,26 +57,26 @@ TASKQGROUP_DEFINE(softirq, mp_ncpus, 1); TASKQGROUP_DEFINE(config, 1, 1); struct gtaskqueue_busy { - struct gtask *tb_running; - TAILQ_ENTRY(gtaskqueue_busy) tb_link; + struct gtask *tb_running; + u_int tb_seq; + LIST_ENTRY(gtaskqueue_busy) tb_link; }; -static struct gtask * const TB_DRAIN_WAITER = (struct gtask *)0x1; - typedef void (*gtaskqueue_enqueue_fn)(void *context); struct gtaskqueue { STAILQ_HEAD(, gtask) tq_queue; + LIST_HEAD(, gtaskqueue_busy) tq_active; + u_int tq_seq; + int tq_callouts; + struct mtx_padalign tq_mutex; gtaskqueue_enqueue_fn tq_enqueue; void *tq_context; char *tq_name; - TAILQ_HEAD(, gtaskqueue_busy) tq_active; - struct mtx tq_mutex; struct thread **tq_threads; int tq_tcount; int tq_spin; int tq_flags; - int tq_callouts; taskqueue_callback_fn tq_callbacks[TASKQUEUE_NUM_CALLBACKS]; void *tq_cb_contexts[TASKQUEUE_NUM_CALLBACKS]; }; @@ -115,12 +115,11 @@ gtask_dump(struct gtask *gtask) #endif static __inline int -TQ_SLEEP(struct gtaskqueue *tq, void *p, struct mtx *m, int pri, const char *wm, - int t) +TQ_SLEEP(struct gtaskqueue *tq, void *p, const char *wm) { if (tq->tq_spin) - return (msleep_spin(p, m, wm, t)); - return (msleep(p, m, pri, wm, t)); + return (msleep_spin(p, (struct mtx *)&tq->tq_mutex, wm, 0)); + return (msleep(p, &tq->tq_mutex, 0, wm, 0)); } static struct gtaskqueue * @@ -144,7 +143,7 @@ _gtaskqueue_create(const char *name, int mflags, } STAILQ_INIT(&queue->tq_queue); - TAILQ_INIT(&queue->tq_active); + LIST_INIT(&queue->tq_active); queue->tq_enqueue = enqueue; queue->tq_context = context; queue->tq_name = tq_name; @@ -167,7 +166,7 @@ gtaskqueue_terminate(struct thread **pp, struct gtaskq while (tq->tq_tcount > 0 || tq->tq_callouts > 0) { wakeup(tq); - TQ_SLEEP(tq, pp, &tq->tq_mutex, PWAIT, "taskqueue_destroy", 0); + TQ_SLEEP(tq, pp, "gtq_destroy"); } } @@ -178,7 +177,7 @@ gtaskqueue_free(struct gtaskqueue *queue) TQ_LOCK(queue); queue->tq_flags &= ~TQ_FLAGS_ACTIVE; gtaskqueue_terminate(queue->tq_threads, queue); - KASSERT(TAILQ_EMPTY(&queue->tq_active), ("Tasks still running?")); + KASSERT(LIST_EMPTY(&queue->tq_active), ("Tasks still running?")); KASSERT(queue->tq_callouts == 0, ("Armed timeout tasks")); mtx_destroy(&queue->tq_mutex); free(queue->tq_threads, M_GTASKQUEUE); @@ -285,7 +284,7 @@ gtaskqueue_drain_tq_queue(struct gtaskqueue *queue) * have completed or are currently executing. */ while (t_barrier.ta_flags & TASK_ENQUEUED) - TQ_SLEEP(queue, &t_barrier, &queue->tq_mutex, PWAIT, "-", 0); + TQ_SLEEP(queue, &t_barrier, "gtq_qdrain"); } /* @@ -296,32 +295,25 @@ gtaskqueue_drain_tq_queue(struct gtaskqueue *queue) static void gtaskqueue_drain_tq_active(struct gtaskqueue *queue) { - struct gtaskqueue_busy tb_marker, *tb_first; + struct gtaskqueue_busy *tb; + u_int seq; - if (TAILQ_EMPTY(&queue->tq_active)) + if (LIST_EMPTY(&queue->tq_active)) return; /* Block taskq_terminate().*/ queue->tq_callouts++; - /* - * Wait for all currently executing taskqueue threads - * to go idle. - */ - tb_marker.tb_running = TB_DRAIN_WAITER; - TAILQ_INSERT_TAIL(&queue->tq_active, &tb_marker, tb_link); - while (TAILQ_FIRST(&queue->tq_active) != &tb_marker) - TQ_SLEEP(queue, &tb_marker, &queue->tq_mutex, PWAIT, "-", 0); - TAILQ_REMOVE(&queue->tq_active, &tb_marker, tb_link); + /* Wait for any active task with sequence from the past. */ + seq = queue->tq_seq; +restart: + LIST_FOREACH(tb, &queue->tq_active, tb_link) { + if ((int)(tb->tb_seq - seq) <= 0) { + TQ_SLEEP(queue, tb->tb_running, "gtq_adrain"); + goto restart; + } + } - /* - * Wakeup any other drain waiter that happened to queue up - * without any intervening active thread. - */ - tb_first = TAILQ_FIRST(&queue->tq_active); - if (tb_first != NULL && tb_first->tb_running == TB_DRAIN_WAITER) - wakeup(tb_first); - /* Release taskqueue_terminate(). */ queue->tq_callouts--; if ((queue->tq_flags & TQ_FLAGS_ACTIVE) == 0) @@ -352,40 +344,27 @@ static void gtaskqueue_run_locked(struct gtaskqueue *queue) { struct gtaskqueue_busy tb; - struct gtaskqueue_busy *tb_first; struct gtask *gtask; KASSERT(queue != NULL, ("tq is NULL")); TQ_ASSERT_LOCKED(queue); tb.tb_running = NULL; + LIST_INSERT_HEAD(&queue->tq_active, &tb, tb_link); - while (STAILQ_FIRST(&queue->tq_queue)) { - TAILQ_INSERT_TAIL(&queue->tq_active, &tb, tb_link); - - /* - * Carefully remove the first task from the queue and - * clear its TASK_ENQUEUED flag - */ - gtask = STAILQ_FIRST(&queue->tq_queue); - KASSERT(gtask != NULL, ("task is NULL")); + while ((gtask = STAILQ_FIRST(&queue->tq_queue)) != NULL) { STAILQ_REMOVE_HEAD(&queue->tq_queue, ta_link); gtask->ta_flags &= ~TASK_ENQUEUED; tb.tb_running = gtask; + tb.tb_seq = ++queue->tq_seq; TQ_UNLOCK(queue); KASSERT(gtask->ta_func != NULL, ("task->ta_func is NULL")); gtask->ta_func(gtask->ta_context); TQ_LOCK(queue); - tb.tb_running = NULL; wakeup(gtask); - - TAILQ_REMOVE(&queue->tq_active, &tb, tb_link); - tb_first = TAILQ_FIRST(&queue->tq_active); - if (tb_first != NULL && - tb_first->tb_running == TB_DRAIN_WAITER) - wakeup(tb_first); } + LIST_REMOVE(&tb, tb_link); } static int @@ -394,7 +373,7 @@ task_is_running(struct gtaskqueue *queue, struct gtask struct gtaskqueue_busy *tb; TQ_ASSERT_LOCKED(queue); - TAILQ_FOREACH(tb, &queue->tq_active, tb_link) { + LIST_FOREACH(tb, &queue->tq_active, tb_link) { if (tb->tb_running == gtask) return (1); } @@ -427,7 +406,7 @@ 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); + TQ_SLEEP(queue, gtask, "gtq_drain"); } void @@ -563,7 +542,7 @@ gtaskqueue_thread_loop(void *arg) */ if ((tq->tq_flags & TQ_FLAGS_ACTIVE) == 0) break; - TQ_SLEEP(tq, tq, &tq->tq_mutex, 0, "-", 0); + TQ_SLEEP(tq, tq, "-"); } gtaskqueue_run_locked(tq); /* @@ -589,7 +568,7 @@ gtaskqueue_thread_enqueue(void *context) tqp = context; tq = *tqp; - wakeup_one(tq); + wakeup_any(tq); } Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Fri Nov 1 21:26:43 2019 (r354240) +++ head/sys/kern/subr_taskqueue.c Fri Nov 1 22:49:44 2019 (r354241) @@ -56,24 +56,25 @@ static void taskqueue_swi_enqueue(void *); static void taskqueue_swi_giant_enqueue(void *); struct taskqueue_busy { - struct task *tb_running; - TAILQ_ENTRY(taskqueue_busy) tb_link; + struct task *tb_running; + u_int tb_seq; + LIST_ENTRY(taskqueue_busy) tb_link; }; -struct task * const TB_DRAIN_WAITER = (struct task *)0x1; - struct taskqueue { STAILQ_HEAD(, task) tq_queue; + LIST_HEAD(, taskqueue_busy) tq_active; + struct task *tq_hint; + u_int tq_seq; + int tq_callouts; + struct mtx_padalign tq_mutex; taskqueue_enqueue_fn tq_enqueue; void *tq_context; char *tq_name; - TAILQ_HEAD(, taskqueue_busy) tq_active; - struct mtx tq_mutex; struct thread **tq_threads; int tq_tcount; int tq_spin; int tq_flags; - int tq_callouts; taskqueue_callback_fn tq_callbacks[TASKQUEUE_NUM_CALLBACKS]; void *tq_cb_contexts[TASKQUEUE_NUM_CALLBACKS]; }; @@ -116,12 +117,11 @@ _timeout_task_init(struct taskqueue *queue, struct tim } static __inline int -TQ_SLEEP(struct taskqueue *tq, void *p, struct mtx *m, int pri, const char *wm, - int t) +TQ_SLEEP(struct taskqueue *tq, void *p, const char *wm) { if (tq->tq_spin) - return (msleep_spin(p, m, wm, t)); - return (msleep(p, m, pri, wm, t)); + return (msleep_spin(p, (struct mtx *)&tq->tq_mutex, wm, 0)); + return (msleep(p, &tq->tq_mutex, 0, wm, 0)); } static struct taskqueue * @@ -145,7 +145,7 @@ _taskqueue_create(const char *name, int mflags, snprintf(tq_name, TASKQUEUE_NAMELEN, "%s", (name) ? name : "taskqueue"); STAILQ_INIT(&queue->tq_queue); - TAILQ_INIT(&queue->tq_active); + LIST_INIT(&queue->tq_active); queue->tq_enqueue = enqueue; queue->tq_context = context; queue->tq_name = tq_name; @@ -196,7 +196,7 @@ taskqueue_terminate(struct thread **pp, struct taskque while (tq->tq_tcount > 0 || tq->tq_callouts > 0) { wakeup(tq); - TQ_SLEEP(tq, pp, &tq->tq_mutex, PWAIT, "taskqueue_destroy", 0); + TQ_SLEEP(tq, pp, "tq_destroy"); } } @@ -207,7 +207,7 @@ taskqueue_free(struct taskqueue *queue) TQ_LOCK(queue); queue->tq_flags &= ~TQ_FLAGS_ACTIVE; taskqueue_terminate(queue->tq_threads, queue); - KASSERT(TAILQ_EMPTY(&queue->tq_active), ("Tasks still running?")); + KASSERT(LIST_EMPTY(&queue->tq_active), ("Tasks still running?")); KASSERT(queue->tq_callouts == 0, ("Armed timeout tasks")); mtx_destroy(&queue->tq_mutex); free(queue->tq_threads, M_TASKQUEUE); @@ -233,21 +233,30 @@ taskqueue_enqueue_locked(struct taskqueue *queue, stru } /* - * Optimise the case when all tasks have the same priority. + * Optimise cases when all tasks use small set of priorities. + * In case of only one priority we always insert at the end. + * In case of two tq_hint typically gives the insertion point. + * In case of more then two tq_hint should halve the search. */ prev = STAILQ_LAST(&queue->tq_queue, task, ta_link); if (!prev || prev->ta_priority >= task->ta_priority) { STAILQ_INSERT_TAIL(&queue->tq_queue, task, ta_link); } else { - prev = NULL; - for (ins = STAILQ_FIRST(&queue->tq_queue); ins; - prev = ins, ins = STAILQ_NEXT(ins, ta_link)) + prev = queue->tq_hint; + if (prev && prev->ta_priority >= task->ta_priority) { + ins = STAILQ_NEXT(prev, ta_link); + } else { + prev = NULL; + ins = STAILQ_FIRST(&queue->tq_queue); + } + for (; ins; prev = ins, ins = STAILQ_NEXT(ins, ta_link)) if (ins->ta_priority < task->ta_priority) break; - if (prev) + if (prev) { STAILQ_INSERT_AFTER(&queue->tq_queue, prev, task, ta_link); - else + queue->tq_hint = task; + } else STAILQ_INSERT_HEAD(&queue->tq_queue, task, ta_link); } @@ -364,6 +373,7 @@ taskqueue_drain_tq_queue(struct taskqueue *queue) */ TASK_INIT(&t_barrier, USHRT_MAX, taskqueue_task_nop_fn, &t_barrier); STAILQ_INSERT_TAIL(&queue->tq_queue, &t_barrier, ta_link); + queue->tq_hint = &t_barrier; t_barrier.ta_pending = 1; /* @@ -371,7 +381,7 @@ taskqueue_drain_tq_queue(struct taskqueue *queue) * have completed or are currently executing. */ while (t_barrier.ta_pending != 0) - TQ_SLEEP(queue, &t_barrier, &queue->tq_mutex, PWAIT, "-", 0); + TQ_SLEEP(queue, &t_barrier, "tq_qdrain"); return (1); } @@ -383,32 +393,25 @@ taskqueue_drain_tq_queue(struct taskqueue *queue) static int taskqueue_drain_tq_active(struct taskqueue *queue) { - struct taskqueue_busy tb_marker, *tb_first; + struct taskqueue_busy *tb; + u_int seq; - if (TAILQ_EMPTY(&queue->tq_active)) + if (LIST_EMPTY(&queue->tq_active)) return (0); /* Block taskq_terminate().*/ queue->tq_callouts++; - /* - * Wait for all currently executing taskqueue threads - * to go idle. - */ - tb_marker.tb_running = TB_DRAIN_WAITER; - TAILQ_INSERT_TAIL(&queue->tq_active, &tb_marker, tb_link); - while (TAILQ_FIRST(&queue->tq_active) != &tb_marker) - TQ_SLEEP(queue, &tb_marker, &queue->tq_mutex, PWAIT, "-", 0); - TAILQ_REMOVE(&queue->tq_active, &tb_marker, tb_link); + /* Wait for any active task with sequence from the past. */ + seq = queue->tq_seq; +restart: + LIST_FOREACH(tb, &queue->tq_active, tb_link) { + if ((int)(tb->tb_seq - seq) <= 0) { + TQ_SLEEP(queue, tb->tb_running, "tq_adrain"); + goto restart; + } + } - /* - * Wakeup any other drain waiter that happened to queue up - * without any intervening active thread. - */ - tb_first = TAILQ_FIRST(&queue->tq_active); - if (tb_first != NULL && tb_first->tb_running == TB_DRAIN_WAITER) - wakeup(tb_first); - /* Release taskqueue_terminate(). */ queue->tq_callouts--; if ((queue->tq_flags & TQ_FLAGS_ACTIVE) == 0) @@ -440,42 +443,31 @@ static void taskqueue_run_locked(struct taskqueue *queue) { struct taskqueue_busy tb; - struct taskqueue_busy *tb_first; struct task *task; int pending; KASSERT(queue != NULL, ("tq is NULL")); TQ_ASSERT_LOCKED(queue); tb.tb_running = NULL; + LIST_INSERT_HEAD(&queue->tq_active, &tb, tb_link); - while (STAILQ_FIRST(&queue->tq_queue)) { - TAILQ_INSERT_TAIL(&queue->tq_active, &tb, tb_link); - - /* - * Carefully remove the first task from the queue and - * zero its pending count. - */ - task = STAILQ_FIRST(&queue->tq_queue); - KASSERT(task != NULL, ("task is NULL")); + while ((task = STAILQ_FIRST(&queue->tq_queue)) != NULL) { STAILQ_REMOVE_HEAD(&queue->tq_queue, ta_link); + if (queue->tq_hint == task) + queue->tq_hint = NULL; pending = task->ta_pending; task->ta_pending = 0; tb.tb_running = task; + tb.tb_seq = ++queue->tq_seq; TQ_UNLOCK(queue); KASSERT(task->ta_func != NULL, ("task->ta_func is NULL")); task->ta_func(task->ta_context, pending); TQ_LOCK(queue); - tb.tb_running = NULL; wakeup(task); - - TAILQ_REMOVE(&queue->tq_active, &tb, tb_link); - tb_first = TAILQ_FIRST(&queue->tq_active); - if (tb_first != NULL && - tb_first->tb_running == TB_DRAIN_WAITER) - wakeup(tb_first); } + LIST_REMOVE(&tb, tb_link); } void @@ -493,7 +485,7 @@ task_is_running(struct taskqueue *queue, struct task * struct taskqueue_busy *tb; TQ_ASSERT_LOCKED(queue); - TAILQ_FOREACH(tb, &queue->tq_active, tb_link) { + LIST_FOREACH(tb, &queue->tq_active, tb_link) { if (tb->tb_running == task) return (1); } @@ -522,8 +514,11 @@ taskqueue_cancel_locked(struct taskqueue *queue, struc u_int *pendp) { - if (task->ta_pending > 0) + if (task->ta_pending > 0) { STAILQ_REMOVE(&queue->tq_queue, task, task, ta_link); + if (queue->tq_hint == task) + queue->tq_hint = NULL; + } if (pendp != NULL) *pendp = task->ta_pending; task->ta_pending = 0; @@ -572,7 +567,7 @@ taskqueue_drain(struct taskqueue *queue, struct task * TQ_LOCK(queue); while (task->ta_pending != 0 || task_is_running(queue, task)) - TQ_SLEEP(queue, task, &queue->tq_mutex, PWAIT, "-", 0); + TQ_SLEEP(queue, task, "tq_drain"); TQ_UNLOCK(queue); } @@ -791,7 +786,7 @@ taskqueue_thread_loop(void *arg) */ if ((tq->tq_flags & TQ_FLAGS_ACTIVE) == 0) break; - TQ_SLEEP(tq, tq, &tq->tq_mutex, 0, "-", 0); + TQ_SLEEP(tq, tq, "-"); } taskqueue_run_locked(tq); /* From owner-svn-src-all@freebsd.org Sat Nov 2 02:05:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80C6C15C60F; Sat, 2 Nov 2019 02:05:10 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474j7V2rSZz428W; Sat, 2 Nov 2019 02:05: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 449B01C529; Sat, 2 Nov 2019 02:05:10 +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 xA225ADW016330; Sat, 2 Nov 2019 02:05:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA225AAZ016329; Sat, 2 Nov 2019 02:05:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201911020205.xA225AAZ016329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 2 Nov 2019 02:05:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354242 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 354242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 02:05:10 -0000 Author: imp Date: Sat Nov 2 02:05:09 2019 New Revision: 354242 URL: https://svnweb.freebsd.org/changeset/base/354242 Log: Make valdiate_rx_req_id static inline because it uses other static inline functions. gcc complains about this, most likely due to the subtle differences between inline and static inline functions defined in headers. Modified: head/sys/dev/ena/ena.h Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Fri Nov 1 22:49:44 2019 (r354241) +++ head/sys/dev/ena/ena.h Sat Nov 2 02:05:09 2019 (r354242) @@ -489,9 +489,8 @@ void ena_down(struct ena_adapter *); int ena_restore_device(struct ena_adapter *); void ena_destroy_device(struct ena_adapter *, bool); int ena_refill_rx_bufs(struct ena_ring *, uint32_t); -inline int validate_rx_req_id(struct ena_ring *, uint16_t); -inline int +static inline int validate_rx_req_id(struct ena_ring *rx_ring, uint16_t req_id) { if (likely(req_id < rx_ring->ring_size)) From owner-svn-src-all@freebsd.org Sat Nov 2 02:24:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DE6E15CF33; Sat, 2 Nov 2019 02:24:54 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474jZG0w0dz42s5; Sat, 2 Nov 2019 02:24:54 +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 F25731C8A6; Sat, 2 Nov 2019 02:24:53 +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 xA22Orpb028220; Sat, 2 Nov 2019 02:24:53 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA22OrFi028219; Sat, 2 Nov 2019 02:24:53 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201911020224.xA22OrFi028219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 2 Nov 2019 02:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354243 - 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: 354243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 02:24:54 -0000 Author: jhibbits Date: Sat Nov 2 02:24:53 2019 New Revision: 354243 URL: https://svnweb.freebsd.org/changeset/base/354243 Log: powerpc/mpc85xx: Set description for the MPC85xx RC bridge Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c Sat Nov 2 02:05:09 2019 (r354242) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c Sat Nov 2 02:24:53 2019 (r354243) @@ -92,6 +92,8 @@ fsl_pcib_rc_probe(device_t dev) if (pci_get_subclass(dev) != PCIS_PROCESSOR_POWERPC) return (ENXIO); + device_set_desc(dev, "MPC85xx Root Complex bridge"); + return (BUS_PROBE_DEFAULT); } From owner-svn-src-all@freebsd.org Sat Nov 2 03:09:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3843B15E954; Sat, 2 Nov 2019 03:09:18 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474kYV0ksQz45FZ; Sat, 2 Nov 2019 03:09:18 +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 F1A721D084; Sat, 2 Nov 2019 03:09:17 +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 xA239HgZ053135; Sat, 2 Nov 2019 03:09:17 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA239HH2053134; Sat, 2 Nov 2019 03:09:17 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911020309.xA239HH2053134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sat, 2 Nov 2019 03:09:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354244 - head/sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netgraph X-SVN-Commit-Revision: 354244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 03:09:18 -0000 Author: glebius Date: Sat Nov 2 03:09:17 2019 New Revision: 354244 URL: https://svnweb.freebsd.org/changeset/base/354244 Log: Fix regression from r353026. Pointer was increased instead of value pointed to. PR: 241646 Submitted by: Aleksandr Fedorov Modified: head/sys/netgraph/ng_bridge.c Modified: head/sys/netgraph/ng_bridge.c ============================================================================== --- head/sys/netgraph/ng_bridge.c Sat Nov 2 02:24:53 2019 (r354243) +++ head/sys/netgraph/ng_bridge.c Sat Nov 2 03:09:17 2019 (r354244) @@ -977,7 +977,7 @@ ng_bridge_unmute(hook_p hook, void *arg) ng_bridge_nodename(node), NG_HOOK_NAME(hook)); } } - counter++; + (*counter)++; return (1); } From owner-svn-src-all@freebsd.org Sat Nov 2 03:38:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DF9615FC51; Sat, 2 Nov 2019 03:38:00 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474lBc0TvKz477M; Sat, 2 Nov 2019 03:38:00 +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 E84281D602; Sat, 2 Nov 2019 03:37:59 +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 xA23bxLo070873; Sat, 2 Nov 2019 03:37:59 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA23bw40070867; Sat, 2 Nov 2019 03:37:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201911020337.xA23bw40070867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 2 Nov 2019 03:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354245 - in head/stand: . common liblua lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/stand: . common liblua lua X-SVN-Commit-Revision: 354245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 03:38:00 -0000 Author: kevans Date: Sat Nov 2 03:37:58 2019 New Revision: 354245 URL: https://svnweb.freebsd.org/changeset/base/354245 Log: stand: consolidate knowledge of lua path Multiple places coordinate to 'know' where lua scripts are installed. Knock this down to being formally defined (and overridable) in exactly one spot, defs.mk, and spread the knowledge to loaders and liblua alike. A future commit will expose this to lua as loader.lua_path, so it can build absolute paths to lua scripts as needed. MFC after: 1 week Modified: head/stand/common/interp_lua.c head/stand/defs.mk head/stand/liblua/Makefile head/stand/liblua/luaconf.h head/stand/loader.mk head/stand/lua/Makefile Modified: head/stand/common/interp_lua.c ============================================================================== --- head/stand/common/interp_lua.c Sat Nov 2 03:09:17 2019 (r354244) +++ head/stand/common/interp_lua.c Sat Nov 2 03:37:58 2019 (r354245) @@ -60,6 +60,8 @@ static struct interp_lua_softc lua_softc; #define LDBG(...) #endif +#define LOADER_LUA LUA_PATH "/loader.lua" + INTERP_DEFINE("lua"); static void * @@ -120,7 +122,7 @@ interp_init(void) lua_pop(luap, 1); /* remove lib */ } - filename = "/boot/lua/loader.lua"; + filename = LOADER_LUA; if (interp_include(filename) != 0) { const char *errstr = lua_tostring(luap, -1); errstr = errstr == NULL ? "unknown" : errstr; Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Sat Nov 2 03:09:17 2019 (r354244) +++ head/stand/defs.mk Sat Nov 2 03:37:58 2019 (r354245) @@ -40,6 +40,9 @@ BOOTOBJ= ${OBJTOP}/stand # BINDIR is where we install BINDIR?= /boot +# LUAPATH is where we search for and install lua scripts. +LUAPATH?= /boot/lua + LIBSA= ${BOOTOBJ}/libsa/libsa.a .if ${MACHINE} == "i386" LIBSA32= ${LIBSA} Modified: head/stand/liblua/Makefile ============================================================================== --- head/stand/liblua/Makefile Sat Nov 2 03:09:17 2019 (r354244) +++ head/stand/liblua/Makefile Sat Nov 2 03:37:58 2019 (r354245) @@ -27,7 +27,7 @@ SRCS+= lerrno.c lfs.c lstd.c lutils.c WARNS= 3 -CFLAGS+= -DLUA_PATH_DEFAULT=\"/boot/lua/\?.lua\" +CFLAGS+= -DLUA_PATH=\"${LUAPATH}\" -DLUA_PATH_DEFAULT=\"${LUAPATH}/\?.lua\" CFLAGS+= -ffreestanding -nostdlib -DLUA_USE_POSIX CFLAGS+= -fno-stack-protector -D__BSD_VISIBLE CFLAGS+= -I${BOOTSRC}/include -I${LIBLUASRC} -I${LUASRC} -I${LDRSRC} Modified: head/stand/liblua/luaconf.h ============================================================================== --- head/stand/liblua/luaconf.h Sat Nov 2 03:09:17 2019 (r354244) +++ head/stand/liblua/luaconf.h Sat Nov 2 03:37:58 2019 (r354245) @@ -202,7 +202,7 @@ #else /* }{ */ -#define LUA_ROOT "/boot/lua/" LUA_VDIR "/" +#define LUA_ROOT LUA_PATH "/" LUA_VDIR "/" #define LUA_LDIR LUA_ROOT "share/" #define LUA_CDIR LUA_ROOT "lib/" #ifndef LUA_PATH_DEFAULT Modified: head/stand/loader.mk ============================================================================== --- head/stand/loader.mk Sat Nov 2 03:09:17 2019 (r354244) +++ head/stand/loader.mk Sat Nov 2 03:37:58 2019 (r354245) @@ -62,6 +62,7 @@ SRCS+= interp_lua.c .include "${BOOTSRC}/lua.mk" LDR_INTERP= ${LIBLUA} LDR_INTERP32= ${LIBLUA32} +CFLAGS+= -DLUA_PATH=\"${LUAPATH}\" .elif ${LOADER_INTERP} == "4th" SRCS+= interp_forth.c .include "${BOOTSRC}/ficl.mk" Modified: head/stand/lua/Makefile ============================================================================== --- head/stand/lua/Makefile Sat Nov 2 03:09:17 2019 (r354244) +++ head/stand/lua/Makefile Sat Nov 2 03:37:58 2019 (r354245) @@ -12,7 +12,7 @@ MAN= cli.lua.8 \ password.lua.8 \ screen.lua.8 -FILESDIR= /boot/lua +FILESDIR= ${LUAPATH} FILES= cli.lua \ color.lua \ config.lua \ From owner-svn-src-all@freebsd.org Sat Nov 2 03:41:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8091015FF5B; Sat, 2 Nov 2019 03:41: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474lGg2rwGz47Y9; Sat, 2 Nov 2019 03:41: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 462F61D658; Sat, 2 Nov 2019 03:41: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 xA23fVbo074261; Sat, 2 Nov 2019 03:41:31 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA23fVsW074260; Sat, 2 Nov 2019 03:41:31 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201911020341.xA23fVsW074260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 2 Nov 2019 03:41:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354246 - head/stand/liblua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/liblua X-SVN-Commit-Revision: 354246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 03:41:31 -0000 Author: kevans Date: Sat Nov 2 03:41:30 2019 New Revision: 354246 URL: https://svnweb.freebsd.org/changeset/base/354246 Log: liblua: add loader.lua_path As described previously, loader.lua_path is absolute path where scripts are installed. A future commit will use this to build paths for dofile in try_include, rather than the current pcall/require setup that makes it more difficult to coordinate loader aborts from local.lua -- we do not need the flexibility of require(), and local.lua is in-fact not a 'module-like' file as we will not be referencing anything from it. Modified: head/stand/liblua/lutils.c Modified: head/stand/liblua/lutils.c ============================================================================== --- head/stand/liblua/lutils.c Sat Nov 2 03:37:58 2019 (r354245) +++ head/stand/liblua/lutils.c Sat Nov 2 03:41:30 2019 (r354246) @@ -384,6 +384,8 @@ luaopen_loader(lua_State *L) lua_setfield(L, -2, "machine"); lua_pushstring(L, MACHINE_ARCH); lua_setfield(L, -2, "machine_arch"); + lua_pushstring(L, LUA_PATH); + lua_setfield(L, -2, "lua_path"); /* Set global printc to loader.printc */ lua_register(L, "printc", lua_printc); return 1; From owner-svn-src-all@freebsd.org Sat Nov 2 04:01:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA3C816066B; Sat, 2 Nov 2019 04:01:39 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474ljv4yzmz48Hj; Sat, 2 Nov 2019 04:01:39 +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 74FAB1D9F3; Sat, 2 Nov 2019 04:01:39 +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 xA241du6088287; Sat, 2 Nov 2019 04:01:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA241dtl088286; Sat, 2 Nov 2019 04:01:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201911020401.xA241dtl088286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 2 Nov 2019 04:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354247 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 354247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 04:01:39 -0000 Author: kevans Date: Sat Nov 2 04:01:39 2019 New Revision: 354247 URL: https://svnweb.freebsd.org/changeset/base/354247 Log: lualoader: rewrite try_include using lfs + dofile Actual modules get require()'d in, rather than try_include(). All instances of try_include should be provided with proper hooks/API in the rest of loader to do the work they need to do, since we can't rely on them to exist. Convert this now to lfs + dofile since we won't really be treating them as modules. lfs is required because dofile will properly throw an error if the file doesn't exist, which is not in the spirit of 'optionally included'. Getting out of the pcall game allows us to provide a loader.exit() style call that backs out to the common bits of loader (autoboot sequence unless disabled with a loader.setenv("autoboot_delay", "NO")). The most ideal way identified so far to implement loader.exit() is to throw a special abort-style error that indicates to the caller in interp_lua that we've not actually errored out, just continue execution. Otherwise, we have to hack in logic to bubble up and return from loader.lua without continuing further, which gets kind of ugly depending on the context in which we're aborting. A compat shim is provided temporarily in case the executing loader doesn't yet have loader.lua_path, which was just added in r354246. Modified: head/stand/lua/core.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Sat Nov 2 03:41:30 2019 (r354246) +++ head/stand/lua/core.lua Sat Nov 2 04:01:39 2019 (r354247) @@ -69,12 +69,28 @@ end -- 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 + if module:sub(1, 1) ~= "/" then + local lua_path = loader.lua_paths + -- XXX Temporary compat shim; this should be removed once the + -- loader.lua_path export has sufficiently spread. + if lua_path == nil then + lua_path = "/boot/lua" + end + module = lua_path .. "/" .. module + -- We only attempt to append an extension if an absolute path + -- wasn't specified. This assumes that the caller either wants + -- to treat this like it would require() and specify just the + -- base filename, or they know what they're doing as they've + -- specified an absolute path and we shouldn't impede. + if module:match(".lua$") == nil then + module = module .. ".lua" + end end - return false, ret + if lfs.attributes(module, "mode") ~= "file" then + return + end + + return dofile(module) end -- Module exports From owner-svn-src-all@freebsd.org Sat Nov 2 09:22:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EDD317C46B; Sat, 2 Nov 2019 09:22:21 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474tqx0VSCz4PTb; Sat, 2 Nov 2019 09:22:21 +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 E8829214BE; Sat, 2 Nov 2019 09:22:20 +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 xA29MKkv075006; Sat, 2 Nov 2019 09:22:20 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA29MKij075005; Sat, 2 Nov 2019 09:22:20 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911020922.xA29MKij075005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 2 Nov 2019 09:22: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: r354248 - stable/12/stand/libsa/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: stable/12/stand/libsa/zfs X-SVN-Commit-Revision: 354248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 09:22:21 -0000 Author: tsoome Date: Sat Nov 2 09:22:20 2019 New Revision: 354248 URL: https://svnweb.freebsd.org/changeset/base/354248 Log: MFC r354119: loader: rs_alloc() may return NULL rs_alloc() in zfs reader code may return NULL, so we need to check the return value and error out if needed. Modified: stable/12/stand/libsa/zfs/zfsimpl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/libsa/zfs/zfsimpl.c ============================================================================== --- stable/12/stand/libsa/zfs/zfsimpl.c Sat Nov 2 04:01:39 2019 (r354247) +++ stable/12/stand/libsa/zfs/zfsimpl.c Sat Nov 2 09:22:20 2019 (r354248) @@ -840,12 +840,17 @@ vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint6 list_t stack; spa_t *spa = vd->spa; zio_t *zio = arg; + remap_segment_t *rs; list_create(&stack, sizeof (remap_segment_t), offsetof(remap_segment_t, rs_node)); - for (remap_segment_t *rs = rs_alloc(vd, offset, asize, 0); - rs != NULL; rs = list_remove_head(&stack)) { + rs = rs_alloc(vd, offset, asize, 0); + if (rs == NULL) { + printf("vdev_indirect_remap: out of memory.\n"); + zio->io_error = ENOMEM; + } + for ( ; rs != NULL; rs = list_remove_head(&stack)) { vdev_t *v = rs->rs_vd; uint64_t num_entries = 0; /* vdev_indirect_mapping_t *vim = v->v_mapping; */ @@ -853,6 +858,9 @@ vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint6 vdev_indirect_mapping_duplicate_adjacent_entries(v, rs->rs_offset, rs->rs_asize, &num_entries); + if (num_entries == 0) + zio->io_error = ENOMEM; + for (uint64_t i = 0; i < num_entries; i++) { vdev_indirect_mapping_entry_phys_t *m = &mapping[i]; uint64_t size = DVA_GET_ASIZE(&m->vimep_dst); @@ -865,9 +873,18 @@ vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint6 vdev_t *dst_v = vdev_lookup_top(spa, dst_vdev); if (dst_v->v_read == vdev_indirect_read) { - list_insert_head(&stack, - rs_alloc(dst_v, dst_offset + inner_offset, - inner_size, rs->rs_split_offset)); + remap_segment_t *o; + + o = rs_alloc(dst_v, dst_offset + inner_offset, + inner_size, rs->rs_split_offset); + if (o == NULL) { + printf("vdev_indirect_remap: " + "out of memory.\n"); + zio->io_error = ENOMEM; + break; + } + + list_insert_head(&stack, o); } vdev_indirect_gather_splits(rs->rs_split_offset, dst_v, dst_offset + inner_offset, From owner-svn-src-all@freebsd.org Sat Nov 2 09:50:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 789FE17D202; Sat, 2 Nov 2019 09:50:37 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474vSY3Nj5z4Qdj; Sat, 2 Nov 2019 09:50:37 +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 587B321879; Sat, 2 Nov 2019 09:50:37 +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 xA29ob1I089333; Sat, 2 Nov 2019 09:50:37 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA29oaKU089330; Sat, 2 Nov 2019 09:50:36 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911020950.xA29oaKU089330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 2 Nov 2019 09:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354249 - in head/stand/efi: include libefi loader X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/stand/efi: include libefi loader X-SVN-Commit-Revision: 354249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 09:50:37 -0000 Author: tsoome Date: Sat Nov 2 09:50:36 2019 New Revision: 354249 URL: https://svnweb.freebsd.org/changeset/base/354249 Log: loader: fall back to term_emu on efi console with serial backend In case of efi console having serial backend (video + serial or only serial), we need to stick with old emulator till we can draw console. Eventually we would need to get console terminal emulator to be removed from serial console because the serial link already has the terminal. However, we need to implement comconsole on all efi platforms first, then we need the ability to draw console, so we do not have to use SimpleTextOutput protocol (which will write both on video and serial in case of multiplexed ComOut). Differential Revision: https://reviews.freebsd.org/D22161 Modified: head/stand/efi/include/efilib.h head/stand/efi/libefi/Makefile head/stand/efi/libefi/efi_console.c head/stand/efi/loader/main.c Modified: head/stand/efi/include/efilib.h ============================================================================== --- head/stand/efi/include/efilib.h Sat Nov 2 09:22:20 2019 (r354248) +++ head/stand/efi/include/efilib.h Sat Nov 2 09:50:36 2019 (r354249) @@ -106,6 +106,7 @@ EFI_STATUS errno_to_efi_status(int errno); void efi_time_init(void); void efi_time_fini(void); +int parse_uefi_con_out(void); bool efi_cons_update_mode(void); EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab); Modified: head/stand/efi/libefi/Makefile ============================================================================== --- head/stand/efi/libefi/Makefile Sat Nov 2 09:22:20 2019 (r354248) +++ head/stand/efi/libefi/Makefile Sat Nov 2 09:50:36 2019 (r354249) @@ -61,4 +61,9 @@ CFLAGS+= -I${LDRSRC} # Handle FreeBSD specific %b and %D printf format specifiers CFLAGS+= ${FORMAT_EXTENSIONS} +# Do not use TERM_EMU on arm and arm64 as it doesn't behave well with serial console +.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "aarch64" +CFLAGS+= -DTERM_EMU +.endif + .include Modified: head/stand/efi/libefi/efi_console.c ============================================================================== --- head/stand/efi/libefi/efi_console.c Sat Nov 2 09:22:20 2019 (r354248) +++ head/stand/efi/libefi/efi_console.c Sat Nov 2 09:50:36 2019 (r354249) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bootstrap.h" @@ -38,6 +39,26 @@ static SIMPLE_TEXT_OUTPUT_INTERFACE *conout; static SIMPLE_INPUT_INTERFACE *conin; static EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *coninex; +static int mode; /* Does ConOut have serial console? */ + +static uint32_t utf8_left; +static uint32_t utf8_partial; +#ifdef TERM_EMU +#define DEFAULT_FGCOLOR EFI_LIGHTGRAY +#define DEFAULT_BGCOLOR EFI_BLACK + +#define MAXARGS 8 +static int args[MAXARGS], argc; +static int fg_c, bg_c, curx, cury; +static int esc; + +void get_pos(int *x, int *y); +void curs_move(int *_x, int *_y, int x, int y); +static void CL(int); +void HO(void); +void end_term(void); +#endif + static tf_bell_t efi_cons_bell; static tf_cursor_t efi_text_cursor; static tf_putchar_t efi_text_putchar; @@ -447,6 +468,340 @@ efi_set_colors(struct env_var *ev, int flags, const vo return (CMD_OK); } +#ifdef TERM_EMU +/* Get cursor position. */ +void +get_pos(int *x, int *y) +{ + *x = conout->Mode->CursorColumn; + *y = conout->Mode->CursorRow; +} + +/* Move cursor to x rows and y cols (0-based). */ +void +curs_move(int *_x, int *_y, int x, int y) +{ + conout->SetCursorPosition(conout, x, y); + if (_x != NULL) + *_x = conout->Mode->CursorColumn; + if (_y != NULL) + *_y = conout->Mode->CursorRow; +} + +/* Clear internal state of the terminal emulation code. */ +void +end_term(void) +{ + esc = 0; + argc = -1; +} +#endif + +static void +efi_cons_rawputchar(int c) +{ + int i; + UINTN x, y; + conout->QueryMode(conout, conout->Mode->Mode, &x, &y); + + if (c == '\t') { + int n; + + n = 8 - ((conout->Mode->CursorColumn + 8) % 8); + for (i = 0; i < n; i++) + efi_cons_rawputchar(' '); + } else { +#ifndef TERM_EMU + if (c == '\n') + efi_cons_efiputchar('\r'); + efi_cons_efiputchar(c); +#else + switch (c) { + case '\r': + curx = 0; + efi_cons_efiputchar('\r'); + return; + case '\n': + efi_cons_efiputchar('\n'); + efi_cons_efiputchar('\r'); + cury++; + if (cury >= y) + cury--; + curx = 0; + return; + case '\b': + if (curx > 0) { + efi_cons_efiputchar('\b'); + curx--; + } + return; + default: + efi_cons_efiputchar(c); + curx++; + if (curx > x-1) { + curx = 0; + cury++; + } + if (cury > y-1) { + curx = 0; + cury--; + } + } +#endif + } + conout->EnableCursor(conout, TRUE); +} + +#ifdef TERM_EMU +/* Gracefully exit ESC-sequence processing in case of misunderstanding. */ +static void +bail_out(int c) +{ + char buf[16], *ch; + int i; + + if (esc) { + efi_cons_rawputchar('\033'); + if (esc != '\033') + efi_cons_rawputchar(esc); + for (i = 0; i <= argc; ++i) { + sprintf(buf, "%d", args[i]); + ch = buf; + while (*ch) + efi_cons_rawputchar(*ch++); + } + } + efi_cons_rawputchar(c); + end_term(); +} + +/* Clear display from current position to end of screen. */ +static void +CD(void) +{ + int i; + UINTN x, y; + + get_pos(&curx, &cury); + if (curx == 0 && cury == 0) { + conout->ClearScreen(conout); + end_term(); + return; + } + + conout->QueryMode(conout, conout->Mode->Mode, &x, &y); + CL(0); /* clear current line from cursor to end */ + for (i = cury + 1; i < y-1; i++) { + curs_move(NULL, NULL, 0, i); + CL(0); + } + curs_move(NULL, NULL, curx, cury); + end_term(); +} + +/* + * Absolute cursor move to args[0] rows and args[1] columns + * (the coordinates are 1-based). + */ +static void +CM(void) +{ + if (args[0] > 0) + args[0]--; + if (args[1] > 0) + args[1]--; + curs_move(&curx, &cury, args[1], args[0]); + end_term(); +} + +/* Home cursor (left top corner), also called from mode command. */ +void +HO(void) +{ + argc = 1; + args[0] = args[1] = 1; + CM(); +} + +/* Clear line from current position to end of line */ +static void +CL(int direction) +{ + int i, len; + UINTN x, y; + CHAR16 *line; + + conout->QueryMode(conout, conout->Mode->Mode, &x, &y); + switch (direction) { + case 0: /* from cursor to end */ + len = x - curx + 1; + break; + case 1: /* from beginning to cursor */ + len = curx; + break; + case 2: /* entire line */ + len = x; + break; + default: /* NOTREACHED */ + __unreachable(); + } + + if (cury == y - 1) + len--; + + line = malloc(len * sizeof (CHAR16)); + if (line == NULL) { + printf("out of memory\n"); + return; + } + for (i = 0; i < len; i++) + line[i] = ' '; + line[len-1] = 0; + + if (direction != 0) + curs_move(NULL, NULL, 0, cury); + + conout->OutputString(conout, line); + /* restore cursor position */ + curs_move(NULL, NULL, curx, cury); + free(line); + end_term(); +} + +static void +get_arg(int c) +{ + if (argc < 0) + argc = 0; + args[argc] *= 10; + args[argc] += c - '0'; +} +#endif + +/* Emulate basic capabilities of cons25 terminal */ +static void +efi_term_emu(int c) +{ +#ifdef TERM_EMU + static int ansi_col[] = { + 0, 4, 2, 6, 1, 5, 3, 7 + }; + int t, i; + EFI_STATUS status; + + switch (esc) { + case 0: + switch (c) { + case '\033': + esc = c; + break; + default: + efi_cons_rawputchar(c); + break; + } + break; + case '\033': + switch (c) { + case '[': + esc = c; + args[0] = 0; + argc = -1; + break; + default: + bail_out(c); + break; + } + break; + case '[': + switch (c) { + case ';': + if (argc < 0) + argc = 0; + else if (argc + 1 >= MAXARGS) + bail_out(c); + else + args[++argc] = 0; + break; + case 'H': /* ho = \E[H */ + if (argc < 0) + HO(); + else if (argc == 1) + CM(); + else + bail_out(c); + break; + case 'J': /* cd = \E[J */ + if (argc < 0) + CD(); + else + bail_out(c); + break; + case 'm': + if (argc < 0) { + fg_c = DEFAULT_FGCOLOR; + bg_c = DEFAULT_BGCOLOR; + } + for (i = 0; i <= argc; ++i) { + switch (args[i]) { + case 0: /* back to normal */ + fg_c = DEFAULT_FGCOLOR; + bg_c = DEFAULT_BGCOLOR; + break; + case 1: /* bold */ + fg_c |= 0x8; + break; + case 4: /* underline */ + case 5: /* blink */ + bg_c |= 0x8; + break; + case 7: /* reverse */ + t = fg_c; + fg_c = bg_c; + bg_c = t; + break; + case 22: /* normal intensity */ + fg_c &= ~0x8; + break; + case 24: /* not underline */ + case 25: /* not blinking */ + bg_c &= ~0x8; + break; + case 30: case 31: case 32: case 33: + case 34: case 35: case 36: case 37: + fg_c = ansi_col[args[i] - 30]; + break; + case 39: /* normal */ + fg_c = DEFAULT_FGCOLOR; + break; + case 40: case 41: case 42: case 43: + case 44: case 45: case 46: case 47: + bg_c = ansi_col[args[i] - 40]; + break; + case 49: /* normal */ + bg_c = DEFAULT_BGCOLOR; + break; + } + } + conout->SetAttribute(conout, EFI_TEXT_ATTR(fg_c, bg_c)); + end_term(); + break; + default: + if (isdigit(c)) + get_arg(c); + else + bail_out(c); + break; + } + break; + default: + bail_out(c); + break; + } +#else + efi_cons_rawputchar(c); +#endif +} + bool efi_cons_update_mode(void) { @@ -461,35 +816,58 @@ efi_cons_update_mode(void) rows = 24; } - if (buffer != NULL) { - if (tp.tp_row == rows && tp.tp_col == cols) - return (true); - free(buffer); - } else { - teken_init(&teken, &tf, NULL); - } + /* + * When we have serial port listed in ConOut, use pre-teken emulator, + * if built with. + * The problem is, we can not output text on efi and comconsole when + * efi also has comconsole bound. But then again, we need to have + * terminal emulator for efi text mode to support the menu. + * While teken is too expensive to be used on serial console, the + * pre-teken emulator is light enough to be used on serial console. + */ + mode = parse_uefi_con_out(); + if ((mode & RB_SERIAL) == 0) { + if (buffer != NULL) { + if (tp.tp_row == rows && tp.tp_col == cols) + return (true); + free(buffer); + } else { + teken_init(&teken, &tf, NULL); + } - tp.tp_row = rows; - tp.tp_col = cols; - buffer = malloc(rows * cols * sizeof(*buffer)); - if (buffer == NULL) - return (false); + tp.tp_row = rows; + tp.tp_col = cols; + buffer = malloc(rows * cols * sizeof(*buffer)); + if (buffer == NULL) + return (false); - teken_set_winsize(&teken, &tp); - a = teken_get_defattr(&teken); + teken_set_winsize(&teken, &tp); + a = teken_get_defattr(&teken); - snprintf(env, sizeof(env), "%d", a->ta_fgcolor); - env_setenv("teken.fg_color", EV_VOLATILE, env, efi_set_colors, - env_nounset); - snprintf(env, sizeof(env), "%d", a->ta_bgcolor); - env_setenv("teken.bg_color", EV_VOLATILE, env, efi_set_colors, - env_nounset); + snprintf(env, sizeof(env), "%d", a->ta_fgcolor); + env_setenv("teken.fg_color", EV_VOLATILE, env, efi_set_colors, + env_nounset); + snprintf(env, sizeof(env), "%d", a->ta_bgcolor); + env_setenv("teken.bg_color", EV_VOLATILE, env, efi_set_colors, + env_nounset); - for (int row = 0; row < rows; row++) - for (int col = 0; col < cols; col++) { - buffer[col + row * tp.tp_col].c = ' '; - buffer[col + row * tp.tp_col].a = *a; + for (int row = 0; row < rows; row++) { + for (int col = 0; col < cols; col++) { + buffer[col + row * tp.tp_col].c = ' '; + buffer[col + row * tp.tp_col].a = *a; + } } + } else { +#ifdef TERM_EMU + conout->SetAttribute(conout, EFI_TEXT_ATTR(DEFAULT_FGCOLOR, + DEFAULT_BGCOLOR)); + end_term(); + get_pos(&curx, &cury); + curs_move(&curx, &cury, curx, cury); + fg_c = DEFAULT_FGCOLOR; + bg_c = DEFAULT_BGCOLOR; +#endif + } snprintf(env, sizeof (env), "%u", (unsigned)rows); setenv("LINES", env, 1); @@ -522,10 +900,108 @@ efi_cons_init(int arg) return (1); } +static void +input_partial(void) +{ + unsigned i; + uint32_t c; + + if (utf8_left == 0) + return; + + for (i = 0; i < sizeof(utf8_partial); i++) { + c = (utf8_partial >> (24 - (i << 3))) & 0xff; + if (c != 0) + efi_term_emu(c); + } + utf8_left = 0; + utf8_partial = 0; +} + +static void +input_byte(uint8_t c) +{ + if ((c & 0x80) == 0x00) { + /* One-byte sequence. */ + input_partial(); + efi_term_emu(c); + return; + } + if ((c & 0xe0) == 0xc0) { + /* Two-byte sequence. */ + input_partial(); + utf8_left = 1; + utf8_partial = c; + return; + } + if ((c & 0xf0) == 0xe0) { + /* Three-byte sequence. */ + input_partial(); + utf8_left = 2; + utf8_partial = c; + return; + } + if ((c & 0xf8) == 0xf0) { + /* Four-byte sequence. */ + input_partial(); + utf8_left = 3; + utf8_partial = c; + return; + } + if ((c & 0xc0) == 0x80) { + /* Invalid state? */ + if (utf8_left == 0) { + efi_term_emu(c); + return; + } + utf8_left--; + utf8_partial = (utf8_partial << 8) | c; + if (utf8_left == 0) { + uint32_t v, u; + uint8_t b; + + v = 0; + u = utf8_partial; + b = (u >> 24) & 0xff; + if (b != 0) { /* Four-byte sequence */ + v = b & 0x07; + b = (u >> 16) & 0xff; + v = (v << 6) | (b & 0x3f); + b = (u >> 8) & 0xff; + v = (v << 6) | (b & 0x3f); + b = u & 0xff; + v = (v << 6) | (b & 0x3f); + } else if ((b = (u >> 16) & 0xff) != 0) { + v = b & 0x0f; /* Three-byte sequence */ + b = (u >> 8) & 0xff; + v = (v << 6) | (b & 0x3f); + b = u & 0xff; + v = (v << 6) | (b & 0x3f); + } else if ((b = (u >> 8) & 0xff) != 0) { + v = b & 0x1f; /* Two-byte sequence */ + b = u & 0xff; + v = (v << 6) | (b & 0x3f); + } + /* Send unicode char directly to console. */ + efi_cons_efiputchar(v); + utf8_partial = 0; + } + return; + } + /* Anything left is illegal in UTF-8 sequence. */ + input_partial(); + efi_term_emu(c); +} + void efi_cons_putchar(int c) { unsigned char ch = c; + + if ((mode & RB_SERIAL) != 0) { + input_byte(ch); + return; + } if (buffer != NULL) teken_input(&teken, &ch, sizeof (ch)); Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Sat Nov 2 09:22:20 2019 (r354248) +++ head/stand/efi/loader/main.c Sat Nov 2 09:50:36 2019 (r354249) @@ -688,7 +688,7 @@ setenv_int(const char *key, int val) * ACPI name space to map the UID for the serial port to a port. The * latter is especially hard. */ -static int +int parse_uefi_con_out(void) { int how, rv; From owner-svn-src-all@freebsd.org Sat Nov 2 10:14:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A32A17DD8C; Sat, 2 Nov 2019 10:14:16 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474vzq6Ts4z4Rmw; Sat, 2 Nov 2019 10:14:15 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C205521E0B; Sat, 2 Nov 2019 10:14:15 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA2AEF0B006799; Sat, 2 Nov 2019 10:14:15 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2AEFeY006798; Sat, 2 Nov 2019 10:14:15 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201911021014.xA2AEFeY006798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Sat, 2 Nov 2019 10:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354250 - head/tools/tools/gensnmpdef X-SVN-Group: head X-SVN-Commit-Author: phk X-SVN-Commit-Paths: head/tools/tools/gensnmpdef X-SVN-Commit-Revision: 354250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 10:14:16 -0000 Author: phk Date: Sat Nov 2 10:14:15 2019 New Revision: 354250 URL: https://svnweb.freebsd.org/changeset/base/354250 Log: Mention that ports/net-mgmt/libsmi is required Modified: head/tools/tools/gensnmpdef/Makefile Modified: head/tools/tools/gensnmpdef/Makefile ============================================================================== --- head/tools/tools/gensnmpdef/Makefile Sat Nov 2 09:50:36 2019 (r354249) +++ head/tools/tools/gensnmpdef/Makefile Sat Nov 2 10:14:15 2019 (r354250) @@ -1,4 +1,6 @@ # $FreeBSD$ +# +# NB: Install ports/net-mgmt/libsmi .PATH: ${SRCTOP}/contrib/bsnmp/gensnmpdef From owner-svn-src-all@freebsd.org Sat Nov 2 10:15:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 10A3417DE6E; Sat, 2 Nov 2019 10:15:35 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474w1L6kncz4RwD; Sat, 2 Nov 2019 10:15:34 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA99E21E11; Sat, 2 Nov 2019 10:15:34 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA2AFYO0006912; Sat, 2 Nov 2019 10:15:34 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2AFY8t006911; Sat, 2 Nov 2019 10:15:34 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201911021015.xA2AFY8t006911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Sat, 2 Nov 2019 10:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354251 - head/tools/tools/nanobsd X-SVN-Group: head X-SVN-Commit-Author: phk X-SVN-Commit-Paths: head/tools/tools/nanobsd X-SVN-Commit-Revision: 354251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 10:15:35 -0000 Author: phk Date: Sat Nov 2 10:15:34 2019 New Revision: 354251 URL: https://svnweb.freebsd.org/changeset/base/354251 Log: If /usr/obj is a symlink, cpio(1) needs persuation to DTRT. Modified: head/tools/tools/nanobsd/defaults.sh Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Sat Nov 2 10:14:15 2019 (r354250) +++ head/tools/tools/nanobsd/defaults.sh Sat Nov 2 10:15:34 2019 (r354251) @@ -193,6 +193,9 @@ NANO_DATADIR="" SRCCONF=/dev/null SRC_ENV_CONF=/dev/null +# Comment this out if /usr/obj is a symlink +# CPIO_SYMLINK=--insecure + ####################################################################### # # The functions which do the real work. @@ -523,7 +526,7 @@ setup_nanobsd ( ) ( if [ -d usr/local/etc ] ; then ( cd usr/local/etc - find . -print | cpio -dumpl ../../../etc/local + find . -print | cpio ${CPIO_SYMLINK} -dumpl ../../../etc/local cd .. rm -xrf etc ) @@ -542,7 +545,7 @@ setup_nanobsd ( ) ( # we use hard links so we have them both places. # the files in /$d will be hidden by the mount. mkdir -p conf/base/$d conf/default/$d - find $d -print | cpio -dumpl conf/base/ + find $d -print | cpio ${CPIO_SYMLINK} -dumpl conf/base/ done echo "$NANO_RAM_ETCSIZE" > conf/base/etc/md_size @@ -623,7 +626,7 @@ populate_slice ( ) ( if [ -n "${dir}" -a -d "${dir}" ]; then echo "Populating ${lbl} from ${dir}" cd "${dir}" - find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)/' | cpio -dumpv ${mnt} + find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)/' | cpio ${CPIO_SYMLINK} -dumpv ${mnt} fi df -i ${mnt} nano_umount ${mnt} @@ -731,7 +734,7 @@ cust_allow_ssh_root ( ) ( cust_install_files ( ) ( cd "${NANO_TOOLS}/Files" - find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)/' | cpio -Ldumpv ${NANO_WORLDDIR} + find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)/' | cpio ${CPIO_SYMLINK} -Ldumpv ${NANO_WORLDDIR} if [ -n "${NANO_CUST_FILES_MTREE}" -a -f ${NANO_CUST_FILES_MTREE} ]; then CR "mtree -eiU -p /" <${NANO_CUST_FILES_MTREE} From owner-svn-src-all@freebsd.org Sat Nov 2 10:53:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BCDEA17F0B9; Sat, 2 Nov 2019 10:53:23 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474wrz4gSmz4TjP; Sat, 2 Nov 2019 10:53:23 +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 845742254B; Sat, 2 Nov 2019 10:53:23 +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 xA2ArNcj030348; Sat, 2 Nov 2019 10:53:23 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2ArNHj030347; Sat, 2 Nov 2019 10:53:23 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911021053.xA2ArNHj030347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 2 Nov 2019 10:53:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354252 - 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: 354252 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 10:53:23 -0000 Author: tsoome Date: Sat Nov 2 10:53:23 2019 New Revision: 354252 URL: https://svnweb.freebsd.org/changeset/base/354252 Log: loader: libi386/comconsole.c cstyle cleanup Only cstyle, no functional changes. Modified: head/stand/i386/libi386/comconsole.c Modified: head/stand/i386/libi386/comconsole.c ============================================================================== --- head/stand/i386/libi386/comconsole.c Sat Nov 2 10:15:34 2019 (r354251) +++ head/stand/i386/libi386/comconsole.c Sat Nov 2 10:53:23 2019 (r354252) @@ -67,144 +67,144 @@ static int comc_port = COMPORT; static uint32_t comc_locator; struct console comconsole = { - "comconsole", - "serial port", - 0, - comc_probe, - comc_init, - comc_putchar, - comc_getchar, - comc_ischar + .c_name = "comconsole", + .c_desc = "serial port", + .c_flags = 0, + .c_probe = comc_probe, + .c_init = comc_init, + .c_out = comc_putchar, + .c_in = comc_getchar, + .c_ready = comc_ischar }; static void comc_probe(struct console *cp) { - char intbuf[16]; - char *cons, *env; - int speed, port; - uint32_t locator; + char intbuf[16]; + char *cons, *env; + int speed, port; + uint32_t locator; - if (comc_curspeed == 0) { - comc_curspeed = COMSPEED; - /* - * Assume that the speed was set by an earlier boot loader if - * comconsole is already the preferred console. - */ - cons = getenv("console"); - if ((cons != NULL && strcmp(cons, comconsole.c_name) == 0) || - getenv("boot_multicons") != NULL) { - comc_curspeed = comc_getspeed(); - } + if (comc_curspeed == 0) { + comc_curspeed = COMSPEED; + /* + * Assume that the speed was set by an earlier boot loader if + * comconsole is already the preferred console. + */ + cons = getenv("console"); + if ((cons != NULL && strcmp(cons, comconsole.c_name) == 0) || + getenv("boot_multicons") != NULL) { + comc_curspeed = comc_getspeed(); + } - env = getenv("comconsole_speed"); - if (env != NULL) { - speed = comc_parseint(env); - if (speed > 0) - comc_curspeed = speed; - } + env = getenv("comconsole_speed"); + if (env != NULL) { + speed = comc_parseint(env); + if (speed > 0) + comc_curspeed = speed; + } - sprintf(intbuf, "%d", comc_curspeed); - unsetenv("comconsole_speed"); - env_setenv("comconsole_speed", EV_VOLATILE, intbuf, comc_speed_set, - env_nounset); + sprintf(intbuf, "%d", comc_curspeed); + unsetenv("comconsole_speed"); + env_setenv("comconsole_speed", EV_VOLATILE, intbuf, + comc_speed_set, env_nounset); - env = getenv("comconsole_port"); - if (env != NULL) { - port = comc_parseint(env); - if (port > 0) - comc_port = port; - } + env = getenv("comconsole_port"); + if (env != NULL) { + port = comc_parseint(env); + if (port > 0) + comc_port = port; + } - sprintf(intbuf, "%d", comc_port); - unsetenv("comconsole_port"); - env_setenv("comconsole_port", EV_VOLATILE, intbuf, comc_port_set, - env_nounset); + sprintf(intbuf, "%d", comc_port); + unsetenv("comconsole_port"); + env_setenv("comconsole_port", EV_VOLATILE, intbuf, + comc_port_set, env_nounset); - env = getenv("comconsole_pcidev"); - if (env != NULL) { - locator = comc_parse_pcidev(env); - if (locator != 0) - comc_pcidev_handle(locator); - } + env = getenv("comconsole_pcidev"); + if (env != NULL) { + locator = comc_parse_pcidev(env); + if (locator != 0) + comc_pcidev_handle(locator); + } - unsetenv("comconsole_pcidev"); - env_setenv("comconsole_pcidev", EV_VOLATILE, env, comc_pcidev_set, - env_nounset); - } - comc_setup(comc_curspeed, comc_port); + unsetenv("comconsole_pcidev"); + env_setenv("comconsole_pcidev", EV_VOLATILE, env, + comc_pcidev_set, env_nounset); + } + comc_setup(comc_curspeed, comc_port); } static int comc_init(int arg) { - comc_setup(comc_curspeed, comc_port); + comc_setup(comc_curspeed, comc_port); - if ((comconsole.c_flags & (C_PRESENTIN | C_PRESENTOUT)) == - (C_PRESENTIN | C_PRESENTOUT)) - return (CMD_OK); - return (CMD_ERROR); + if ((comconsole.c_flags & (C_PRESENTIN | C_PRESENTOUT)) == + (C_PRESENTIN | C_PRESENTOUT)) + return (CMD_OK); + return (CMD_ERROR); } static void comc_putchar(int c) { - int wait; + int wait; - for (wait = COMC_TXWAIT; wait > 0; wait--) - if (inb(comc_port + com_lsr) & LSR_TXRDY) { - outb(comc_port + com_data, (u_char)c); - break; - } + for (wait = COMC_TXWAIT; wait > 0; wait--) + if (inb(comc_port + com_lsr) & LSR_TXRDY) { + outb(comc_port + com_data, (u_char)c); + break; + } } static int comc_getchar(void) { - return (comc_ischar() ? inb(comc_port + com_data) : -1); + return (comc_ischar() ? inb(comc_port + com_data) : -1); } static int comc_ischar(void) { - return (inb(comc_port + com_lsr) & LSR_RXRDY); + return (inb(comc_port + com_lsr) & LSR_RXRDY); } static int comc_speed_set(struct env_var *ev, int flags, const void *value) { - int speed; + int speed; - if (value == NULL || (speed = comc_parseint(value)) <= 0) { - printf("Invalid speed\n"); - return (CMD_ERROR); - } + if (value == NULL || (speed = comc_parseint(value)) <= 0) { + printf("Invalid speed\n"); + return (CMD_ERROR); + } - if (comc_curspeed != speed) - comc_setup(speed, comc_port); + if (comc_curspeed != speed) + comc_setup(speed, comc_port); - env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); + env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); - return (CMD_OK); + return (CMD_OK); } static int comc_port_set(struct env_var *ev, int flags, const void *value) { - int port; + int port; - if (value == NULL || (port = comc_parseint(value)) <= 0) { - printf("Invalid port\n"); - return (CMD_ERROR); - } + if (value == NULL || (port = comc_parseint(value)) <= 0) { + printf("Invalid port\n"); + return (CMD_ERROR); + } - if (comc_port != port) - comc_setup(comc_curspeed, port); + if (comc_port != port) + comc_setup(comc_curspeed, port); - env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); + env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); - return (CMD_OK); + return (CMD_OK); } /* @@ -320,46 +320,46 @@ comc_pcidev_set(struct env_var *ev, int flags, const v static void comc_setup(int speed, int port) { - static int TRY_COUNT = 1000000; - char intbuf[64]; - int tries; + static int TRY_COUNT = 1000000; + char intbuf[64]; + int tries; - unsetenv("hw.uart.console"); - comc_curspeed = speed; - comc_port = port; - if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) == 0) - return; + unsetenv("hw.uart.console"); + comc_curspeed = speed; + comc_port = port; + if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) == 0) + return; - outb(comc_port + com_cfcr, CFCR_DLAB | COMC_FMT); - outb(comc_port + com_dlbl, COMC_BPS(speed) & 0xff); - outb(comc_port + com_dlbh, COMC_BPS(speed) >> 8); - outb(comc_port + com_cfcr, COMC_FMT); - outb(comc_port + com_mcr, MCR_RTS | MCR_DTR); + outb(comc_port + com_cfcr, CFCR_DLAB | COMC_FMT); + outb(comc_port + com_dlbl, COMC_BPS(speed) & 0xff); + outb(comc_port + com_dlbh, COMC_BPS(speed) >> 8); + outb(comc_port + com_cfcr, COMC_FMT); + outb(comc_port + com_mcr, MCR_RTS | MCR_DTR); - tries = 0; - do - inb(comc_port + com_data); - while (inb(comc_port + com_lsr) & LSR_RXRDY && ++tries < TRY_COUNT); + tries = 0; + do + inb(comc_port + com_data); + while (inb(comc_port + com_lsr) & LSR_RXRDY && ++tries < TRY_COUNT); - if (tries < TRY_COUNT) { - comconsole.c_flags |= (C_PRESENTIN | C_PRESENTOUT); - sprintf(intbuf, "io:%d,br:%d", comc_port, comc_curspeed); - env_setenv("hw.uart.console", EV_VOLATILE, intbuf, NULL, NULL); - } else - comconsole.c_flags &= ~(C_PRESENTIN | C_PRESENTOUT); + if (tries < TRY_COUNT) { + comconsole.c_flags |= (C_PRESENTIN | C_PRESENTOUT); + sprintf(intbuf, "io:%d,br:%d", comc_port, comc_curspeed); + env_setenv("hw.uart.console", EV_VOLATILE, intbuf, NULL, NULL); + } else + comconsole.c_flags &= ~(C_PRESENTIN | C_PRESENTOUT); } static int comc_parseint(const char *speedstr) { - char *p; - int speed; + char *p; + int speed; - speed = strtol(speedstr, &p, 0); - if (p == speedstr || *p != '\0' || speed <= 0) - return (-1); + speed = strtol(speedstr, &p, 0); + if (p == speedstr || *p != '\0' || speed <= 0) + return (-1); - return (speed); + return (speed); } static int From owner-svn-src-all@freebsd.org Sat Nov 2 12:28:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ACC1B1A39BB; Sat, 2 Nov 2019 12:28:07 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474yyH4wXyz4bnC; Sat, 2 Nov 2019 12:28:07 +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 8BFE0235D9; Sat, 2 Nov 2019 12:28:07 +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 xA2CS7pw085539; Sat, 2 Nov 2019 12:28:07 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2CS5mr085528; Sat, 2 Nov 2019 12:28:05 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911021228.xA2CS5mr085528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 2 Nov 2019 12:28:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354253 - in head: cddl/lib/libzpool stand/efi/boot1 stand/i386/gptzfsboot stand/i386/zfsboot stand/libsa stand/libsa/zfs sys/cddl/boot/zfs sys/cddl/contrib/opensolaris/common/lz4 sys/c... X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head: cddl/lib/libzpool stand/efi/boot1 stand/i386/gptzfsboot stand/i386/zfsboot stand/libsa stand/libsa/zfs sys/cddl/boot/zfs sys/cddl/contrib/opensolaris/common/lz4 sys/cddl/contrib/opensolaris/u... X-SVN-Commit-Revision: 354253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 12:28:07 -0000 Author: tsoome Date: Sat Nov 2 12:28:04 2019 New Revision: 354253 URL: https://svnweb.freebsd.org/changeset/base/354253 Log: Remove duplicate lz4 implementations Port illumos change: https://www.illumos.org/issues/11667 Move lz4.c out of zfs tree to opensolaris/common/lz4, adjust it to be usable from kernel/stand/userland builds, so we can use just one single source. Add lz4.h to declare lz4_compress() and lz4_decompress(). MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D22037 Added: head/sys/cddl/contrib/opensolaris/common/lz4/ head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c - copied, changed from r354252, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c head/sys/cddl/contrib/opensolaris/common/lz4/lz4.h (contents, props changed) Deleted: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c Modified: head/cddl/lib/libzpool/Makefile head/stand/efi/boot1/Makefile head/stand/i386/gptzfsboot/Makefile head/stand/i386/zfsboot/Makefile head/stand/libsa/Makefile head/stand/libsa/zfs/Makefile.inc head/sys/cddl/boot/zfs/zfssubr.c head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files head/sys/modules/zfs/Makefile Modified: head/cddl/lib/libzpool/Makefile ============================================================================== --- head/cddl/lib/libzpool/Makefile Sat Nov 2 10:53:23 2019 (r354252) +++ head/cddl/lib/libzpool/Makefile Sat Nov 2 12:28:04 2019 (r354253) @@ -8,6 +8,8 @@ .PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua # ZFS_SHARED_SRCS .PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +# LZ4_COMMON_SRCS +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 # KERNEL_SRCS .PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common # LIST_SRCS @@ -32,6 +34,7 @@ LIB= zpool ZFS_COMMON_SRCS= ${ZFS_COMMON_OBJS:C/.o$/.c/} trim_map.c ZFS_SHARED_SRCS= ${ZFS_SHARED_OBJS:C/.o$/.c/} +LZ4_COMMON_SRCS= lz4.c LUA_SRCS= ${LUA_OBJS:C/.o$/.c/} KERNEL_SRCS= kernel.c taskq.c util.c LIST_SRCS= list.c @@ -39,7 +42,7 @@ UNICODE_SRCS= u8_textprep.c LIBCMDUTILS_SRCS=nicenum.c SRCS= ${ZFS_COMMON_SRCS} ${ZFS_SHARED_SRCS} ${LUA_SRCS} \ - ${KERNEL_SRCS} ${LIST_SRCS} ${ATOMIC_SRCS} \ + ${LZ4_COMMON_SRCS} ${KERNEL_SRCS} ${LIST_SRCS} ${ATOMIC_SRCS} \ ${UNICODE_SRCS} ${LIBCMDUTILS_SRCS} WARNS?= 0 @@ -50,6 +53,7 @@ CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libz CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair Modified: head/stand/efi/boot1/Makefile ============================================================================== --- head/stand/efi/boot1/Makefile Sat Nov 2 10:53:23 2019 (r354252) +++ head/stand/efi/boot1/Makefile Sat Nov 2 12:28:04 2019 (r354253) @@ -37,6 +37,7 @@ CFLAGS.zfs_module.c+= -I${ZFSSRC} CFLAGS.zfs_module.c+= -I${SYSDIR}/cddl/boot/zfs CFLAGS.zfs_module.c+= -I${SYSDIR}/crypto/skein CFLAGS.zfs_module.c+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/common +CFLAGS.zfs_module.c+= -I${SYSDIR}/cddl/contrib/opensolaris/common/lz4 CFLAGS+= -DEFI_ZFS_BOOT .endif Modified: head/stand/i386/gptzfsboot/Makefile ============================================================================== --- head/stand/i386/gptzfsboot/Makefile Sat Nov 2 10:53:23 2019 (r354252) +++ head/stand/i386/gptzfsboot/Makefile Sat Nov 2 12:28:04 2019 (r354253) @@ -29,6 +29,7 @@ CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \ -I${SYSDIR}/crypto/skein \ -I${SYSDIR}/cddl/boot/zfs \ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR}/cddl/contrib/opensolaris/common/lz4 \ -I${BOOTSRC}/i386/btx/lib \ -I${BOOTSRC}/i386/boot2 \ -Wall -Waggregate-return -Wbad-function-cast \ Modified: head/stand/i386/zfsboot/Makefile ============================================================================== --- head/stand/i386/zfsboot/Makefile Sat Nov 2 10:53:23 2019 (r354252) +++ head/stand/i386/zfsboot/Makefile Sat Nov 2 12:28:04 2019 (r354253) @@ -28,6 +28,7 @@ CFLAGS+=-DBOOTPROG=\"zfsboot\" \ -I${SYSDIR}/crypto/skein \ -I${SYSDIR}/cddl/boot/zfs \ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR}/cddl/contrib/opensolaris/common/lz4 \ -I${BOOTSRC}/i386/boot2 \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Sat Nov 2 10:53:23 2019 (r354252) +++ head/stand/libsa/Makefile Sat Nov 2 12:28:04 2019 (r354253) @@ -102,6 +102,11 @@ CFLAGS+=-DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib SRCS+= adler32.c crc32.c SRCS+= infback.c inffast.c inflate.c inftrees.c zutil.c +# lz4 decompression functionality +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 +SRCS+= lz4.c +CFLAGS.lz4.c+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 + # Create a subset of includes that are safe, as well as adjusting those that aren't # The lists may drive people nuts, but they are explicitly opt-in FAKE_DIRS=xlocale arpa Modified: head/stand/libsa/zfs/Makefile.inc ============================================================================== --- head/stand/libsa/zfs/Makefile.inc Sat Nov 2 10:53:23 2019 (r354252) +++ head/stand/libsa/zfs/Makefile.inc Sat Nov 2 12:28:04 2019 (r354253) @@ -12,4 +12,6 @@ CFLAGS+= -I${SYSDIR}/cddl/boot/zfs CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/common CFLAGS+= -I${SYSDIR}/crypto/skein +CFLAGS.zfs.c+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 + CFLAGS+= -Wformat -Wall Modified: head/sys/cddl/boot/zfs/zfssubr.c ============================================================================== --- head/sys/cddl/boot/zfs/zfssubr.c Sat Nov 2 10:53:23 2019 (r354252) +++ head/sys/cddl/boot/zfs/zfssubr.c Sat Nov 2 12:28:04 2019 (r354253) @@ -26,6 +26,8 @@ #include __FBSDID("$FreeBSD$"); +#include + static uint64_t zfs_crc64_table[256]; #define ECKSUM 666 @@ -161,7 +163,6 @@ typedef struct zio_compress_info { #include "lzjb.c" #include "zle.c" -#include "lz4.c" /* * Compression vectors. Copied and modified: head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c (from r354252, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c) ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c Sat Nov 2 10:53:23 2019 (r354252, copy source) +++ head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c Sat Nov 2 12:28:04 2019 (r354253) @@ -35,11 +35,29 @@ * Copyright (c) 2016 by Delphix. All rights reserved. */ +#if defined(_KERNEL) #include +#elif defined(_STANDALONE) +#include +#include +#include +#include +#include +#define ASSERT assert +#else +#include +#include +#include +#include +#include + +#define ASSERT assert +#endif +#include + static int real_LZ4_compress(const char *source, char *dest, int isize, int osize); -static int LZ4_compressBound(int isize); static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest, int isize, int maxOutputSize); static int LZ4_compressCtx(void *ctx, const char *source, char *dest, @@ -47,11 +65,13 @@ static int LZ4_compressCtx(void *ctx, const char *sour static int LZ4_compress64kCtx(void *ctx, const char *source, char *dest, int isize, int osize); +#if defined(_KERNEL) static kmem_cache_t *lz4_ctx_cache; +#endif -/*ARGSUSED*/ size_t -lz4_compress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n) +lz4_compress(void *s_start, void *d_start, size_t s_len, size_t d_len, + int n __unused) { uint32_t bufsiz; char *dest = d_start; @@ -71,17 +91,25 @@ lz4_compress(void *s_start, void *d_start, size_t s_le * added to the compressed buffer and which, if unhandled, would * confuse the hell out of our decompression function. */ - *(uint32_t *)dest = BE_32(bufsiz); +#if defined(_KERNEL) + *(uint32_t *)(void *)dest = BE_32(bufsiz); +#else + *(uint32_t *)(void *)dest = htonl(bufsiz); +#endif return (bufsiz + sizeof (bufsiz)); } -/*ARGSUSED*/ int -lz4_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n) +lz4_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, + int n __unused) { const char *src = s_start; - uint32_t bufsiz = BE_IN32(src); +#if defined(_KERNEL) + uint32_t bufsiz = BE_IN32(s_start); +#else + uint32_t bufsiz = htonl(*(uint32_t *)s_start); +#endif /* invalid compressed buffer size encoded at start */ if (bufsiz + sizeof (bufsiz) > s_len) @@ -105,20 +133,10 @@ lz4_decompress(void *s_start, void *d_start, size_t s_ * or 0 if the compression fails (if LZ4_COMPRESSMIN is set). * note : destination buffer must be already allocated. * destination buffer must be sized to handle worst cases - * situations (input data not compressible) worst case size - * evaluation is provided by function LZ4_compressBound(). + * situations (input data not compressible). * * Advanced Functions * - * LZ4_compressBound() : - * Provides the maximum size that LZ4 may output in a "worst case" - * scenario (input data not compressible) primarily useful for memory - * allocation of output buffer. - * - * isize : is the input size. Max supported value is ~1.9GB - * return : maximum output size in a "worst case" scenario - * note : this function is limited by "int" range (2^31-1) - * * LZ4_uncompress_unknownOutputSize() : * isize : is the input size, therefore the compressed size * maxOutputSize : is the size of the destination buffer (which must be @@ -292,9 +310,9 @@ typedef struct _U64_S { #pragma pack() #endif -#define A64(x) (((U64_S *)(x))->v) -#define A32(x) (((U32_S *)(x))->v) -#define A16(x) (((U16_S *)(x))->v) +#define A64(x) (((U64_S *)(__DECONST(void *, x)))->v) +#define A32(x) (((U32_S *)(__DECONST(void *, x)))->v) +#define A16(x) (((U16_S *)(__DECONST(void *, x)))->v) /* * Constants @@ -456,14 +474,6 @@ LZ4_NbCommonBytes(register U32 val) #endif -/* Public functions */ - -static int -LZ4_compressBound(int isize) -{ - return (isize + (isize / 255) + 16); -} - /* Compression functions */ /*ARGSUSED*/ @@ -478,7 +488,7 @@ LZ4_compressCtx(void *ctx, const char *source, char *d HTYPE HashTable[HASHTABLESIZE] = { 0 }; #endif - const BYTE *ip = (BYTE *) source; + const BYTE *ip = (const BYTE *) source; INITBASE(base); const BYTE *anchor = ip; const BYTE *const iend = ip + isize; @@ -527,7 +537,7 @@ LZ4_compressCtx(void *ctx, const char *source, char *d } while ((ref < ip - MAX_DISTANCE) || (A32(ref) != A32(ip))); /* Catch up */ - while ((ip > anchor) && (ref > (BYTE *) source) && + while ((ip > anchor) && (ref > (const BYTE *) source) && unlikely(ip[-1] == ref[-1])) { ip--; ref--; @@ -673,7 +683,7 @@ LZ4_compress64kCtx(void *ctx, const char *source, char U16 HashTable[HASH64KTABLESIZE] = { 0 }; #endif - const BYTE *ip = (BYTE *) source; + const BYTE *ip = (const BYTE *) source; const BYTE *anchor = ip; const BYTE *const base = ip; const BYTE *const iend = ip + isize; @@ -720,7 +730,7 @@ LZ4_compress64kCtx(void *ctx, const char *source, char } while (A32(ref) != A32(ip)); /* Catch up */ - while ((ip > anchor) && (ref > (BYTE *) source) && + while ((ip > anchor) && (ref > (const BYTE *) source) && (ip[-1] == ref[-1])) { ip--; ref--; @@ -847,7 +857,11 @@ static int real_LZ4_compress(const char *source, char *dest, int isize, int osize) { #if HEAPMODE +#if defined(_KERNEL) void *ctx = kmem_cache_alloc(lz4_ctx_cache, KM_NOSLEEP); +#else + void *ctx = malloc(sizeof(struct refTables)); +#endif int result; /* @@ -863,7 +877,11 @@ real_LZ4_compress(const char *source, char *dest, int else result = LZ4_compressCtx(ctx, source, dest, isize, osize); +#if defined(_KERNEL) kmem_cache_free(lz4_ctx_cache, ctx); +#else + free(ctx); +#endif return (result); #else if (isize < (int)LZ4_64KLIMIT) @@ -876,7 +894,7 @@ real_LZ4_compress(const char *source, char *dest, int /* * Note: The decoding function LZ4_uncompress_unknownOutputSize() is safe - * against "buffer overflow" attack type. They will never write nor + * against "buffer overflow" attack type. It will never write nor * read outside of the provided output buffers. * LZ4_uncompress_unknownOutputSize() also insures that it will never * read outside of the input buffer. A corrupted input will produce @@ -1010,9 +1028,10 @@ LZ4_uncompress_unknownOutputSize(const char *source, c /* write overflow error detected */ _output_error: - return (int)(-(((char *)ip) - source)); + return (int)(-(((const char *)ip) - source)); } +#if defined(_KERNEL) extern void lz4_init(void) { @@ -1031,3 +1050,4 @@ lz4_fini(void) kmem_cache_destroy(lz4_ctx_cache); #endif } +#endif /* _KERNEL */ Added: head/sys/cddl/contrib/opensolaris/common/lz4/lz4.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/contrib/opensolaris/common/lz4/lz4.h Sat Nov 2 12:28:04 2019 (r354253) @@ -0,0 +1,50 @@ +/* + * LZ4 - Fast LZ compression algorithm + * Header File + * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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 COPYRIGHT HOLDERS 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 COPYRIGHT + * OWNER 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. + * + * You can contact the author at : + * - LZ4 homepage : http://fastcompression.blogspot.com/p/lz4.html + * - LZ4 source repository : http://code.google.com/p/lz4/ + */ + +#ifndef _LZ4_H +#define _LZ4_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +extern size_t lz4_compress(void *, void *, size_t, size_t, int); +extern int lz4_decompress(void *, void *, size_t, size_t, int); + +#ifdef __cplusplus +} +#endif + +#endif /* _LZ4_H */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Sat Nov 2 10:53:23 2019 (r354252) +++ head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Sat Nov 2 12:28:04 2019 (r354253) @@ -98,7 +98,6 @@ ZFS_COMMON_OBJS += \ dsl_scan.o \ zfeature.o \ gzip.o \ - lz4.o \ lzjb.o \ metaslab.o \ multilist.o \ Modified: head/sys/modules/zfs/Makefile ============================================================================== --- head/sys/modules/zfs/Makefile Sat Nov 2 10:53:23 2019 (r354252) +++ head/sys/modules/zfs/Makefile Sat Nov 2 12:28:04 2019 (r354253) @@ -18,6 +18,8 @@ SRCS+= opensolaris_nvpair_alloc_fixed.c SRCS+= opensolaris_fnvpair.c .PATH: ${SYSDIR}/cddl/contrib/opensolaris/common/unicode SRCS+= u8_textprep.c +.PATH: ${SUNW}/common/lz4 +SRCS+= lz4.c .PATH: ${SYSDIR}/cddl/compat/opensolaris/kern SRCS+= opensolaris_acl.c @@ -84,6 +86,7 @@ CFLAGS+=-I${SUNW}/uts/common/zmod CFLAGS+=-I${SUNW}/uts/common CFLAGS+=-I${SYSDIR} CFLAGS+=-I${SUNW}/common/zfs +CFLAGS+=-I${SUNW}/common/lz4 CFLAGS+=-I${SUNW}/common CFLAGS+=-DBUILDING_ZFS CFLAGS.gcc+=-fms-extensions From owner-svn-src-all@freebsd.org Sat Nov 2 15:08:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B6051A85CC; Sat, 2 Nov 2019 15:08:20 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4752W80sBKz3Hmr; Sat, 2 Nov 2019 15:08:20 +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 D67E7252A5; Sat, 2 Nov 2019 15:08: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 xA2F8Jmx082083; Sat, 2 Nov 2019 15:08:19 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2F8Jvw082082; Sat, 2 Nov 2019 15:08:19 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911021508.xA2F8Jvw082082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 2 Nov 2019 15:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354254 - head/sys/cddl/boot/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/cddl/boot/zfs X-SVN-Commit-Revision: 354254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 15:08:20 -0000 Author: tsoome Date: Sat Nov 2 15:08:19 2019 New Revision: 354254 URL: https://svnweb.freebsd.org/changeset/base/354254 Log: r354253 did miss lz4.c from sys/cddl/boot/zfs. Deleted: head/sys/cddl/boot/zfs/lz4.c From owner-svn-src-all@freebsd.org Sat Nov 2 16:59:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 64EC41AC1D2; Sat, 2 Nov 2019 16:59:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4754zt21s1z3QBH; Sat, 2 Nov 2019 16:59:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CF7F26620; Sat, 2 Nov 2019 16:59:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA2Gxr5S048602; Sat, 2 Nov 2019 16:59:53 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2Gxrh1048600; Sat, 2 Nov 2019 16:59:53 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201911021659.xA2Gxrh1048600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 2 Nov 2019 16:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354255 - in head/lib: libc/gen msun/src X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head/lib: libc/gen msun/src X-SVN-Commit-Revision: 354255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 16:59:54 -0000 Author: dim Date: Sat Nov 2 16:59:53 2019 New Revision: 354255 URL: https://svnweb.freebsd.org/changeset/base/354255 Log: Add __isnan()/__isnanf() aliases for compatibility with glibc and CUDA Even though clang comes with a number of internal CUDA wrapper headers, compiling sample CUDA programs will result in errors similar to: In file included from :1: In file included from /usr/lib/clang/9.0.0/include/__clang_cuda_runtime_wrapper.h:204: /usr/home/arr/cuda/var/cuda-repo-10-0-local-10.0.130-410.48/usr/local/cuda-10.0//include/crt/math_functions.hpp:2910:7: error: no matching function for call to '__isnan' if (__isnan(a)) { ^~~~~~~ /usr/lib/clang/9.0.0/include/__clang_cuda_device_functions.h:460:16: note: candidate function not viable: call to __device__ function from __host__ function __DEVICE__ int __isnan(double __a) { return __nv_isnand(__a); } ^ CUDA expects __isnan() and __isnanf() declarations to be available, which are glibc specific extensions, equivalent to the regular isnan() and isnanf(). To provide these, define __isnan() and __isnanf() as aliases of the already existing static inline functions __inline_isnan() and __inline_isnanf() from math.h. Reported by: arrowd PR: 241550 MFC after: 1 week Modified: head/lib/libc/gen/isnan.c head/lib/msun/src/math.h head/lib/msun/src/s_isnan.c Modified: head/lib/libc/gen/isnan.c ============================================================================== --- head/lib/libc/gen/isnan.c Sat Nov 2 15:08:19 2019 (r354254) +++ head/lib/libc/gen/isnan.c Sat Nov 2 16:59:53 2019 (r354255) @@ -43,6 +43,13 @@ */ #ifdef PIC +/* + * Because math.h defines __isnan and __isnanf as aliases for compatibility with + * glibc and CUDA, we have to undefine them here to avoid redefinition errors. + */ +#undef __isnan +#undef __isnanf + __weak_reference(__isnan, isnan); __weak_reference(__isnanf, isnanf); Modified: head/lib/msun/src/math.h ============================================================================== --- head/lib/msun/src/math.h Sat Nov 2 15:08:19 2019 (r354254) +++ head/lib/msun/src/math.h Sat Nov 2 16:59:53 2019 (r354255) @@ -215,6 +215,12 @@ __inline_isnanl(__const long double __x) } /* + * Define the following aliases, for compatibility with glibc and CUDA. + */ +#define __isnan __inline_isnan +#define __isnanf __inline_isnanf + +/* * Version 2 of the Single UNIX Specification (UNIX98) defined isnan() and * isinf() as functions taking double. C99, and the subsequent POSIX revisions * (SUSv3, POSIX.1-2001, define it as a macro that accepts any real floating Modified: head/lib/msun/src/s_isnan.c ============================================================================== --- head/lib/msun/src/s_isnan.c Sat Nov 2 15:08:19 2019 (r354254) +++ head/lib/msun/src/s_isnan.c Sat Nov 2 16:59:53 2019 (r354255) @@ -45,6 +45,12 @@ isnan(double d) } #endif /* !PIC */ +/* + * Because math.h defines __isnanf as an alias for compatibility with glibc and + * CUDA, we have to undefine it here to avoid redefinition errors. + */ +#undef __isnanf + int __isnanf(float f) { From owner-svn-src-all@freebsd.org Sat Nov 2 17:50:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B880D1ADCB2; Sat, 2 Nov 2019 17:50:29 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47566F4S6gz40V8; Sat, 2 Nov 2019 17:50:29 +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 5DFD626F17; Sat, 2 Nov 2019 17:50:29 +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 xA2HoThr080004; Sat, 2 Nov 2019 17:50:29 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2HoTiM080003; Sat, 2 Nov 2019 17:50:29 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201911021750.xA2HoTiM080003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 2 Nov 2019 17:50:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r354256 - vendor/sqlite3/sqlite-3290000 X-SVN-Group: vendor X-SVN-Commit-Author: cy X-SVN-Commit-Paths: vendor/sqlite3/sqlite-3290000 X-SVN-Commit-Revision: 354256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 17:50:29 -0000 Author: cy Date: Sat Nov 2 17:50:28 2019 New Revision: 354256 URL: https://svnweb.freebsd.org/changeset/base/354256 Log: Tag import of sqlite3-3.29.0 (3290000) Added: vendor/sqlite3/sqlite-3290000/ - copied from r354255, vendor/sqlite3/dist/ From owner-svn-src-all@freebsd.org Sat Nov 2 17:57:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C5771AE083; Sat, 2 Nov 2019 17:57:19 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4756G722nlz40tN; Sat, 2 Nov 2019 17:57:19 +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 29D55270C9; Sat, 2 Nov 2019 17:57:19 +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 xA2HvJgC085681; Sat, 2 Nov 2019 17:57:19 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2Hv3bq085666; Sat, 2 Nov 2019 17:57:03 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201911021757.xA2Hv3bq085666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 2 Nov 2019 17:57:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r354257 - in vendor/sqlite3/dist: . tea tea/generic X-SVN-Group: vendor X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in vendor/sqlite3/dist: . tea tea/generic X-SVN-Commit-Revision: 354257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 17:57:19 -0000 Author: cy Date: Sat Nov 2 17:57:02 2019 New Revision: 354257 URL: https://svnweb.freebsd.org/changeset/base/354257 Log: Import sqlite3-3.30.1 (3300100) Modified: vendor/sqlite3/dist/Makefile.msc vendor/sqlite3/dist/configure vendor/sqlite3/dist/configure.ac vendor/sqlite3/dist/shell.c vendor/sqlite3/dist/sqlite3.c vendor/sqlite3/dist/sqlite3.h vendor/sqlite3/dist/sqlite3ext.h vendor/sqlite3/dist/tea/configure vendor/sqlite3/dist/tea/configure.ac vendor/sqlite3/dist/tea/generic/tclsqlite3.c Modified: vendor/sqlite3/dist/Makefile.msc ============================================================================== --- vendor/sqlite3/dist/Makefile.msc Sat Nov 2 17:50:28 2019 (r354256) +++ vendor/sqlite3/dist/Makefile.msc Sat Nov 2 17:57:02 2019 (r354257) @@ -73,7 +73,7 @@ API_ARMOR = 0 !IFNDEF NO_WARN !IF $(USE_FULLWARN)!=0 NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4130 -wd4152 -wd4189 -wd4206 -NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4305 -wd4306 -wd4702 -wd4706 +NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4244 -wd4305 -wd4306 -wd4702 -wd4706 !ENDIF !ENDIF Modified: vendor/sqlite3/dist/configure ============================================================================== --- vendor/sqlite3/dist/configure Sat Nov 2 17:50:28 2019 (r354256) +++ vendor/sqlite3/dist/configure Sat Nov 2 17:57:02 2019 (r354257) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.29.0. +# Generated by GNU Autoconf 2.69 for sqlite 3.30.1. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.29.0' -PACKAGE_STRING='sqlite 3.29.0' +PACKAGE_VERSION='3.30.1' +PACKAGE_STRING='sqlite 3.30.1' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.29.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.30.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.29.0:";; + short | recursive ) echo "Configuration of sqlite 3.30.1:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.29.0 +sqlite configure 3.30.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.29.0, which was +It was created by sqlite $as_me 3.30.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.29.0' + VERSION='3.30.1' cat >>confdefs.h <<_ACEOF @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.29.0, which was +This file was extended by sqlite $as_me 3.30.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.29.0 +sqlite config.status 3.30.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: vendor/sqlite3/dist/configure.ac ============================================================================== --- vendor/sqlite3/dist/configure.ac Sat Nov 2 17:50:28 2019 (r354256) +++ vendor/sqlite3/dist/configure.ac Sat Nov 2 17:57:02 2019 (r354257) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.29.0, http://www.sqlite.org) +AC_INIT(sqlite, 3.30.1, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) Modified: vendor/sqlite3/dist/shell.c ============================================================================== --- vendor/sqlite3/dist/shell.c Sat Nov 2 17:50:28 2019 (r354256) +++ vendor/sqlite3/dist/shell.c Sat Nov 2 17:57:02 2019 (r354257) @@ -9801,12 +9801,12 @@ static void editFunc( } sz = sqlite3_value_bytes(argv[0]); if( bBin ){ - x = fwrite(sqlite3_value_blob(argv[0]), 1, sz, f); + x = fwrite(sqlite3_value_blob(argv[0]), 1, (size_t)sz, f); }else{ const char *z = (const char*)sqlite3_value_text(argv[0]); /* Remember whether or not the value originally contained \r\n */ if( z && strstr(z,"\r\n")!=0 ) hasCRNL = 1; - x = fwrite(sqlite3_value_text(argv[0]), 1, sz, f); + x = fwrite(sqlite3_value_text(argv[0]), 1, (size_t)sz, f); } fclose(f); f = 0; @@ -9834,12 +9834,12 @@ static void editFunc( fseek(f, 0, SEEK_END); sz = ftell(f); rewind(f); - p = sqlite3_malloc64( sz+(bBin==0) ); + p = sqlite3_malloc64( sz+1 ); if( p==0 ){ sqlite3_result_error_nomem(context); goto edit_func_end; } - x = fread(p, 1, sz, f); + x = fread(p, 1, (size_t)sz, f); fclose(f); f = 0; if( x!=sz ){ @@ -10311,7 +10311,8 @@ static void eqp_render_level(ShellState *p, int iEqpId for(pRow = eqp_next_row(p, iEqpId, 0); pRow; pRow = pNext){ pNext = eqp_next_row(p, iEqpId, pRow); z = pRow->zText; - utf8_printf(p->out, "%s%s%s\n", p->sGraph.zPrefix, pNext ? "|--" : "`--", z); + utf8_printf(p->out, "%s%s%s\n", p->sGraph.zPrefix, + pNext ? "|--" : "`--", z); if( n<(int)sizeof(p->sGraph.zPrefix)-7 ){ memcpy(&p->sGraph.zPrefix[n], pNext ? "| " : " ", 4); eqp_render_level(p, pRow->iEqpId); @@ -10502,7 +10503,7 @@ static int shell_callback( while( j>0 && IsSpace(z[j-1]) ){ j--; } z[j] = 0; if( strlen30(z)>=79 ){ - for(i=j=0; (c = z[i])!=0; i++){ /* Copy changes from z[i] back to z[j] */ + for(i=j=0; (c = z[i])!=0; i++){ /* Copy from z[i] back to z[j] */ if( c==cEnd ){ cEnd = 0; }else if( c=='"' || c=='\'' || c=='`' ){ @@ -11081,7 +11082,7 @@ static int display_stats( raw_printf(pArg->out, "Autoindex Inserts: %d\n", iCur); iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_VM_STEP, bReset); raw_printf(pArg->out, "Virtual Machine Steps: %d\n", iCur); - iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_REPREPARE, bReset); + iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_REPREPARE,bReset); raw_printf(pArg->out, "Reprepare operations: %d\n", iCur); iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_RUN, bReset); raw_printf(pArg->out, "Number of times run: %d\n", iCur); @@ -12004,20 +12005,20 @@ static const char *(azHelp[]) = { ".archive ... Manage SQL archives", " Each command must have exactly one of the following options:", " -c, --create Create a new archive", - " -u, --update Add files or update files with changed mtime", - " -i, --insert Like -u but always add even if mtime unchanged", + " -u, --update Add or update files with changed mtime", + " -i, --insert Like -u but always add even if unchanged", " -t, --list List contents of archive", " -x, --extract Extract files from archive", " Optional arguments:", " -v, --verbose Print each filename as it is processed", - " -f FILE, --file FILE Operate on archive FILE (default is current db)", - " -a FILE, --append FILE Operate on FILE opened using the apndvfs VFS", - " -C DIR, --directory DIR Change to directory DIR to read/extract files", + " -f FILE, --file FILE Use archive FILE (default is current db)", + " -a FILE, --append FILE Open FILE using the apndvfs VFS", + " -C DIR, --directory DIR Read/extract files from directory DIR", " -n, --dryrun Show the SQL that would have occurred", " Examples:", - " .ar -cf archive.sar foo bar # Create archive.sar from files foo and bar", - " .ar -tf archive.sar # List members of archive.sar", - " .ar -xvf archive.sar # Verbosely extract files from archive.sar", + " .ar -cf ARCHIVE foo bar # Create ARCHIVE from files foo and bar", + " .ar -tf ARCHIVE # List members of ARCHIVE", + " .ar -xvf ARCHIVE # Verbosely extract files from ARCHIVE", " See also:", " http://sqlite.org/cli.html#sqlar_archive_support", #endif @@ -12026,7 +12027,7 @@ static const char *(azHelp[]) = { #endif ".backup ?DB? FILE Backup DB (default \"main\") to FILE", " --append Use the appendvfs", - " --async Write to FILE without a journal and without fsync()", + " --async Write to FILE without journal and fsync()", ".bail on|off Stop after hitting an error. Default OFF", ".binary on|off Turn binary output on or off. Default OFF", ".cd DIRECTORY Change the working directory to DIRECTORY", @@ -12046,15 +12047,15 @@ static const char *(azHelp[]) = { " Other Modes:", #ifdef SQLITE_DEBUG " test Show raw EXPLAIN QUERY PLAN output", - " trace Like \"full\" but also enable \"PRAGMA vdbe_trace\"", + " trace Like \"full\" but enable \"PRAGMA vdbe_trace\"", #endif " trigger Like \"full\" but also show trigger bytecode", - ".excel Display the output of next command in a spreadsheet", + ".excel Display the output of next command in spreadsheet", ".exit ?CODE? Exit this program with return-code CODE", - ".expert EXPERIMENTAL. Suggest indexes for specified queries", + ".expert EXPERIMENTAL. Suggest indexes for queries", /* Because explain mode comes on automatically now, the ".explain" mode -** is removed from the help screen. It is still supported for legacy, however */ -/*".explain ?on|off|auto? Turn EXPLAIN output mode on or off or to automatic",*/ +** is removed from the help screen. It is still supported for legacy, however */ +/*".explain ?on|off|auto? Turn EXPLAIN output mode on or off",*/ ".filectrl CMD ... Run various sqlite3_file_control() operations", " Run \".filectrl\" with no arguments for details", ".fullschema ?--indent? Show schema and the content of sqlite_stat tables", @@ -12101,7 +12102,7 @@ static const char *(azHelp[]) = { " --append Use appendvfs to append database to the end of FILE", #ifdef SQLITE_ENABLE_DESERIALIZE " --deserialize Load into memory useing sqlite3_deserialize()", - " --hexdb Load the output of \"dbtotxt\" as an in-memory database", + " --hexdb Load the output of \"dbtotxt\" as an in-memory db", " --maxsize N Maximum size for --hexdb or --deserialized database", #endif " --new Initialize FILE to an empty database", @@ -12114,7 +12115,7 @@ static const char *(azHelp[]) = { " init Initialize the TEMP table that holds bindings", " list List the current parameter bindings", " set PARAMETER VALUE Given SQL parameter PARAMETER a value of VALUE", - " PARAMETER should start with '$', ':', '@', or '?'", + " PARAMETER should start with one of: $ : @ ?", " unset PARAMETER Remove PARAMETER from the binding table", ".print STRING... Print literal STRING", #ifndef SQLITE_OMIT_PROGRESS_CALLBACK @@ -12129,6 +12130,11 @@ static const char *(azHelp[]) = { ".read FILE Read input from FILE", #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB) ".recover Recover as much data as possible from corrupt db.", + " --freelist-corrupt Assume the freelist is corrupt", + " --recovery-db NAME Store recovery metadata in database file NAME", + " --lost-and-found TABLE Alternative name for the lost-and-found table", + " --no-rowids Do not attempt to recover rowid values", + " that are not also INTEGER PRIMARY KEYs", #endif ".restore ?DB? FILE Restore content of DB (default \"main\") from FILE", ".save FILE Write in-memory database into FILE", @@ -12160,7 +12166,7 @@ static const char *(azHelp[]) = { " Options:", " --schema Also hash the sqlite_master table", " --sha3-224 Use the sha3-224 algorithm", - " --sha3-256 Use the sha3-256 algorithm. This is the default.", + " --sha3-256 Use the sha3-256 algorithm (default)", " --sha3-384 Use the sha3-384 algorithm", " --sha3-512 Use the sha3-512 algorithm", " Any other argument is a LIKE pattern for tables to hash", @@ -12194,6 +12200,10 @@ static const char *(azHelp[]) = { " --row Trace each row (SQLITE_TRACE_ROW)", " --close Trace connection close (SQLITE_TRACE_CLOSE)", #endif /* SQLITE_OMIT_TRACE */ +#ifdef SQLITE_DEBUG + ".unmodule NAME ... Unregister virtual table modules", + " --allexcept Unregister everything except those named", +#endif ".vfsinfo ?AUX? Information about the top-level VFS", ".vfslist List all available VFSes", ".vfsname ?AUX? Print the name of the VFS stack", @@ -12436,6 +12446,8 @@ static unsigned char *readHexDb(ShellState *p, int *pn rc = sscanf(zLine, "| size %d pagesize %d", &n, &pgsz); if( rc!=2 ) goto readHexDb_error; if( n<0 ) goto readHexDb_error; + if( pgsz<512 || pgsz>65536 || (pgsz&(pgsz-1))!=0 ) goto readHexDb_error; + n = (n+pgsz-1)&~(pgsz-1); /* Round n up to the next multiple of pgsz */ a = sqlite3_malloc( n ? n : 1 ); if( a==0 ){ utf8_printf(stderr, "Out of memory!\n"); @@ -12521,6 +12533,23 @@ static void shellInt32( } /* +** Scalar function "shell_idquote(X)" returns string X quoted as an identifier, +** using "..." with internal double-quote characters doubled. +*/ +static void shellIdQuote( + sqlite3_context *context, + int argc, + sqlite3_value **argv +){ + const char *zName = (const char*)sqlite3_value_text(argv[0]); + UNUSED_PARAMETER(argc); + if( zName ){ + char *z = sqlite3_mprintf("\"%w\"", zName); + sqlite3_result_text(context, z, -1, sqlite3_free); + } +} + +/* ** Scalar function "shell_escape_crnl" used by the .recover command. ** The argument passed to this function is the output of built-in ** function quote(). If the first character of the input is "'", @@ -12696,6 +12725,8 @@ static void open_db(ShellState *p, int openFlags){ shellEscapeCrnl, 0, 0); sqlite3_create_function(p->db, "shell_int32", 2, SQLITE_UTF8, 0, shellInt32, 0, 0); + sqlite3_create_function(p->db, "shell_idquote", 1, SQLITE_UTF8, 0, + shellIdQuote, 0, 0); #ifndef SQLITE_NOHAVE_SYSTEM sqlite3_create_function(p->db, "edit", 1, SQLITE_UTF8, 0, editFunc, 0, 0); @@ -14043,7 +14074,7 @@ void shellReset( #endif /* !defined SQLITE_OMIT_VIRTUALTABLE */ #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_HAVE_ZLIB) -/********************************************************************************* +/****************************************************************************** ** The ".archive" or ".ar" command. */ /* @@ -14241,7 +14272,8 @@ static int arParseCommand( i = n; }else{ if( iArg>=(nArg-1) ){ - return arErrorMsg(pAr, "option requires an argument: %c",z[i]); + return arErrorMsg(pAr, "option requires an argument: %c", + z[i]); } zArg = azArg[++iArg]; } @@ -14629,10 +14661,10 @@ end_ar_transaction: ** Implementation of ".ar" dot command. */ static int arDotCommand( - ShellState *pState, /* Current shell tool state */ - int fromCmdLine, /* True if -A command-line option, not .ar cmd */ - char **azArg, /* Array of arguments passed to dot command */ - int nArg /* Number of entries in azArg[] */ + ShellState *pState, /* Current shell tool state */ + int fromCmdLine, /* True if -A command-line option, not .ar cmd */ + char **azArg, /* Array of arguments passed to dot command */ + int nArg /* Number of entries in azArg[] */ ){ ArCommand cmd; int rc; @@ -14732,7 +14764,7 @@ end_ar_command: return rc; } /* End of the ".archive" or ".ar" command logic -**********************************************************************************/ +*******************************************************************************/ #endif /* !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_HAVE_ZLIB) */ #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB) @@ -14874,6 +14906,10 @@ static RecoverTable *recoverNewTable( rc = sqlite3_open("", &dbtmp); if( rc==SQLITE_OK ){ + sqlite3_create_function(dbtmp, "shell_idquote", 1, SQLITE_UTF8, 0, + shellIdQuote, 0, 0); + } + if( rc==SQLITE_OK ){ rc = sqlite3_exec(dbtmp, "PRAGMA writable_schema = on", 0, 0, 0); } if( rc==SQLITE_OK ){ @@ -14929,18 +14965,18 @@ static RecoverTable *recoverNewTable( } } - pTab->zQuoted = shellMPrintf(&rc, "%Q", zName); + pTab->zQuoted = shellMPrintf(&rc, "\"%w\"", zName); pTab->azlCol = (char**)shellMalloc(&rc, sizeof(char*) * (nSqlCol+1)); pTab->nCol = nSqlCol; if( bIntkey ){ - pTab->azlCol[0] = shellMPrintf(&rc, "%Q", zPk); + pTab->azlCol[0] = shellMPrintf(&rc, "\"%w\"", zPk); }else{ pTab->azlCol[0] = shellMPrintf(&rc, ""); } i = 1; shellPreparePrintf(dbtmp, &rc, &pStmt, - "SELECT %Q || group_concat(name, ', ') " + "SELECT %Q || group_concat(shell_idquote(name), ', ') " " FILTER (WHERE cid!=%d) OVER (ORDER BY %s cid) " "FROM pragma_table_info(%Q)", bIntkey ? ", " : "", pTab->iPk, @@ -15054,7 +15090,7 @@ static RecoverTable *recoverOrphanTable( pTab = (RecoverTable*)shellMalloc(pRc, sizeof(RecoverTable)); if( pTab ){ - pTab->zQuoted = shellMPrintf(pRc, "%Q", zTab); + pTab->zQuoted = shellMPrintf(pRc, "\"%w\"", zTab); pTab->nCol = nCol; pTab->iPk = -2; if( nCol>0 ){ @@ -15103,6 +15139,7 @@ static int recoverDatabaseCmd(ShellState *pState, int RecoverTable *pOrphan = 0; int bFreelist = 1; /* 0 if --freelist-corrupt is specified */ + int bRowids = 1; /* 0 if --no-rowids */ for(i=1; iout, azArg[0]); return 1; } } @@ -15132,6 +15169,7 @@ static int recoverDatabaseCmd(ShellState *pState, int shellExecPrintf(pState->db, &rc, /* Attach an in-memory database named 'recovery'. Create an indexed ** cache of the sqlite_dbptr virtual table. */ + "PRAGMA writable_schema = on;" "ATTACH %Q AS recovery;" "DROP TABLE IF EXISTS recovery.dbptr;" "DROP TABLE IF EXISTS recovery.freelist;" @@ -15162,7 +15200,22 @@ static int recoverDatabaseCmd(ShellState *pState, int ); } + /* If this is an auto-vacuum database, add all pointer-map pages to + ** the freelist table. Do this regardless of whether or not + ** --freelist-corrupt was specified. */ shellExec(pState->db, &rc, + "WITH ptrmap(pgno) AS (" + " SELECT 2 WHERE shell_int32(" + " (SELECT data FROM sqlite_dbpage WHERE pgno=1), 13" + " )" + " UNION ALL " + " SELECT pgno+1+(SELECT page_size FROM pragma_page_size)/5 AS pp " + " FROM ptrmap WHERE pp<=(SELECT page_count FROM pragma_page_count)" + ")" + "REPLACE INTO recovery.freelist SELECT pgno FROM ptrmap" + ); + + shellExec(pState->db, &rc, "CREATE TABLE recovery.dbptr(" " pgno, child, PRIMARY KEY(child, pgno)" ") WITHOUT ROWID;" @@ -15210,7 +15263,7 @@ static int recoverDatabaseCmd(ShellState *pState, int " )" " SELECT pgno FROM p WHERE (parent IS NULL OR pgno = orig)" ") " - "FROM pages WHERE maxlen > 0 AND i NOT IN freelist;" + "FROM pages WHERE maxlen IS NOT NULL AND i NOT IN freelist;" "UPDATE recovery.map AS o SET intkey = (" " SELECT substr(data, 1, 1)==X'0D' FROM sqlite_dbpage WHERE pgno=o.pgno" ");" @@ -15235,6 +15288,11 @@ static int recoverDatabaseCmd(ShellState *pState, int ** CREATE TABLE statements that extracted from the existing schema. */ if( rc==SQLITE_OK ){ sqlite3_stmt *pStmt = 0; + /* ".recover" might output content in an order which causes immediate + ** foreign key constraints to be violated. So disable foreign-key + ** constraint enforcement to prevent problems when running the output + ** script. */ + raw_printf(pState->out, "PRAGMA foreign_keys=OFF;\n"); raw_printf(pState->out, "BEGIN;\n"); raw_printf(pState->out, "PRAGMA writable_schema = on;\n"); shellPrepare(pState->db, &rc, @@ -15265,8 +15323,12 @@ static int recoverDatabaseCmd(ShellState *pState, int shellPrepare(pState->db, &rc, "SELECT pgno FROM recovery.map WHERE root=?", &pPages ); + shellPrepare(pState->db, &rc, - "SELECT max(field), group_concat(shell_escape_crnl(quote(value)), ', ')" + "SELECT max(field), group_concat(shell_escape_crnl(quote" + "(case when (? AND field<0) then NULL else value end)" + "), ', ')" + ", min(field) " "FROM sqlite_dbdata WHERE pgno = ? AND field != ?" "GROUP BY cell", &pCells ); @@ -15285,6 +15347,7 @@ static int recoverDatabaseCmd(ShellState *pState, int int bNoop = 0; RecoverTable *pTab; + assert( bIntkey==0 || bIntkey==1 ); pTab = recoverFindTable(pState, &rc, iRoot, bIntkey, nCol, &bNoop); if( bNoop || rc ) continue; if( pTab==0 ){ @@ -15295,29 +15358,44 @@ static int recoverDatabaseCmd(ShellState *pState, int if( pTab==0 ) break; } - if( 0==sqlite3_stricmp(pTab->zQuoted, "'sqlite_sequence'") ){ + if( 0==sqlite3_stricmp(pTab->zQuoted, "\"sqlite_sequence\"") ){ raw_printf(pState->out, "DELETE FROM sqlite_sequence;\n"); } sqlite3_bind_int(pPages, 1, iRoot); - sqlite3_bind_int(pCells, 2, pTab->iPk); + if( bRowids==0 && pTab->iPk<0 ){ + sqlite3_bind_int(pCells, 1, 1); + }else{ + sqlite3_bind_int(pCells, 1, 0); + } + sqlite3_bind_int(pCells, 3, pTab->iPk); while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pPages) ){ int iPgno = sqlite3_column_int(pPages, 0); - sqlite3_bind_int(pCells, 1, iPgno); + sqlite3_bind_int(pCells, 2, iPgno); while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pCells) ){ int nField = sqlite3_column_int(pCells, 0); + int iMin = sqlite3_column_int(pCells, 2); const char *zVal = (const char*)sqlite3_column_text(pCells, 1); + RecoverTable *pTab2 = pTab; + if( pTab!=pOrphan && (iMin<0)!=bIntkey ){ + if( pOrphan==0 ){ + pOrphan = recoverOrphanTable(pState, &rc, zLostAndFound, nOrphan); + } + pTab2 = pOrphan; + if( pTab2==0 ) break; + } + nField = nField+1; - if( pTab==pOrphan ){ + if( pTab2==pOrphan ){ raw_printf(pState->out, "INSERT INTO %s VALUES(%d, %d, %d, %s%s%s);\n", - pTab->zQuoted, iRoot, iPgno, nField, - bIntkey ? "" : "NULL, ", zVal, pTab->azlCol[nField] + pTab2->zQuoted, iRoot, iPgno, nField, + iMin<0 ? "" : "NULL, ", zVal, pTab2->azlCol[nField] ); }else{ raw_printf(pState->out, "INSERT INTO %s(%s) VALUES( %s );\n", - pTab->zQuoted, pTab->azlCol[nField], zVal + pTab2->zQuoted, pTab2->azlCol[nField], zVal ); } } @@ -15376,7 +15454,7 @@ static int do_meta_command(char *zLine, ShellState *p) int nArg = 0; int n, c; int rc = 0; - char *azArg[50]; + char *azArg[52]; #ifndef SQLITE_OMIT_VIRTUALTABLE if( p->expert.pExpert ){ @@ -15386,7 +15464,7 @@ static int do_meta_command(char *zLine, ShellState *p) /* Parse the input line into tokens. */ - while( zLine[h] && nArgout, "ANALYZE sqlite_master;\n"); @@ -16615,12 +16693,8 @@ static int do_meta_command(char *zLine, ShellState *p) ** Clear all bind parameters by dropping the TEMP table that holds them. */ if( nArg==2 && strcmp(azArg[1],"clear")==0 ){ - int wrSchema = 0; - sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, -1, &wrSchema); - sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, 1, 0); sqlite3_exec(p->db, "DROP TABLE IF EXISTS temp.sqlite_parameters;", 0, 0, 0); - sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, wrSchema, 0); }else /* .parameter list @@ -16933,7 +17007,7 @@ static int do_meta_command(char *zLine, ShellState *p) zDiv = " UNION ALL "; appendText(&sSelect, "SELECT shell_add_schema(sql,", 0); if( sqlite3_stricmp(zDb, "main")!=0 ){ - appendText(&sSelect, zDb, '"'); + appendText(&sSelect, zDb, '\''); }else{ appendText(&sSelect, "NULL", 0); } @@ -16942,15 +17016,16 @@ static int do_meta_command(char *zLine, ShellState *p) appendText(&sSelect, " AS snum, ", 0); appendText(&sSelect, zDb, '\''); appendText(&sSelect, " AS sname FROM ", 0); - appendText(&sSelect, zDb, '"'); + appendText(&sSelect, zDb, quoteChar(zDb)); appendText(&sSelect, ".sqlite_master", 0); } sqlite3_finalize(pStmt); -#ifdef SQLITE_INTROSPECTION_PRAGMAS +#ifndef SQLITE_OMIT_INTROSPECTION_PRAGMAS if( zName ){ appendText(&sSelect, " UNION ALL SELECT shell_module_schema(name)," - " 'table', name, name, name, 9e+99, 'main' FROM pragma_module_list", 0); + " 'table', name, name, name, 9e+99, 'main' FROM pragma_module_list", + 0); } #endif appendText(&sSelect, ") WHERE ", 0); @@ -17049,7 +17124,8 @@ static int do_meta_command(char *zLine, ShellState *p) if( pSession->p==0 ) goto session_not_open; out = fopen(azCmd[1], "wb"); if( out==0 ){ - utf8_printf(stderr, "ERROR: cannot open \"%s\" for writing\n", azCmd[1]); + utf8_printf(stderr, "ERROR: cannot open \"%s\" for writing\n", + azCmd[1]); }else{ int szChng; void *pChng; @@ -17370,8 +17446,7 @@ static int do_meta_command(char *zLine, ShellState *p) { utf8_printf(stderr, "Unknown option \"%s\" on \"%s\"\n", azArg[i], azArg[0]); - raw_printf(stderr, "Should be one of: --schema" - " --sha3-224 --sha3-256 --sha3-384 --sha3-512\n"); + showHelp(p->out, azArg[0]); rc = 1; goto meta_command_exit; } @@ -17417,8 +17492,7 @@ static int do_meta_command(char *zLine, ShellState *p) }else if( strcmp(zTab, "sqlite_stat1")==0 ){ appendText(&sQuery,"SELECT tbl,idx,stat FROM sqlite_stat1" " ORDER BY tbl,idx;", 0); - }else if( strcmp(zTab, "sqlite_stat3")==0 - || strcmp(zTab, "sqlite_stat4")==0 ){ + }else if( strcmp(zTab, "sqlite_stat4")==0 ){ appendText(&sQuery, "SELECT * FROM ", 0); appendText(&sQuery, zTab, 0); appendText(&sQuery, " ORDER BY tbl, idx, rowid;\n", 0); @@ -17650,25 +17724,26 @@ static int do_meta_command(char *zLine, ShellState *p) int ctrlCode; /* Integer code for that option */ const char *zUsage; /* Usage notes */ } aCtrl[] = { - { "always", SQLITE_TESTCTRL_ALWAYS, "BOOLEAN" }, - { "assert", SQLITE_TESTCTRL_ASSERT, "BOOLEAN" }, - /*{ "benign_malloc_hooks",SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS, "" },*/ - /*{ "bitvec_test", SQLITE_TESTCTRL_BITVEC_TEST, "" },*/ - { "byteorder", SQLITE_TESTCTRL_BYTEORDER, "" }, - /*{ "fault_install", SQLITE_TESTCTRL_FAULT_INSTALL, "" }, */ - { "imposter", SQLITE_TESTCTRL_IMPOSTER, "SCHEMA ON/OFF ROOTPAGE"}, - { "internal_functions", SQLITE_TESTCTRL_INTERNAL_FUNCTIONS, "BOOLEAN" }, - { "localtime_fault", SQLITE_TESTCTRL_LOCALTIME_FAULT,"BOOLEAN" }, - { "never_corrupt", SQLITE_TESTCTRL_NEVER_CORRUPT, "BOOLEAN" }, - { "optimizations", SQLITE_TESTCTRL_OPTIMIZATIONS, "DISABLE-MASK" }, + { "always", SQLITE_TESTCTRL_ALWAYS, "BOOLEAN" }, + { "assert", SQLITE_TESTCTRL_ASSERT, "BOOLEAN" }, + /*{ "benign_malloc_hooks",SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS, "" },*/ + /*{ "bitvec_test", SQLITE_TESTCTRL_BITVEC_TEST, "" },*/ + { "byteorder", SQLITE_TESTCTRL_BYTEORDER, "" }, + { "extra_schema_checks",SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS,"BOOLEAN" }, + /*{ "fault_install", SQLITE_TESTCTRL_FAULT_INSTALL, "" },*/ + { "imposter", SQLITE_TESTCTRL_IMPOSTER, "SCHEMA ON/OFF ROOTPAGE"}, + { "internal_functions", SQLITE_TESTCTRL_INTERNAL_FUNCTIONS, "BOOLEAN" }, + { "localtime_fault", SQLITE_TESTCTRL_LOCALTIME_FAULT,"BOOLEAN" }, + { "never_corrupt", SQLITE_TESTCTRL_NEVER_CORRUPT, "BOOLEAN" }, + { "optimizations", SQLITE_TESTCTRL_OPTIMIZATIONS, "DISABLE-MASK" }, #ifdef YYCOVERAGE - { "parser_coverage", SQLITE_TESTCTRL_PARSER_COVERAGE, "" }, + { "parser_coverage", SQLITE_TESTCTRL_PARSER_COVERAGE, "" }, #endif - { "pending_byte", SQLITE_TESTCTRL_PENDING_BYTE, "OFFSET " }, - { "prng_reset", SQLITE_TESTCTRL_PRNG_RESET, "" }, - { "prng_restore", SQLITE_TESTCTRL_PRNG_RESTORE, "" }, - { "prng_save", SQLITE_TESTCTRL_PRNG_SAVE, "" }, - { "reserve", SQLITE_TESTCTRL_RESERVE, "BYTES-OF-RESERVE" }, + { "pending_byte", SQLITE_TESTCTRL_PENDING_BYTE, "OFFSET " }, + { "prng_restore", SQLITE_TESTCTRL_PRNG_RESTORE, "" }, + { "prng_save", SQLITE_TESTCTRL_PRNG_SAVE, "" }, + { "prng_seed", SQLITE_TESTCTRL_PRNG_SEED, "SEED ?db?" }, + { "reserve", SQLITE_TESTCTRL_RESERVE, "BYTES-OF-RESERVE"}, }; int testctrl = -1; int iCtrl = -1; @@ -17749,6 +17824,27 @@ static int do_meta_command(char *zLine, ShellState *p) } break; + /* sqlite3_test_control(int, int, sqlite3*) */ + case SQLITE_TESTCTRL_PRNG_SEED: + if( nArg==3 || nArg==4 ){ + int ii = (int)integerValue(azArg[2]); + sqlite3 *db; + if( ii==0 && strcmp(azArg[2],"random")==0 ){ + sqlite3_randomness(sizeof(ii),&ii); + printf("-- random seed: %d\n", ii); + } + if( nArg==3 ){ + db = 0; + }else{ + db = p->db; + /* Make sure the schema has been loaded */ + sqlite3_table_column_metadata(db, 0, "x", 0, 0, 0, 0, 0, 0); + } + rc2 = sqlite3_test_control(testctrl, ii, db); + isOk = 3; + } + break; + /* sqlite3_test_control(int, int) */ case SQLITE_TESTCTRL_ASSERT: case SQLITE_TESTCTRL_ALWAYS: @@ -17790,7 +17886,7 @@ static int do_meta_command(char *zLine, ShellState *p) } } if( isOk==0 && iCtrl>=0 ){ - utf8_printf(p->out, "Usage: .testctrl %s %s\n", zCmd, aCtrl[iCtrl].zUsage); + utf8_printf(p->out, "Usage: .testctrl %s %s\n", zCmd,aCtrl[iCtrl].zUsage); rc = 1; }else if( isOk==1 ){ raw_printf(p->out, "%d\n", rc2); @@ -17868,6 +17964,31 @@ static int do_meta_command(char *zLine, ShellState *p) }else #endif /* !defined(SQLITE_OMIT_TRACE) */ +#if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_VIRTUALTABLE) + if( c=='u' && strncmp(azArg[0], "unmodule", n)==0 ){ + int ii; + int lenOpt; + char *zOpt; + if( nArg<2 ){ + raw_printf(stderr, "Usage: .unmodule [--allexcept] NAME ...\n"); + rc = 1; + goto meta_command_exit; + } + open_db(p, 0); + zOpt = azArg[1]; + if( zOpt[0]=='-' && zOpt[1]=='-' && zOpt[2]!=0 ) zOpt++; + lenOpt = (int)strlen(zOpt); + if( lenOpt>=3 && strncmp(zOpt, "-allexcept",lenOpt)==0 ){ + assert( azArg[nArg]==0 ); + sqlite3_drop_modules(p->db, nArg>2 ? (const char**)(azArg+2) : 0); + }else{ + for(ii=1; iidb, azArg[ii], 0, 0); + } + } + }else +#endif + #if SQLITE_USER_AUTHENTICATION if( c=='u' && strncmp(azArg[0], "user", n)==0 ){ if( nArg<2 ){ @@ -17882,7 +18003,8 @@ static int do_meta_command(char *zLine, ShellState *p) rc = 1; goto meta_command_exit; } - rc = sqlite3_user_authenticate(p->db, azArg[2], azArg[3], strlen30(azArg[3])); + rc = sqlite3_user_authenticate(p->db, azArg[2], azArg[3], + strlen30(azArg[3])); if( rc ){ utf8_printf(stderr, "Authentication failed for user %s\n", azArg[2]); rc = 1; Modified: vendor/sqlite3/dist/sqlite3.c ============================================================================== --- vendor/sqlite3/dist/sqlite3.c Sat Nov 2 17:50:28 2019 (r354256) +++ vendor/sqlite3/dist/sqlite3.c Sat Nov 2 17:57:02 2019 (r354257) @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.29.0. By combining all the individual C code files into this +** version 3.30.1. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -331,8 +331,6 @@ static const char * const sqlite3azCompileOpt[] = { #endif #if defined(SQLITE_ENABLE_STAT4) "ENABLE_STAT4", -#elif defined(SQLITE_ENABLE_STAT3) - "ENABLE_STAT3", #endif #if SQLITE_ENABLE_STMTVTAB "ENABLE_STMTVTAB", @@ -1167,9 +1165,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.29.0" -#define SQLITE_VERSION_NUMBER 3029000 -#define SQLITE_SOURCE_ID "2019-07-10 17:32:03 fc82b73eaac8b36950e527f12c4b5dc1e147e6f4ad2217ae43ad82882a88bfa6" +#define SQLITE_VERSION "3.30.1" +#define SQLITE_VERSION_NUMBER 3030001 +#define SQLITE_SOURCE_ID "2019-10-10 20:19:45 18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3df1b0b" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -3137,6 +3135,17 @@ struct sqlite3_mem_methods { ** following this call. The second parameter may be a NULL pointer, in ** which case the trigger setting is not reported back. ** +** [[SQLITE_DBCONFIG_ENABLE_VIEW]] +**
SQLITE_DBCONFIG_ENABLE_VIEW
+**
^This option is used to enable or disable [CREATE VIEW | views]. +** There should be two additional arguments. +** The first argument is an integer which is 0 to disable views, +** positive to enable views or negative to leave the setting unchanged. +** The second parameter is a pointer to an integer into which +** is written 0 or 1 to indicate whether views are disabled or enabled +** following this call. The second parameter may be a NULL pointer, in +** which case the view setting is not reported back.
+** ** [[SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER]] **
SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
**
^This option is used to enable or disable the @@ -3309,7 +3318,8 @@ struct sqlite3_mem_methods { #define SQLITE_DBCONFIG_LEGACY_ALTER_TABLE 1012 /* int int* */ #define SQLITE_DBCONFIG_DQS_DML 1013 /* int int* */ #define SQLITE_DBCONFIG_DQS_DDL 1014 /* int int* */ -#define SQLITE_DBCONFIG_MAX 1014 /* Largest DBCONFIG */ +#define SQLITE_DBCONFIG_ENABLE_VIEW 1015 /* int int* */ +#define SQLITE_DBCONFIG_MAX 1015 /* Largest DBCONFIG */ /* ** CAPI3REF: Enable Or Disable Extended Result Codes @@ -4858,7 +4868,7 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int new ** ^The specific value of WHERE-clause [parameter] might influence the ** choice of query plan if the parameter is the left-hand side of a [LIKE] ** or [GLOB] operator or if the parameter is compared to an indexed column -** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled. +** and the [SQLITE_ENABLE_STAT4] compile-time option is enabled. ** ** ** @@ -5893,6 +5903,12 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); ** perform additional optimizations on deterministic functions, so use ** of the [SQLITE_DETERMINISTIC] flag is recommended where possible. ** +** ^The fourth parameter may also optionally include the [SQLITE_DIRECTONLY] +** flag, which if present prevents the function from being invoked from +** within VIEWs or TRIGGERs. For security reasons, the [SQLITE_DIRECTONLY] +** flag is recommended for any application-defined SQL function that has +** side-effects. +** ** ^(The fifth parameter is an arbitrary pointer. The implementation of the ** function can gain access to this pointer using [sqlite3_user_data()].)^ ** @@ -6009,8 +6025,30 @@ SQLITE_API int sqlite3_create_window_function( ** [SQLITE_UTF8 | preferred text encoding] as the fourth argument ** to [sqlite3_create_function()], [sqlite3_create_function16()], or ** [sqlite3_create_function_v2()]. +** +** The SQLITE_DETERMINISTIC flag means that the new function will always +** maps the same inputs into the same output. The abs() function is +** deterministic, for example, but randomblob() is not. +** +** The SQLITE_DIRECTONLY flag means that the function may only be invoked +** from top-level SQL, and cannot be used in VIEWs or TRIGGERs. This is +** a security feature which is recommended for all +** [application-defined SQL functions] that have side-effects. This flag +** prevents an attacker from adding triggers and views to a schema then +** tricking a high-privilege application into causing unintended side-effects +** while performing ordinary queries. +** +** The SQLITE_SUBTYPE flag indicates to SQLite that a function may call +** [sqlite3_value_subtype()] to inspect the sub-types of its arguments. +** Specifying this flag makes no difference for scalar or aggregate user +** functions. However, if it is not specified for a user-defined window +** function, then any sub-types belonging to arguments passed to the window +** function may be discarded before the window function is called (i.e. +** sqlite3_value_subtype() will always return 0). */ -#define SQLITE_DETERMINISTIC 0x800 +#define SQLITE_DETERMINISTIC 0x000000800 +#define SQLITE_DIRECTONLY 0x000080000 +#define SQLITE_SUBTYPE 0x000100000 /* ** CAPI3REF: Deprecated Functions @@ -7656,6 +7694,12 @@ struct sqlite3_index_info { ** ^The sqlite3_create_module() ** interface is equivalent to sqlite3_create_module_v2() with a NULL ** destructor. +** +** ^If the third parameter (the pointer to the sqlite3_module object) is +** NULL then no new module is create and any existing modules with the +** same name are dropped. +** +** See also: [sqlite3_drop_modules()] */ SQLITE_API int sqlite3_create_module( sqlite3 *db, /* SQLite connection to register module with */ @@ -7672,6 +7716,23 @@ SQLITE_API int sqlite3_create_module_v2( ); /* +** CAPI3REF: Remove Unnecessary Virtual Table Implementations +** METHOD: sqlite3 +** +** ^The sqlite3_drop_modules(D,L) interface removes all virtual +** table modules from database connection D except those named on list L. +** The L parameter must be either NULL or a pointer to an array of pointers +** to strings where the array is terminated by a single NULL pointer. +** ^If the L parameter is NULL, then all virtual table modules are removed. +** +** See also: [sqlite3_create_module()] +*/ +SQLITE_API int sqlite3_drop_modules( + sqlite3 *db, /* Remove modules from this connection */ + const char **azKeep /* Except, do not remove the ones named here */ +); + +/* ** CAPI3REF: Virtual Table Instance Object ** KEYWORDS: sqlite3_vtab ** @@ -8379,7 +8440,7 @@ SQLITE_API int sqlite3_test_control(int op, ...); #define SQLITE_TESTCTRL_FIRST 5 #define SQLITE_TESTCTRL_PRNG_SAVE 5 #define SQLITE_TESTCTRL_PRNG_RESTORE 6 -#define SQLITE_TESTCTRL_PRNG_RESET 7 +#define SQLITE_TESTCTRL_PRNG_RESET 7 /* NOT USED */ #define SQLITE_TESTCTRL_BITVEC_TEST 8 #define SQLITE_TESTCTRL_FAULT_INSTALL 9 #define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS 10 @@ -8402,7 +8463,9 @@ SQLITE_API int sqlite3_test_control(int op, ...); #define SQLITE_TESTCTRL_IMPOSTER 25 #define SQLITE_TESTCTRL_PARSER_COVERAGE 26 #define SQLITE_TESTCTRL_RESULT_INTREAL 27 -#define SQLITE_TESTCTRL_LAST 27 /* Largest TESTCTRL */ +#define SQLITE_TESTCTRL_PRNG_SEED 28 +#define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29 +#define SQLITE_TESTCTRL_LAST 29 /* Largest TESTCTRL */ /* ** CAPI3REF: SQL Keyword Checking @@ -13099,15 +13162,15 @@ struct fts5_api { ** So we have to define the macros in different ways depending on the ** compiler. */ -#if defined(__PTRDIFF_TYPE__) /* This case should work for GCC */ +#if defined(HAVE_STDINT_H) /* Use this case if we have ANSI headers */ +# define SQLITE_INT_TO_PTR(X) ((void*)(intptr_t)(X)) +# define SQLITE_PTR_TO_INT(X) ((int)(intptr_t)(X)) +#elif defined(__PTRDIFF_TYPE__) /* This case should work for GCC */ # define SQLITE_INT_TO_PTR(X) ((void*)(__PTRDIFF_TYPE__)(X)) # define SQLITE_PTR_TO_INT(X) ((int)(__PTRDIFF_TYPE__)(X)) #elif !defined(__GNUC__) /* Works for compilers other than LLVM */ # define SQLITE_INT_TO_PTR(X) ((void*)&((char*)0)[X]) # define SQLITE_PTR_TO_INT(X) ((int)(((char*)X)-(char*)0)) -#elif defined(HAVE_STDINT_H) /* Use this case if we have ANSI headers */ -# define SQLITE_INT_TO_PTR(X) ((void*)(intptr_t)(X)) -# define SQLITE_PTR_TO_INT(X) ((int)(intptr_t)(X)) #else /* Generates a warning - but it always works */ # define SQLITE_INT_TO_PTR(X) ((void*)(X)) # define SQLITE_PTR_TO_INT(X) ((int)(X)) @@ -13597,100 +13660,103 @@ SQLITE_PRIVATE void sqlite3HashClear(Hash*); #define TK_VIEW 79 #define TK_VIRTUAL 80 #define TK_WITH 81 -#define TK_CURRENT 82 -#define TK_FOLLOWING 83 -#define TK_PARTITION 84 -#define TK_PRECEDING 85 -#define TK_RANGE 86 -#define TK_UNBOUNDED 87 -#define TK_EXCLUDE 88 -#define TK_GROUPS 89 -#define TK_OTHERS 90 -#define TK_TIES 91 -#define TK_REINDEX 92 -#define TK_RENAME 93 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Nov 2 18:00:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75FC51AE1B8; Sat, 2 Nov 2019 18:00:17 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4756KY2Xvmz413C; Sat, 2 Nov 2019 18:00:17 +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 2374A270D5; Sat, 2 Nov 2019 18:00:17 +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 xA2I0HKm085912; Sat, 2 Nov 2019 18:00:17 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2I0HrO085911; Sat, 2 Nov 2019 18:00:17 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201911021800.xA2I0HrO085911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 2 Nov 2019 18:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r354258 - vendor/sqlite3/sqlite-3300100 X-SVN-Group: vendor X-SVN-Commit-Author: cy X-SVN-Commit-Paths: vendor/sqlite3/sqlite-3300100 X-SVN-Commit-Revision: 354258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 18:00:17 -0000 Author: cy Date: Sat Nov 2 18:00:16 2019 New Revision: 354258 URL: https://svnweb.freebsd.org/changeset/base/354258 Log: Import sqlite3-3.30.1 (3300100) Added: vendor/sqlite3/sqlite-3300100/ - copied from r354257, vendor/sqlite3/dist/ From owner-svn-src-all@freebsd.org Sat Nov 2 18:23:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B0791AEF18; Sat, 2 Nov 2019 18:23:00 +0000 (UTC) (envelope-from mack@macktronics.com) Received: from mail.macktronics.com (coco.macktronics.com [209.181.253.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4756qk6pMKz42SS; Sat, 2 Nov 2019 18:22:58 +0000 (UTC) (envelope-from mack@macktronics.com) Received: from olive.macktronics.com (unknown [209.181.253.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.macktronics.com (Postfix) with ESMTPS id AC50D14EC5; Sat, 2 Nov 2019 13:22:52 -0500 (CDT) Date: Sat, 2 Nov 2019 13:22:52 -0500 (CDT) From: Dan Mack X-X-Sender: mack@localhost.local To: Toomas Soome cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r354254 - head/sys/cddl/boot/zfs In-Reply-To: <201911021508.xA2F8Jvw082082@repo.freebsd.org> Message-ID: References: <201911021508.xA2F8Jvw082082@repo.freebsd.org> User-Agent: Alpine 2.20 (GSO 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 4756qk6pMKz42SS X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=macktronics.com; spf=pass (mx1.freebsd.org: domain of mack@macktronics.com designates 209.181.253.65 as permitted sender) smtp.mailfrom=mack@macktronics.com X-Spamd-Result: default: False [-2.75 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.93)[-0.934,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.181.253.64/29]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-0.01)[asn: 209(-0.01), country: US(-0.05)]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; DMARC_POLICY_ALLOW(-0.50)[macktronics.com,none]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:209, ipnet:209.180.0.0/15, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 18:23:00 -0000 I'm still getting a build failure on r354254: --- all_subdir_rescue --- ld: error: undefined symbol: lz4_init >>> referenced by spa_misc.c:2066 (/usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c:2066) >>> spa_misc.o:(spa_init) in archive /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libzpool.a ld: error: undefined symbol: lz4_fini >>> referenced by spa_misc.c:2096 (/usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c:2096) >>> spa_misc.o:(spa_fini) in archive /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libzpool.a --- all_subdir_lib --- root@k2:/usr/src # svnlite info . Path: . Working Copy Root Path: /usr/src URL: https://svn.freebsd.org/base/head Relative URL: ^/head Repository Root: https://svn.freebsd.org/base Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f Revision: 354254 Node Kind: directory Schedule: normal Last Changed Author: tsoome Last Changed Rev: 354254 On Sat, 2 Nov 2019, Toomas Soome wrote: > Author: tsoome > Date: Sat Nov 2 15:08:19 2019 > New Revision: 354254 > URL: https://svnweb.freebsd.org/changeset/base/354254 > > Log: > r354253 did miss lz4.c from sys/cddl/boot/zfs. > > Deleted: > head/sys/cddl/boot/zfs/lz4.c > _______________________________________________ > 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" > From owner-svn-src-all@freebsd.org Sat Nov 2 19:12:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 493181607A9; Sat, 2 Nov 2019 19:12:50 +0000 (UTC) (envelope-from freebsd@bdragon.rtk0.net) Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4757xF3dHrz44X7; Sat, 2 Nov 2019 19:12:49 +0000 (UTC) (envelope-from freebsd@bdragon.rtk0.net) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 3675A46E; Sat, 2 Nov 2019 15:12:47 -0400 (EDT) Received: from imap1 ([10.202.2.51]) by compute5.internal (MEProxy); Sat, 02 Nov 2019 15:12:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=T6hAS+ OosLmsAG5/egEOvdUXH8atEM7a8m/EFN8b6QY=; b=gDjr9ilA+M1Qky3+WH+D/t dEyrNRrk1k1o6l1HDHn9ex4A4pIGaVii6wGSIVgM67/XIy6RWS0QwhsP4afPIuc9 j2Cf+6bJINNgtC4nMfLhZSVvkJPSLn2wRL0PxjllBvz0LTMIu+3aN0q/xcondLgr Qi4p1XYL5+grs+odOw4Q21xILFjwr4Te7OKirF1XzGKVKWiuhFSbJnXZvvpJH1BI TShPLagYY5E6Cpz396bg9f75W4gMJzX467mfioPhOJoghlJdmc5pswm1BlhHovZe g2q9CmuVEGdkLOK1l//tmP3YFFD0MMyjRxv9ubNKKziybo2q042KdMCppJT9RVOQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedruddtledguddvtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfuehr rghnughonhcuuegvrhhgrhgvnhdfuceofhhrvggvsghsugessggurhgrghhonhdrrhhtkh dtrdhnvghtqeenucfrrghrrghmpehmrghilhhfrhhomhepfhhrvggvsghsugessggurhgr ghhonhdrrhhtkhdtrdhnvghtnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 295B2C200A4; Sat, 2 Nov 2019 15:12:46 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.7-509-ge3ec61c-fmstable-20191030v1 Mime-Version: 1.0 Message-Id: <48906cfb-b903-47b5-9c38-4f3c76e20f2e@www.fastmail.com> In-Reply-To: References: <201911021508.xA2F8Jvw082082@repo.freebsd.org> Date: Sat, 02 Nov 2019 14:12:23 -0500 From: "Brandon Bergren" To: "Dan Mack" , "Toomas Soome" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r354254 - head/sys/cddl/boot/zfs Content-Type: text/plain X-Rspamd-Queue-Id: 4757xF3dHrz44X7 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=gDjr9ilA; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@bdragon.rtk0.net has no SPF policy when checking 64.147.123.20) smtp.mailfrom=freebsd@bdragon.rtk0.net X-Spamd-Result: default: False [-4.87 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; R_DKIM_ALLOW(-0.20)[messagingengine.com:s=fm1]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; IP_SCORE(-3.48)[ip: (-9.77), ipnet: 64.147.123.0/24(-4.91), asn: 11403(-2.68), country: US(-0.05)]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[rtk0.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[messagingengine.com:+]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[20.123.147.64.list.dnswl.org : 127.0.5.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:11403, ipnet:64.147.123.0/24, country:US]; RCVD_TLS_LAST(0.00)[]; MID_RHS_WWW(0.50)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 19:12:50 -0000 sys/conf/files also contains a reference to cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c still. This breaks building zfs into the kernel (which builds kernels that are explicitly nonredistributable because of the licence incompatibility, but is useful for having root-on-zfs in circumstances like powerpc64 powernv where there is no native FreeBSD loader at the moment) From owner-svn-src-all@freebsd.org Sat Nov 2 19:22:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9DA36160CCD; Sat, 2 Nov 2019 19:22:35 +0000 (UTC) (envelope-from freebsd@bdragon.rtk0.net) Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47588V5HFyz453v; Sat, 2 Nov 2019 19:22:34 +0000 (UTC) (envelope-from freebsd@bdragon.rtk0.net) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 342983AC; Sat, 2 Nov 2019 15:22:33 -0400 (EDT) Received: from imap1 ([10.202.2.51]) by compute5.internal (MEProxy); Sat, 02 Nov 2019 15:22:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=BKs1Sy +DY91cGCD4kBWY3WEUA8ZbvTEQeIOquL2jDmA=; b=UyJy8ZKd+0aPtK3W4Lu9YR zOtd2SDR0PJhkpw8HcByQU4S37U7Nfp2VmUIR9M/93ksYZpOKnwZ8ziqxrcBZdIJ s9XEM6Xkf72OUh1rjOcJChgMOzXqlxwT5CekMiQHSNfuDRRvWX3ymyn9trczV8o/ A35NCadmz89z9s98uup4AFbAlS7NMH0YdwM9DlgBbsoQLy7WExZ0OBg7OOTlLSHW /jg+GLcNC2LNpOxqmxfw5iECLbgr0bMOvmooj6UzTanls8fiEDKZzHLEOnicNQA/ Mfz4DJPrfSF4M2Y2xYC42TM1kC/Qkd/3QsMfKoDNmNRci7gaghWhopRKFscC+6bA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedruddtledguddvvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfuehr rghnughonhcuuegvrhhgrhgvnhdfuceofhhrvggvsghsugessggurhgrghhonhdrrhhtkh dtrdhnvghtqeenucffohhmrghinhepphhrvgdrmhhknecurfgrrhgrmhepmhgrihhlfhhr ohhmpehfrhgvvggsshgusegsughrrghgohhnrdhrthhktddrnhgvthenucevlhhushhtvg hrufhiiigvpedt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 5557AC200A4; Sat, 2 Nov 2019 15:22:32 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.7-509-ge3ec61c-fmstable-20191030v1 Mime-Version: 1.0 Message-Id: <81a05d10-a562-4469-b8d8-5403399e80b5@www.fastmail.com> In-Reply-To: <48906cfb-b903-47b5-9c38-4f3c76e20f2e@www.fastmail.com> References: <201911021508.xA2F8Jvw082082@repo.freebsd.org> <48906cfb-b903-47b5-9c38-4f3c76e20f2e@www.fastmail.com> Date: Sat, 02 Nov 2019 14:22:12 -0500 From: "Brandon Bergren" To: "Dan Mack" , "Toomas Soome" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r354254 - head/sys/cddl/boot/zfs Content-Type: text/plain X-Rspamd-Queue-Id: 47588V5HFyz453v X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=UyJy8ZKd; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@bdragon.rtk0.net has no SPF policy when checking 64.147.123.20) smtp.mailfrom=freebsd@bdragon.rtk0.net X-Spamd-Result: default: False [-4.87 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[messagingengine.com:s=fm1]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; IP_SCORE(-3.48)[ip: (-9.76), ipnet: 64.147.123.0/24(-4.91), asn: 11403(-2.68), country: US(-0.05)]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[rtk0.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[messagingengine.com:+]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[20.123.147.64.list.dnswl.org : 127.0.5.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:11403, ipnet:64.147.123.0/24, country:US]; RCVD_TLS_LAST(0.00)[]; MID_RHS_WWW(0.50)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 19:22:35 -0000 On Sat, Nov 2, 2019, at 2:12 PM, Brandon Bergren wrote: > sys/conf/files also contains a reference to > cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c still. This breaks > building zfs into the kernel (which builds kernels that are explicitly > nonredistributable because of the licence incompatibility, but is > useful for having root-on-zfs in circumstances like powerpc64 powernv > where there is no native FreeBSD loader at the moment) > Additionally, it looks like sys/cddl/contrib/opensolaris/common/lz4 was never added to ZFS_CFLAGS in sys/conf/kern.pre.mk From owner-svn-src-all@freebsd.org Sat Nov 2 19:33:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 540621614B5; Sat, 2 Nov 2019 19:33:03 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4758Nb1cjjz45Xk; Sat, 2 Nov 2019 19:33:03 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C22A2E9; Sat, 2 Nov 2019 19:33:03 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA2JX2Z2044289; Sat, 2 Nov 2019 19:33:02 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2JX2sK044288; Sat, 2 Nov 2019 19:33:02 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201911021933.xA2JX2sK044288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sat, 2 Nov 2019 19:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354259 - head/sys/riscv/conf X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/riscv/conf X-SVN-Commit-Revision: 354259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 19:33:03 -0000 Author: mhorne Date: Sat Nov 2 19:33:02 2019 New Revision: 354259 URL: https://svnweb.freebsd.org/changeset/base/354259 Log: RISC-V: Remove EARLY_AP_STARTUP from GENERIC This option is causing boot to fail for the Hifive Unleashed and older versions of QEMU (3.1.1). Remove it from the GENERIC config for now. Reported by: br MFC after: 1 week Modified: head/sys/riscv/conf/GENERIC Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Sat Nov 2 18:00:16 2019 (r354258) +++ head/sys/riscv/conf/GENERIC Sat Nov 2 19:33:02 2019 (r354259) @@ -71,7 +71,6 @@ options RACCT # Resource accounting framework options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default options RCTL # Resource limits options SMP -options EARLY_AP_STARTUP options INTRNG # RISC-V SBI console From owner-svn-src-all@freebsd.org Sat Nov 2 19:46:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4BCAC161A59; Sat, 2 Nov 2019 19:46:40 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4758hJ1GCGz461J; Sat, 2 Nov 2019 19:46:40 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E65A4C8; Sat, 2 Nov 2019 19:46:40 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA2JkdSH050085; Sat, 2 Nov 2019 19:46:39 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2JkdjX050083; Sat, 2 Nov 2019 19:46:39 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201911021946.xA2JkdjX050083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sat, 2 Nov 2019 19:46: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: r354260 - in stable/12/sys: arm64/arm64 kern riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in stable/12/sys: arm64/arm64 kern riscv/riscv X-SVN-Commit-Revision: 354260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 19:46:40 -0000 Author: mhorne Date: Sat Nov 2 19:46:39 2019 New Revision: 354260 URL: https://svnweb.freebsd.org/changeset/base/354260 Log: MFC r340228-r340229, r340231 r340228 by jhb: Enable use of a global shared page for RISC-V. machine/vmparam.h already defines the SHAREDPAGE constant. This change just enables it for ELF executables. The only use of the shared page currently is to hold the signal trampoline. Reviewed by: markj, kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17875 r340229 by jhb: Drop the legacy ELF brandinfo for the old rtld from arm64 and riscv. These architectures never shipped binaries with an rtld path of /usr/libexec/ld-elf.so.1. Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17876 r340231 by jhb: Enable non-executable stacks by default on RISC-V. Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17878 Modified: stable/12/sys/arm64/arm64/elf_machdep.c stable/12/sys/kern/imgact_elf.c stable/12/sys/riscv/riscv/elf_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/arm64/elf_machdep.c ============================================================================== --- stable/12/sys/arm64/arm64/elf_machdep.c Sat Nov 2 19:33:02 2019 (r354259) +++ stable/12/sys/arm64/arm64/elf_machdep.c Sat Nov 2 19:46:39 2019 (r354260) @@ -107,21 +107,6 @@ static Elf64_Brandinfo freebsd_brand_info = { SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_info); -static Elf64_Brandinfo freebsd_brand_oinfo = { - .brand = ELFOSABI_FREEBSD, - .machine = EM_AARCH64, - .compat_3_brand = "FreeBSD", - .emul_path = NULL, - .interp_path = "/usr/libexec/ld-elf.so.1", - .sysvec = &elf64_freebsd_sysvec, - .interp_newpath = NULL, - .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE -}; - -SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY, - (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_oinfo); - void elf64_dump_thread(struct thread *td __unused, void *dst __unused, size_t *off __unused) Modified: stable/12/sys/kern/imgact_elf.c ============================================================================== --- stable/12/sys/kern/imgact_elf.c Sat Nov 2 19:33:02 2019 (r354259) +++ stable/12/sys/kern/imgact_elf.c Sat Nov 2 19:46:39 2019 (r354260) @@ -119,7 +119,8 @@ SYSCTL_INT(_debug, OID_AUTO, __elfN(legacy_coredump), int __elfN(nxstack) = #if defined(__amd64__) || defined(__powerpc64__) /* both 64 and 32 bit */ || \ - (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__) + (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__) || \ + defined(__riscv) 1; #else 0; Modified: stable/12/sys/riscv/riscv/elf_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/elf_machdep.c Sat Nov 2 19:33:02 2019 (r354259) +++ stable/12/sys/riscv/riscv/elf_machdep.c Sat Nov 2 19:46:39 2019 (r354260) @@ -84,10 +84,12 @@ struct sysentvec elf64_freebsd_sysvec = { .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_ASLR, + .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP | SV_ASLR, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, + .sv_shared_page_base = SHAREDPAGE, + .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = NULL, .sv_thread_detach = NULL, .sv_trap = NULL, @@ -110,22 +112,6 @@ static Elf64_Brandinfo freebsd_brand_info = { SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t) elf64_insert_brand_entry, &freebsd_brand_info); - -static Elf64_Brandinfo freebsd_brand_oinfo = { - .brand = ELFOSABI_FREEBSD, - .machine = EM_RISCV, - .compat_3_brand = "FreeBSD", - .emul_path = NULL, - .interp_path = "/usr/libexec/ld-elf.so.1", - .sysvec = &elf64_freebsd_sysvec, - .interp_newpath = NULL, - .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE -}; - -SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY, - (sysinit_cfunc_t) elf64_insert_brand_entry, - &freebsd_brand_oinfo); static int debug_kld; SYSCTL_INT(_kern, OID_AUTO, debug_kld, From owner-svn-src-all@freebsd.org Sat Nov 2 19:48:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7881B161B85; Sat, 2 Nov 2019 19:48:43 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4758kg2ZcJz46PK; Sat, 2 Nov 2019 19:48:43 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 367CC4D3; Sat, 2 Nov 2019 19:48:43 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA2JmhKw050228; Sat, 2 Nov 2019 19:48:43 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2JmhxF050227; Sat, 2 Nov 2019 19:48:43 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201911021948.xA2JmhxF050227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sat, 2 Nov 2019 19:48: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: r354261 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 354261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 19:48:43 -0000 Author: mhorne Date: Sat Nov 2 19:48:42 2019 New Revision: 354261 URL: https://svnweb.freebsd.org/changeset/base/354261 Log: MFC r352729: Cleanup of elf_machdep.c Fix some style(9) violations. This also changes the name of the machine-dependent sysctl kern.debug_kld to debug.kld_reloc, and changes its type from int to bool. This is acceptable since we are not currently concerned with preserving the RISC-V ABI. Reviewed by: markj, kp Differential Revision: https://reviews.freebsd.org/D21772 Modified: stable/12/sys/riscv/riscv/elf_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/elf_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/elf_machdep.c Sat Nov 2 19:46:39 2019 (r354260) +++ stable/12/sys/riscv/riscv/elf_machdep.c Sat Nov 2 19:48:42 2019 (r354261) @@ -110,13 +110,11 @@ static Elf64_Brandinfo freebsd_brand_info = { }; SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST, - (sysinit_cfunc_t) elf64_insert_brand_entry, - &freebsd_brand_info); + (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_info); -static int debug_kld; -SYSCTL_INT(_kern, OID_AUTO, debug_kld, - CTLFLAG_RW, &debug_kld, 0, - "Activate debug prints in elf_reloc_internal()"); +static bool debug_kld; +SYSCTL_BOOL(_debug, OID_AUTO, kld_reloc, CTLFLAG_RW, &debug_kld, 0, + "Activate debug prints in elf_reloc_internal()"); struct type2str_ent { int type; @@ -275,7 +273,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas uint32_t before32_1; uint32_t before32; uint64_t before64; - uint32_t* insn32p; + uint32_t *insn32p; uint32_t imm20; int error; @@ -283,15 +281,15 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas case ELF_RELOC_RELA: rela = (const Elf_Rela *)data; where = (Elf_Addr *)(relocbase + rela->r_offset); - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; addend = rela->r_addend; rtype = ELF_R_TYPE(rela->r_info); symidx = ELF_R_SYM(rela->r_info); break; default: printf("%s:%d unknown reloc type %d\n", - __FUNCTION__, __LINE__, type); - return -1; + __FUNCTION__, __LINE__, type); + return (-1); } switch (rtype) { @@ -302,43 +300,36 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas case R_RISCV_JUMP_SLOT: error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); val = addr; before64 = *where; if (*where != val) *where = val; - if (debug_kld) - printf("%p %c %-24s %016lx -> %016lx\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before64, *where); + printf("%p %c %-24s %016lx -> %016lx\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before64, *where); break; case R_RISCV_RELATIVE: before64 = *where; - *where = elf_relocaddr(lf, relocbase + addend); - if (debug_kld) - printf("%p %c %-24s %016lx -> %016lx\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before64, *where); + printf("%p %c %-24s %016lx -> %016lx\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before64, *where); break; case R_RISCV_JAL: error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); val = addr - (Elf_Addr)where; - if ((val <= -(1UL << 20) || (1UL << 20) <= val)) { + if (val <= -(1UL << 20) || (1UL << 20) <= val) { printf("kldload: huge offset against R_RISCV_JAL\n"); - return -1; + return (-1); } before32 = *insn32p; @@ -346,13 +337,10 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas *insn32p = insert_imm(*insn32p, val, 10, 1, 21); *insn32p = insert_imm(*insn32p, val, 11, 11, 20); *insn32p = insert_imm(*insn32p, val, 19, 12, 12); - if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; case R_RISCV_CALL: @@ -360,14 +348,15 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas * R_RISCV_CALL relocates 8-byte region that consists * of the sequence of AUIPC and JALR. */ - /* calculate and check the pc relative offset. */ + /* Calculate and check the pc relative offset. */ error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); + val = addr - (Elf_Addr)where; - if ((val <= -(1UL << 32) || (1UL << 32) <= val)) { + if (val <= -(1UL << 32) || (1UL << 32) <= val) { printf("kldload: huge offset against R_RISCV_CALL\n"); - return -1; + return (-1); } /* Relocate AUIPC. */ @@ -378,112 +367,91 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas /* Relocate JALR. */ before32_1 = insn32p[1]; insn32p[1] = insert_imm(insn32p[1], val, 11, 0, 20); - if (debug_kld) - printf("%p %c %-24s %08x %08x -> %08x %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, insn32p[0], - before32_1, insn32p[1]); + printf("%p %c %-24s %08x %08x -> %08x %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, insn32p[0], before32_1, insn32p[1]); break; case R_RISCV_PCREL_HI20: val = addr - (Elf_Addr)where; - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; before32 = *insn32p; imm20 = calc_hi20_imm(val); *insn32p = insert_imm(*insn32p, imm20, 31, 12, 12); - if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; case R_RISCV_PCREL_LO12_I: val = addr - (Elf_Addr)where; - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; before32 = *insn32p; *insn32p = insert_imm(*insn32p, addr, 11, 0, 20); - if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; case R_RISCV_PCREL_LO12_S: val = addr - (Elf_Addr)where; - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; before32 = *insn32p; *insn32p = insert_imm(*insn32p, addr, 11, 5, 25); *insn32p = insert_imm(*insn32p, addr, 4, 0, 7); if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; case R_RISCV_HI20: error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; before32 = *insn32p; imm20 = calc_hi20_imm(val); *insn32p = insert_imm(*insn32p, imm20, 31, 12, 12); - if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; case R_RISCV_LO12_I: error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); val = addr; - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; before32 = *insn32p; *insn32p = insert_imm(*insn32p, addr, 11, 0, 20); - if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; case R_RISCV_LO12_S: error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); val = addr; - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; before32 = *insn32p; *insn32p = insert_imm(*insn32p, addr, 11, 5, 25); *insn32p = insert_imm(*insn32p, addr, 4, 0, 7); - if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; default: From owner-svn-src-all@freebsd.org Sat Nov 2 19:50:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF5AF161CF9; Sat, 2 Nov 2019 19:50:36 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4758mr5dgSz46YQ; Sat, 2 Nov 2019 19:50:36 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A50DC4DD; Sat, 2 Nov 2019 19:50:36 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA2JoaFv051034; Sat, 2 Nov 2019 19:50:36 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2Joa6S051033; Sat, 2 Nov 2019 19:50:36 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201911021950.xA2Joa6S051033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sat, 2 Nov 2019 19:50: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: r354262 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 354262 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 19:50:36 -0000 Author: mhorne Date: Sat Nov 2 19:50:36 2019 New Revision: 354262 URL: https://svnweb.freebsd.org/changeset/base/354262 Log: MFC r352730: Fix some broken relocation handling In a few cases, the symbol lookup is missing before attempting to perform the relocation. While the relocation types affected are currently unused, this results in an uninitialized variable warning, that is escalated to an error when building with clang. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D21773 Modified: stable/12/sys/riscv/riscv/elf_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/elf_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/elf_machdep.c Sat Nov 2 19:48:42 2019 (r354261) +++ stable/12/sys/riscv/riscv/elf_machdep.c Sat Nov 2 19:50:36 2019 (r354262) @@ -374,6 +374,10 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; case R_RISCV_PCREL_HI20: + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return (-1); + val = addr - (Elf_Addr)where; insn32p = (uint32_t *)where; before32 = *insn32p; @@ -386,6 +390,10 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; case R_RISCV_PCREL_LO12_I: + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return (-1); + val = addr - (Elf_Addr)where; insn32p = (uint32_t *)where; before32 = *insn32p; @@ -397,6 +405,10 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; case R_RISCV_PCREL_LO12_S: + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return (-1); + val = addr - (Elf_Addr)where; insn32p = (uint32_t *)where; before32 = *insn32p; @@ -413,6 +425,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas if (error != 0) return (-1); + val = addr; insn32p = (uint32_t *)where; before32 = *insn32p; imm20 = calc_hi20_imm(val); From owner-svn-src-all@freebsd.org Sat Nov 2 19:52:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DA0F161E0D; Sat, 2 Nov 2019 19:52:23 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4758pv0qxRz46ty; Sat, 2 Nov 2019 19:52:23 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 000B867C; Sat, 2 Nov 2019 19:52:22 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA2JqM0x056302; Sat, 2 Nov 2019 19:52:22 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2JqMKE056301; Sat, 2 Nov 2019 19:52:22 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201911021952.xA2JqMKE056301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sat, 2 Nov 2019 19:52: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: r354263 - stable/12/lib/libthr/arch/riscv/include X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: stable/12/lib/libthr/arch/riscv/include X-SVN-Commit-Revision: 354263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 19:52:23 -0000 Author: mhorne Date: Sat Nov 2 19:52:22 2019 New Revision: 354263 URL: https://svnweb.freebsd.org/changeset/base/354263 Log: MFC r353334: RISC-V: Fix an alignment warning in libthr Compiling with clang gives a loss-of-alignment error due the cast to uint8_t *. Since the TLS is always tcb aligned and TP_OFFSET is defined as sizeof(struct tcb) we can guarantee there is no misalignment. Silence the error by moving the offset into the inline assembly. Reviewed by: br Differential Revision: https://reviews.freebsd.org/D21926 Modified: stable/12/lib/libthr/arch/riscv/include/pthread_md.h Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libthr/arch/riscv/include/pthread_md.h ============================================================================== --- stable/12/lib/libthr/arch/riscv/include/pthread_md.h Sat Nov 2 19:50:36 2019 (r354262) +++ stable/12/lib/libthr/arch/riscv/include/pthread_md.h Sat Nov 2 19:52:22 2019 (r354263) @@ -62,7 +62,7 @@ static __inline void _tcb_set(struct tcb *tcb) { - __asm __volatile("mv tp, %0" :: "r"((uint8_t *)tcb + TP_OFFSET)); + __asm __volatile("addi tp, %0, %1" :: "r"(tcb), "I"(TP_OFFSET)); } /* @@ -71,11 +71,11 @@ _tcb_set(struct tcb *tcb) static __inline struct tcb * _tcb_get(void) { - register uint8_t *_tp; + struct tcb *_tcb; - __asm __volatile("mv %0, tp" : "=r"(_tp)); + __asm __volatile("addi %0, tp, %1" : "=r"(_tcb) : "I"(-TP_OFFSET)); - return ((struct tcb *)(_tp - TP_OFFSET)); + return (_tcb); } static __inline struct pthread * From owner-svn-src-all@freebsd.org Sat Nov 2 20:46:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA165163F83; Sat, 2 Nov 2019 20:46:46 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475B1f50kYz49f3; Sat, 2 Nov 2019 20:46:46 +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 7089AF8C; Sat, 2 Nov 2019 20:46:46 +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 xA2KkkU2086272; Sat, 2 Nov 2019 20:46:46 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2KkkqD086270; Sat, 2 Nov 2019 20:46:46 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911022046.xA2KkkqD086270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 2 Nov 2019 20:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354264 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 354264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 20:46:46 -0000 Author: tsoome Date: Sat Nov 2 20:46:45 2019 New Revision: 354264 URL: https://svnweb.freebsd.org/changeset/base/354264 Log: r354253 did miss the updates to sys/conf/files and sys/conf/kern.pre.mk Reported by: Brandon Bergren Modified: head/sys/conf/files head/sys/conf/kern.pre.mk Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Nov 2 19:52:22 2019 (r354263) +++ head/sys/conf/files Sat Nov 2 20:46:45 2019 (r354264) @@ -152,6 +152,7 @@ cddl/compat/opensolaris/kern/opensolaris_vm.c optio cddl/compat/opensolaris/kern/opensolaris_zone.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/acl/acl_common.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/avl/avl.c optional zfs compile-with "${ZFS_C}" +cddl/contrib/opensolaris/lz4/lz4.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/nvpair/opensolaris_fnvpair.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair_alloc_fixed.c optional zfs compile-with "${ZFS_C}" @@ -202,7 +203,6 @@ cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/gzip.c optional zfs compile-with "${ZFS_C}" -cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/lzjb.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/multilist.c optional zfs compile-with "${ZFS_C}" Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Sat Nov 2 19:52:22 2019 (r354263) +++ head/sys/conf/kern.pre.mk Sat Nov 2 20:46:45 2019 (r354264) @@ -197,6 +197,7 @@ CDDL_C= ${CC} -c ${CDDL_CFLAGS} ${WERROR} ${PROF} ${. ZFS_CFLAGS= -DBUILDING_ZFS -I$S/cddl/contrib/opensolaris/uts/common/fs/zfs ZFS_CFLAGS+= -I$S/cddl/contrib/opensolaris/uts/common/fs/zfs/lua ZFS_CFLAGS+= -I$S/cddl/contrib/opensolaris/uts/common/zmod +ZFS_CFLAGS+= -I$S/cddl/contrib/opensolaris/common/lz4 ZFS_CFLAGS+= -I$S/cddl/contrib/opensolaris/common/zfs ZFS_CFLAGS+= ${CDDL_CFLAGS} ZFS_ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${ZFS_CFLAGS} From owner-svn-src-all@freebsd.org Sat Nov 2 21:02:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 802DC164D18; Sat, 2 Nov 2019 21:02:55 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475BNH2nBxz4C5D; Sat, 2 Nov 2019 21:02:55 +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 43053135E; Sat, 2 Nov 2019 21:02:55 +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 xA2L2tXO098043; Sat, 2 Nov 2019 21:02:55 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2L2sQq098040; Sat, 2 Nov 2019 21:02:54 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911022102.xA2L2sQq098040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 2 Nov 2019 21:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354265 - in head: cddl/lib/libzpool sys/cddl/contrib/opensolaris/common/lz4 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head: cddl/lib/libzpool sys/cddl/contrib/opensolaris/common/lz4 X-SVN-Commit-Revision: 354265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 21:02:55 -0000 Author: tsoome Date: Sat Nov 2 21:02:54 2019 New Revision: 354265 URL: https://svnweb.freebsd.org/changeset/base/354265 Log: r354253 did miss the fact that libzpool is built as fake kernel We build libzpool as kernel like, use _FAKE_KERNEL check to include kernel api in libzpool. Added: head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c - copied, changed from r354249, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c head/sys/cddl/contrib/opensolaris/common/lz4/lz4.h (contents, props changed) Replaced: head/sys/cddl/contrib/opensolaris/common/lz4/ Modified: head/cddl/lib/libzpool/Makefile Modified: head/cddl/lib/libzpool/Makefile ============================================================================== --- head/cddl/lib/libzpool/Makefile Sat Nov 2 20:46:45 2019 (r354264) +++ head/cddl/lib/libzpool/Makefile Sat Nov 2 21:02:54 2019 (r354265) @@ -65,6 +65,8 @@ CFLAGS+= -DWANTS_MUTEX_OWNED CFLAGS+= -I${SRCTOP}/lib/libpthread/thread CFLAGS+= -I${SRCTOP}/lib/libpthread/sys CFLAGS+= -I${SRCTOP}/lib/libthr/arch/${MACHINE_CPUARCH}/include +CFLAGS.lz4.o+= -D_FAKE_KERNEL +CFLAGS.lz4.pico+= -D_FAKE_KERNEL CFLAGS.gcc+= -fms-extensions LIBADD= md pthread z nvpair avl umem Copied and modified: head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c (from r354249, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c) ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c Sat Nov 2 09:50:36 2019 (r354249, copy source) +++ head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c Sat Nov 2 21:02:54 2019 (r354265) @@ -35,11 +35,29 @@ * Copyright (c) 2016 by Delphix. All rights reserved. */ +#if defined(_KERNEL) || defined(_FAKE_KERNEL) #include +#elif defined(_STANDALONE) +#include +#include +#include +#include +#include +#define ASSERT assert +#else +#include +#include +#include +#include +#include + +#define ASSERT assert +#endif +#include + static int real_LZ4_compress(const char *source, char *dest, int isize, int osize); -static int LZ4_compressBound(int isize); static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest, int isize, int maxOutputSize); static int LZ4_compressCtx(void *ctx, const char *source, char *dest, @@ -47,11 +65,13 @@ static int LZ4_compressCtx(void *ctx, const char *sour static int LZ4_compress64kCtx(void *ctx, const char *source, char *dest, int isize, int osize); +#if defined(_KERNEL) || defined(_FAKE_KERNEL) static kmem_cache_t *lz4_ctx_cache; +#endif -/*ARGSUSED*/ size_t -lz4_compress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n) +lz4_compress(void *s_start, void *d_start, size_t s_len, size_t d_len, + int n __unused) { uint32_t bufsiz; char *dest = d_start; @@ -71,17 +91,25 @@ lz4_compress(void *s_start, void *d_start, size_t s_le * added to the compressed buffer and which, if unhandled, would * confuse the hell out of our decompression function. */ - *(uint32_t *)dest = BE_32(bufsiz); +#if defined(_KERNEL) || defined(_FAKE_KERNEL) + *(uint32_t *)(void *)dest = BE_32(bufsiz); +#else + *(uint32_t *)(void *)dest = htonl(bufsiz); +#endif return (bufsiz + sizeof (bufsiz)); } -/*ARGSUSED*/ int -lz4_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n) +lz4_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, + int n __unused) { const char *src = s_start; - uint32_t bufsiz = BE_IN32(src); +#if defined(_KERNEL) || defined(_FAKE_KERNEL) + uint32_t bufsiz = BE_IN32(s_start); +#else + uint32_t bufsiz = htonl(*(uint32_t *)s_start); +#endif /* invalid compressed buffer size encoded at start */ if (bufsiz + sizeof (bufsiz) > s_len) @@ -105,20 +133,10 @@ lz4_decompress(void *s_start, void *d_start, size_t s_ * or 0 if the compression fails (if LZ4_COMPRESSMIN is set). * note : destination buffer must be already allocated. * destination buffer must be sized to handle worst cases - * situations (input data not compressible) worst case size - * evaluation is provided by function LZ4_compressBound(). + * situations (input data not compressible). * * Advanced Functions * - * LZ4_compressBound() : - * Provides the maximum size that LZ4 may output in a "worst case" - * scenario (input data not compressible) primarily useful for memory - * allocation of output buffer. - * - * isize : is the input size. Max supported value is ~1.9GB - * return : maximum output size in a "worst case" scenario - * note : this function is limited by "int" range (2^31-1) - * * LZ4_uncompress_unknownOutputSize() : * isize : is the input size, therefore the compressed size * maxOutputSize : is the size of the destination buffer (which must be @@ -292,9 +310,9 @@ typedef struct _U64_S { #pragma pack() #endif -#define A64(x) (((U64_S *)(x))->v) -#define A32(x) (((U32_S *)(x))->v) -#define A16(x) (((U16_S *)(x))->v) +#define A64(x) (((U64_S *)(__DECONST(void *, x)))->v) +#define A32(x) (((U32_S *)(__DECONST(void *, x)))->v) +#define A16(x) (((U16_S *)(__DECONST(void *, x)))->v) /* * Constants @@ -456,14 +474,6 @@ LZ4_NbCommonBytes(register U32 val) #endif -/* Public functions */ - -static int -LZ4_compressBound(int isize) -{ - return (isize + (isize / 255) + 16); -} - /* Compression functions */ /*ARGSUSED*/ @@ -478,7 +488,7 @@ LZ4_compressCtx(void *ctx, const char *source, char *d HTYPE HashTable[HASHTABLESIZE] = { 0 }; #endif - const BYTE *ip = (BYTE *) source; + const BYTE *ip = (const BYTE *) source; INITBASE(base); const BYTE *anchor = ip; const BYTE *const iend = ip + isize; @@ -527,7 +537,7 @@ LZ4_compressCtx(void *ctx, const char *source, char *d } while ((ref < ip - MAX_DISTANCE) || (A32(ref) != A32(ip))); /* Catch up */ - while ((ip > anchor) && (ref > (BYTE *) source) && + while ((ip > anchor) && (ref > (const BYTE *) source) && unlikely(ip[-1] == ref[-1])) { ip--; ref--; @@ -673,7 +683,7 @@ LZ4_compress64kCtx(void *ctx, const char *source, char U16 HashTable[HASH64KTABLESIZE] = { 0 }; #endif - const BYTE *ip = (BYTE *) source; + const BYTE *ip = (const BYTE *) source; const BYTE *anchor = ip; const BYTE *const base = ip; const BYTE *const iend = ip + isize; @@ -720,7 +730,7 @@ LZ4_compress64kCtx(void *ctx, const char *source, char } while (A32(ref) != A32(ip)); /* Catch up */ - while ((ip > anchor) && (ref > (BYTE *) source) && + while ((ip > anchor) && (ref > (const BYTE *) source) && (ip[-1] == ref[-1])) { ip--; ref--; @@ -847,7 +857,11 @@ static int real_LZ4_compress(const char *source, char *dest, int isize, int osize) { #if HEAPMODE +#if defined(_KERNEL) || defined(_FAKE_KERNEL) void *ctx = kmem_cache_alloc(lz4_ctx_cache, KM_NOSLEEP); +#else + void *ctx = malloc(sizeof(struct refTables)); +#endif int result; /* @@ -863,7 +877,11 @@ real_LZ4_compress(const char *source, char *dest, int else result = LZ4_compressCtx(ctx, source, dest, isize, osize); +#if defined(_KERNEL) || defined(_FAKE_KERNEL) kmem_cache_free(lz4_ctx_cache, ctx); +#else + free(ctx); +#endif return (result); #else if (isize < (int)LZ4_64KLIMIT) @@ -876,7 +894,7 @@ real_LZ4_compress(const char *source, char *dest, int /* * Note: The decoding function LZ4_uncompress_unknownOutputSize() is safe - * against "buffer overflow" attack type. They will never write nor + * against "buffer overflow" attack type. It will never write nor * read outside of the provided output buffers. * LZ4_uncompress_unknownOutputSize() also insures that it will never * read outside of the input buffer. A corrupted input will produce @@ -1010,9 +1028,10 @@ LZ4_uncompress_unknownOutputSize(const char *source, c /* write overflow error detected */ _output_error: - return (int)(-(((char *)ip) - source)); + return (int)(-(((const char *)ip) - source)); } +#if defined(_KERNEL) || defined(_FAKE_KERNEL) extern void lz4_init(void) { @@ -1031,3 +1050,4 @@ lz4_fini(void) kmem_cache_destroy(lz4_ctx_cache); #endif } +#endif /* _KERNEL || _FAKE_KERNEL */ Added: head/sys/cddl/contrib/opensolaris/common/lz4/lz4.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/contrib/opensolaris/common/lz4/lz4.h Sat Nov 2 21:02:54 2019 (r354265) @@ -0,0 +1,50 @@ +/* + * LZ4 - Fast LZ compression algorithm + * Header File + * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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 COPYRIGHT HOLDERS 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 COPYRIGHT + * OWNER 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. + * + * You can contact the author at : + * - LZ4 homepage : http://fastcompression.blogspot.com/p/lz4.html + * - LZ4 source repository : http://code.google.com/p/lz4/ + */ + +#ifndef _LZ4_H +#define _LZ4_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +extern size_t lz4_compress(void *, void *, size_t, size_t, int); +extern int lz4_decompress(void *, void *, size_t, size_t, int); + +#ifdef __cplusplus +} +#endif + +#endif /* _LZ4_H */ From owner-svn-src-all@freebsd.org Sat Nov 2 21:15:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B82D165745; Sat, 2 Nov 2019 21:15:58 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475BgL1xXsz4DN9; Sat, 2 Nov 2019 21:15:58 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21C60152C; Sat, 2 Nov 2019 21:15:58 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA2LFweo004305; Sat, 2 Nov 2019 21:15:58 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2LFuWi004298; Sat, 2 Nov 2019 21:15:56 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <201911022115.xA2LFuWi004298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Sat, 2 Nov 2019 21:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354266 - in head/sys: conf powerpc/booke powerpc/conf/dpaa powerpc/include powerpc/mpc85xx powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: in head/sys: conf powerpc/booke powerpc/conf/dpaa powerpc/include powerpc/mpc85xx powerpc/powerpc X-SVN-Commit-Revision: 354266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 21:15:58 -0000 Author: bdragon Date: Sat Nov 2 21:15:56 2019 New Revision: 354266 URL: https://svnweb.freebsd.org/changeset/base/354266 Log: Add support for building Book-E kernels with clang/lld. This involved several changes: * Since lld does not like text relocations, replace SMP boot page text relocs in booke/locore.S with position-independent math, and track the virtual base in the SMP boot page header. * As some SPRs are interpreted differently on clang due to the way it handles platform-specific SPRs, switch m*dear and m*esr mnemonics out for regular m*spr. Add both forms of SPR_DEAR to spr.h so the correct encoding is selected. * Change some hardcoded 32 bit things in the boot page to be pointer-sized, and fix alignment. * Fix 64-bit build of booke/pmap.c when enabling pmap debugging. Additionally, I took the opportunity to document how the SMP boot page works. Approved by: jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D21999 Modified: head/sys/conf/Makefile.powerpc head/sys/powerpc/booke/locore.S head/sys/powerpc/booke/pmap.c head/sys/powerpc/booke/trap_subr.S head/sys/powerpc/conf/dpaa/config.dpaa head/sys/powerpc/include/spr.h head/sys/powerpc/mpc85xx/platform_mpc85xx.c head/sys/powerpc/powerpc/pmap_dispatch.c Modified: head/sys/conf/Makefile.powerpc ============================================================================== --- head/sys/conf/Makefile.powerpc Sat Nov 2 21:02:54 2019 (r354265) +++ head/sys/conf/Makefile.powerpc Sat Nov 2 21:15:56 2019 (r354266) @@ -42,6 +42,20 @@ CFLAGS+= -mabi=spe -D__SPE__ CFLAGS+= -msoft-float CFLAGS.gcc+= -Wa,-many +# Apply compiler-specific DPAA exceptions. +.if "${COMPILER_TYPE}" == "clang" +DPAAWARNFLAGS += \ + -Wno-error=parentheses-equality \ + -Wno-error=self-assign \ + -Wno-error=incompatible-pointer-types-discards-qualifiers \ + -Wno-error=non-literal-null-conversion \ + -Wno-error=enum-conversion +.elif "${COMPILER_TYPE}" == "gcc" && ${COMPILER_VERSION} >= 50200 +DPAAWARNFLAGS += \ + -Wno-error=redundant-decls \ + -Wno-error=int-in-bool-context +.endif + # Build position-independent kernel CFLAGS+= -fPIC LDFLAGS+= -pie Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Sat Nov 2 21:02:54 2019 (r354265) +++ head/sys/powerpc/booke/locore.S Sat Nov 2 21:15:56 2019 (r354266) @@ -39,6 +39,10 @@ #include #include +#ifdef _CALL_ELF +.abiversion _CALL_ELF +#endif + #define TMPSTACKSZ 16384 #ifdef __powerpc64__ @@ -76,6 +80,12 @@ #define WORD_SIZE 4 #endif +#ifdef __powerpc64__ + /* Placate lld by creating a kboot stub. */ + .section ".text.kboot", "x", @progbits + b __start +#endif + .text .globl btext btext: @@ -309,6 +319,9 @@ done_mapping: 1: mflr %r3 ld %r1,0(%r3) add %r1,%r1,%r3 +/* + * Relocate kernel + */ bl 1f .llong _DYNAMIC-. 1: mflr %r3 @@ -379,16 +392,63 @@ done_mapping: .globl __boot_page .align 12 __boot_page: - bl 1f + /* + * The boot page is a special page of memory used during AP bringup. + * Before the AP comes out of reset, the physical 4K page holding this + * code is arranged to be mapped at 0xfffff000 by use of + * platform-dependent registers. + * + * Alternatively, this page may be executed using an ePAPR-standardized + * method -- writing to the address specified in "cpu-release-addr". + * + * In either case, execution begins at the last instruction of the + * page, which is a branch back to the start of the page. + * + * The code in the page must do initial MMU setup and normalize the + * TLBs for regular operation in the correct address space before + * reading outside the page. + * + * This implementation accomplishes this by: + * 1) Wiping TLB0 and all TLB1 entries but the one currently in use. + * 2) Establishing a temporary 4K TLB1 mapping in AS=1, and switching + * to it with rfi. This entry must NOT be in TLB1 slot 0. + * (This is needed to give the code freedom to clean up AS=0.) + * 3) Removing the initial TLB1 entry, leaving us with a single valid + * TLB1 entry, NOT in slot 0. + * 4) Installing an AS0 entry in TLB1 slot 0 mapping the 64MB kernel + * segment at its final virtual address. A second rfi is done to + * switch to the final address space. At this point we can finally + * access the rest of the kernel segment safely. + * 5) The temporary TLB1 AS=1 entry is removed, finally leaving us in + * a consistent (but minimal) state. + * 6) Set up TOC, stack, and pcpu registers. + * 7) Now that we can finally call C code, call pmap_boostrap_ap(), + * which finishes copying in the shared TLB1 entries. + * + * At this point, the MMU is fully set up, and we can proceed with + * running the actual AP bootstrap code. + * + * Pieces of this code are also used for UP kernel, but in this case + * the sections specific to boot page functionality are dropped by + * the preprocessor. + */ +#ifdef __powerpc64__ + nop /* PPC64 alignment word. 64-bit target. */ +#endif + bl 1f /* 32-bit target. */ .globl bp_trace bp_trace: - .long 0 + ADDR(0) /* Trace pointer (%r31). */ .globl bp_kernload bp_kernload: - .long 0 + ADDR(0) /* Kern phys. load address. */ + .globl bp_virtaddr +bp_virtaddr: + ADDR(0) /* Virt. address of __boot_page. */ + /* * Initial configuration */ @@ -444,7 +504,7 @@ bp_kernload: mfmsr %r3 ori %r3, %r3, (PSL_IS | PSL_DS) #ifdef __powerpc64__ - oris %r3, %r3, PSL_CM@h + oris %r3, %r3, PSL_CM@h /* Ensure we're in 64-bit after RFI */ #endif bl 3f 3: mflr %r4 @@ -461,7 +521,7 @@ bp_kernload: bl tlb1_inval_entry /* - * Setup final mapping in TLB1[1] and switch to it + * Setup final mapping in TLB1[0] and switch to it */ /* Final kernel mapping, map in 64 MB of RAM */ lis %r3, MAS0_TLBSEL1@h /* Select TLB1 */ @@ -481,31 +541,19 @@ bp_kernload: isync /* Retrieve kernel load [physical] address from bp_kernload */ +5: + mflr %r3 #ifdef __powerpc64__ - b 0f - .align 3 -0: - nop -#endif - bl 5f - ADDR(bp_kernload) - ADDR(__boot_page) -5: mflr %r3 -#ifdef __powerpc64__ - ld %r4, 0(%r3) - ld %r5, 8(%r3) - clrrdi %r3, %r3, 12 + clrrdi %r3, %r3, PAGE_SHIFT /* trunc_page(%r3) */ #else - lwz %r4, 0(%r3) - lwz %r5, 4(%r3) - rlwinm %r3, %r3, 0, 0, 19 + clrrwi %r3, %r3, PAGE_SHIFT /* trunc_page(%r3) */ #endif - sub %r4, %r4, %r5 /* offset of bp_kernload within __boot_page */ - lwzx %r3, %r4, %r3 + LOAD %r4, (bp_kernload - __boot_page)(%r3) + LOAD %r5, (bp_virtaddr - __boot_page)(%r3) /* Set RPN and protection */ - ori %r3, %r3, (MAS3_SX | MAS3_SW | MAS3_SR)@l - mtspr SPR_MAS3, %r3 + ori %r4, %r4, (MAS3_SX | MAS3_SW | MAS3_SR)@l + mtspr SPR_MAS3, %r4 isync li %r4, 0 mtspr SPR_MAS7, %r4 @@ -518,8 +566,8 @@ bp_kernload: bl 6f 6: mflr %r3 rlwinm %r3, %r3, 0, 0xfff /* Offset from boot page start */ - add %r3, %r3, %r5 /* Make this virtual address */ - addi %r3, %r3, (7f - 6b) + add %r3, %r3, %r5 /* Make this a virtual address */ + addi %r3, %r3, (7f - 6b) /* And figure out return address. */ #ifdef __powerpc64__ lis %r4, PSL_CM@h /* Note AS=0 */ #else @@ -758,6 +806,11 @@ __boot_page_padding: */ .space 4092 - (__boot_page_padding - __boot_page) b __boot_page + /* + * This is the end of the boot page. + * During AP startup, the previous instruction is at 0xfffffffc + * virtual (i.e. the reset vector.) + */ #endif /* SMP */ /************************************************************************/ @@ -881,6 +934,7 @@ ENTRY(bpred_enable) * created. */ ENTRY(get_spr) + /* Note: The spr number is patched at runtime */ mfspr %r3, 0 blr @@ -900,7 +954,9 @@ tmpstackbound: .space 10240 /* XXX: this really should not be necessary */ #ifdef __powerpc64__ TOC_ENTRY(tmpstack) +#ifdef SMP TOC_ENTRY(bp_kernload) +#endif #endif /* Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Nov 2 21:02:54 2019 (r354265) +++ head/sys/powerpc/booke/pmap.c Sat Nov 2 21:15:56 2019 (r354266) @@ -1674,7 +1674,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o /* Calculate corresponding physical addresses for the kernel region. */ phys_kernelend = kernload + kernsize; debugf("kernel image and allocated data:\n"); - debugf(" kernload = 0x%09llx\n", (uint64_t)kernload); + debugf(" kernload = 0x%09jx\n", (uintmax_t)kernload); debugf(" kernstart = 0x%"PRI0ptrX"\n", kernstart); debugf(" kernsize = 0x%"PRI0ptrX"\n", kernsize); @@ -1859,9 +1859,9 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o thread0.td_kstack = kstack0; thread0.td_kstack_pages = kstack_pages; - debugf("kstack_sz = 0x%08x\n", kstack0_sz); - debugf("kstack0_phys at 0x%09llx - 0x%09llx\n", - kstack0_phys, kstack0_phys + kstack0_sz); + debugf("kstack_sz = 0x%08jx\n", (uintmax_t)kstack0_sz); + debugf("kstack0_phys at 0x%09jx - 0x%09jx\n", + (uintmax_t)kstack0_phys, (uintmax_t)kstack0_phys + kstack0_sz); debugf("kstack0 at 0x%"PRI0ptrX" - 0x%"PRI0ptrX"\n", kstack0, kstack0 + kstack0_sz); @@ -4003,7 +4003,7 @@ tlb1_mapin_region(vm_offset_t va, vm_paddr_t pa, vm_si for (idx = 0; idx < nents; idx++) { pgsz = pgs[idx]; - debugf("%u: %llx -> %jx, size=%jx\n", idx, pa, + debugf("%u: %jx -> %jx, size=%jx\n", idx, (uintmax_t)pa, (uintmax_t)va, (uintmax_t)pgsz); tlb1_set_entry(va, pa, pgsz, _TLB_ENTRY_SHARED | _TLB_ENTRY_MEM); Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Sat Nov 2 21:02:54 2019 (r354265) +++ head/sys/powerpc/booke/trap_subr.S Sat Nov 2 21:15:56 2019 (r354266) @@ -120,8 +120,8 @@ GET_CPUINFO(%r1); /* Per-cpu structure */ \ STORE %r30, (savearea+CPUSAVE_R30)(%r1); \ STORE %r31, (savearea+CPUSAVE_R31)(%r1); \ - mfdear %r30; \ - mfesr %r31; \ + mfspr %r30, SPR_DEAR; \ + mfspr %r31, SPR_ESR; \ STORE %r30, (savearea+CPUSAVE_BOOKE_DEAR)(%r1); \ STORE %r31, (savearea+CPUSAVE_BOOKE_ESR)(%r1); \ mfspr %r30, isrr0; \ @@ -143,8 +143,8 @@ GET_CPUINFO(%r1); /* Per-cpu structure */ \ STORE %r30, (savearea+CPUSAVE_R30)(%r1); \ STORE %r31, (savearea+CPUSAVE_R31)(%r1); \ - mfdear %r30; \ - mfesr %r31; \ + mfspr %r30, SPR_DEAR; \ + mfspr %r31, SPR_ESR; \ STORE %r30, (savearea+CPUSAVE_BOOKE_DEAR)(%r1); \ STORE %r31, (savearea+CPUSAVE_BOOKE_ESR)(%r1); \ mfspr %r30, isrr0; \ @@ -375,9 +375,9 @@ rlwinm outr, inr, 6, 23, 25; /* 4 x TLBSAVE_LEN */ #endif #define TLB_PROLOG \ - mtsprg4 %r1; /* Save SP */ \ - mtsprg5 %r28; \ - mtsprg6 %r29; \ + mtspr SPR_SPRG4, %r1; /* Save SP */ \ + mtspr SPR_SPRG5, %r28; \ + mtspr SPR_SPRG6, %r29; \ /* calculate TLB nesting level and TLBSAVE instance address */ \ GET_CPUINFO(%r1); /* Per-cpu structure */ \ LOAD %r28, PC_BOOKE_TLB_LEVEL(%r1); \ @@ -388,8 +388,8 @@ add %r1, %r1, %r29; /* current TLBSAVE ptr */ \ \ /* save R20-31 */ \ - mfsprg5 %r28; \ - mfsprg6 %r29; \ + mfspr %r28, SPR_SPRG5; \ + mfspr %r29, SPR_SPRG6; \ TLB_SAVE_REGS(%r1); \ /* save LR, CR */ \ mflr %r30; \ @@ -402,7 +402,7 @@ STORE %r30, (TLBSAVE_BOOKE_SRR0)(%r1); /* save SRR0 */ \ STORE %r31, (TLBSAVE_BOOKE_SRR1)(%r1); /* save SRR1 */ \ isync; \ - mfsprg4 %r1 + mfspr %r1, SPR_SPRG4 /* * restores LR, CR, SRR0-1, R20-31 from the TLBSAVE area @@ -410,7 +410,7 @@ * same notes as for the TLB_PROLOG */ #define TLB_RESTORE \ - mtsprg4 %r1; /* Save SP */ \ + mtspr SPR_SPRG4, %r1; /* Save SP */ \ GET_CPUINFO(%r1); /* Per-cpu structure */ \ /* calculate TLB nesting level and TLBSAVE instance addr */ \ LOAD %r28, PC_BOOKE_TLB_LEVEL(%r1); \ @@ -432,7 +432,7 @@ mtsrr1 %r31; \ /* restore R20-31 */ \ TLB_RESTORE_REGS(%r1); \ - mfsprg4 %r1 + mfspr %r1, SPR_SPRG4 #ifdef SMP #define TLB_LOCK \ @@ -693,7 +693,7 @@ INTERRUPT(int_data_tlb_error) TLB_PROLOG TLB_LOCK - mfdear %r31 + mfspr %r31, SPR_DEAR /* * Save MAS0-MAS2 registers. There might be another tlb miss during @@ -1052,8 +1052,8 @@ ASENTRY_NOPROF(breakpoint) mflr %r31 mtsrr0 %r31 - mfdear %r30 - mfesr %r31 + mfspr %r30, SPR_DEAR + mfspr %r31, SPR_ESR STORE %r30, (PC_DBSAVE+CPUSAVE_BOOKE_DEAR)(%r3) STORE %r31, (PC_DBSAVE+CPUSAVE_BOOKE_ESR)(%r3) Modified: head/sys/powerpc/conf/dpaa/config.dpaa ============================================================================== --- head/sys/powerpc/conf/dpaa/config.dpaa Sat Nov 2 21:02:54 2019 (r354265) +++ head/sys/powerpc/conf/dpaa/config.dpaa Sat Nov 2 21:15:56 2019 (r354266) @@ -2,7 +2,7 @@ files "dpaa/files.dpaa" -makeoptions DPAA_COMPILE_CMD="${LINUXKPI_C} \ +makeoptions DPAA_COMPILE_CMD="${LINUXKPI_C} ${DPAAWARNFLAGS} \ -Wno-cast-qual -Wno-unused-function -Wno-init-self -fms-extensions \ -include $S/contrib/ncsw/build/dflags.h \ -Wno-error=missing-prototypes \ Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Sat Nov 2 21:02:54 2019 (r354265) +++ head/sys/powerpc/include/spr.h Sat Nov 2 21:15:56 2019 (r354266) @@ -504,7 +504,11 @@ #define SPR_HASH2 0x3d3 /* .68 Secondary Hash Address Register */ #define SPR_IMISS 0x3d4 /* .68 Instruction TLB Miss Address Register */ #define SPR_TLBMISS 0x3d4 /* .6. TLB Miss Address Register */ +#if defined(BOOKE_PPC4XX) #define SPR_DEAR 0x3d5 /* 4.. Data Error Address Register */ +#else +#define SPR_DEAR 0x03d /* ..8 Data Exception Address Register */ +#endif #define SPR_ICMP 0x3d5 /* .68 Instruction TLB Compare Register */ #define SPR_PTEHI 0x3d5 /* .6. Instruction TLB Compare Register */ #define SPR_EVPR 0x3d6 /* 4.. Exception Vector Prefix Register */ Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/platform_mpc85xx.c Sat Nov 2 21:02:54 2019 (r354265) +++ head/sys/powerpc/mpc85xx/platform_mpc85xx.c Sat Nov 2 21:15:56 2019 (r354266) @@ -68,7 +68,8 @@ __FBSDID("$FreeBSD$"); extern void *ap_pcpu; extern vm_paddr_t kernload; /* Kernel physical load address */ extern uint8_t __boot_page[]; /* Boot page body */ -extern uint32_t bp_kernload; +extern vm_paddr_t bp_kernload; /* Boot page copy of kernload */ +extern vm_offset_t bp_virtaddr; /* Virtual address of boot page */ extern vm_offset_t __startkernel; struct cpu_release { @@ -354,11 +355,13 @@ mpc85xx_smp_start_cpu_epapr(platform_t plat, struct pc pmap_kenter(rel_page, rel_pa & ~PAGE_MASK); rel = (struct cpu_release *)rel_va; bptr = pmap_kextract((uintptr_t)__boot_page); + cpu_flush_dcache(__DEVOLATILE(struct cpu_release *,rel), sizeof(*rel)); - rel->pir = pc->pc_cpuid; __asm __volatile("sync"); - rel->entry_h = (bptr >> 32); - rel->entry_l = bptr; __asm __volatile("sync"); + rel->pir = pc->pc_cpuid; __asm __volatile("sync" ::: "memory"); + rel->entry_h = (bptr >> 32); __asm __volatile("sync" ::: "memory"); cpu_flush_dcache(__DEVOLATILE(struct cpu_release *,rel), sizeof(*rel)); + rel->entry_l = bptr & 0xffffffff; __asm __volatile("sync" ::: "memory"); + cpu_flush_dcache(__DEVOLATILE(struct cpu_release *,rel), sizeof(*rel)); if (bootverbose) printf("Waking up CPU %d via CPU release page %p\n", pc->pc_cpuid, rel); @@ -397,11 +400,13 @@ mpc85xx_smp_start_cpu(platform_t plat, struct pcpu *pc cpuid = pc->pc_cpuid + 24; } bp_kernload = kernload; + bp_virtaddr = (vm_offset_t)&__boot_page; /* - * bp_kernload is in the boot page. Sync the cache because ePAPR - * booting has the other core(s) already running. + * bp_kernload and bp_virtaddr are in the boot page. Sync the cache + * because ePAPR booting has the other core(s) already running. */ cpu_flush_dcache(&bp_kernload, sizeof(bp_kernload)); + cpu_flush_dcache(&bp_virtaddr, sizeof(bp_virtaddr)); ap_pcpu = pc; __asm __volatile("msync; isync"); Modified: head/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- head/sys/powerpc/powerpc/pmap_dispatch.c Sat Nov 2 21:02:54 2019 (r354265) +++ head/sys/powerpc/powerpc/pmap_dispatch.c Sat Nov 2 21:15:56 2019 (r354266) @@ -145,7 +145,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t p, v u_int flags, int8_t psind) { - CTR6(KTR_PMAP, "pmap_enter(%p, %#x, %p, %#x, %x, %d)", pmap, va, + CTR6(KTR_PMAP, "pmap_enter(%p, %#x, %p, %#x, %#x, %d)", pmap, va, p, prot, flags, psind); return (MMU_ENTER(mmu_obj, pmap, va, p, prot, flags, psind)); } From owner-svn-src-all@freebsd.org Sat Nov 2 21:52:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2614A166FA3; Sat, 2 Nov 2019 21:52:46 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475CTp0CMvz4GH4; Sat, 2 Nov 2019 21:52:46 +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 DF6BC1C3F; Sat, 2 Nov 2019 21:52:45 +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 xA2LqjQ4027653; Sat, 2 Nov 2019 21:52:45 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2Lqj6R027652; Sat, 2 Nov 2019 21:52:45 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911022152.xA2Lqj6R027652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 2 Nov 2019 21:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354267 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 354267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2019 21:52:46 -0000 Author: tsoome Date: Sat Nov 2 21:52:45 2019 New Revision: 354267 URL: https://svnweb.freebsd.org/changeset/base/354267 Log: r354264 did mix up the directory path The correct path is sys/cddl/contrib/opensolaris/common/lz4, not sys/cddl/contrib/opensolaris/lz4 Reported by: Michael Butler Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Nov 2 21:15:56 2019 (r354266) +++ head/sys/conf/files Sat Nov 2 21:52:45 2019 (r354267) @@ -152,7 +152,7 @@ cddl/compat/opensolaris/kern/opensolaris_vm.c optio cddl/compat/opensolaris/kern/opensolaris_zone.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/acl/acl_common.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/avl/avl.c optional zfs compile-with "${ZFS_C}" -cddl/contrib/opensolaris/lz4/lz4.c optional zfs compile-with "${ZFS_C}" +cddl/contrib/opensolaris/common/lz4/lz4.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/nvpair/opensolaris_fnvpair.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair_alloc_fixed.c optional zfs compile-with "${ZFS_C}"